Next Generation Emulation banner
1 - 11 of 11 Posts

·
Registered
Joined
·
5 Posts
Discussion Starter · #1 ·
This should, in principle, be comparatively simple.

There is an old DOS game by DC True called Shadow President.

It simulates, amongst other things, the economies of the nations of the world.

It stores GDP Growth as a Floating Point or Double number. A Percentage.

At the end of each game year it calculates how much each nations' GDP increases.

It always resets all percentages greater than 5% to 5%.

That last part is what I want to hack.

Logically there must be:

a) A binary expression approximating: "if a > 0.05 then a = 0.05".
b) A constant in one of the text data files that has hitherto eluded my
attempts at discovering it.

I want to sweep for a) through the binary EXE. How would I approach this?
 

·
PCSX2 Coder
Joined
·
10,122 Posts
was there a softice for dos? or maybe you could run the game in a dos box with softice running i dont know.

but its probably going to be your best, bet, it should narrow down where abouts in the game the code is so you can at least hex edit it
 

·
War Games coder
Joined
·
1,926 Posts
I suspect the byte sequence you're looking for is '5FFFFFFD'. On the other hand, that assumes that it's a 16-bit double or a 32-bit float. If it's a 16-bit float, it would be '5FFD'.

I calculated this by taking the first number in BCD (5) and it's to the 10^-2 power. -2 in binary is F...D. Smear them together, you get those bytes. I'm not 100% positive, and don't have the time to research, so you may want to do some work yourself.
 

·
Registered
Joined
·
774 Posts
Or you could just grab yourself a copy of IDA and search for the opcode that way. I think the free version should have the functionality you need for this. It may have saving disabled or something, but as long as you know the opcode's offset you can just use a hex editor to modify it.
 

·
War Games coder
Joined
·
1,926 Posts
Wow, that's quite a package. Multi-platform too. Thumbs up, nice product :).
 

·
Registered
Joined
·
5 Posts
Discussion Starter · #6 ·
Hmmmmmm.... How very interesting.

I obtained SoftICE (But am too OS illiterate to figure out how to turn it on under Windows). What I also did was search 5FFD instead of 5FFFFFFD. 3 instances in my EXE. Now we're getting somewhere!

Now All I need to do is research Floats and see what 5 x 10 ^ 1 will be...(5F00 I'd guess.)
 

·
Registered
Joined
·
5 Posts
Discussion Starter · #7 ·
Xzyx987X, the free version of IDA does not include DOS executables, which is a shame as I like the program.

Also the "simple" expedient of hunting down the 5FFD Float failed to cause the desired results. So unless I get SoftIce operational, it appears that this project is going nowhere.

Nuts.
 

·
Transcended
Joined
·
1,416 Posts
There quite a number of ways to represent an if a > n statement, ranging from cmp->jumps to some memory juggling, depending on the eccentricities of the the compiler, so you'd have to know how your program does that to begin with if you're going to trace it by just reading code.

Get Turbo Debugger. I think it still works under Win32, or at least Win98 IIRC. But for tracing DOS programs, I have a VMWare setup that runs DOS, so SoftIce is not a problem. TD is kinda awkward after you've used SI. I have IDA too, but it doesn't trace DOS programs, although it gives a disassembly.

But honestly, getting SoftIce to run under Windows is a much trivial task compared to tracing a High Level Language program. The only hitch with SI is that it functions as in Kernel/System, so it CAN make Windows go awry if you're not careful.

Btw... there ARE apps that allow you to freeze values in memory you know, so you might be able to work around your problem by approaching it differently.
 

·
Transcended
Joined
·
1,416 Posts
Oh, it's a bug? Well... if you don't like to learn reversing, then just hope for the best. Good luck!
 

·
Registered
Joined
·
5 Posts
Discussion Starter · #11 ·
Yup Yup... CyberJudas fixes the darned bug. You pour a Billion in Aid into Lesotho and their GDP goes up 154%.

It's not that I don't want to learn back-engineering, but I have only the most rudimentary understanding of Assembly, so it would be exceedingly difficult for me to tackle this as a 1st project, it having proved much more challenging than expected. And the cost of getting the sequel, about $15 including shipping, well, you do the Cost/Benefit analysis. And now I have something to while away the hours while listening to my books on tape. Huzzah!

Thanks all for your help though.
 
1 - 11 of 11 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top