You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to execute some code before the main entry point in the binary. I tried to use __mod_init_func and I can see __DATA segment and the corresponding section (__mod_init_func) created in the modified binary but how do I confirm that code execution goes to the address stored there?
app = lief.parse("binary")
# some random data
mod_init_data = (
0xaa,0xaa,0xaa,0xaa,
)
mod_init_func_section = lief.MachO.Section("__mod_init_func",mod_init_data)
mod_init_func_section.alignment = 2
data_segment = lief.MachO.SegmentCommand()
data_segment.name = "__DATA"
mod_init_func_section = data_segment.add_section(mod_init_func_section)
app.add(data_segment)
This discussion was converted from issue #1041 on April 13, 2024 19:30.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi
I am trying to execute some code before the main entry point in the binary. I tried to use __mod_init_func and I can see __DATA segment and the corresponding section (__mod_init_func) created in the modified binary but how do I confirm that code execution goes to the address stored there?
Beta Was this translation helpful? Give feedback.
All reactions