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 


Memory viewer

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Sun Dec 19, 2010 7:14 am    Post subject: Memory viewer Reply with quote

Hello,

I''m trying to make something as CE, at least the easy way. First I wanna do the memory view thing, I've created the byte array thing with address +10 all the time. But what is a good way to hex->Opcode.

I've got this now:

Code:
void Dissasemble(wchar_t wBytes[3])
{
   
   if(wBytes[0] == *_T("90"))
   {
      cout <<"   nop"<<endl;
      offset = 0;
   }
   if(wBytes[0] == *_T("0e"))
   {
      cout <<"   push cs"<<endl;
      offset = 0;
   }
   if(wBytes[0] == *_T("1f"))
   {
      cout <<"   pop ds"<<endl;
      offset = 0;
   }
   if(wBytes[0] == *_T("ba"))
   {
      cout <<"   mov edx"<<endl;
      offset = 0;
   }
   
   else
      cout << endl;

}

BOOL StartRegion(DWORD Address)
{
   //MEMORY_BASIC_INFORMATION mbi;

   //VirtualQueryEx(hProc, (LPVOID)Address, &mbi, sizeof(MEMORY_BASIC_INFORMATION));
   const SIZE_T size = 100;
   BYTE buffer[size] = {0};
   wchar_t wDump[50];
   wchar_t wBytes[13];


      ReadProcessMemory(hProc, (VOID*)Address, buffer, sizeof(buffer), NULL);
         cout << "Address       " << " Bytes        "  << "Opcode          " << endl;
         for( int j = 0; j < 10; j++)
         {
            SecureZeroMemory(wBytes, sizeof(wBytes));
            StringCchPrintf(wDump, 3, L"%02X",buffer[j]);   
            StringCchCat(wBytes, 3, wDump);
               
            wcout << "              " << wBytes << endl;;
            

         }
         
      return 1;
}


Is this a good way, and how should I do things like this?

My idea: All First hex things, assigning the good ofset (how long the opcode is, but sometimes its longer then else)...
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Dec 19, 2010 2:53 pm    Post subject: Reply with quote

There are projects that do similar to this idea which you can use:
http://hde32.narod.ru/

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Sun Dec 19, 2010 5:03 pm    Post subject: Reply with quote

It goes for me about the learning.

Any ideas?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sun Dec 19, 2010 9:45 pm    Post subject: Reply with quote

I recommend working with a switch statement, or even an array that contains the basis of all the instructions and use the first few bytes as index into that array
_________________
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
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Tue Dec 21, 2010 9:55 am    Post subject: Reply with quote

Would it be possible to make from CE's source a .dll and use that with return value address-bytes-opcode?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Dec 21, 2010 2:40 pm    Post subject: Reply with quote

Yes, you can do that if you want to
You could also just try a free disassembler library like http://ragestorm.net/distorm/

_________________
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
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