![](/img/trans.png)
[英]Jump to specific address in loaded shared object file (loaded by the LD_PRELOAD)
假設我們有兩個程序。 程序測試是二進制形式(ELF文件),第二個程序是一個shred object文件,比如說f.so。 我想在程序測試中掛鈎一些指令並將執行移動到位於 f.so 文件中的特定指令。? 我不想撥打 function 電話。 例如,我想在測試程序中掛接一條指令(二進制指令)並刪除它的 ...
[英]Jump to specific address in loaded shared object file (loaded by the LD_PRELOAD)
假設我們有兩個程序。 程序測試是二進制形式(ELF文件),第二個程序是一個shred object文件,比如說f.so。 我想在程序測試中掛鈎一些指令並將執行移動到位於 f.so 文件中的特定指令。? 我不想撥打 function 電話。 例如,我想在測試程序中掛接一條指令(二進制指令)並刪除它的 ...
[英]How to invoke compiler with LD_PRELOAD in CMake
是否可以在調用編譯器/鏈接器之前讓 CMake“導出環境變量”(例如 LD_PRELOAD),就像在 shell 中一樣? 我在 WSL2 中使用舊的 32 位交叉編譯器。 源文件位於安裝到 WSL 的 Windows 文件系統上,其中 inode 是 64 位的,因此不受支持,編譯器無法讀取。 我 ...
[英]How to debug with LD_preload
我使用 LD_PRELOAD 用我自己的 function 覆蓋 MPI_Send function 來對 MPI_send function 進行一些調試。 在這里,myMPI_Send.c 代碼: 在我的項目中,我使用了一個外部庫,其中還包含 MPI_Send 函數。 我需要調試外部庫以了解每次 ...
[英]How to preload library with ld_preload to wine(windows game(32bit))?
賞金將在 7 天后到期。 此問題的答案有資格獲得+250聲望賞金。 JustOneMan想引起更多關注這個問題: 如何在 Arch Linux 中將帶有 ld_preload 的庫預加載到 wine 中? 我想學習如何在運行 windows 應用程序的 wine 中預加載和掛鈎函數。 我正在嘗試 ...
[英]Block read until data available in memfd_create
我正在嘗試在內存中創建一個文件,它的行為就像一個字符設備。 我使用memfd_create(path, 0) ,但我開始認為這不是我需要的。 本質上,我想做的是在打開時通過 LD_PRELOAD 創建一個鈎子,查找open("/dev/input/event0")並將返回的 fd 更改為我的 mem ...
[英]`__attribute__((destructor))` not running in some cases?
我正在編寫一個加載了LD_PRELOAD的玩具 malloc(3) 實現作為練習。 我有一個用__attribute__((destructor))注釋的函數來轉儲分配列表及其退出時的狀態以進行調試,但我發現它在某些情況下無法運行。 具體來說,它確實可以在本地編譯的代碼上運行,但不能針對/bin/l ...
[英]How to set LD_PRELOAD in systemd
我想用 systemd 中的LD_PRELOAD掛鈎 libssl 中的一些函數。 在我放的systemd文件中 在 /etc/myscript.sh 我把 當我查看/proc/RUN_PID/maps時,我可以看到 inject_libssl.so 確實注入了進程,但原始 libssl.so 在 ...
[英]OpenCL Error -1001 / gr-fosphor with Intel CPU OpenCL
錯誤 上下文我根據https://osmocom.org/projects/sdr/wiki/Fosphor在Linux Mint 20.3 x64 Cinnamon with Intel CPU OpenCL上安裝了gr-fosphor 。# Install Dependencies sudo ...
[英]Checkpointing with LD_PRELOAD -- how to manipulate the instruction pointer and call stack?
LD_PRELOAD 技術允許我們向現有二進制文件提供我們自己的自定義標准庫函數,覆蓋標准函數或操縱它們的行為,提供一種有趣的方式來試驗二進制文件並了解其行為。 我讀過 LD_PRELOAD 可用於“檢查點”程序 --- 也就是說,生成完整 memory state 的記錄,在任何給定時間調用堆 ...
[英]can I do nested calls for system functions loaded by LD_PRELOAD
嗨,我正在嘗試覆蓋從localtime() sscanf() sscanf() ,而是調用 glibc 的sscanf() 。 有什么我想念的嗎? 文件內容如下: 我正在做的步驟: output 我得到: 預期的 output:它也應該打印test ,從printf("test\n"); ssc ...
[英]Not able to use function from my dynamic library loaded via LD_PRELOAD
我正在嘗試使用preload.so中的sscanf() ,它是從preload.c生成的。 為了檢查我的sscanf()從preload.so被調用,我添加了額外的打印語句: printf("test\n"); 有什么我想念的嗎? 文件內容如下: 我正在執行以下步驟: O/p 我得到: 預期的 ...
[英]Is it possible to override C syscall open without LD_PRELOAD?
源被打印,但沒有open:或open64:被打印。 如何解決這個問題? 謝謝!/* gcc -o emload emload.c -ldl ./emload */ // emload.c #define _GNU_SOURCE #include <stdio.h> #includ ...
[英]How to get command line arguments inside LD_PRELOAD library
我想從 LD_PRELOAD 庫中獲取 argv,例如,讓我們假設我們調用 在我的自定義 fopen 中,我想獲得“輸入”,因此是我程序的 argv[1](還有 argv[2] 等等)。 是否可以? 如何? ...
[英]Is it possible to programatically preload a shared library?
我正在構建一個項目,該項目需要修改一些仿生方法(例如 getaddrinfo、__android_print)的行為。 我已經能夠使用獨立編譯器或使用 Cmake 將其直接包含在 Apk 中創建掛鈎庫。 我已經能夠使用 setprop wrap.com.foo.bar 和 LD_PRELOAD 預加 ...
[英]Address Sanitizer on a python extension result in AddressSanitizer:DEADLYSIGNAL
c源代碼如下: #include<stdlib.h> #include<stdio.h> #include "demo_c.h" void func(data_pair* pair) { printf("func called"); pair->len ...
[英]Is it possible for an LD_PRELOAD to only affect the main executable?
實際問題我有一個默認情況下使用 EGL 和 SDL 1.2 分別處理圖形和用戶輸入的可執行文件。 使用LD_PRELOAD ,我已將兩者都替換為 GLFW。 這可以正常工作,除非用戶安裝了 GLFW 的 Wayland 版本,這取決於 EGL 本身。 因為所有的 EGL 調用要么不做任何事情,要么 ...
[英]Can we include an .so file LD_PRELOAD inside a file?
我有一個已編譯的文件,可能是用 C 編寫的。 該文件需要一個.so文件(庫文件)。 C 編譯后的文件名為/usr/local/solar/excusekey /usr/local/solar/excusekey /usr/local/libsolar/libexcuse.so .so庫文件為/u ...
[英]Difference in behavior when hooking a library function via LD_PRELOAD on Ubuntu and CentOS
有一個鈎子 function socketHook.c可以攔截socket()調用: 還有一個簡單的程序getpwuid.c (1),它只調用getpwuid() function: getpwuid()在內部進行socket()調用。 在 CentOS 上: 在 Ubuntu 上: 運行 (1) ...
[英]What's equivalent writing of PRELOAD on fish shell?
protoc 依賴於更高版本的 libstdc++。 通常在 bash shell 上我們寫道: 我嘗試使用魚 shell 來做同樣的事情。 但是,fish shell 無法識別單詞libstdc++.so.6.0.26和單詞thirdparty之間的空格。 預期行為是腳本使用LD_PRELOA ...
[英]LD_PRELOAD not working on Heroku + jemalloc + quotaguard
TL;DR:更新你的bin/qgtunnel 。 我最近注意到我的 web 測功機的 memory 使用量有所增加。 經過一番挖掘,我可以看到應該使用heroku-buildpack-jemalloc設置的LD_PRELOAD變量設置不正確。 我使用了一個小腳本( bin/show_preloa ...