NASM - The Netwide Assembler
Related Projects => NASMX => Topic started by: william427 on July 31, 2014, 05:25:21 PM
-
can you jump out of proc and then return with an answer?
is it allright to jump where I commented ;;;;jump here ?
and will it return to that spot?
thanks
proc Wm_CommandProc
.hwnd argd
.wparam argd
.lparam argd
cmp argv(.wparam), dword 201
je .cmd_idok
cmp argv(.wparam), dword 200
je .cmd_idgo
xor eax, eax
ret
.cmd_idok:
invoke EndDialog, dword argv(.hwnd), byte 1
mov eax, 1
ret
.cmd_idgo:
invoke SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXTLENGTH, dword NULL, dword NULL
cmp eax, 0
jne .fine
invoke MessageBoxA, dword argv(.hwnd), dword szContent, dword szTitle, dword MB_OK | MB_ICONERROR
mov eax, 1
ret
.fine:
inc eax
mov ecx, eax
push eax
invoke GetProcessHeap
mov [dwHeap], eax
invoke HeapAlloc, eax, dword 0x000008, ecx
mov [dwText], eax
pop eax
invoke SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText
;;;;; jump here
invoke SendDlgItemMessageA, dword argv(.hwnd), dword 206, dword WM_SETTEXT, dword 0, dword dwText
invoke HeapFree, dword dwHeap, dword 0x000008, dword dwText
mov eax, 1
ret
endproc
-
is it ok to alter an rc file?
thanks
-
You are free to jump around "within" the procedure itself ( just remember to use the "dot" notation for labels within the proc.
If you're going to jump "into" a proc from an outside location you should know how the names are mangled depending on the operating system being assembled for. You must also ensure that you set up the stack properly prior to the jump so that it does not become corrupted when the procedure ends.
Feel free to modify the RC files to your hearts content. They are just text files that you can edit with a text editor. Look up the keywords used within those resource files so you understand what each token does. If you're using Windows there is a tool named ResEd in the nasmx/bin directory that you can use to easily create and/or modify RC files.
-
hey yall
is gettext a storage place like a string?and what does dwtext do ?
thanks
william
invoke SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText
-
hey yall
is gettext a storage place like a string?and what does dwtext do ?
thanks
william
is the lParam of SendDlgItemMessageA the
pointer to the buffer that is to receive the text
invoke SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText
-
hey yall
is gettext a storage place like a string?and what does dwtext do ?
thanks
william
invoke SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText
WinAPI home environment is C programming language, that's the place you should start, at least that's my opinion AND that would get you at least somewhere.
Stop using those Dialog Boxes, first you need to learn is basics - creating window and window procedure manually.
This is nice web site to learn WinAPI: theForger's Win32 API Programming Tutorial (http://www.winprog.org/tutorial/)
invoke SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText
is gettext a storage place like a string?and what does dwtext do ?
Omg. You have to provide a pointer to place where window text will be stored.
C / C++:
char windowText[2048];
SendMessage(windowHandle,WM_GETTEXT,2048,(LPARAM)windowText);
-
thanks so much