flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
RedGhost 12 Jan 2006, 03:45
hey i created a test dll/program with your code
dll Code: format pe dll entry start include '%fasminc%\win32a.inc' section '.code' code readable executable proc start hinstDLL, fdwReason, lpvReserved mov eax, TRUE ret endp ; void readString(char *); proc readString pStr invoke MessageBoxA, 0, [pStr], 0, 0 ret endp section '.idata' import data readable writeable library kernel,'KERNEL32.DLL',\ user, 'USER32.DLL' import kernel,\ ExitProcess,'ExitProcess' import user,\ MessageBoxA,'MessageBoxA' section '.edata' export data readable export 'MY.DLL',\ readString,'readString' section '.reloc' fixups data discardable exe Code: format pe gui entry start include '%fasminc%\win32a.inc' section '.code' code readable executable start: invoke readString, myString invoke ExitProcess, 0 section '.data' data readable writeable myString db 'Some string',0 section '.idata' import data readable writeable library kernel,'KERNEL32.DLL',\ mydll,'MY.DLL' import kernel,\ ExitProcess,'ExitProcess' import mydll,\ readString,'readString' i also tested with "pe console" aswell to be sure sure enough the MessageBoxA with "Some String" was called when i ran the exe without problem, are you sure your naming it "MY.DLL" ? _________________ redghost.ca |
|||
![]() |
|
madmatt 12 Jan 2006, 08:31
A couple of suggestions:
Code: format PE GUI 4.0 DLL also, I'm not an expert on java, but I think it uses c style parameters, so you would need a procedure defined like this: Code: proc c readString pStr the c being use for the c calling convention, to test you would need to use the cinvoke, I think. |
|||
![]() |
|
Fungos Bauux 12 Jan 2006, 16:14
Quote:
yup.. ![]() @madmatt: Thanks, I will need that. But fasm isnt accepting "proc c readString pStr" it gives error at "endp". cinvoke fasm compiled. |
|||
![]() |
|
Tomasz Grysztar 12 Jan 2006, 16:54
Please look at the section "Problems" in the Windows FAQ (it's the sticky thread in this forum) - there are two threads that refer exactly to the problem you've got here.
Fungos Bauux wrote: Thanks, I will need that. But fasm isnt accepting "proc c readString pStr" it gives error at "endp". It should be "proc readString c pStr". Look here for the complete information on the "proc" macro syntax. |
|||
![]() |
|
Fungos Bauux 12 Jan 2006, 18:00
Sorry Tomasz, but I have read that threads, but I was thinking mine wasnt related.
Thank you guys. ![]() |
|||
![]() |
|
madmatt 13 Jan 2006, 02:13
Sorry for that mistake, Fungos Bauux
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.