 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
VDV Newbie cheater
Reputation: -1
Joined: 09 Mar 2013 Posts: 19
|
Posted: Sat Jul 06, 2013 1:49 am Post subject: please help c++ dll VS2012 |
|
|
please help with aob scan on c++.
I need to scan dynamic memory.
I need to combine FindPattern + VirtualQuery , how to do it???
Code: | DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
{
for(DWORD i=0; i<dwLen; i++)
if (bCompare((BYTE*)(dwAddress+i),bMask,szMask))
return (DWORD)(dwAddress+i);
return 0;
} |
Code: |
MEMORY_BASIC_INFORMATION mbi;
VirtualQuery( ( void* )pvAddress, &mbi, sizeof( mbi ) ); |
PLEASE HELP , VERY NEED.
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
Back to top |
|
 |
VDV Newbie cheater
Reputation: -1
Joined: 09 Mar 2013 Posts: 19
|
Posted: Sat Jul 06, 2013 9:03 am Post subject: |
|
|
Wiccaan wrote: | You need to loop VitualQuery and step the page sizes that are currently accessible to you. |
I need in source code or example . PLEASE VERY NEED HELP.
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sat Jul 06, 2013 11:04 am Post subject: |
|
|
VDV wrote: | Wiccaan wrote: | You need to loop VitualQuery and step the page sizes that are currently accessible to you. |
I need in source code or example . PLEASE VERY NEED HELP. |
I'm not going to hand you the code because you obviously don't know what you are doing already. Look at the MSDN page regarding VitualQuery, it explains the purpose of the API and the parameters needed to call it.
Use Google if you need to find further help. Begging isn't going to help you learn anything.
_________________
- Retired. |
|
Back to top |
|
 |
Obitio Advanced Cheater
Reputation: 0
Joined: 09 Apr 2012 Posts: 68 Location: null
|
Posted: Sun Jul 07, 2013 1:38 pm Post subject: |
|
|
VDV wrote: | Wiccaan wrote: | You need to loop VitualQuery and step the page sizes that are currently accessible to you. |
I need in source code or example . PLEASE VERY NEED HELP. |
Here is what I do:
Code: |
function FindPattern(pattern,sig:string;startaddress,stopaddress,index:dword):dword;
var
MBI:MEMORY_BASIC_INFORMATION;
p,i,z,k,m,nindex,nsize:dword;
rzsig:array of byte;
begin
nindex:=0;
Result:=0;
if odd(length(sig)) then exit;
SetLength(rzsig,length(pattern));
p:=length(sig);
i:=0;
z:=1;
repeat
if pattern[i+1]='?' then
rzsig[i]:=0
else
rzsig[i]:=strtoint('$'+sig[z]+sig[z+1]);
inc(i);
inc(z,2);
dec(p,2);
until p=0;
z:=length(pattern);
while(VirtualQuery(ptr(startaddress),MBI,sizeof(MBI))=SizeOf(MBI)) do begin
if startaddress>=stopaddress then break;
p:=MBI.Protect;
if not ((p=PAGE_READWRITE)or(p=PAGE_EXECUTE_READWRITE)or(p=PAGE_READONLY)or(p=PAGE_EXECUTE_READ)) then begin
inc(startaddress,MBI.RegionSize);
Continue;
end;
m:=dword(MBI.BaseAddress);
if MBI.RegionSize=0 then Continue;
if z>MBI.RegionSize then Continue;
nsize:=(MBI.RegionSize-z)+1;
p:=0;
if m>=z then
repeat
k:=pbyte(m+p)^;
if rzsig[0]=k then begin
i:=1;
repeat
if pattern[i+1]='?' then begin
inc(i);
Continue;
end;
k:=pbyte(m+p+I)^;
if not (k=rzsig[i]) then break;
inc(i);
until i=z;
if i=z then begin
if nindex=index then begin
Result:=m+p;
exit;
end
else
inc(nindex);
end;
end;
inc(p);
until p=nsize;
inc(startaddress,mbi.RegionSize);
end;
end;
|
yeah I know,messy.
_________________
Gamer |
|
Back to top |
|
 |
VDV Newbie cheater
Reputation: -1
Joined: 09 Mar 2013 Posts: 19
|
Posted: Fri Jul 12, 2013 11:54 am Post subject: |
|
|
VEVO wrote: | VDV wrote: | Wiccaan wrote: | You need to loop VitualQuery and step the page sizes that are currently accessible to you. |
I need in source code or example . PLEASE VERY NEED HELP. |
Here is what I do:
Code: |
function FindPattern(pattern,sig:string;startaddress,stopaddress,index:dword):dword;
var
MBI:MEMORY_BASIC_INFORMATION;
p,i,z,k,m,nindex,nsize:dword;
rzsig:array of byte;
begin
nindex:=0;
Result:=0;
if odd(length(sig)) then exit;
SetLength(rzsig,length(pattern));
p:=length(sig);
i:=0;
z:=1;
repeat
if pattern[i+1]='?' then
rzsig[i]:=0
else
rzsig[i]:=strtoint('$'+sig[z]+sig[z+1]);
inc(i);
inc(z,2);
dec(p,2);
until p=0;
z:=length(pattern);
while(VirtualQuery(ptr(startaddress),MBI,sizeof(MBI))=SizeOf(MBI)) do begin
if startaddress>=stopaddress then break;
p:=MBI.Protect;
if not ((p=PAGE_READWRITE)or(p=PAGE_EXECUTE_READWRITE)or(p=PAGE_READONLY)or(p=PAGE_EXECUTE_READ)) then begin
inc(startaddress,MBI.RegionSize);
Continue;
end;
m:=dword(MBI.BaseAddress);
if MBI.RegionSize=0 then Continue;
if z>MBI.RegionSize then Continue;
nsize:=(MBI.RegionSize-z)+1;
p:=0;
if m>=z then
repeat
k:=pbyte(m+p)^;
if rzsig[0]=k then begin
i:=1;
repeat
if pattern[i+1]='?' then begin
inc(i);
Continue;
end;
k:=pbyte(m+p+I)^;
if not (k=rzsig[i]) then break;
inc(i);
until i=z;
if i=z then begin
if nindex=index then begin
Result:=m+p;
exit;
end
else
inc(nindex);
end;
end;
inc(p);
until p=nsize;
inc(startaddress,mbi.RegionSize);
end;
end;
|
yeah I know,messy. |
с++ , not AA.
|
|
Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Fri Jul 12, 2013 12:14 pm Post subject: |
|
|
VDV wrote: | с++ , not AA. |
Rather than waiting for someone to pity you, why don't you spend this time learning how to read MSDN?
We're not going to help someone who won't put in any of his/her own effort.
And that's Pascal, not AA.
|
|
Back to top |
|
 |
VDV Newbie cheater
Reputation: -1
Joined: 09 Mar 2013 Posts: 19
|
Posted: Sat Jul 13, 2013 6:06 am Post subject: |
|
|
Innovation wrote: | VDV wrote: | с++ , not AA. |
Rather than waiting for someone to pity you, why don't you spend this time learning how to read MSDN?
We're not going to help someone who won't put in any of his/her own effort.
And that's Pascal, not AA. |
I do not expect there is no way I can help in another forum, if I could, I'd make the code itself.
Pascal I have never seen ...
|
|
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
|
|