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 


[Help] AoB c++ scanning on a 64 bit process

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

Joined: 14 May 2021
Posts: 14
Location: Sweden

PostPosted: Tue Sep 28, 2021 1:06 am    Post subject: [Help] AoB c++ scanning on a 64 bit process Reply with quote

I have been trying to figure out how to perform AoB scans in c++ for the past week and have succeeded on 32 bit processes by using the following github project as a base: github com/AlexCatDev/ProcessMemory

I have modified the code in the main function to look like this:
Code:

            Process targetProcess = Process.GetProcessesByName("Tutorial-x86_64")[0];
            Console.WriteLine("Tutorial-x86_64 PID: " + targetProcess.Id);

            ProcessStream s = new ProcessStream(Process.GetProcessesByName("Tutorial-x86_64")[0]);

            IntPtr hProcess =
                OpenProcess(
                    PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION |
                    PROCESS_VM_WRITE | PROCESS_VM_READ, false, targetProcess.Id);
            Console.WriteLine("Process Handle: " + hProcess);

            Console.WriteLine("Searching");
            HexPattern p = new HexPattern("0x60 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x63 0x00 0x65 0x00 0x6E 0x00 0x74 0x00");
            Console.WriteLine("Search started");
            long intaddress = s.PatternScan(p);
            Console.WriteLine("Search done");
            //Calculate address of offset
            //intaddress -= 4;
            Console.WriteLine(intaddress);
            string hexaddress = intaddress.ToString("X");
            Console.WriteLine("0x"+hexaddress);

            Console.WriteLine("Done");
            Console.ReadLine();


The code above works just fine and is able to find the address where the array of bytes was found, but when I switch from Tutorial-i386 (the 32 bit tutorial) to the Tutorial-x86_64 (64 bit tutorial), the scan never completes or finds any usable address. What am I doing wrong here?
Back to top
View user's profile Send private message
KianBrose
Newbie cheater
Reputation: 0

Joined: 14 May 2021
Posts: 14
Location: Sweden

PostPosted: Tue Sep 28, 2021 9:31 am    Post subject: Reply with quote

Figured it out, turns out the address that contained the variable I was looking for was in 0x21CEEB3C924 and I was searching up to 0x100000000 which is far less than where that address is located.... mb
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 Gamehacking 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