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

Memory patching help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 03-27-2017 , 17:39   Memory patching help
Reply With Quote #1

Can somebody point me out on how to patch a value



I want to thange the value below the gray line
Attached Images
File Type: jpg 141414.jpg (67.9 KB, 406 views)

Last edited by Despirator; 03-27-2017 at 17:52.
Despirator is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 03-27-2017 , 18:14   Re: Memory patching help
Reply With Quote #2

Address gamedata to find where to patch and then StoreToAddress with your patch.
__________________
asherkin is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 03-27-2017 , 23:49   Re: Memory patching help
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
Address gamedata to find where to patch and then StoreToAddress with your patch.
I have already found the address and I need to find out the offset. I pointed to push eax offset and have changed it. But the lower value crashes the server and the higher value set to unexpected result

Last edited by Despirator; 03-27-2017 at 23:50.
Despirator is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 03-28-2017 , 03:59   Re: Memory patching help
Reply With Quote #4

I think what you are trying to do is a lot more complex than you think it is, you'll need to learn the ins and outs of x86 assembly and calling conventions - even more so than most because you are trying to patch the middle of a function call. I feel this may be a bit of an XY problem, your post made it sound like you knew what to change just not how to do it.
__________________
asherkin is offline
Robotex
Junior Member
Join Date: Mar 2016
Old 03-28-2017 , 04:48   Re: Memory patching help
Reply With Quote #5

Messing with the push opcodes is almost never a good idea unless you know what you're doing, you will end up screwing the stack which means a sure crash sooner or later.

Last edited by Robotex; 03-28-2017 at 04:52.
Robotex is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 03-28-2017 , 04:54   Re: Memory patching help
Reply With Quote #6

Quote:
Originally Posted by asherkin View Post
I think what you are trying to do is a lot more complex than you think it is, you'll need to learn the ins and outs of x86 assembly and calling conventions - even more so than most because you are trying to patch the middle of a function call. I feel this may be a bit of an XY problem, your post made it sound like you knew what to change just not how to do it.
I've just started to learn memory patching so I'm new there
I'm trying to change players count always showing 0 or at least 1 in the A2S_INFO queries (I now that Valve legacy master servers avoids this. But it is not for it though). I've succeded on the windows (I may be wrong on patching there anyway) but not linux.

Attached the test plugins I've used to. I'll be pleased if you point me out on how to patch the correct offset so it should show always 0.

Also this thread maybe as a tutorial for other people on the forum like me
Attached Files
File Type: txt test.gamedata.txt (546 Bytes, 64 views)
File Type: sp Get Plugin or Get Source (test.sp - 167 views - 753 Bytes)

Last edited by Despirator; 03-28-2017 at 04:54.
Despirator is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 03-28-2017 , 04:58   Re: Memory patching help
Reply With Quote #7

Quote:
Originally Posted by Robotex View Post
Messing with the push opcodes is almost never a good idea unless you know what you're doing, you will end up screwing the stack which means a sure crash sooner or later.
yep. I did it. And changed the patch offset to previous bytes to mov

Attached Images
File Type: jpg 124124.jpg (77.8 KB, 326 views)
Despirator is offline
Reply


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 Off

Forum Jump


All times are GMT -4. The time now is 22:36.


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