flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
JohnFound
You should compile both "ERRORMSG.asm" and "LASTERR.asm".
After the compilation, there must be two files: "LASTERR.exe" and "ERRORMSG.dll" |
|||
![]() |
|
znatz
Thank you and yes, I did compile both files but it didn`t work.
Also the directory also contains the original LASTER.exe and ERRORMSG.dll files which are included after installation, but it shows the same message when I execute the LASTER.exe file. |
|||
![]() |
|
JohnFound
Very strange. What OS?
|
|||
![]() |
|
znatz
I tried it in 2 PCs, neither of them work.
One with Windows 7 32bit ultimate. When I run it as administrator, it tells me access denied. Another one with windows xp professional. When run, it tells me specific module is missing. |
|||
![]() |
|
JohnFound
Can you post a screenshot? Actually the proper work of this example is to show error message box. Try to modify the example to show something else, in order to exclude false impression.
|
|||
![]() |
|
typedef
lol. what an oxymoron. Last error being "module not found"
|
|||
![]() |
|
znatz
Thank you for your advice!!
I changed the MB_OK to MB_OKCANCELand it shows different button in it. Terribly sorry for my ignorance. I missed the ShowLastError part and kept thinking of a system error because the msg changed in different system... |
|||
![]() |
|
hopcode
typedef wrote: lol. what an oxymoron. Last error being "module not found" ![]() btw are you interested in languages and poetry ? Cheers, _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
![]() |
|
znatz
Yeah, that message made me crazy. Thank you all guys.
And another headache comes out now when I am writing my first dll. Not actually mine, I just rewrite part of the code in the ERRORMSG.asm to make it mine. However, it kept telling me the mydll.dll is not a valid image file when I call the function in it from another file. Did I miss something again?
|
|||||||||||
![]() |
|
JohnFound
There was some problem with dll's that has no import section. Try to import some functions at least from kernel32.dll
|
|||
![]() |
|
hopcode
for any reasons i didnt investigate, .reloc should preceed export.
try this Code: section '.reloc' data readable discardable fixups section '.edata' export data readable ;--- follow export _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
![]() |
|
znatz
After I post the last message, I import kernel32.dll and called ExitProcess once in DLLEntryPoint then it works!
And now comes the problem, I dont see anything likely in ERRORMSG.asm. Does it mean the ERRORMSG did the same thing implicitly/indirectly (invoke ExitProcess) ? |
|||
![]() |
|
JohnFound
You don't have to call ExitProcess. Only the import section must exists and be not empty.
ERRORMSG.asm imports some API functions and this is enough for Windows to accept it as a valid .dll |
|||
![]() |
|
znatz
But if I comment out the call [ExitProcess] ,
the same error message shows up again.
|
|||||||||||
![]() |
|
JohnFound
The import macros of FASM imports the function only if it is used somewhere in the source. If you don't use any API function, the the import section will be empty and Windows will complain.
One of the workarounds is to use: Code: virtual at 0 call [ExitProcess] end virtual This way, the ExitProcess will be imported, but the call will not be defined in the binary. The other way is to simply work on your dll, until you need some API function and then to import it - this will fix the issue in "natural way". |
|||
![]() |
|
LocoDelAssembly
There is an even shorter method:
Code: dummy = ExitProcess |
|||
![]() |
|
hopcode
LocoDelAssembly wrote: There is an even shorter method: ![]() force relocation instead as suggested 100 times in other threads correct would be Code: format PE GUI 4.0 DLL entry DllEntryPoint include 'win32a.inc' section '.text' code readable executable proc DllEntryPoint hinstDLL,fdwReason,lpvReserved mov eax,TRUE ret endp proc myFC ret ;Do nothing endp mov eax,myFC ;<-- force it section '.edata' export data readable export 'mydll.dll',\ myFC,'myFC' section '.reloc' fixups data discardable Cheers, _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
![]() |
|
JohnFound
All these problems appears only on empty test DLLs. If the library contains more or less useful code, everything will be OK, without using these all tricks.
I write DLLs very often on my job and never had any problems with above issues. So, the moral is: "Write more, think less." ![]() |
|||
![]() |
|
hopcode
JohnFound wrote: So, the moral is: "Write more, think less." de facto, is so overbloated the code you write that, as in the above case, when giving hints to people who needs it, the wrong way is called "JohnFound". i suspect it is your faking job about understimating the help people really need. _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.