flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Grom PE 23 May 2017, 07:56
The problem is actually the declared but empty relocation section.
If you forcre it to generate at least one relocation, by adding Code: dummy: mov eax, dummy anywhere in code section, it will work. |
|||
![]() |
|
revolution 23 May 2017, 09:32
If you don't want to pollute your code with dummy instructions you can populate the relocation data with this:
Code: data fixups dd 0,8 end data |
|||
![]() |
|
Tomasz Grysztar 23 May 2017, 10:57
There is also a different way to avoid creation of an empty section when the relocation directory is empty - you can put the fixups inside a section that already contains some other data:
Code: section '.rdata' data readable data export export 'new.DLL', myFunction,'myFunction' end data data fixups end data |
|||
![]() |
|
CrawlUp 23 May 2017, 10:58
Quote: data fixups It works well Code: format PE GUI 4.0 DLL entry DllEntryPoint include 'win32a.inc' ;__________________________________________________________ section '.code' code readable executable proc DllEntryPoint hinstDLL,fdwReason,lpvReserved mov eax,TRUE ret endp proc myFunction ret endp ;_________________________________________________________ section '.edata' export data readable export 'new.DLL', myFunction,'myFunction' ;_________________________________________________________ section '.reloc' fixups data readable discardable dd 0,8 ;But it's completely unclear why this is needed dd 0,8 ; But it's completely unclear why this is needed Quote: dummy: mov eax, dummy This does not work in more than one place code |
|||
![]() |
|
CrawlUp 23 May 2017, 11:11
Thank you all for your help. I will read the link.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.