Raised This Month: $32 Target: $400
 8% 

Solved [L4D2] Need help with detouring functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 01-17-2022 , 10:43   [L4D2] Need help with detouring functions
Reply With Quote #1

For example, let's put... "SurvivorBot::Update" and it looks like this in Linux:
Code:
void _thiscall SurvivorBot::Update(SurvivorBot *this)
{
    // etc etc.
}
But in Windows, it looks like this:
Code:
void FUN_101E6FA0(void)
{
    undefined local_60[16];
    FUN_100D206E(local_60); //what happens inside this is inlined in Linux
    // etc etc.
}
The function I'm trying to detour is the one inside another and it seems to accept a... stack(?) as a parameter. Question is how do I declare the calling convention of it? _cdecl or _stdcall? And what type should the stack be identified as? int or object?

Edit: All I had to do was right click the function name and select "Set Type" in IDA.

Last edited by cravenge; 01-17-2022 at 19:56.
cravenge is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 01-17-2022 , 11:32   Re: [L4D2] Need help with detouring functions
Reply With Quote #2

Quote:
Originally Posted by cravenge View Post
For example, let's put... "SurvivorBot::Update" and it looks like this in Linux:
Code:
void _thiscall SurvivorBot::Update(SurvivorBot *this)
{
    // etc etc.
}
But in Windows, it looks like this:
Code:
void FUN_101E6FA0(void)
{
    undefined local_60[16];
    FUN_100D206E(local_60); //what happens inside this is inlined in Linux
    // etc etc.
}
The function I'm trying to detour is the one inside another and it seems to accept a... stack(?) as a parameter. Question is how do I declare the calling convention of it? _cdecl or _stdcall? And what type should the stack be identified as? int or object?
You are probly looking at non virtual thunk idk without looking where you looking.

I already have windows signiture here for SurvivorBot::Update, it's usual this call type for
Code:
SurvivorBot::Update

? ? ? ? ? ? 01 00 00 A1 ? ? ? ? 33 C5 89 45 FC A1 ? ? ? ? 53 33 DB 
\x2A\x2A\x2A\x2A\x2A\x2A\x01\x00\x00\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\xFC\xA1\x2A\x2A\x2A\x2A\x53\x33\xDB
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 01-17-2022 , 12:13   Re: [L4D2] Need help with detouring functions
Reply With Quote #3

It's just an example. What I'm having trouble with is a function that pushes a stack as its parameter.

Last edited by cravenge; 01-17-2022 at 12:21.
cravenge is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 01-17-2022 , 12:34   Re: [L4D2] Need help with detouring functions
Reply With Quote #4

Quote:
Originally Posted by cravenge View Post
It's just an example. What I'm having trouble with is a function that pushes a stack as its parameter.
what you provided is not helpful, dump the asm code someone may help you.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 14:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode