EXETOOLS FORUM  

Go Back   EXETOOLS FORUM > General > Source Code

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2017, 23:22
sh3dow sh3dow is offline
Family
 
Join Date: Oct 2014
Posts: 62
Rept. Given: 71
Rept. Rcvd 76 Times in 21 Posts
Thanks Given: 58
Thanks Rcvd at 59 Times in 21 Posts
sh3dow Reputation: 76
SignatureToDetour: Converts IDA Pro signatures to C++ Detours

this tool is helpful when you try to hook functions that aren't in the Win32 API.
Example:

Given a signature like the following from IDA Pro:
PHP Code:
char __cdecl sub_1193D40(int a1unsigned int a2signed int *a3_BYTE **a4, const char *a5
SignatureToDetour will output ("InternalFunction" being the user supplied desired name):
PHP Code:
#define INTERNALFUNCTION_ADDRESS 0x1193D40
char(__cdecloriginalInternalFunction)(intunsigned intsigned int *, BYTE **, const char *);
char hkInternalFunction(int a1,  unsigned int a2,  signed int *a3,  BYTE **a4,  const char *a5)
{
    return 
originalInternalFunction(a1a2a3a4a5);
}

originalInternalFunction = (char(__cdecl*)(intunsigned intsigned int *, BYTE **, const char *))DetourFunction((PBYTE)INTERNALFUNCTION_ADDRESS, (PBYTE)hkInternalFunction); 
source
PHP Code:
https://github.com/ChairGraveyard/SignatureToDetour 
Reply With Quote
The Following 5 Users Say Thank You to sh3dow For This Useful Post:
alephz (01-16-2017), bytepudding (01-16-2017), mudlord (01-15-2017), user1 (01-15-2017), WRP (01-14-2017)
  #2  
Old 01-23-2017, 19:18
΢Цһ ΢Цһ is offline
Friend
 
Join Date: Dec 2006
Location: ....
Posts: 22
Rept. Given: 0
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 1
Thanks Rcvd at 0 Times in 0 Posts
΢Цһ Reputation: 1
Good tool. Maybe it's better to Write IDA plugin.
Reply With Quote
  #3  
Old 01-23-2017, 21:14
Shub-Nigurrath's Avatar
Shub-Nigurrath Shub-Nigurrath is offline
VIP
 
Join Date: Mar 2004
Location: Obscure Kadath
Posts: 777
Rept. Given: 42
Rept. Rcvd 390 Times in 85 Posts
Thanks Given: 10
Thanks Rcvd at 46 Times in 16 Posts
Shub-Nigurrath Reputation: 300-399 Shub-Nigurrath Reputation: 300-399 Shub-Nigurrath Reputation: 300-399 Shub-Nigurrath Reputation: 300-399
very nice, always have to do it manually!
__________________
Ŝħůb-Ňìĝùŕřaŧħ ₪)
There are only 10 types of people in the world: Those who understand binary, and those who don't
http://www.accessroot.com
Reply With Quote
Reply

Tags
detours, hook, ida pro plugin

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Detours Pro v3.0 b30wulf Source Code 26 04-07-2017 05:40


All times are GMT +8. The time now is 23:55.


ICP05004977
vBulletin Security provided by vBSecurity v2.2.0 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX