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 


Multilevel Pointer

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

Joined: 01 Jul 2012
Posts: 23

PostPosted: Sun Dec 01, 2013 4:52 pm    Post subject: Multilevel Pointer Reply with quote

I've checked out the tutorials etc. About a year ago I got it work correctly with C#, but now... What the...

What's wrong guys?

Code:

        [DllImport("kernel32.dll")]
        public static extern int ReadProcessMemory(int hProcess, int lpBaseAddress, byte[] lpBuffer, int dwSize, out int lpNumberOfBytesRead);

            bytesRead = 0;
            int BaseAddr1 = 0x013398F3;
            int Offset1 = 0x18C;

            int Addr1 = ReadProcessMemory((int)nProcHandle, BaseAddr1, Buff, Buff.Length, out bytesRead);
            int Addr2 = ReadProcessMemory((int)nProcHandle, Addr1 + Offset1, Buff, Buff.Length, out bytesRead);
            int Addr3 = ReadProcessMemory((int)nProcHandle, Addr2, Buff, Buff.Length, out bytesRead);


Whatever convert style I use I can't get same result than cheat engine does result (in 4bytes value): 1155350528 (in CE)

E: I really tried many times, but... pffft... getting kinda angry, because I don't just get the result I want to. Sadly I've thrown all of my old sources to trash bin :/
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25785
Location: The netherlands

PostPosted: Sun Dec 01, 2013 5:01 pm    Post subject: Reply with quote

ReadProcessMemory returns a boolean, not a value. Buff contains the value instead
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Epz
Newbie cheater
Reputation: 0

Joined: 01 Jul 2012
Posts: 23

PostPosted: Sun Dec 01, 2013 5:13 pm    Post subject: Reply with quote

Oh. I fixed it, by converting everything after found result. If someone is finding a answer it's this:

Code:
            ReadProcessMemory((int)nProcHandle, BaseAddr1, Buff, Buff.Length, out bytesRead);
            int Addr1 = BitConverter.ToInt32(Buff, 0);
            ReadProcessMemory((int)nProcHandle, Addr1 + Offset1, Buff, Buff.Length, out bytesRead);
            int Addr2 = BitConverter.ToInt32(Buff, 0);
            ReadProcessMemory((int)nProcHandle, Addr2, Buff, Buff.Length, out bytesRead);


E: Thank you Dark Byte.
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