Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Guide] Hex editing directly in linux

Joined
Aug 6, 2009
Messages
74
Reaction score
86
Most of us here who hex edit something like the gs may be doing it in Windows, and uploading the HUGE file back to your server over a slow connection.

This tutorial shows how you can hex edit your files directly in linux without installing any extra packages.

Run the following command:
Code:
INPUT | dd obs=1 seek=DECIMAL_OFFSET conv=notrunc of=FILENAME

The words in caps can be changed as follows:
FILENAME - File to be edited

DECIMAN_OFFSET -  Offset in FILENAME where you want to start editing, [COLOR="#FF0000"]MUST[/COLOR] be in decimal form and not hexadecimal

INPUT - change this to
cat INPUTFILE
or
printf STRING

Examples:
Let's say you want to fix gs for v80 and allow GMs to create monsters, you would type in:
Code:
printf "\xEB" | dd obs=1 seek=841439 conv=notruc of=/ServerPath/gamed/gs
and
printf "\xEB" | dd obs=1 seek=842055 conv=notruc of=/ServerPath/gamed/gs

The example above is more suitable for small edits, if you want to patch gs to read ptemplate.conf, you may have more bytes to be edited, they can be saved in a file. Then use another command to patch gs. The following example assumes the patch file is named "new" and the offset is 123456:
Code:
cat new | dd obs=1 seek=123456 conv=notruc of=/ServerPath/gamed/gs
EDIT:
I'm learning with linux and I found out that you can use
dd bs=1 if=INPUTFILE skip=OFFSET_FROM_INPUTFILE count=NUMBER_OF_BYTES_TO_READ of=OUTPUTFILE seek=OFFSET_IN_OUTPUTFILE conv=notrunc
so for this example it's
dd bs=1 if=new skip=0 count=12 of=/ServerPath/gamed/gs seek=123456 conv=notrunc
This way you would only have to upload a small patch file onto your remote server.

The commands can be saved into a .sh file to be uploaded with the patch file so you do not have to type the whole thing out, risking unnecessary mistakes.

Meanwhile... look forward to more guides to come!
Maybe a utility to allow easier editing of gs for things like max level cap, reading ptemplate.conf etc.

Cheers

EDIT:
Tested on CentOS
 
Last edited:
Back
Top