Raised This Month: $ Target: $400
 0% 

Orpheu: Patching strings in memory


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-06-2010 , 14:56   Re: Orpheu: Patching strings in memory
Reply With Quote #1

'Quim will probably post about the use of virtual functions.
I'm writing a tuto "How find functions and make signatures". Something like.

You have to use IDA or such software to understand that you can do a lot of things, like to find that such function is called from others functions ( to block, etc.. ). HLSDK is obviously not enough for CS functions. Or you need to block/replace a specific thing in one function, so you see the disassembled code, then you could for example find a constant value you could change and making a patch. Like the plugin 'infinite round' I nop a check so the whole if() is ignored.

You have to know how are done the funtions so you can do almost what you want. For example, using IDA by decompiling and changing some things, you can see for example what does exactly PM_Jump : http://paste.ak-team.com/f87e7065 ; then you see there are constants, you could change easily, or ignoring.

What I say is for the game dll, but you can do more things with other library like "engine", so much interesting functions there to alter.
Anyway above is very specific, you can also change param/param of struct of a function on-the-fly easily and such.
__________________

Last edited by Arkshine; 02-06-2010 at 15:35.
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 02-06-2010 , 16:06   Re: Orpheu: Patching strings in memory
Reply With Quote #2

Quote:
Originally Posted by Arkshine View Post
I'm writing a tuto "How find functions and make signatures". Something like.
It would be nice to have a repository of such signatures, like CS entity offsets in Alliedmodders wiki.


I think one thing that can be done with orpheu is to manage func_ladder so anyone can dynamically create ladders that will be managed by engine.

As Arkshine said, hlsdk is not enough and we need more specific sdk (CS, DOD, etc) to fully understand how to do things.

EDIT:
Quote:
Originally Posted by 01101101 View Post
So I could do something like

PHP Code:
    #include <amxmodx>
    #include <orpheu_memory>
    
    
public plugin_precache()
    {
        
OrpheuMemoryReplace("engineString",0,"Connection accepted by %s^n","Welcome %s to porn server !!!^n")
    } 
Does Orpheu actually changes that string on memory or just change pointers to a new stack of strings?
Because if it changes strings and the new one is larger than the first one, what happens with the original memory alloc? Could happen a memory alloc error?
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 02-06-2010 at 16:10.
joropito is offline
Send a message via MSN to joropito
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 02-06-2010 , 15:58   Re: Orpheu: Patching strings in memory
Reply With Quote #3

So I could do something like

PHP Code:
    #include <amxmodx>
    #include <orpheu_memory>
    
    
public plugin_precache()
    {
        
OrpheuMemoryReplace("engineString",0,"Connection accepted by %s^n","Welcome %s to porn server !!!^n")
    } 
Code:
{
    "name"        : "engineString",
    "library"     : "engine",
    "type"        : "string",
    "memoryType"  : "data"
}
01101101 is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 02-06-2010 , 15:59   Re: Orpheu: Patching strings in memory
Reply With Quote #4

This is very interesting. Thanks.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Old 02-06-2010, 16:16
01101101
This message has been deleted by 01101101. Reason: im wrong
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 02-06-2010 , 16:21   Re: Orpheu: Patching strings in memory
Reply With Quote #6

Quim somehow your example doesn't work for me, it says


Memory object identifier type "string" is invalid

What is weird since I put

Code:
 {
    "name"        : "engineString",
    "library"     : "engine",
    "type"        : "string",
    "memoryType"  : "data"
}
01101101 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-06-2010 , 16:31   Re: Orpheu: Patching strings in memory
Reply With Quote #7

@joropito : Already talked about that with Quim, I think I will start a page on the wiki. About the strings, it changes the strings so yes, like Quim has warned "you should not use replacement strings longer than the original.", because obviously you will overwrite the next area and you will get probably a crash.

@01101101 : Wait for Quim, it seems the type is not included yet. I'm not sure.
__________________

Last edited by Arkshine; 02-06-2010 at 16:36.
Arkshine is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-06-2010 , 20:15   Re: Orpheu: Patching strings in memory
Reply With Quote #8

About the type "string" not being recognized, It seems that I didn't posted an update where I changed the type to "string". Before, the type was called "char []" but I made it "string" to be better looking. I'm adding some stuff to Orpheu I will post an update latter.
__________________
joaquimandrade is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 02-07-2010 , 14:15   Re: Orpheu: Patching strings in memory
Reply With Quote #9

Nice Evolution....
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Owyn
Veteran Member
Join Date: Nov 2007
Old 02-17-2010 , 16:36   Re: Orpheu: Patching strings in memory
Reply With Quote #10

it takes time on every map load to find and replace strings, if you want you can just edit mp.dll or swds.dll manually
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 02-17-2010 at 17:03.
Owyn is offline
Send a message via ICQ to Owyn
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 19:31.


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