Posted December 29, 200618 yr Hi and happy new year for all !Just to know if there a source code exemple of a loader ( patch memory doing search & replace bytes) ?no succeed with google, so may be you can help methinks for any help
December 29, 200618 yr A little bit of searching leads me to:http://www.tuts4you.com/blogs/download.php?list.28For S&R source code in MASM Diablo has a very good example:http://diablo2oo2.di.funpic.de/downloads/dup.search.and.replace.patchengine.sourcecode.rarI will also move this to the correct forum, Programming and Coding, since it will probably be more appropriate there...Ted.
January 3, 200718 yr Delphi SrcProcedure Replace(var lpStartAddr:pByte; lpReplace:pByte; nReplaceLen:Integer);var i:Integer;begin i := 0; while i < nReplaceLen do begin lpStartAddr^ := lpReplace^; inc(lpStartAddr,1); inc(lpReplace,1); end;end;Function Search(lpStartAddr:pByte; nStartAddrLen:Integer; lpSearchData:pByte; nSearchDataLen:Integer):pByte;var i,j,nMatchingCount:Integer; pTmp1,pTmp2:pChar;begin i := 0; nMatchingCount := 0; ResUlt := nil; while i < nStartAddrLen do begin if nMatchingCount >= nSearchDataLen then begin dec(lpStartAddr,1); ResUlt := lpStartAddr; Exit; end; nMatchingCount := 0; pTmp1 := pChar(lpStartAddr); pTmp2 := pChar(lpSearchData); j := 0; while pTmp1[j] = pTmp2[j] do begin inc(nMatchingCount); inc(j) end; inc(lpStartAddr,1); inc(i); end;end;
Create an account or sign in to comment