flat assembler
Message board for the users of flat assembler.
![]() |
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). |
|||
![]() |
|
badc0de02 20 Mar 2016, 16:08
can you send me an Example of a PIC?
|
|||
![]() |
|
badc0de02 20 Mar 2016, 17:27
thanks for helping anyway
|
|||
![]() |
|
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 ;... |
|||
![]() |
|
badc0de02 21 Mar 2016, 06:28
ah thanks. i have to recalculate the delta offset i did that on previously projects.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.