Valhalla Legends Forums Archive | Advanced Programming | in an RTS game, with packets flying all the time...

AuthorMessageTime
thetempest
ok, with SC, i'm trying to find the mineral update packet...i'm not sure where to start.

any help would be great, thanks
December 7, 2003, 1:43 AM
Arta
Find calls to send(). Isolate those that send game packets. Write a hook to log those packets, or display them ingame. Add functionality to that function that checks the memory address used to store the current amount of minerals, and compare that number to the data in outgoing packets. Record the unique identifiers of those packets. Experiment to eliminate false positives.
December 7, 2003, 4:45 AM
Adron
Alternatively, you might also want to just note that there isn't any mineral update packet :P
December 7, 2003, 10:04 AM
Arta
lol :)
December 7, 2003, 4:11 PM
Adron
Well, I just figured that even though your post was very nice, and would've sent him out on a long chase, perhaps it'd be more constructive to just realize and move on.
December 7, 2003, 5:05 PM
thetempest
ok,

well if that is true, than please explaint this:

1) if i change my minerals via writeprocmem() sc IMEDIENTLY desyncs...so if there is no (mineral update) packet, then how does it know to desync imediently, instead of when i build buildings or spend the $$??

I mean no disresect, just curious

Thanks
December 10, 2003, 4:42 AM
Yoni
Having never taken a serious look at it, I don't know anything about how Starcraft netcode works, but I would guess that the synchronization is done by sending the other player(s) a checksum of your current "statistics" (which would include your minerals and gas...) every few twinklings, and the other players compare it with the checksum they think you should have, and desync you in case of forgery. When you spend your minerals, you send a message that says what you did, and the other players calculate how many minerals you spent and deduct that from what they think you have.
December 10, 2003, 7:28 AM
iago
I haven't looked at this since 1.09, but, at least in 1.09, minerals weren't checksummed, and I find it doubtful that they are now.

But if you did something that you shouldn't be able to do, like buy an scv with 0 minerals, you would desync.

And I think Yoni is right about the checksums.

Note that mineral hacks are impossible. Don't worry yourself with trying.
December 10, 2003, 11:44 AM
Kp
[quote author=iago link=board=23;threadid=4121;start=0#msg34581 date=1071056672]
Note that mineral hacks are impossible. Don't worry yourself with trying.[/quote]

Untrue! They work just fine if everyone runs them. ;)
December 10, 2003, 7:24 PM
thetempest
lol :D,

everyone thinks i'm trying to write a mineral hack...haha...

i know a hell alot better than thatone. here is what i want to do:

i want to find the routine that compiles the "stats" packet you guys are reffering too...and send it to all the other players in the game using the SC algo that does this 0x190869...i think...but here is my catch....

i have the sendto() function hooked, and it scans outgoing packets for this update packet ID, and if it's there...i dont send using the SC sendto() i call my own and spoof a different players IP, therefore all players in game would get my minerals/gas but associate it with another person, and if they dont have MY stats, they would be droped for hacking...

make better since now?
December 10, 2003, 8:03 PM
iago
There's better ways to do that.

It would be difficult to do that,since you wouldn't have the right seq/ack (or Blizzard's equivolant)
December 10, 2003, 8:05 PM
thetempest
yes, your right, SC uses seq#'s...
but i dont see that as a problem because if the client recv's a packet with a bad seq#, wont it just drop the client that sent that packet...or at least caues some problem to desync them? You're right, thats' a big hassle...

so you've got my attention, what's the easier method? PM me if you want, i'd be quite intrested in listening to what you have to say

EDIT:

acually, now that i think about it. there is a way to over come that problem...

hook recvfrom() and scan for the update packet id. If found, goto offset in packet and change his resource # to someting different (experiment ither up or down) and then send that packet to everyone via the starcraft algo that sends to all players...
December 10, 2003, 11:01 PM
Kp
... but I don't approve of people randomly dropping others in game, so I won't say what to do (it's quite easy though, and much less trouble than the scheme you're proposing).
December 11, 2003, 12:30 AM
TheMinistered
IIAC, I believe each starcraft instance keeps track of a linked list of unit structures. The unit structure has a flag to signal if a scv is mining, building, has minerals ready to dump etc. When the scv brings the minerals back to the cc their instance updates how many minerals you have. Please correct me if I am wrong.
December 11, 2003, 2:47 AM
iago
[quote author=Kp link=board=23;threadid=4121;start=0#msg34699 date=1071102628]
... but I don't approve of people randomly dropping others in game, so I won't say what to do (it's quite easy though, and much less trouble than the scheme you're proposing).
[/quote]

Agreed. You're just going to have to figure it out :P
December 11, 2003, 2:47 AM
UserLoser.
On the topic of Starcraft games (nothing to do with minerals), I think it'd be great if someone posted some information and documention on some UDP packets. I've started a gamebot, I do have a checksum function, but I'm not totally sure if it's correct. The farthest I can get is almost into the game lobby. However, I do open UDP sockets for each user in the game, and ping them.

Maybe show some (if there's any) on BnetDocs, or post in botdev forum?
December 12, 2003, 12:02 AM
thetempest
a little bit on UDP packets:

http://www.mit.edu/afs/athena/user/d/a/daveg/Src/pkt.c

this will contain a checksum that is correct ;D
December 12, 2003, 1:19 AM
St0rm.iD
That's not what he wants.

There is about a million light-years between pinging and getting into the waiting room.
December 13, 2003, 4:03 AM
indulgence
[quote author=thetempest link=board=23;threadid=4121;start=0#msg34631 date=1071086604]
lol :D,

everyone thinks i'm trying to write a mineral hack...haha...

i know a hell alot better than thatone. here is what i want to do:

i want to find the routine that compiles the "stats" packet you guys are reffering too...and send it to all the other players in the game using the SC algo that does this 0x190869...i think...but here is my catch....

i have the sendto() function hooked, and it scans outgoing packets for this update packet ID, and if it's there...i dont send using the SC sendto() i call my own and spoof a different players IP, therefore all players in game would get my minerals/gas but associate it with another person, and if they dont have MY stats, they would be droped for hacking...

make better since now?
[/quote]

That wont work because the data isnt coming in on the socket associated with the player you want to spoof - its coming from yours... All the data about playername, etc, is stored on thier computer and is refrenced when needed while the data from individual sockets is being processed
December 14, 2003, 3:12 AM
thetempest
o, i didnt know that. That explains why you can't change all of the occurences of your screen name on your computer to get the impersinator hack. you have to spoof their playerID??? i dunno
December 14, 2003, 4:18 AM
Adron
[quote author=thetempest link=board=23;threadid=4121;start=15#msg35218 date=1071375509]
o, i didnt know that. That explains why you can't change all of the occurences of your screen name on your computer to get the impersinator hack. you have to spoof their playerID??? i dunno
[/quote]

Which reminds me of some of the Blizz icon hacks from the Diablo 1 days. They worked. For you.
December 14, 2003, 12:37 PM

Search