Go Back   UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats > Anti-Cheat Software & Programming > General Reversing

- Sponsored Advertisement -
http://www.myfpscheats.com/

Welcome to the UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats.
You have to register before you can post and see and access any of the advanced forum features, please click the register link to proceed to the registration form. To start viewing threads or posts, select a forum that you want to visit from the selection below.
General Reversing
Anything relating to reverse engineering.
You are Unregistered, please register to gain Full access.    
Reply
 
Thread Tools

Register Detour 1.1 - With example
Old 08-20-2010, 11:48 PM   #1
SEGnosis
Guest

Posts: n/a
Register Detour 1.1 - With example

This is a function I made to detour program flow and log a specific register into a variable, using this I can get the structures I use for operation7 without the need for pointers or calling the game's own functions.



Here is the video example with instructions in the bottom right corner
Best in HD & Fullscreen




Whats new:
Quote:
Adding and subtracting the offset *Optional
Calling a void based function after *Optional
What it does:
Quote:
1. It creates a newly allocated section of memory

2. It writes the opcodes at the address specified ( in the amount of bytes that you specified as the original opcode amount )

3. It logs the register you put as the parameter into the variable you put as the result variable

4. If you put a value for add offset it adds the offset to the result variable

5. If you put a value for sub offset it subtracts the offset to the result variable

6. If you put a value for the call parameter it writes a call to that function to be executed

7. If you put true as the value for bRewriteOriginal, it will write the original instructions back to the address that was detoured so that it no longer gets logged

8. Once the log is finished it returns to the normal program flow

Last edited by SEGnosis; 08-21-2010 at 12:29 AM.

Reply With Quote


Old 08-20-2010, 11:58 PM   #2
Hax 101

|KungFuPenguin|'s Avatar

Join Date: Jan 2008
Posts: 355
Reputation: 5711
Rep Power: 114
|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS
Points: 6,680, Level: 9
Points: 6,680, Level: 9 Points: 6,680, Level: 9 Points: 6,680, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
This is looks, interesting.
I like the concept.

Good work
|KungFuPenguin| is offline

Reply With Quote

Old 08-25-2010, 05:13 AM   #3
Donator

Kozmo's Avatar

Join Date: Sep 2007
Posts: 718
Reputation: 26481
Rep Power: 332
Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (2)
Points: 20,308, Level: 19
Points: 20,308, Level: 19 Points: 20,308, Level: 19 Points: 20,308, Level: 19
Activity: 6.6%
Activity: 6.6% Activity: 6.6% Activity: 6.6%
Last Achievements
Great Job, Great Video!

+REP
Koz
__________________
KozmoK
Kozmo is online now

Reply With Quote

Old 08-25-2010, 05:29 AM   #4
SEGnosis
Guest

Posts: n/a
o: Thnks, I hope that some people will use it in their projects as a regular method :]

Reply With Quote

Old 08-25-2010, 05:38 AM   #5
Donator

Kozmo's Avatar

Join Date: Sep 2007
Posts: 718
Reputation: 26481
Rep Power: 332
Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!Kozmo has reputation that takes up 2GB of server space!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (2)
Points: 20,308, Level: 19
Points: 20,308, Level: 19 Points: 20,308, Level: 19 Points: 20,308, Level: 19
Activity: 6.6%
Activity: 6.6% Activity: 6.6% Activity: 6.6%
Last Achievements
Will this detour thiscall's where EAX is passed?
__________________
KozmoK
Kozmo is online now

Reply With Quote

Old 08-25-2010, 06:19 AM   #6
SEGnosis
Guest

Posts: n/a
I dont know what you mean, show the dump

Reply With Quote

Old 08-25-2010, 12:54 PM   #7
Retired Admin

learn_more's Avatar

