Starcraft Game Lobby stuff

Started by brew, January 16, 2010, 04:43:08 PM

Previous topic - Next topic

brew

For the upcoming Starcraft© Guardian™ banlist (1.16.21), I intend to (in addition to entering text) have a convenient option to blacklist a player by the menu underneath the associated game slot. There's a quick dirty way to do this, of course. Hooking 0041AF10, then adding a reference to your string at (*(dword)(ecx + 3Ah) + *(byte *)(ecx + 46h)).
But this requires hooking, which is ugly, and even worse, would cause StarCraft to fail CheckRevision.

I refuse to use this 'solution' as it lowers my standards of quality software.
Instead, I am currently trying to figure out how to add a menu item by calling 0041B760h but it requires the construction of that struct i mentioned (Since it's passed via ecx like a thiscall, it's probably a reference to 'this').
Interestingly, this is the same function that inserts a line of text into the game lobby chatbox.

So far I've documented a bit of it:

word 0h   = unknown, maybe reference ID?
word 2h   = x
word 4h   = cx
word 6h   = y
word 8h   = cy
word Ah   = unknown, variable val, maybe this has something to do with the y?
word Ch   = unknown, constant 0xA000 though
word Eh   = unknown, constant 0x10 though
dword 10h = unknown, 0
dword 14h = unknown, 0
dword 18h = Flags, currently A0020411h
dword 1Ch = unknown, 0
word 20h  = unknown, variable, smallish value (35 - 63)
word 22h  = unknown, constant 13
word 24h  = unknown, constant 1
word 26h  = unknown, variable, higher order byte seems > than lower order (are these bytes?)
word 28h  =
dword 3Ah = Pointer to the string table of the current menu
byte 46h = current menu slot being referenced
byte 47h = upper bound of slots #s?
byte 4Ch = direction of menu drawing (always 0, for backwards draw)


I'm hesitant on calling it because I _don't_ know what the majority of these members actually are.
Anyone else feel like looking into it and contributing?

Heinermann

#1
Hello, I'm posting because I received an inquery from MysT_DooM, and I support your methods.
QuoteBut this requires hooking, which is ugly, and even worse, would cause StarCraft to fail CheckRevision.

I refuse to use this 'solution' as it lowers my standards of quality software.

The structure you're referring to is a BIN Dialog structure(used in Starcraft's *.BIN dialog files). See http://code.google.com/p/vgce/source/browse/trunk/docs/Blizzard/Starcraft/BIN%20FORMAT.txt.
I believe that there are unions involved based on the Control Type, but this has never been documented and I hadn't spent the time to do research on it.

I labelled 0x0041B760 as "AddItemToListing", despite it not being completely accurate. IDA reported it as a __usercall/__userpurge, which I'm not completely sure what to do with.

You'll also probably come across:
004DDD30 ; char *__stdcall get_GluAll_String(int strID)

Don't forget Storm:
http://code.google.com/p/vgce/source/browse/trunk/docs/Blizzard/stormold.txt

EDIT: Also, by "1.16.2", do you mean waiting for the next Starcraft patch?

brew

This.... is simply amazing. I don't know what else to say.
Thank you so much, you're probably the best resource I'll ever encounter.
Are you the main contributor to that google code project?

The storm function listing really helps out too. So, I guess that's why I could never ban the players, because i was just dropping them instead! (I was doing Ordinal106(slotindex, 3), and i gave it the misnomer of SNetIssueCommand)

Also no, that's a whoops on my part. I thought the current version was 1.16.2 *shrug*

Heinermann

I'm the only contributor to that Google Code page. However, not all of the work is mine. The 115Structs were DiscipleOfAdun's and that storm list was originally the one posted on valhallalegends(I only modified it a little  ;) ). A lot of it is still original though.

Heinermann

I recently created a dialog class.
  See   http://code.google.com/p/bwapi/source/browse/trunk/bwapi/BWAPI/Source/BW/Dialog.h
 
  It can be detached from the project's code easily. There are 4 offsets   required, no hooks. You can create dialogs and controls, including two   premade dialogs, a "window"(movable with title/minimize/close), and a   "canvas"(alternative to drawing hooks). I've created a function that can   draw text to a bitmap surface as well (for the canvas, but can have   other uses).
 
  It's too bad I didn't make this sooner, I don't know if you still plan   to do this or not.