Jump to content


Photo
- - - - -

Python Hex editor


Old topic!
Guest, the last post in this thread is over 60 days old. Posting in this thread will be considered a bump, so please make an attempt to be courteous if you go ahead with it.

If the last post is over 6 months old, it may instead be a better idea to start a new topic. If you aren't sure about what to do, feel free to ask a staff member for help, or try to locate a 'general questions'-type thread if it exists in this (sub-)forum.


  • Please log in to reply
8 replies to this topic

#1 17 June 2010 - 07:11 PM

Carrotlord Offline
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: 28 Jan 2010
Location: LocationInternet
Posts: 1,374
Age: 20
 

Well, today I made my own hex editor.

The editor is a small little python script file. It was actually quite easy to make, but it's also kind of primitive at this stage, since everything is done through command line. You can still do the basics, such as reading/writing hex values for any file, as well as reading/writing ascii characters if you need to do that.

Posted Image

Posted Image

=== Some Commands ===
open X - Opens the file with filename X for editing.

name - Shows the filename of the file that is currently opened.

offset X - Sets the starting offset to hexadecimal number X.

decoffset X - Sets the starting offset to decimal number X.

readhex - Displays a block of hex codes, which start at the offset specified by the offset commands.

writehex [hex string] - Writes a string of hex codes directly into the file starting at the offset specified by the offset commands. (example: writehex 4A 6B 32 FF 00 AC 5B 5C)

readascii - Shows a block of ascii characters from the file, starting at the offset specified in the offset commands.

writeascii [ASCII text] - Converts a block of ASCII characters into their respective hex codes, then writes those hex codes directly into the file starting at the offset specified by the offset commands. (example: writeascii A125fe89305euqn25m3)

readsize X - Changes the maximum number of ASCII characters displayed by the command readascii to X.

readlineshex X - Changes the maximum number of hex code lines displayed by the command readhex to X.

showvars - Displays the numbers that are stored in the offset, readsize, and readlineshex variables.

exit - Closes the program.
========

Example hack:
Put Doukutsu.exe in the same folder as the program. Then use the commands:

open Doukutsu.exe
offset 83AF
writehex 57
offset 83ED
writehex 57
offset 8428
writehex 57
offset 8463
writehex 57
exit

This will cause the Nemesis bullets to produce hearts (yes, the healing kind) instead of smoke.

So, what was the point of all this?

Well, I can easily make this more Cavestory specific. For example, I could make a program that could
auto-install a certain type of ASM hack into a Cavestory executable, given the correct offsets and hex codes needed to do it.
Also, since this is a Hex editor in its early stages, writing a custom disassembler is not far off.

If you want to see it, it's available here. Please read the "User Guide.html" for extra information on the commands.

#2 17 June 2010 - 07:17 PM

Noxid Offline
a2_a2
"Life begins and ends with Nu."
Join Date: 28 Aug 2009
Location: LocationOu
Posts: 3,858
 

I see this as something that will let me apply a double-res or other hack to a blank .exe with the touch of a button, something I don't really know how to do with a standard hex editor.

Am I right? Can I set up some sort of auto-hacking... thing?
Because that'd be useful. It'd also be useful for the WAV org fix, so you wouldnt have to know how to use the debugger.

kss-button.png azarashi-button.png mahinbuttongif2.gif balbal-button.png
Userbox-SC16B_Knuckles.png


#3 17 June 2010 - 07:22 PM

Carrotlord Offline
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: 28 Jan 2010
Location: LocationInternet
Posts: 1,374
Age: 20
 

I see this as something that will let me apply a double-res or other hack to a blank .exe with the touch of a button, something I don't really know how to do with a standard hex editor.

Am I right? Can I set up some sort of auto-hacking... thing?
Because that'd be useful. It'd also be useful for the WAV org fix, so you wouldnt have to know how to use the debugger.


Yes. Auto-hacking is perfectly doable. Just need the hex codes and the addresses and I can make you an ASM hack-installer program.

#4 17 June 2010 - 07:27 PM

Noxid Offline
a2_a2
"Life begins and ends with Nu."
Join Date: 28 Aug 2009
Location: LocationOu
Posts: 3,858
 

Well I can't *GIVE* the double-res ones to anybody but you could try it with the WAV hack available on the MP3 in Cave Story Thread.

kss-button.png azarashi-button.png mahinbuttongif2.gif balbal-button.png
Userbox-SC16B_Knuckles.png


#5 17 June 2010 - 07:31 PM

Carrotlord Offline
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: 28 Jan 2010
Location: LocationInternet
Posts: 1,374
Age: 20
 

Well I can't *GIVE* the double-res ones to anybody but you could try it with the WAV hack available on the MP3 in Cave Story Thread.


Hmm... good point. Perhaps I'll start working on a general-purpose hack installer, so that you don't have to give me any hex codes for 2x res. (it'll be like "put text files with hex data in this folder. Have an offset at first line of each file, rest is hex data. Then run the program. Hack installed.")

#6 17 June 2010 - 07:40 PM

WoodenRat Offline
Pirate Member
"What is a man!? A miserable pile of secrets! But enough talk, have at you!"
Join Date: 26 Dec 2007
Location: LocationLithuania
Posts: 1,846
 

Hmm... good point. Perhaps I'll start working on a general-purpose hack installer, so that you don't have to give me any hex codes for 2x res. (it'll be like "put text files with hex data in this folder. Have an offset at first line of each file, rest is hex data. Then run the program. Hack installed.")


That sounds easy enough, even for a newb such as myself who couldn't tell the difference between an offset and a taco.

And WoodenRat never liked you in the first place


#7 19 June 2010 - 12:33 PM

andwhyisit Offline
Administrator
"Life begins and ends with Nu."
Join Date: 15 Jul 2007
Location: LocationAustralia
Posts: 4,792
Age: 27
 

That sounds easy enough, even for a newb such as myself who couldn't tell the difference between an offset and a taco.

This one is a taco:
http://1.bp.blogspot...1600-R/taco.png

Posted Image

Spoiler

 


#8 19 June 2010 - 12:44 PM

Vercci Offline
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: 16 Sep 2009
Location:
Posts: 521
 

This one is a taco:
http://1.bp.blogspot...1600-R/taco.png


o shit wtf did i do in carrotlord's assenbly guide then???:cool::mad::eek:

#9 19 June 2010 - 02:39 PM

WoodenRat Offline
Pirate Member
"What is a man!? A miserable pile of secrets! But enough talk, have at you!"
Join Date: 26 Dec 2007
Location: LocationLithuania
Posts: 1,846
 

This one is a taco:
http://1.bp.blogspot...1600-R/taco.png


Thanks man, now I'll know what an off set does not look like.

And WoodenRat never liked you in the first place




Old topic!
Guest, the last post in this thread is over 60 days old. Posting in this thread will be considered a bump, so please make an attempt to be courteous if you go ahead with it.

If the last post is over 6 months old, it may instead be a better idea to start a new topic. If you aren't sure about what to do, feel free to ask a staff member for help, or try to locate a 'general questions'-type thread if it exists in this (sub-)forum.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users