flat assembler
Message board for the users of flat assembler.
Index
> Windows > Why does my code injection not work |
Author |
|
revolution 20 Mar 2016, 15:59
In x86 memory addresses are absolute so your injected code is accessing incorrect locations when copied to another memory address.
You will either need to "relocate" the injected section to match the target address before inserting it, or make the injected code position independent code (PIC). |
|||
20 Mar 2016, 15:59 |
|
badc0de02 20 Mar 2016, 16:08
can you send me an Example of a PIC?
|
|||
20 Mar 2016, 16:08 |
|
badc0de02 20 Mar 2016, 17:27
thanks for helping anyway
|
|||
20 Mar 2016, 17:27 |
|
revolution 20 Mar 2016, 20:26
Something like this perhaps:
Code: ;... call .reference .reference: pop ebx mov eax,[ebx - .reference + .variable1] ;<--- PIC memory read ;... .variable1: dd 0x12345678 ;... |
|||
20 Mar 2016, 20:26 |
|
badc0de02 21 Mar 2016, 06:28
ah thanks. i have to recalculate the delta offset i did that on previously projects.
|
|||
21 Mar 2016, 06:28 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.