Some interesting data in starcraft 1.08

Go to index

1/The map

When you choose a map to play starcraft (like blood bath), you can see its size : from 64x64 up to 256x256.
The width stands at the address 5087fch (word) and the height stands at the address 5087feh (word)
For instance, if you choose a map which size is 128 x 92, the width is 128 and the height is 92.

We can deduce the size in pixel from this information.
The unit of the previous size is the cell. And a cell is an object of 32 x 32 pixels.
So, for example, a map described as 256x256 (cells) is a map of (256*32) x (256*32) pixels,
so 8192x8192 pixels [this is besides the maximum value]

What you can see on your screen is a piece of the map. The size of this piece is 640x480 pixels.
The coordinates of your screen in the map are at the addresses 5255d4h (dword) for the abscissa, and  at the addresses 5255d8h (dword) for the ordinate.
This is the coordinates of the point that is in the top-left position of your screen.

The map in pixels begins at the address pointed by 646518h.

2/The focused units

The units on focus are given at the address 65a7c8h, on a field of 12 dwords because there may be up to 12 focused units.
If there are n units (less than 12), the first n dwords after 65a7c8h point on the n focused units and the (12-n) other data contain dword ptr 0.

The recorded units (with ctrl-n) are stored in a field of 12 dwords. The address is calcuted like this :
@beginning of storing area = 509488h + (18*[4fc73c] + n) * 48
where [4fc73c] is the value at this address 4fc73c and n is the number of the stored group (from 0 to 9)
[I've not tested this functionnality]

3/The teams

Each team has a number that identifies it, from 0 to 7.
In the blizzard map, in general, the team 0 is in the north-west, and the id of the teams are incremented in the direction of the clock.
Your team number is at the address 4fc738h (byte)

Otherwise, starcraft prefers using a mask to know the team.
It allows to handle in a better way the alliances for example.
The bit n corresponds to the team n.
These masks are for instance at the addresses 65a800h (dword) or 65a804h (dword).
(ex : team6 sets the bit 6 to 1 so the value is 00 10 00 00 = 20h for mask in 65a800h)

You can get a pointer to the name of a team at this address :
65a853 + (24h x number of the team).
It is also a good test to know if a team of a certain number exists.

You can get the amount of minerals of a team by reading this address:
508718h + (4 x number of the team)
You can get the amount of vespene gas of a team by reading this address:
508748h + (4 x number of the team)

In starcraft, there are some objects with a dynamic behaviour (units, buildings, animals, minerals, ...).
These objects are stored in a general double linked list.
What's more, each object is in another double linked list and  is linked per team.
The linked list are null-terminated in the tail or in the head.
There are 10 'teams' : the 8 potential teams of player, and a 9th list for all the neutral object (mineral field, vespene geyser, neutral animals, and some temporary stuff like dark swarms).
The 10th list links all the objects.

The addresses to access to the head of these linked lists are :

4/The objects

So each object is represented by the same structure.
This structure has a size of 144 bytes and these structures are linked each other.

The meanings of some of the fields of the 144 bytes-structure are the following ones :
(o.xx means that this is the offset xx with the beginning of this structure)
(dw : double word | w : word | b : byte)

o.0h (dw) : previous unit in the general linked list
o.4h (dw)  : next unit in the general linked list
o.8h (dw)  : health of the unit
o.14h (dw) : another unit that is linked to an action (eg : unit that is repaired by a scv)
o.28h (w) : abscissa in pixels
o.2ch (w) : ordinate in pixels
o.35h (b) : =c if the unit is in stimpack mode
o.4ch (b) : team of this unit
o.4dh (w) : present action of the unit
                  examples of some values : 3h : the unit does nothing | 17h : in a transport or in a bunker | 0afh : this medic autoheals units
                  106h : simple move | 622h : this scv repairs | 681h : this ghost is launching a nuke, ....
o.61h (w) : plasma of the unit
o.64h (dw) : type of the unit
o.68h (dw) : previous unit int the team linked list
o.6ch (dw) : next unit int the team linked list
o.94h(b) : = 0f2h is this unit is an unit created with an hallucination
o.96h(b) : bit1  = 1 if this unit is cloacked or burrowed
o.a3h(b) : mana of the unit
o.ach (w) : different from 0 if it is a building which construction is not finished
o.10bh (b) : point of health remaining on the defensive matrix shield (from 250 to 0)
o.10ch (b) : units of time remaining before the end of defensive matrix
o.10fh (b) : units of time remaining before the end of lockdown (so = 0 if no lockdown)
o.110h (b)  : units of time remaining before the end of irradiate (so = 0 if no irradiate)
o.119h (b) : = 0 if the unit is not parasited, 1 otherwise
o.11bh (b) : = 0 if the unit is not blind, 2 otherwise
o.11ch (b) : units of time remaining before the end of maelstrom (so = 0 if no maelstrom)
o.11eh (b) : units of time remaining before the end of ensnare (so = 0 if no ensnare)

5/The type of an object

The type of the object is given in o.64h and identifies the class of the unit
It allows to know if this object is a command center, a zergling, a mineral field, ....

Here are some tests about the type of the object :
eax is the type of the object.

To know if this kind of unit is mechanical :
shl eax, 2
test dword ptr [eax+6baa98h], 40000000h

To know if this kind of unit is irradiable :
shl eax, 2
test dword ptr [eax+6baa98h], 10000h

To know how many points of health has a kind of unit at the creation :
mov ecx, [eax+6b6470h]

-----------------------------

The different values of the type :

0 = Terran Marine
1 = Terran Ghost
2 = Terran Vulture
3 = Terran Goliath
4 = Goliath Turret
5 = Terran Siege Tank (Tank Mode)
6 = Tank Turret
7 = Terran SCV
8 = Terran Wraith
9 = Terran Science Vessel
10 = Gui Montang (Firebat)
11 = Terran Dropship
12 = Terran Battlecruiser
13 = Vulture Spider Mine
14 = Nuclear Missile
15 = Terran Civilian
16 = Sarah Kerrigan (Ghost)
17 = Alan Schezar (Goliath)
18 = Alan Schezar Turret
19 = Jim Raynor (Vulture)
20 = Jim Raynor (Marine)
21 = Tom Kazansky (Wraith)
22 = Magellan (Science Vessel)
23 = Edmund Duke (Siege Tank)
24 = Edmund Duke Turret
25 = Edmund Duke (Siege Mode)
26 = Edmund Duke Turret
27 = Arcturus Mengsk (Battlecruiser)
28 = Hyperion (Battlecruiser)
29 = Norad II (Battlecruiser)
30 = Terran Siege Tank (Siege Mode)
31 = Tank Turret
32 = Firebat
33 = Scanner Sweep
34 = Terran Medic
35 = Zerg Larva
36 = Zerg Egg
37 = Zerg Zergling
38 = Zerg Hydralisk
39 = Zerg Ultralisk
40 = Zerg Broodling
41 = Zerg Drone
42 = Zerg Overlord
43 = Zerg Mutalisk
44 = Zerg Guardian
45 = Zerg Queen
46 = Zerg Defiler
47 = Zerg Scourge
48 = Torrarsque (Ultralisk)
49 = Matriarch (Queen)
50 = Infested Terran
51 = Infested Kerrigan
52 = Unclean One (Defiler)
53 = Hunter Killer (Hydralisk)
54 = Devouring One (Zergling)
55 = Kukulza (Mutalisk)
56 = Kukulza (Guardian)
57 = Yggdrasill (Overlord)
58 = Terran Valkyrie Frigate
59 = Mutalisk/Guardian Cocoon
60 = Protoss Corsair
61 = Protoss Dark Templar
62 = Zerg Devourer
63 = Protoss Dark Archon
64 = Protoss Probe
65 = Protoss Zealot
66 = Protoss Dragoon
67 = Protoss High Templar
68 = Protoss Archon
69 = Protoss Shuttle
70 = Protoss Scout
71 = Protoss Arbiter
72 = Protoss Carrier
73 = Protoss Interceptor
74 = Dark Templar
75 = Zeratul (Dark Templar)
76 = Tassadar/Zeratul (Archon)
77 = Fenix (Zealot)
78 = Fenix (Dragoon)
79 = Tassadar (Templar)
80 = Mojo (Scout)
81 = Warbringer (Reaver)
82 = Gantrithor (Carrier)
83 = Protoss Reaver
84 = Protoss Observer
85 = Protoss Scarab
86 = Danimoth (Arbiter)
87 = Aldaris (Templar)
88 = Artanis (Scout)
89 = Rhynadon (Badlands Critter)
90 = Bengalaas (Jungle Critter)
91 = Unused - Was Cargo Ship
92 = Unused - Was Mercenary Gunship
93 = Scantid (Desert Critter)
94 = Kakaru (Twilight Critter)
95 = Ragnasaur (Ashworld Critter)
96 = Ursadon (Ice World Critter)
97 = Lurker Egg
98 = Raszagal
99 = Samir Duran (Ghost)
100 = Alexei Stukov (Ghost)
101 = Map Revealer
102 = Gerard DuGalle
103 = Zerg Lurker
104 = Infested Duran
105 = Disruption Web
106 = Terran Command Center
107 = Terran Comsat Station
108 = Terran Nuclear Silo
109 = Terran Supply Depot
110 = Terran Refinery
111 = Terran Barracks
112 = Terran Academy
113 = Terran Factory
114 = Terran Starport
115 = Terran Control Tower
116 = Terran Science Facility
117 = Terran Covert Ops
118 = Terran Physics Lab
119 = Unused - Was Starbase?
120 = Terran Machine Shop
121 = Unused - Was Repair Bay?
122 = Terran Engineering Bay
123 = Terran Armory
124 = Terran Missile Turret
125 = Terran Bunker
126 = Norad II
127 = Ion Cannon
128 = Uraj Crystal
129 = Khalis Crystal
130 = Infested Command Center
131 = Zerg Hatchery
132 = Zerg Lair
133 = Zerg Hive
134 = Zerg Nydus Canal
135 = Zerg Hydralisk Den
136 = Zerg Defiler Mound
137 = Zerg Greater Spire
138 = Zerg Queen's Nest
139 = Zerg Evolution Chamber
140 = Zerg Ultralisk Cavern
141 = Zerg Spire
142 = Zerg Spawning Pool
143 = Zerg Creep Colony
144 = Zerg Spore Colony
145 = Unused Zerg Building
146 = Zerg Sunken Colony
147 = Zerg Overmind (With Shell)
148 = Zerg Overmind
149 = Zerg Extractor
150 = Mature Chrysalis
151 = Zerg Cerebrate
152 = Zerg Cerebrate Daggoth
153 = Unused Zerg Building 5
154 = Protoss Nexus
155 = Protoss Robotics Facility
156 = Protoss Pylon
157 = Protoss Assimilator
158 = Unused Protoss Building
159 = Protoss Observatory
160 = Protoss Gateway
161 = Unused Protoss Building
162 = Protoss Photon Cannon
163 = Protoss Citadel of Adun
164 = Protoss Cybernetics Core
165 = Protoss Templar Archives
166 = Protoss Forge
167 = Protoss Stargate
168 = Stasis Cell/Prison
169 = Protoss Fleet Beacon
170 = Protoss Arbiter Tribunal
171 = Protoss Robotics Support Bay
172 = Protoss Shield Battery
173 = Khaydarin Crystal Formation
174 = Protoss Temple
175 = Xel'Naga Temple
176 = Mineral Field (Type 1)
177 = Mineral Field (Type 2)
178 = Mineral Field (Type 3)
179 = Cave
180 = Cave-in
181 = Cantina
182 = Mining Platform
183 = Independant Command Center
184 = Independant Starport
185 = Independant Jump Gate
186 = Ruins
187 = Khayadarin Crystal Formation
188 = Vespene Geyser
189 = Warp Gate
190 = PSI Disruptor
191 = Zerg Marker
192 = Terran Marker
193 = Protoss Marker
194 = Zerg Beacon
195 = Terran Beacon
196 = Protoss Beacon
197 = Zerg Flag Beacon
198 = Terran Flag Beacon
199 = Protoss Flag Beacon
200 = Power Generator
201 = Overmind Cocoon
202 = Dark Swarm
203 = Floor Missile Trap
204 = Floor Hatch
205 = Left Upper Level Door
206 = Right Upper Level Door
207 = Left Pit Door
208 = Right Pit Door
209 = Floor Gun Trap
210 = Left Wall Missile Trap
211 = Left Wall Flame Trap
212 = Right Wall Missile Trap
213 = Right Wall Flame Trap
214 = Start Location
215 = Flag
216 = Young Chrysalis
217 = Psi Emitter
218 = Data Disc
219 = Khaydarin Crystal
220 = Mineral Cluster Type 1
221 = Mineral Cluster Type 2
222 = Protoss Vespene Gas Orb Type 1
223 = Protoss Vespene Gas Orb Type 2
224 = Zerg Vespene Gas Sac Type 1
225 = Zerg Vespene Gas Sac Type 2
226 = Terran Vespene Gas Tank Type 1
227 = Terran Vespene Gas Tank Type 2

Go to index