 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
onlyus Newbie cheater
Reputation: 0
Joined: 27 Aug 2011 Posts: 19 Location: 214214
|
Posted: Fri Sep 14, 2012 9:00 am Post subject: i Need Converting Code C++ -> Delphi |
|
|
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 |
|
 |
PR0GAM3 How do I cheat?
Reputation: 0
Joined: 15 Nov 2012 Posts: 3
|
Posted: Thu Nov 15, 2012 4:22 pm Post subject: |
|
|
ตอบช้ายังดีกว่าไม่ตอบ
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 |
|
 |
|
|
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
|
|