flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
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). |
|||
![]() |
|
badc0de02
can you send me an Example of a PIC?
|
|||
![]() |
|
badc0de02
thanks for helping anyway
|
|||
![]() |
|
revolution
Something like this perhaps:
Code: ;... call .reference .reference: pop ebx mov eax,[ebx - .reference + .variable1] ;<--- PIC memory read ;... .variable1: dd 0x12345678 ;... |
|||
![]() |
|
badc0de02
ah thanks. i have to recalculate the delta offset i did that on previously projects.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.