• Welcome to Valhalla Legends Archive.
 

Waiting for a push of a specific value with WinDBG

Started by Stwong, February 27, 2005, 01:36 PM

Previous topic - Next topic

Stwong

Alright, I'm using WinDBG.  My friend that did this used SoftICE, which doesn't work on my computer.  So, here's what I'm trying tyo do, and why it doesn't work.

I want to find the spot where the SC graphics display routines start up--we've discussed this before (making SC run in 800x600).  Last time my friend and I did this, he found the code that starts the display up by looking for the first spot where SC pushed 640 onto the stack.

Here's what I'm trying as of this posting:
Open Executable: starcraft.exe (1.12b)
bp 46a7b0
g
(hits breakpoint, seeing as that breakpoint is the start / main(){})
.while (@@c++(*@esp != 0x80020000)) { p; }
QuoteNo pointer for operator* '!= 0x80020000)) { p; }'

I've fiddled with the syntax a bit, read the documentation, and can't really figure it out.  I know this is a newbish question, though...

Kp

Why not just search the disassembly for 6880020000?  Unless the push is soft-coded from some variable, that'll work just as well and be much easier.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Stwong

#2
Probably could do that, in fact, I should.  I'll check it out and get back to you in a moment.

Edit:
It worked.  Brilliantly.  There's two pushes in a row, as expected, one after another--y first, then x.  They're 5 bytes apart, so they were really easy to find.  In fact, doing a search for the following
68e00100006880020000
yields the resolution setting code for me on second try.  (There are two instances of these pushes--time to figure out what the first one does.  Most likely creates a buffer somewhere.)

On a side note, I tried this earlier but didn't include the trailing 0000, so I got some strange values.  I also wasn't as thorough as this time.

Thanks for the help again, kp.