Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


i Need Converting Code C++ -> Delphi

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
onlyus
Newbie cheater
Reputation: 0

Joined: 27 Aug 2011
Posts: 19
Location: 214214

PostPosted: Fri Sep 14, 2012 9:00 am    Post subject: i Need Converting Code C++ -> Delphi Reply with quote

BOOL bDataCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
for (;*szMask;++szMask,++pData,++bMask)
if (*szMask=='x' && *pData!=*bMask)
return FALSE;
return (*szMask) == NULL;
}

DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char *szMask)
{
for (DWORD i=0; i < dwLen; i++)
if (bDataCompare((BYTE*)(dwAddress+i),bMask, szMask))
return (DWORD)(dwAddress+i);
return 0;
}

Can anyone help me?

_________________
i'm noob
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
PR0GAM3
How do I cheat?
Reputation: 0

Joined: 15 Nov 2012
Posts: 3

PostPosted: Thu Nov 15, 2012 4:22 pm    Post subject: Reply with quote

ตอบช้ายังดีกว่าไม่ตอบ Wink
try this

Code:

function bDataCompare(pData, bMask: PByte; szMask: PAnsiChar): Boolean;
var
  i: Integer;
begin
  for i := 0 to Length(szMask) do
    if (szMask[i + 1] = 'x') and (PByte(DWORD(pData) + i)^ <> (PByte(DWORD(bMask) + i)^)) then
      exit;
  Result := True;
end;

function FindPattern(dwAddress:PByte; dwLen: Cardinal; bMask: PByte; szMask: PAnsiChar): DWORD;
var
  i: DWORD;
begin
  Result := 0; 
   for i := 0 to dwLen do
      if bDataCompare(PByte(DWORD(dwAddress) + i), bMask, szMask) then
    begin
         Result := DWORD(dwAddress) + i;
      break;
    end; 
end;

//usage
const
   bPattern : array[0..4] of Byte = ($68, $90, $90, $90, $90);
FindPattern(PByte($400000), $FFFFFFF, @bPattern, '?xxxx');   
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites