im trying to get Hutch's BMBinSearch lib to work for me. im just trying to search a string for certain text and display the text if it was found in a messagebox. here is the code. i just zero'd out the messagebox parameters hoping someone can fill them in for me.
.586
.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
startpos db 0
lpSource db "Searching this text for specific text",0
lpSubStr db "specific",0
sResult db 9 dup(0)
.code
start:
invoke BinSearch ,0\ ;start address of search
,ADDR lpSource\ ;data to be searched
,SIZEOF lpSource -1\ ;length of data to be searched
,ADDR lpSubStr\ ;data to find
,SIZEOF lpSubStr -1 ;length of data to find
.IF eax != -1
lea ebx, lpSource
add eax, ebx
invoke MemCopy,eax,ADDR sResult,SIZEOF lpSubStr - 1
invoke MessageBox,0,ADDR sResult,0,0 ;display the data found in a messagebox. should dispay "specific"
.ENDIF
invoke ExitProcess,NULL
end start
with SIZEOF the 0 value byte gets counted too :)
.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
startpos db 0
lpSource db "Searching this text for specific text",0
lpSubStr db "specific",0
sResult db 9 dup(0)
.code
start:
invoke BinSearch ,0\ ;start address of search
,ADDR lpSource\ ;data to be searched
,SIZEOF lpSource -1\ ;length of data to be searched
,ADDR lpSubStr\ ;data to find
,SIZEOF lpSubStr -1 ;length of data to find
.IF eax != -1
lea ebx, lpSource
add eax, ebx
invoke MemCopy,eax,ADDR sResult,SIZEOF lpSubStr - 1
invoke MessageBox,0,ADDR sResult,0,0 ;display the data found in a messagebox. should dispay "specific"
.ENDIF
invoke ExitProcess,NULL
end start
with SIZEOF the 0 value byte gets counted too :)
thank you sir:grin: