flat assembler
Message board for the users of flat assembler.
Index
> Main > trying to translate to fasm from masm |
Author |
|
Overflowz 30 Aug 2011, 13:37
Loading executable from memory.. right. Use another way like how DLL's are loaded, do same with executable. (it should have .reloc section too.)
1) sinfo STARTUPINFO 2) cmp eax,0 --> jnz somewhere --- also, xinvoke are another macro. without xinvoke, that code won't work fine. |
|||
30 Aug 2011, 13:37 |
|
demien 30 Aug 2011, 13:50
thanx Overflowz
and .data? mPath byte 256 dup (0) ThreadID DWORD ? hInstance dword ? loop_stopper dword ? ResInf dword ? hResourceSize dword ? hResource dword ? rc4keytable DB 256 dup (?) will be ? section '.bbs' data readable mPath rb 256h btw Code: macro xinvoke proc,[arg] { common if ~ arg eq reverse pushd arg common end if call [ebx+_#proc-_delta] } entry start =) and here... xinvoke LoadLibrary,addr nt xinvoke GetProcAddress,eax,addr zw i need do such: xinvoke LoadLibrary,addr [nt] ? ----- aslo maybe someone have something like my function already in fasm? with this code some exe files like for example Win XP SP2 calc.exe execute with error |
|||
30 Aug 2011, 13:50 |
|
Overflowz 30 Aug 2011, 14:42
data? means unitialized data so, you can make it in every section which you like, it doesn't matter.
--- about macroses, I haven't learned it yet. addr nt = just nt in fasm. xinvoke LoadLibrary,nt it's same. --- check this out if you'll find something interesting. http://board.flatassembler.net/topic.php?t=12644 --- also, if you'll have success, can you post working code here ? I am stucking at "GetThreadContext" API. |
|||
30 Aug 2011, 14:42 |
|
Enko 30 Aug 2011, 14:55
.if eax != 0
in fasm it Code: .if eax <> 0 ;block .elseif eax = 1 ;block .else ;block .endif you need to include: win32ax.inc or win32a.inc with '\macro\if.inc'' Quote:
sorry, I don't know what is xinvoke in masm... why not use invoke? for the "addr": masm Code: var1 ;content addr var1; dir of var1 offset var1; dir of var1 if var1 is local, in masm Code: addr var1 ;lea eax, [ebp -X] in fasm Code: [var1]; content var1; offset var1 if its local variable and you use standard macros Code: mov eax, var1; will fail, because: ;mov eax, ebp-8 if you use extenden macros, there is addr macro for this cases. Code: ;include (win32ax.inc) invoke SomeProc, addr local1 ;lea eax, [ebp - 8] ;push eax ;call [SomeProc] |
|||
30 Aug 2011, 14:55 |
|
Newp 13 Feb 2013, 03:42
Hello community,
i have the same problem and i dont know how to store loval variables in Fasm. And it should look like so... Enko wrote:
A lot of things i tried, like proc virtual and locals but it will not work for me and i have no idea now. Code: format PE GUI 4.0 include 'D:\FASM\INCLUDE\WIN32AX.INC' entry start section '.data' data readable writeable _global db 'Title',0 _local db 'message',0 section '.code' code readable executable ; Entry point start: locals .var _local endl invoke MessageBox,NULL ,[.var] , _global ,MB_OK ret section '.idata' import data readable library USER32,'user32.dll' import USER32,MessageBox,'MessageBoxA' |
|||
13 Feb 2013, 03:42 |
|
Overflowz 31 Mar 2013, 02:30
Newp
Try this: Code: format PE GUI 4.0 include 'D:\FASM\INCLUDE\WIN32AX.INC' entry start section '.code' code readable executable ; Entry point proc start locals _local db "Hello, World!",0 endl invoke MessageBox,NULL ,addr _local , NULL ,MB_OK ret endp section '.idata' import data readable library USER32,'user32.dll' import USER32,MessageBox,'MessageBoxA' |
|||
31 Mar 2013, 02:30 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.