Raised This Month: $51 Target: $400
 12% 

[Orpheu] Memory hack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
teh ORiON
Member
Join Date: Sep 2011
Location: Denmark
Old 12-07-2014 , 19:39   [Orpheu] Memory hack
Reply With Quote #1

Hi,

Is it possible to remove a function call inside an other function?

Basically like this, where the purpose is to stop Function B() from being called,
rest of the function will execute as normal:

PHP Code:
Function A()
{
   ...
   Function 
B()
   ...

The function is impractical to recreate, so was wondering if it would be possible to do something like this.
teh ORiON is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-07-2014 , 19:48   Re: [Orpheu] Memory hack
Reply With Quote #2

Just NOP the related bytes.
__________________
Arkshine is offline
teh ORiON
Member
Join Date: Sep 2011
Location: Denmark
Old 12-07-2014 , 19:53   Re: [Orpheu] Memory hack
Reply With Quote #3

How would I go about doing it in more detail, have a signature for the function and then displace down to the bytes where the function is called or?
teh ORiON is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-08-2014 , 13:09   Re: [Orpheu] Memory hack
Reply With Quote #4

So, you only have .amxx file, and you can't edit the plugin?
If so, you have to decompress .amxx file, change the corresponding bytes (parameter pushes, function call) to NOP instruction, and compress it back.
I've written decompresser, but I couldn't manage to write a program to compress it back. Maybe I will give it another try in a few days.

EDIT:
I feel dumb here... Are you trying to "hack" a plugin or a module/game DLL?
Because all that I written before is to not a run-time hack, and only works for plugins.

Last edited by klippy; 12-08-2014 at 15:12.
klippy is offline
teh ORiON
Member
Join Date: Sep 2011
Location: Denmark
Old 12-08-2014 , 18:12   Re: [Orpheu] Memory hack
Reply With Quote #5

Quote:
Originally Posted by KliPPy View Post
So, you only have .amxx file, and you can't edit the plugin?
If so, you have to decompress .amxx file, change the corresponding bytes (parameter pushes, function call) to NOP instruction, and compress it back.
I've written decompresser, but I couldn't manage to write a program to compress it back. Maybe I will give it another try in a few days.

EDIT:
I feel dumb here... Are you trying to "hack" a plugin or a module/game DLL?
Because all that I written before is to not a run-time hack, and only works for plugins.
Yeah, it's basically hacking the .dll, changing part of a function when it has been loaded into memory. I could patch the .dll directly but I dont have any experience in doing so, would also have to be the .so, since server is linux.
teh ORiON is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-08-2014 , 18:57   Re: [Orpheu] Memory hack
Reply With Quote #6

You answer yourself already. You can either use a signature which points to the related bytes start or getting a function address and adding n bytes to points where you want.

Once you get your address, just a matter to NOP all related bytes with 0x90.

I don't know the context and don't know much about assembly, so for a simple call in linux you will have E8 X X X X where X X X X is the function address. So you need to NOP these 5 bytes. There are probably tips to not necessary replace all to 90's but don't know. You may have to care about function with arguments, you will have some bytes before and you could corrupt the stack easily depending what you do/how is called the function.
__________________

Last edited by Arkshine; 12-08-2014 at 18:59.
Arkshine is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-08-2014 , 18:59   Re: [Orpheu] Memory hack
Reply With Quote #7

Well, it is probably easier to modify a .so than a .dll.
But run-time patching with Orpheu is probably easier than doing so.
Do you have a source code of that module? If you do, I can try to recompile it, omitting that function call.
klippy is offline
z0mbiland
Senior Member
Join Date: Jan 2013
Old 12-08-2014 , 19:06   Re: [Orpheu] Memory hack
Reply With Quote #8

Something like this i want to do, To crack the dll engine and change the value of ENTITY LIMIT TO UNLIMITED ENTITIES!!! Reverse engineering, assembly language, this need a cracker to be done!!!
z0mbiland is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-08-2014 , 19:08   Re: [Orpheu] Memory hack
Reply With Quote #9

Quote:
Originally Posted by z0mbiland View Post
Something like this i want to do, To crack the dll engine and change the value of ENTITY LIMIT TO UNLIMITED ENTITIES!!! Reverse engineering, assembly language, this need a cracker to be done!!!
It is useless, all those limitations are also enforced on the client.
klippy is offline
teh ORiON
Member
Join Date: Sep 2011
Location: Denmark
Old 12-08-2014 , 19:21   Re: [Orpheu] Memory hack
Reply With Quote #10

Yeah but now that I think about it, would probably be better to patch the library for what I need it for.
I'll give a bit of context now, so you know what it's about.

I want to change is PM_PlayerMove in tfc.so (Team fortress classic library).

PM_PlayerMove


What I want removed is the VectorScale call in this bit:

PHP Code:
// Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground
    
if ( ( pmove->onground != -) && ( pmove->cmd.buttons IN_USE) )
    {
        
VectorScalepmove->velocity0.3pmove->velocity );
    } 
teh ORiON 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 07:18.


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