Jump to content

Source Code To Make A Loader


supergg

Recommended Posts

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 me

thinks for any help

Link to comment

A little bit of searching leads me to:

http://www.tuts4you.com/blogs/download.php?list.28

For S&R source code in MASM Diablo has a very good example:

http://diablo2oo2.di.funpic.de/downloads/dup.search.and.replace.patchengine.sourcecode.rar

I will also move this to the correct forum, Programming and Coding, since it will probably be more appropriate there...

Ted.

Link to comment
Guest wynney

Delphi Src

Procedure 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;

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...