Staredit Network > Forums > General StarCraft > Topic: Function signature
Function signature
Dec 18 2015, 10:29 am
By: iCCup.xboi209  

Dec 18 2015, 10:29 am iCCup.xboi209 Post #1



I'd be grateful if someone could find the function signature at 0x00486530. BWAPI doc titles this as Cls2RecvFrom




Dec 18 2015, 12:34 pm UndeadStar Post #2



What exactly do you call "function signature" ?
Some random stuffs I can tell:

-the function go between 00486530 and 0048657D
-at some point, it call the function 00486040 (I know it as "LOBBYCLASS2_RECV")
-it doesn't seem to take input parameters using registers, unless those are left untouched to be used in 00486040
-it doesn't return anything
-it's based on a loop using a value starting at 8 and decreasing.

Hope it help.

edit:

prototype would be "void Cls2RecvFrom();".

This function seems to be called in what I know as gameLoopTurns function.
I'm not sure why you would try to call a function at that scale.

Post has been edited 1 time(s), last time on Dec 18 2015, 2:32 pm by UndeadStar.



None.

Dec 18 2015, 1:34 pm iCCup.xboi209 Post #3



I meant the function prototype




Dec 18 2015, 4:06 pm Heinermann Post #4

SDE, BWAPI owner, hacker.

Maybe something like "void ParseAllLobbyTurnCommands();" would be more appropriate?

Code
// .data:0057F0B8 ; DWORD arrayPlayerStatus[8]
// .text:00486040 ; void __userpurge LOBBYCLASS2_RECV(char *arrayData@<eax>, int dataLen, int plStormID)
// .data:006554B4 ; char *recvTurnArrayData[8]
// .data:00654A80 ; unsigned int sgdwTurnLens[8]
// .data:00512680 g_ActiveStormID dd 8

const int NUM_PLAYERS = 8;
const int NO_PLAYER = 8;
const unsigned PLAYER_STATUS_ACTIVE = 0x20000;

void ParseAllLobbyTurnCommands()
{
 int i = NUM_PLAYERS;
 while (i--) // Terrible devs code golfing Starcraft
 {
   g_ActiveStormID = i;
   if (arrayPlayerStatus & PLAYER_STATUS_ACTIVE)
     LOBBYCLASS2_RECV(recvTurnArrayData[i], sgdwTurnLens[i], i);
 }
 g_ActiveStormID = NO_PLAYER;
}






Dec 18 2015, 8:17 pm iCCup.xboi209 Post #5



Thank you but it looks like I guessed the function wrong....
I'm trying to find the function that receives game packets from other players, so 0x00486040(LOBBYCLASS2_RECV) or 0x004865D0(Game_RECV)?




Dec 18 2015, 11:18 pm UndeadStar Post #6



In case it can help, the gameLoopTurns function that is the one using @00486530 is calling the following functions:

00486580 //RecvSaveTurns
004A3380 //timeoutProcDropdown
00485AA0 //GameKeepAlive
00486F50 //ParseGameRecvInfo
00486530 //Cls2RecvFrom
0047CFC0 //UpdateGameHash

I would guess the first one is a hit, or maybe it would be 004BB530 (ReceiveTurns) that is called by 00486580, but all those functions are in the middle of code that write and read from memory, instead of using registers or the stack, so good luck for preventing what you use to do bad stuff in your back.

edit: Just noticed, but this assume the gameLoopTurns function is not executed after what you wanted (thus using result that have already been received), in which case I'm missing the point again.In that case, my apologies.



None.

Dec 20 2015, 11:36 pm iCCup.xboi209 Post #7



Still need the function prototype :|




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:36 pm]
Suicidal Insanity -- fortheovermind
fortheovermind shouted: my turn rate bar from the Create panel is no longer there. my games are created with the default 12 and i can no longer modify it, what could be causing this?
Known patch bug
[06:07 pm]
Ultraviolet -- lifebot This version appears to be older than the version I already have downloaded (1.5). Why is this one being posted?
[06:03 pm]
Ultraviolet -- Zoan
Zoan shouted: MTiger156 lifebot woah, that's awesome! I'm too lazy right now to check, but does it work with Remastered or 1.1.16 only?
I haven't used it in the latest version of remastered, but I assume it still works. It definitely did before. It's pretty neat. Super fast & easy way to create a save/load system
[05:02 pm]
fortheovermind -- my turn rate bar from the Create panel is no longer there. my games are created with the default 12 and i can no longer modify it, what could be causing this?
[04:50 pm]
Zoan -- MTiger156
MTiger156 shouted: Also, here's a link to its actual description http://www.staredit.net/topic/17696/
lifebot woah, that's awesome! I'm too lazy right now to check, but does it work with Remastered or 1.1.16 only?
[04:18 pm]
Dem0n -- o nvm you're talking about SCDB, not the map
[04:17 pm]
Dem0n -- wtf is a "software innovation" in BW LMAO
[04:16 pm]
Dem0n -- no
[02:45 pm]
MTiger156 -- Also, here's a link to its actual description http://www.staredit.net/topic/17696/
[02:33 pm]
MTiger156 -- One of the greatest software innovations in all of SCBW :P
Please log in to shout.


Members Online: Doodan, Roy, KrayZee, atom379634, GGmano, 8z2b3z2c7xc5bn