Tuesday, December 4, 2007

Javascript engine bug again!

I was very close to release of the initial beta battle ground AFK scripts, when all of a sudden I hit a strange problem when start run with release version of the code.

When the execution enters a javascript function that accepts 1 argument, the bot skips everything and starts the next round.

A close inspection found that happens when the bot is trying to access that argument. Isolate to that one function, and the script reports it does not known that argument! Samething running with debug mode is just fine.

The first thought I had is it is those #define statements again. But none of that is the case. While I was stepping through the code, parse of arguments mysteriously changed on a totally unrelated statement (on a compare statement)! Inspecting on the resulting assembly code, and I found the stock return was corrupting the arguments passed in. Turned out the Microsoft optimizer is optimizing on nuts!

After put all javascript engine code on /Od (disable optimization), problem solved.

So that concludes another wasted night.

3 comments:

Anonymous said...

Ok, now i saw your bot. But your hooking the game aren't you? If you are hook it warden can detect that and well .. ban yah :p
It was search for wow's pid i saw so ..

Wow Panda said...

Nope there is no hooks/injections. Bot is searching for WOW pid so it can read from WOW's memory.

You can dump all the kernel calls from the program (it is not encrypted in anyway), and you won't find any hook calls.

This is my last comment before going on vacation, so no more posting for next 2 weeks.

Anonymous said...

Very nice bot, thank you