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 


scan array of byte
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
nielskool
Advanced Cheater
Reputation: 0

Joined: 03 Jun 2007
Posts: 65

PostPosted: Sat Nov 21, 2009 7:12 pm    Post subject: scan array of byte Reply with quote

Heey guys,

Little question, long answer:P
How to find a array of byte in delphi with readprocessmemory?
I need to find: 01 00 00 00 00 73 74 65 72 2F
How to do this:P

Grtz,
Niels

_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Nov 21, 2009 7:38 pm    Post subject: Reply with quote

Read, compare, repeat
Back to top
View user's profile Send private message
nielskool
Advanced Cheater
Reputation: 0

Joined: 03 Jun 2007
Posts: 65

PostPosted: Sat Nov 21, 2009 8:26 pm    Post subject: Reply with quote

already got it:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
test: byte;
test2: variant;
a,b: integer;
begin
for a:=978893079 to 978893279 do
begin
ReadProcessMemory(PHandle,Pointer(a),@test,1,Read);
test2:= 00;
if (test = test2) then
begin
ReadProcessMemory(PHandle,Pointer(a+1),@test,1,Read);
if (test = test2) then
begin
ReadProcessMemory(PHandle,Pointer(a+3),@test,1,Read);
if (test = test2) then
begin
ReadProcessMemory(PHandle,Pointer(a+4),@test,1,Read);
if (test = test2) then
begin
test2:= 115;
ReadProcessMemory(PHandle,Pointer(a+5),@test,1,Read);
if (test = test2) then
begin
test2:= 116;

ReadProcessMemory(PHandle,Pointer(a+6),@test,1,Read);
if (test = test2) then
begin
test2:= 101;
ReadProcessMemory(PHandle,Pointer(a+7),@test,1,Read);
if (test = test2) then
begin
test2:= 114;
ReadProcessMemory(PHandle,Pointer(a+8),@test,1,Read);
if (test = test2) then
begin
test2:= 47;
ReadProcessMemory(PHandle,Pointer(a+9),@test,1,Read);
if (test = test2) then
begin
b:=a;
metinsteen:=a;
end;

end;

end;
end;
end;
end;
end;
end;
end;
end;
ShowMessage('found');
ShowMessage(inttostr(b));
end;

bit vrapy but t works:P
didn't know it works that fast in delphi, thougt it would be much slower because it isn't asm

//edit
hmm not so fast as i thougt. i need to scan a bigger area, than it is very slow.

_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Nov 21, 2009 8:42 pm    Post subject: Reply with quote

it compiles to asm, fyi.

and why are you doing a billion single byte reads
Back to top
View user's profile Send private message
nielskool
Advanced Cheater
Reputation: 0

Joined: 03 Jun 2007
Posts: 65

PostPosted: Sat Nov 21, 2009 8:51 pm    Post subject: Reply with quote

is there an other way to do this?
_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Nov 21, 2009 11:17 pm    Post subject: Reply with quote

hmm, read the array length worth of bytes from an address, then compare what you got to the original with CompareMem
Back to top
View user's profile Send private message
nielskool
Advanced Cheater
Reputation: 0

Joined: 03 Jun 2007
Posts: 65

PostPosted: Sun Nov 22, 2009 4:28 am    Post subject: Reply with quote

i don't really know what you mean

//edit
hmm i now know how to use comparemem, but i don't know how to read a larger area.

//edit2
i found a few things but don't know how to use them.
copymem
getprop

how do i copy the memory of an other app?

_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sun Nov 22, 2009 5:48 am    Post subject: Reply with quote

slovach wrote:
Read, compare, repeat
Read, compare, compare, compare, ..., repeat for faster results :P
Back to top
View user's profile Send private message
nielskool
Advanced Cheater
Reputation: 0

Joined: 03 Jun 2007
Posts: 65

PostPosted: Sun Nov 22, 2009 6:20 am    Post subject: Reply with quote

how or what do i read in this case?
_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Nov 22, 2009 6:08 pm    Post subject: Reply with quote

nielskool wrote:
i don't really know what you mean

//edit
hmm i now know how to use comparemem, but i don't know how to read a larger area.

//edit2
i found a few things but don't know how to use them.
copymem
getprop

how do i copy the memory of an other app?


you don't unless you've injected a dll.

just read a chunk with ReadProcessMemory
Back to top
View user's profile Send private message
nielskool
Advanced Cheater
Reputation: 0

Joined: 03 Jun 2007
Posts: 65

PostPosted: Mon Nov 23, 2009 10:10 am    Post subject: Reply with quote

how to read a large area with readprocessmemory?
if i read about 8bytes then the first byte is 1 and all other bytes are zero

_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Nov 23, 2009 12:39 pm    Post subject: Reply with quote

http://msdn.microsoft.com/en-us/library/ms680553%28VS.85%29.aspx

BOOL WINAPI ReadProcessMemory(
__in HANDLE hProcess,
__in LPCVOID lpBaseAddress,
__out LPVOID lpBuffer,
__in SIZE_T nSize,
__out SIZE_T *lpNumberOfBytesRead
);


nSize [in]

The number of bytes to be read from the specified process.
Back to top
View user's profile Send private message
nielskool
Advanced Cheater
Reputation: 0

Joined: 03 Jun 2007
Posts: 65

PostPosted: Mon Nov 23, 2009 5:28 pm    Post subject: Reply with quote

you where right, this moring i tryed again reading more bytes. this time i worked.
so now i read 1.000.000 bytes and it works.
thank you very much.

_________________
cheaters are the best race in the world, they love eachother:P, so i would say never fuck poeple of your own race, unless they're beautiful:P
Back to top
View user's profile Send private message
Jonathan.Ramlie
Cheater
Reputation: 0

Joined: 13 May 2011
Posts: 39
Location: Cheat Engine

PostPosted: Sat May 28, 2011 8:14 am    Post subject: Reply with quote

i didnt understand Sad
Back to top
View user's profile Send private message Send e-mail
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat May 28, 2011 11:12 am    Post subject: Reply with quote

nielskool wrote:
you where right, this moring i tryed again reading more bytes. this time i worked.
so now i read 1.000.000 bytes and it works.
thank you very much.


Keep in mind when you are reading from another processes memory:
Quote:

The entire area to be read must be accessible, and if it is not accessible, the function fails.


So just setting nSize to 1,000,000 has high potential to fail. Use VirtualQueryEx to get page size and information and read based on that instead for a more secure method.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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