flat assembler
Message board for the users of flat assembler.
Index
> Windows > Converting MASM code |
Author |
|
TmX 18 Jan 2009, 14:36
This is a code about autotyping, written in MASM
Code: .386 .model flat,stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib .data msg db 'Hello Netters in Hanjian Site (http://hanjian.web.id)',13,10 db 'Ini adalah Contoh AutoType with MASM32. ',0 app db 'notepad.exe',0 wndclass db 'Notepad',0 childclass db 'Edit',0 .data? handle dd ? .code start: invoke WinExec,ADDR app,SW_SHOW invoke FindWindow,ADDR wndclass,0 invoke FindWindowEx,eax,0,ADDR childclass,0 mov handle,eax mov edx,OFFSET msg @@: xor eax,eax mov al,byte PTR [edx] or al,al jz @f push edx invoke SendMessage,handle,WM_CHAR,eax,0 invoke Sleep,200 pop edx inc edx jmp @b @@: invoke ExitProcess,0 END start It's taken from here: http://www.hanjian-oke.co.cc/2008/08/autotype-with-asm-by-hanjian.html This is my attempt to translate it to FASM: Code: format PE console 4.0 entry start include 'win32a.inc' include 'api/kernel32.inc' include 'api/user32.inc' section '.data' data readable writeable msg db 'Hello Netters in Hanjian Site (http://hanjian.web.id)',13,10 db 'Ini adalah Contoh AutoType with FASM ',0 app db 'notepad.exe',0 wndclass db 'Notepad',0 childclass db 'Edit',0 handle dd ? section '.code' code readable executable start: invoke WinExec,addr app,SW_SHOW invoke FindWindow,addr wndclass,0 invoke FindWindowEx,eax,0,addr childclass,0 mov eax,handle mov edx,msg @@: xor eax,eax mov al,byte ptr [edx] or al,al ja @f push edx invoke SendMessage,handle,WM_CHAR,eax,0 invoke Sleep,200 pop edx inc edx jmp @b @@: invoke ExitProcess,0 section '.idata' import data readable writeable library kernel32,'kernel32.dll',user32,'user32.dll' import kernel32,WinExec,'WinExec',\ Sleep,'Sleep',\ ExitProcess,'ExitProcess' import user32,FindWindow,'FindWindow',\ FindWindowEx,'FindWindowEx',\ SendMessage,'SendMessage' When I tried to compile it, FASM said: Quote:
How to fix that? |
|||
18 Jan 2009, 14:36 |
|
LocoDelAssembly 18 Jan 2009, 15:01
Code: mov al, byte [edx] ; or just mov al, [edx] since "byte" is implicit |
|||
18 Jan 2009, 15:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.