Join Date: Sep 2006
Posts: 5,249
Reputation: 93628
Rep Power: 1106
learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (2)
sieg heil Nazi
Points: 70,490, Level: 39
Points: 70,490, Level: 39 Points: 70,490, Level: 39 Points: 70,490, Level: 39
Activity: 24.7%
Activity: 24.7% Activity: 24.7% Activity: 24.7%
Last Achievements
Award-Showcase
Quote:
Originally Posted by Kozmo View Post
Will this detour thiscall's where EAX is passed?
this is meant to find out what the value of a register is at a fixed position (e.g. for finding classptr's)
__________________
learn_more is offline

Reply With Quote

Old 08-27-2010, 02:56 PM   #8
Junior Member

M.Holder's Avatar

Join Date: Aug 2010
Location: Germany
Posts: 47
Reputation: -91
Rep Power: 0
M.Holder is becoming an outcast
Hello,

sorry for this n00by question, i heard register detour for the first time...

Can i use this detour-Method for hooking D3D functions like EndScene or DIP?
M.Holder is offline

Reply With Quote

Old 08-27-2010, 03:33 PM   #9
:3 1337 :3

Wieter20's Avatar

Join Date: Nov 2008
Location: The Netherlands
Posts: 979
Reputation: 14563
Rep Power: 204
Wieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server spaceWieter20 's rep takes up 1 gig of server space
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Points: 13,900, Level: 15
Points: 13,900, Level: 15 Points: 13,900, Level: 15 Points: 13,900, Level: 15
Activity: 1.2%
Activity: 1.2% Activity: 1.2% Activity: 1.2%
Last Achievements
Quote:
Originally Posted by M.Holder View Post
Hello,

sorry for this n00by question, i heard register detour for the first time...

Can i use this detour-Method for hooking D3D functions like EndScene or DIP?
They aint in the register?-.- but are a simple function in directx afaik correct me if im rong
__________________
hai
Wieter20 is offline

Reply With Quote

Old 08-27-2010, 04:18 PM   #10
Junior Member

M.Holder's Avatar

Join Date: Aug 2010
Location: Germany
Posts: 47
Reputation: -91
Rep Power: 0
M.Holder is becoming an outcast
Quote:
Originally Posted by Wieter20 View Post
They aint in the register?-.- but are a simple function in directx afaik correct me if im rong
I donīt know, thats why i asked.

Your video isnīt working in germany because of music licencenes.
M.Holder is offline

Reply With Quote

Old 10-01-2010, 12:37 AM   #11
SEGnosis
Guest

Posts: n/a
Added two new functions



PHP Code:
void C_Memory_Manager::RegisterDetourUnhookDWORD dwDetourAddress )
{
    
DWORD dwCaveAddress = *( DWORD* )( dwDetourAddress 0x01 ); // Gets the address of the cave from the detour
    
DWORD dwOriginalOpcodesAddress dwCaveAddress;
    
DWORD dwOriginalOpcodeAmount = *( DWORD* )( CMManager.FindPatterndwCaveAddress1024"\x68\x00\x00\x00\x00\xC3""x????x" ) + ); // Gets the amount of bytes that were detoured
    
DWORD dwOldProtect

    
VirtualProtect( ( LPVOID )dwDetourAddressdwOriginalOpcodeAmountPAGE_EXECUTE_READWRITE, &dwOldProtect );

    
memmove( ( PVOID )dwDetourAddress, ( PVOID )dwOriginalOpcodesAddressdwOriginalOpcodeAmount ); // restores original opcodes

    
VirtualProtect( ( LPVOID )dwDetourAddressdwOriginalOpcodeAmountdwOldProtect);

PHP Code:
bool C_Memory_Manager::IsRegisterDetouredDWORD dwDetourAddress )
{
    if( *( 
BYTE* )dwDetourAddress == ASM_PUSH_DWORD && *( BYTE* )( dwDetourAddress ) == ASM_RET // checks if its a push & ret
        
return true;
    return 
false;

So now u can check if it got unhooked or if you want to remove it.

Reply With Quote

Old 10-01-2010, 01:25 AM   #12
UnKnoWnCheaTeR

disavow's Avatar

Join Date: Jul 2009
Posts: 1,069
Reputation: 49844
Rep Power: 551
disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (2)
Points: 31,281, Level: 26
Points: 31,281, Level: 26 Points: 31,281, Level: 26 Points: 31,281, Level: 26
Activity: 14.9%
Activity: 14.9% Activity: 14.9% Activity: 14.9%
Last Achievements
Really good job here, i like.

[ plus one ]
__________________

Shad0w_'s Alter Ego

Last edited by disavow; 10-01-2010 at 01:27 AM.
disavow is online now

Reply With Quote
Reply  

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit



Tags
detour, register, segnosis
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT +1. The time now is 03:28 PM.