flat assembler
Message board for the users of flat assembler.
Index
> Windows > Windows 8 DLL Bad Image error Goto page Previous 1, 2 |
Author |
|
typedef 02 Jun 2012, 03:23
so now they acknowledge/require the read attribute.
|
|||
02 Jun 2012, 03:23 |
|
ogo 02 Jun 2013, 08:31
Tomasz Grysztar wrote: I have just tested it and it appears that Windows 8 doesn't like .reloc section to not have "readable" attribute. So the correction should be to replace the last line with: Hello Tomasz, I have tried this, but it does not help. I am not able to load the DLL with LoadLibrary. The function call returns always NULL. When I'am using Code: format PE DLL at 0x01400000 it works! When I'am using Code: format PE DLL it does NOT work. What's wrong with it? Here's my code of the DLL... Code: ;format PE DLL at 0x01400000 ;format PE DLL format PE GUI 4.0 DLL entry DllEntry include 'win32a.inc' section '.text' code readable executable DllEntry: ;hinstDLL,fdwReason,lpvReserved .hInstance=8 .dwReason=12 .lpvReverved=16 ;enter push ebp mov ebp,esp sub esp,4 push ebx push esi push edi ;body mov eax,TRUE .leave: pop edi pop esi pop ebx mov esp,ebp pop ebp ret 0 db 0x90 align 16 GetProperty: ;enter push ebp mov ebp,esp sub esp,0 push ebx push esi push edi ;body mov eax,[Property] .leave: pop edi pop esi pop ebx mov esp,ebp pop ebp ret 0 db 0x90 align 16 SetProperty: ;parameter .value=8 ;enter push ebp mov ebp,esp sub esp,0 push ebx push esi push edi ;body mov eax,[ebp+.value] mov [Property],eax .leave: pop edi pop esi pop ebx mov esp,ebp pop ebp ret 0 db 0x90 align 16 section '.data' data readable writeable dd 0,0,0,0 Property dd 0x12345678 section '.const' data readable dd 0,0,0,0 section '.edata' export data readable export 'dlltest.dll',\ GetProperty,'GetProperty',\ SetProperty,'SetProperty' ;section '.reloc' fixups data readable discardable ; dd 0,0,0,0 there is no effect with or without reloc section!? |
|||
02 Jun 2013, 08:31 |
|
comrade 01 Aug 2013, 09:24
In the future, to debug DLL loading related issues, use gflags.exe (part of the SDK and the debugger kit) and enable "Show loader snaps".
Then start the .exe under a debugger such as ntsd/cdb/windbg, and watch the debug spew printed to the console. Reference: http://msdn.microsoft.com/en-us/library/windows/hardware/ff556886%28v=vs.85%29.aspx |
|||
01 Aug 2013, 09:24 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.