Open dzervas opened 2 years ago
Yes, actually the modification of the import/export table for PE binary is very (very) limited. I'll have to refactor this part around November.
Are there any other solutions to inject frida into an exe? I don't get why nobody does it and there's literally nothing out there
it looks like the refactoring never happened, the crashes are still going on
+1
+1
this code generate exe file but after run it crash filePath= r"PE64_x86-64_binary_mfc-application.exe" outFile= r"out-1.exe" peFile = lief.parse(filePath)
kernel32_lhs = peFile.add_library("user32.dll") kernel32_lhs.add_entry("UnregisterClassW")
builder = lief.PE.Builder(peFile)
builder.build_imports(True).patch_imports(True) builder.build()
builder.write(outFile)
this code generate exe file but after run it crash filePath= r"PE64_x86-64_binary_mfc-application.exe" outFile= r"out-1.exe" peFile = lief.parse(filePath)
kernel32_lhs = peFile.add_library("user32.dll") kernel32_lhs.add_entry("UnregisterClassW")
builder = lief.PE.Builder(peFile)
builder.build_imports(True).patch_imports(True) builder.build()
builder.write(outFile)
Import rebuild is broken for X64.
Two years have passed and the crash continues :(
We also needed to add the dll to the import table of the exe.
https://github.com/Snshadow/debug It was a difficult work, but he succeeded! It was made in Go and works well. With this as a reference, someone might be able to fix LIEF too.
Describe the bug I'm trying to add a single DLL to the import table of a x64 EXE
To Reproduce Steps to reproduce the behavior:
Expected behavior The executable should execute regularly without any new crashes
Environment (please complete the following information):
python -c "import lief;print(lief.__version__)"
or the one fromLIEF/config.h
: 0.12.1-Additional context Code used:
error.txt
Unfortunately I can't freely redistribute the executable so contact me if you need it to send it privately