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 


[C++] mrBOT DLL with SOURCE!
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming -> Binaries
View previous topic :: View next topic  
Author Message
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Tue Jul 29, 2008 3:22 pm    Post subject: [C++] mrBOT DLL with SOURCE! Reply with quote

First thing I have released, I made a trainer for Ghost Online here. Which was my first real project I tried making a trainer before but it sucked :\ For this I just took out all of the hacks real quick and I am going on vacation tomorow so thought I may as well release this.


The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Tue Jul 29, 2008 4:00 pm    Post subject: Reply with quote

Code:

static const FARPROC VPX = (FARPROC)((DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "VirtualProtectEx")+5);
DWORD oldp = 0; 
PDWORD oldprot = &oldp;
#define JMP(frm, to) (int)(((int)to - (int)frm) - 5);
DWORD dwBytesWritten;

_declspec(naked) BOOL WINAPI FixMemEx(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect) {
   _asm {
      mov edi,edi
      push ebp
      mov ebp,esp
      jmp VPX
   }
}

Useless shit?
Back to top
View user's profile Send private message
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Tue Jul 29, 2008 4:20 pm    Post subject: Reply with quote

I just took shit out of my trainer though took me less than 5 minutes, I don't care bout the useless shit.
_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat Aug 02, 2008 3:31 am    Post subject: Reply with quote

Why do people always feel inclined to add the "mov edi, edi" when trampolining ?! It does nothing.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sat Aug 02, 2008 4:45 am    Post subject: Reply with quote

Slugsnack wrote:
Why do people always feel inclined to add the "mov edi, edi" when trampolining ?! It does nothing.


to verify it's 5 byte(s) long.
Back to top
View user's profile Send private message
DoomsDay
Grandmaster Cheater
Reputation: 0

Joined: 06 Jan 2007
Posts: 768
Location: %HomePath%

PostPosted: Sat Aug 02, 2008 8:47 am    Post subject: Reply with quote

Rot1 wrote:
Slugsnack wrote:
Why do people always feel inclined to add the "mov edi, edi" when trampolining ?! It does nothing.


to verify it's 5 byte(s) long.
What's the logic about that? The instruction was added to make hooking easier, and to identify the libraries.
Back to top
View user's profile Send private message
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Sat Aug 02, 2008 11:00 pm    Post subject: Reply with quote

Without mov edi, edi it doesn't work.
Back to top
View user's profile Send private message
DoomsDay
Grandmaster Cheater
Reputation: 0

Joined: 06 Jan 2007
Posts: 768
Location: %HomePath%

PostPosted: Sun Aug 03, 2008 2:43 am    Post subject: Reply with quote

Zand wrote:
Without mov edi, edi it doesn't work.
Lets go forward with that one Laughing

Prove it!
Back to top
View user's profile Send private message
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Sun Aug 03, 2008 2:56 am    Post subject: Reply with quote

You can either code a sample DLL that does hookhop without "mov edi, edi" to prove it, or take my word for it. The instruction was in the original function, so it follows to replicate the first 5 bytes of the original instruction you would have to have "mov edi, edi". I'm not completely sure, but the last time I tried hookhop without that instruction it didn't work.
Back to top
View user's profile Send private message
Cx
Master Cheater
Reputation: 0

Joined: 27 Jul 2007
Posts: 367

PostPosted: Sun Aug 03, 2008 3:23 am    Post subject: Reply with quote

YEAH CAUSE MOV EDI,EDI SURE DOES A LOT OF SHIT.
Read this Zand:
http://blogs.msdn.com/ishai/archive/2004/06/24/165143.aspx

_________________

armed with this small butterfly net
i will face the world alone
& never be lonely.
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Wed Aug 20, 2008 7:47 am    Post subject: Reply with quote

Rot1 wrote:
Slugsnack wrote:
Why do people always feel inclined to add the "mov edi, edi" when trampolining ?! It does nothing.


to verify it's 5 byte(s) long.

He means, what's the point of adding "mov edi,edi" IN the hook? the only reason APIs starts with "mov edi,edi" is to make hooking easier, because most of the APIs starts by pushing ebp and storing esp in ebp (to save the stack address when the API was called), you could replace "mov edi,edi" with any other 2 bytes, xor eax,eax, 2 NOPs, push eax & pop eax...
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Aug 21, 2008 1:54 am    Post subject: Reply with quote

Sorry if I was unclear, I meant there is no point in putting that instruction into the trampoline. It does nothing. It's just like writing in 2 NOPs instead. And Zand, you are wrong, trampolining works perfectly without the "mov edi, edi" since that instruction does nothing.

I know its purpose in normal functions already (hot patching).
Back to top
View user's profile Send private message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Thu Aug 21, 2008 5:38 pm    Post subject: Reply with quote

it does do something it moves the edi back into the edi.. so it moves it self back to it self i think so but it does something doesn't do nothing.. it still processes the command now replacing it with nops will make it looks messier though.. like

mov edi, edi is like correct me im wrong but its like gonna be omg. like man lemme do this.. 2 NOPS! man.. thats heavy

_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Thu Aug 21, 2008 5:56 pm    Post subject: Reply with quote

Code:
   _asm {
      mov edi,edi
      push ebp
      mov ebp,esp
      jmp VPX
   }

is equal to
Code:
   _asm {
      push ebp
      mov ebp,esp
      jmp VPX
   }

from the program's view.
Why do you think they used that command for hotpatching? Because it does nothing and wouldn't change anything. Like saying varx=varx;.

_________________
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Aug 22, 2008 1:44 am    Post subject: Reply with quote

pkedpker wrote:
it does do something it moves the edi back into the edi.. so it moves it self back to it self i think so but it does something doesn't do nothing.. it still processes the command now replacing it with nops will make it looks messier though.. like

mov edi, edi is like correct me im wrong but its like gonna be omg. like man lemme do this.. 2 NOPS! man.. thats heavy

I hope you do realise that a NOP is XCHNG EAX, EAX. So you can say a NOP 'does do something' too..
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 -> Binaries 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