• Welcome to Valhalla Legends Archive.
 

Winbot

Started by pianka, August 11, 2004, 09:00 PM

Previous topic - Next topic

pianka

I'm making a winbot right now and after packet logging Madd0x's winbot, Starcraft itself and looking at Gamer Bot and Soup Bot winbot sources; I think I got the packets correct.  Everything seems to be working correctly except I don't get wins.

Here's a hex dump of what I'm sending:

FF 2C 41 02 00 00 00 00 08 00 00 00 05 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 69 61 6E 6B 61 57 69 6E 62 6F 74 00 69 42 6F 74 32 2E 30 00 00 00 00 00 00 00 4F 6E 20 6D 61 70 20 22 41 73 68 72 69 67 6F 22 3A 0A 00 50 69 61 6E 6B 61 57 69 6E 62 6F 74 20 77 61 73 20 5A 65 72 67 20 61 6E 64 20 70 6C 61 79 65 64 20 66 6F 72 20 32 20 6D 69 6E 75 74 65 73 0A 0A 20 20 4F 76 65 72 61 6C 6C 20 53 63 6F 72 65 20 31 37 30 30 0A 20 20 20 20 20 20 20 20 20 20 20 37 30 30 20 66 6F 72 20 55 6E 69 74 73 0A 20 20 20 20 20 20 20 20 20 20 20 33 30 30 20 66 6F 72 20 53 74 72 75 63 74 75 72 65 73 0A 20 20 20 20 20 20 20 20 20 20 20 37 30 30 20 66 6F 72 20 52 65 73 6F 75 72 63 65 73 0A 0A 20 20 55 6E 69 74 73 20 53 63 6F 72 65 20 37 35 30 0A 20 20 20 20 20 20 20 20 20 20 20 20 31 33 20 55 6E 69 74 73 20 50 72 6F 64 75 63 65 64 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 30 20 55 6E 69 74 73 20 4B 69 6C 6C 65 64 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 30 20 55 6E 69 74 73 20 4C 6F 73 74 0A 0A 20 20 53 74 72 75 63 74 75 72 65 73 20 53 63 6F 72 65 20 33 30 30 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 31 20 53 74 72 75 63 74 75 72 65 73 20 43 6F 6E 73 74 72 75 63 74 65 64 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 30 20 53 74 72 75 63 74 75 72 65 73 20 52 61 7A 65 64 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 30 20 53 74 72 75 63 74 75 72 65 73 20 4C 6F 73 74 0A 0A 20 20 52 65 73 6F 75 72 63 65 73 20 53 63 6F 72 65 20 37 30 30 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 30 20 47 61 73 20 4D 69 6E 65 64 0A 20 20 20 20 20 20 20 20 20 20 20 37 30 30 20 4D 69 6E 65 72 61 6C 73 20 4D 69 6E 65 64 0A 20 20 20 20 20 20 20 20 20 20 20 34 30 30 20 54 6F 74 61 6C 20 53 70 65 6E 74 0A 00


My code to authorize map:

With clsB
   .InsertByte &HC8
   .InsertByte &H1C
   .InsertByte &H1
   .InsertByte &H0
   .InsertByte &H42
   .InsertByte &HA7
   .InsertByte &H2
   .InsertByte &H4D
   .InsertByte &H93
   .InsertByte &H1F
   .InsertByte &H9F
   .InsertByte &H3
   .InsertByte &H43
   .InsertByte &H11
   .InsertByte &HEC
   .InsertByte &HFE
   .InsertByte &HCB
   .InsertByte &HA8
   .InsertByte &HDB
   .InsertByte &H70
   .InsertByte &H32
   .InsertByte &H5F
   .InsertByte &H3B
   .InsertByte &H8A
   .InsertString "(4)Ashrigo.scm"
   .Send &H3C, i
End With


My leave game packet:

For i = 0 To UBound(Winbots)
       If Winbots(i).GameName = Winbots(Index).GameName Then
           If i = Index Then
               With clsB
                   .Send &H0, Index
               End With
           End If
           If Winbots(i).Win = True Then
               Results(CurrRes) = &H5
           Else
               Results(CurrRes) = &H6
           End If
           Players(CurrRes) = Winbots(i).Username
           CurrRes = CurrRes + 1
       End If
Next i
With clsB
       .InsertDWORD &H0
       .InsertDWORD &H8
       .InsertDWORD CLng(Results(0))
       .InsertDWORD CLng(Results(1))
       .InsertDWORD CLng(Results(2))
       .InsertDWORD CLng(Results(3))
       .InsertDWORD CLng(Results(4))
       .InsertDWORD CLng(Results(5))
       .InsertDWORD CLng(Results(6))
       .InsertDWORD CLng(Results(7))
       .InsertString Players(0)
       .InsertString Players(1)
       .InsertString Players(2)
       .InsertString Players(3)
       .InsertString Players(4)
       .InsertString Players(5)
       .InsertString Players(6)
       .InsertString Players(7)
       .InsertNonNTString "On map " & Chr(&H22) & "Ashrigo" & Chr(&H22) & ":" & Chr(&HA)
       .InsertByte &H0
       .InsertNonNTString Winbots(Index).Username & " was Zerg and played for 2 minutes" & Chr(&HA)
       .InsertByte &HA
       .InsertNonNTString "  "
       .InsertNonNTString "Overall Score 1700" & Chr(&HA)
       .InsertNonNTString "           700 for Units" & Chr(&HA)
       .InsertNonNTString "           300 for Structures" & Chr(&HA)
       .InsertNonNTString "           700 for Resources" & Chr(&HA)
       .InsertByte &HA
       .InsertNonNTString "  "
       .InsertNonNTString "Units Score 750" & Chr(&HA)
       .InsertNonNTString "            13 Units Produced" & Chr(&HA)
       .InsertNonNTString "             0 Units Killed" & Chr(&HA)
       .InsertNonNTString "             0 Units Lost" & Chr(&HA)
       .InsertByte &HA
       .InsertNonNTString "  "
       .InsertNonNTString "Structures Score 300" & Chr(&HA)
       .InsertNonNTString "             1 Structures Constructed" & Chr(&HA)
       .InsertNonNTString "             0 Structures Razed" & Chr(&HA)
       .InsertNonNTString "             0 Structures Lost" & Chr(&HA)
   .InsertByte &HA
       .InsertNonNTString "  "
       .InsertNonNTString "Resources Score 700" & Chr(&HA)
       .InsertNonNTString "             0 Gas Mined" & Chr(&HA)
       .InsertNonNTString "           700 Minerals Mined" & Chr(&HA)
       .InsertNonNTString "           400 Total Spent" & Chr(&HA)
       .InsertByte &H0
       .Send &H2C, Index
       .Send &H2, Index
       .InsertString Winbots(Index).Username
       .InsertByte &H0
       .Send &HA, Index
       .InsertDWORD &H2
       .InsertString ReadINI("Settings", "Channel")
       .Send &HC, Index
