Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a couple of games (free, but closed source) that I'm editing to alter a certain feature so its less annoying. It's essentially Paused - Sorry can't do anything! thing. I've messed around with disassem\debuggers and found the JNE code that controls this, which I can edit to JMP to bypass the annoying behavior. Thing is there's about ~30 instances in every file, and the position and # can vary from file to file, and it gets tedious to do it. I've found 2 patterns that will find all the instances:

84 C0 74 ** B8 ** ** 4A 00
84 C0 74 ** E8 ** ** ** 00

Changing the 74 to EB is what I want to do.

84 C0 EB ** B8 ** ** 4A 00
84 C0 EB ** E8 ** ** ** 00

I've spent some time looking at various hex editors (Windows) but havent found any with this sort of functionality. Is there a scripting language that would help? Or some program I haven't found yet? (I know some c#\vb\java, so not that big of a leap)

share|improve this question

1 Answer 1

up vote 2 down vote accepted

In Ruby:

regex = /84 C0 74 \*\* B8 \*\* \*\* 4A 00/
regex2 = /84 C0 74 \*\* E8 \*\* \*\* \*\* 00/
File.open("your file", "rb+") do |file|
    file.gsub! regex, '84 C0 EB ** B8 ** ** 4A 00'
    file.gsub! regex2 '84 C0 EB ** E8 ** ** ** 00'

However, I'm not too familiar with how writing in binary works so that may or may not work. So back up. Your hair follicles will thank you.

Edit: Also keep in mind that you're voiding the warranty, possibly the EULA, any signatures the executable had, and the secret leprechaun trust by trying to modify closed source code. Jus sayin'.

share|improve this answer
Thanks! Though there is no warranty, no checksums, and afaik, disassembly and modification are legal, under personal use\non distribution etc. This 'feature' was requested to the dev to be made optional, but it will take months to convince them, and months more for a new build. It's extremely annoying to me, and I prefer to fix it myself right now :D –  Kage Aug 24 '11 at 7:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.