![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 4
![]() |
problem with lstrcmp (masm32)
Hi all,
i'm trying to get the following program to work, i need this option for a program i am writing, but it only works when i use the following line to read into the buffer: invoke StdIn,addr buffer,4 is there a workaround for this? program: .386 .model flat,stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\user32.inc include \masm32\include\masm32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\user32.lib includelib \masm32\lib\masm32.lib .data string1 db "Enter: ",0 string2 db 13,10,"equal",0 string3 db 13,10,"not equal",0 teststring db "exit",0 test2 db "exit",0 buffer db 50 dup (?) vier db "4",0 .code start: invoke StdOut,addr string1 invoke StdIn,addr buffer,6 invoke lstrcmpA,addr test2,addr buffer .if eax==0 invoke StdOut,addr string2 invoke ExitProcess,0 .endif invoke StdOut,addr string3 invoke ExitProcess,0 end start i've tried adding the ending [color=blue 13 and 10 (CR and LF)[/color] to the buffer and then it works. but this will not work for my program since i need to compare the userinput with the strings generated by the Process32Next API... piece of my real program code: invoke Process32Next,[Snap],offset proc32 ;if we have finished the last process listing ;------------------------------------------------------ .if eax!=TRUE jmp again .endif ;------------------------------------------------------ invoke lstrcmpA, addr ProcToKill,addr proc32.szExeFile .if eax == 0 jmp contin .endif thanks in advance,
__________________
http://www.white-scorpion.nl |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Mar 2005
Location: South Africa
Posts: 21
Rep Power: 0
![]() |
Have you considered using interupts, that should work.
__________________
Small is beautiful |
|
|
|
|
|
#3 | |
|
Hobbyist Programmer
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 4
![]() |
Quote:
http://www.white-scorpion.nl/programs/pk.zip that's the program i was writing. (source included). Thanks for your response tho ![]()
__________________
http://www.white-scorpion.nl |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|