End With

MyndFyre

Quote from: PiaNKA on August 11, 2004, 09:00 PM
I'm making a winbot right now and after packet logging Madd0x's winbot, Starcraft itself and looking at Gamer Bot and Soup Bot winbot sources; I think I got the packets correct.  Everything seems to be working correctly except I don't get wins.

Ignoring your code completely, are you emulating two actual players, or one player and one computer?  Battle.net only records games with more than one human player.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

pianka

Two human players, no computers.

UserLoser.

I've been told SID_GAMEREPORT is different, and is more XML-stylish.  I havn't looked at it my self.  Also, you can't expect to copy code and make it work.

pianka

Quote from: UserLoser. on August 11, 2004, 10:33 PM
I've been told SID_GAMEREPORT is different, and is more XML-stylish.  I havn't looked at it my self.  Also, you can't expect to copy code and make it work.

I understand that which is why I didn't copy code, like I said, I looked at it.  Then of course I did get a hex dump of 0x2C from Starcraft and you're correct it did look XML-ish, though I don't understand why Madd0x's winbot can use the old style...and still get wins.

iago

I don't think battle.net cares about that text.

And you really ought to find out what each of the values your'e sending does.  Create a ton of games, changing each option, and figure out what's going on.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


pianka

Quote from: iago on August 12, 2004, 02:11 PM
I don't think battle.net cares about that text.

And you really ought to find out what each of the values your'e sending does.  Create a ton of games, changing each option, and figure out what's going on.

Nobody is getting this, huh?  I've packet logged it, I get what it does, I just don't get why it doesn't work.  I was just hoping perhaps somebody who had done this before knew of something I did wrong...

MyndFyre

Quote from: PiaNKA on August 12, 2004, 04:33 PM
Quote from: iago on August 12, 2004, 02:11 PM
I don't think battle.net cares about that text.

And you really ought to find out what each of the values your'e sending does.  Create a ton of games, changing each option, and figure out what's going on.

Nobody is getting this, huh?  I've packet logged it, I get what it does, I just don't get why it doesn't work.  I was just hoping perhaps somebody who had done this before knew of something I did wrong...

We understand.  Evidently, though, you're not doing something correctly, or you're not understanding the differences between packet logs satisfactorily.  So, don't bitch at us.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

pianka

#8
I didn't mean to seem like I was bitching, I'm just frustrated because I did so many different things.  I change around the 0x2C to exactly what SC had, including the XML and every other little byte.  I have the exact same map authorize checksum as Madd0x's winbot, which I had also tried to use packets from.  I was just hoping that I made a little mistake that I kept missing from looking at it so many times that you caught or something; thanks anyways.

iago

Code like this:

Quote.InsertByte &H93
  .InsertByte &H1F
  .InsertByte &H9F
  .InsertByte &H3
  .InsertByte &H43
  .InsertByte &H11
  .InsertByte &HEC
  .InsertByte &HFE
  .InsertByte &HCB

indicates to me that you have no clue what you're doing.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


pianka

Quote from: iago on August 13, 2004, 01:53 AM
Code like this:

Quote.InsertByte &H93
  .InsertByte &H1F
  .InsertByte &H9F
  .InsertByte &H3
  .InsertByte &H43
  .InsertByte &H11
  .InsertByte &HEC
  .InsertByte &HFE
  .InsertByte &HCB

indicates to me that you have no clue what you're doing.

My packet buffer doesn't have InsertBytes() and I was too lazy to write one, but why would that indicate that I have no idea what I'm doing...?  That's part of the map checksum...

Banana fanna fo fanna

because those fields mean something.

ChR0NiC

Quote from: iago on August 13, 2004, 01:53 AM
indicates to me that you have no clue what you're doing.

Not to mention the choice of avatar he chose >:(

Mesiah / haiseM

Might i just be the one to recommend packet logging the actual client?

Inserting values and "bytes" the way you are doing it is not good at all, especially since some of those values change. Instead of packet logging a program somebody else made, packet log the program your trying to emulate, you will get more answers instead of guess's.
]HighBrow Innovations
Coming soon...

AIM Online Status: 

DeTaiLs

Quote from: MesiaH on August 13, 2004, 12:38 PM
Might i just be the one to recommend packet logging the actual client?

Inserting values and "bytes" the way you are doing it is not good at all, especially since some of those values change. Instead of packet logging a program somebody else made, packet log the program your trying to emulate, you will get more answers instead of guess's.
If u read the first post he already said he packet logged a winbot and starcraft then looked at another bots source code