flat assembler
Message board for the users of flat assembler.
Index
> Windows > PE DLL fixups of initialized data |
Author |
|
Tomasz Grysztar 27 Mar 2004, 12:18
It is possible and working (for example with DD directive). Can you show what kind of code is not working for you?
|
|||
27 Mar 2004, 12:18 |
|
comrade 27 Mar 2004, 18:58
Code: macro dbdd bytes,long { db bytes dd long } section ".code" code readable executable ... blit32: mov eax,[fwidth] shl eax,2 mov edx,[fheight] sub [lockrc.Pitch],eax .line: mov ecx,[fwidth] rep movsd add edi,[lockrc.Pitch] dec edx ja .line retn blit16: mov eax,[fwidth] add eax,eax mov edx,[fheight] sub [lockrc.Pitch],eax .line: mov ecx,[fwidth] .pixel: mov eax,[esi] ; red mov ebx,[esi] ; green mov ebp,[esi] ; blue shr eax,08h shr ebx,05h shr ebp,03h and eax,0000F800h and ebx,000007E0h and ebp,0000001Fh add ebx,ebp add eax,ebx stosw add esi,04h loop .pixel add edi,[lockrc.Pitch] dec edx ja .line retn section ".data" data readable writeable data import library kernel32,"kernel32.dll",user32,"user32.dll" include "%include%/apia/kernel32.inc" include "%include%/apia/user32.inc" end data data fixups end data ... blitprocs: dbdd D3DFMT_A8R8G8B8,blit32 dbdd D3DFMT_X8R8G8B8,blit32 dbdd D3DFMT_A1R5G5B5,blit16 dbdd D3DFMT_X1R5G5B5,blit16 dbdd D3DFMT_R5G6B5,blit16 db 0 The latter declarations do not work, I am forced to use RVA operator: Code: blitprocs: dbdd D3DFMT_A8R8G8B8,RVA blit32 dbdd D3DFMT_X8R8G8B8,RVA blit32 dbdd D3DFMT_A1R5G5B5,RVA blit16 dbdd D3DFMT_X1R5G5B5,RVA blit16 dbdd D3DFMT_R5G6B5,RVA blit16 db 0 |
|||
27 Mar 2004, 18:58 |
|
comrade 27 Mar 2004, 19:00
moving "data fixups" after data declarations fixed the problem
|
|||
27 Mar 2004, 19:00 |
|
Tomasz Grysztar 27 Mar 2004, 19:38
Yes, you cannot generate any relocatable code after the fixups table has been made (because it's too late to expand it).
|
|||
27 Mar 2004, 19:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.