EUDTrig v1.3
By O)FaRTy1billion (aka FaRTy[MM])

   I. About EUDs
  II. Finding EUDs
 III. StarForge Data Files
  IV. Using EUDTrig
   V. Using the Exporter
  VI. Finding Version Offsets
 VII. Version History
VIII. Disclaimer

--- I. About EUDs ---
EUD stands for 'Extended Unit Death'.
EUDs are simply a buffer overflow  you put in a really big number
for unit, and StarCraft reads past the end of the death count table
allowing you to read arbitrary data.

At one point in time, EUDs were able to actually write to memory. But,
as this could be dangerous, Blizzard removed this feature leaving us
with the mostly useless EUD Conditions. EUDTrig supports older
versions, allowing you to downgrade and use EUD Actions once again.
EUD Actions work with 1.12b, and there exists lots of memory addresses
for 1.12b in a list (that I currently have misplaced :P).

!!New!!
Now available are EPD--or Extended Player Deaths. They are exactly the
same as EUDs, except instead of huge unit IDs they huge player numbers.
The advantage of using player number is that it is a 4-byte value,
allowing EUDs to read any address. Also they only have one value to
deal with as unit ID is always 0 (Terran Marine). ;D


--- II. Finding EUDs ---
Using a memory searcher (such as ArtMoney), you just search and filter
for a known (or partially known) value until you narrow the results
down to a few. After that, you just test and make sure that your newly
found address is the correct one (maybe increment it and see what
happens in StarCraft.)

Once you have found the memory address you want to use, just stick it
into EUDTrig and find the player number and unit ID.


--- III. StarForge Data Files ---
If you don't already have these (or want to update them for Extended
Players), this will show you how to update them.

In StarForge's Data folder, you will find (among other things)
Actions.lst and Conditions.lst. Open them and find Action SetDeaths()
and Condition Deaths() in thier respective files.
For extended players, replace "Player Player" with "Player Number".
For extended units, replace "Unit Unit" with "Unit Number".
When you make these fixes, normal values no longer become valid.


--- IV. Using EUDTrig ---
EUDTrig is very simple; that shouldn't be hard to assume when looking
at it. Most of this is covered in the Help dialog, but this will fill
in a few minor details.

EUDTrig accepts both hexadecimal (0-F) numbers, and decimal numbers
(0-9). Usually when you get a memory address, it will be in hex. To
input a decimal number, simply put the number as you see it. For a hex
number, you must put a preceeding '0x' (or the VB prefix '&H'.)

Numbers returned by EUDTrig's calculations will be decimal by default.
If you want them in hex, you must check Options->Output Hex (or hit
Ctrl+H.) This option will be saved when you close EUDTrig.

If you would like to use an older version of StarCraft, then you can
go to Options->Version Offset ([current]) and choose the version you
would like to use. Available versions are: 1.12b, 1.13f, 1.14, 1.15.x,
and 1.16.x. If the version you want is not listed, then you can find
it (see VI. Finding Version Offsets) and input it with the 'Other'
option. The selected version offset will also be saved when you close
EUDTrig.

Now for actually using the calculator.

Memory Offset - This is where you put your memory offset. Not to
difficult, eh?

Object ID/Len. - Sometimes the memory offset you use is simply a
pointer to the beginning of a table of values (such as death counters
themselves.) The ID (text box) will be where you specify the ID. This
can be left blank and is defaulted as 0 (0 is added to the memory
offset.) The length (dropdown box) is how many bytes the value is.

Use Extended Player Deaths - Unit ID will always be 0 (Terran Marine).
These require a different modification of StarForge's data files.

Down/Up buttons - These perform the calculations. Down will calculate
player number and Unit ID from the memory offset. Up will do the
reverse.

Player Number - This is the player that is used when using this EUD.
Player 9-12 can be read, but cannot be written to. When not using EPDs,
this value will be prefixed by a "P". This means that the literal value
is one less than what is shown (such as "P1" = 0x00, "P2" = 0x01, "3" =
0x03, "4" = 0x04). The "P" prefix must exist before the hex prefix when
necessary.

Unit ID - This shows the ID of the unit to use when using your EUD.
Using the Signed/Unsigned box, you can change whether or not the output
value can or can't be negative (some things use signed numbers (such as
StarForge) and other things use unsigned. EUDTrig's exporter should
accept both.)


--- V. Using the Exporter ---
This is really just a very simple trigger editor that does the bare
minimum for EUDs. This shouldn't be too difficult.

Conditions/Actions:
Player/Unit ID - info from the EUDTrig output. "P" prefix applies to
the Player field.

Compare/Modifier - Comparison and modifier for the Death condition/
action.

Value - Number to compare deaths to/modify with.

Add - Adds the condition/action to the respective list for StarForge/
StarEdit (*.trg).

Output:
StarForge/StarEdit (*.trg) - Output for the 'Add' button. StarEdit is
mainly for reference (and is what the Expoter uses.)

Save - Saves the current output as a .trg file.

Reset - Clears StarForge and StarEdit output.


--- VI. Finding Version Offsets ---
So you want to use an unsupported version (or a new patch came out.)
This little guide will show you how simple it can be.

Simply make a map that allows you to do a controlled incrementing of
deaths for Player 1 Marine (player 0, unit 0.) Such as a beacon to add
1 death for Player 1 Marine, or a constant spawning of Player 1 Marines
that get killed. To help narrow it down, you must also add something
to increment kills (if you are killing the marine) and force/all player
deaths for Player 1 Marine.

Once you have the offset, you must verify it. Make a trigger to read if
Player 1 Marine is some random value. Use the memory searcher to edit
the offset to that value. If whatever action takes place, then you've
got the correct memory address.


--- VII. Version History ---
1.3.0  - Added Extended Player calculations. Any EUD outside of the
         range P1-P12 and Unit 0-65535 will be calculated as an EPD.
       - Added "P" prefix to Player Number fields. A value with the "P"
         is one higher than the value in memory (see section IV.)
       - Made Object Len. allow any integer value.
       - Updated for 1.16.x.
       - Added info for StarForge data files to support EUDs in this
         readme.

1.2.0  - Fixed EUD max bounds (now supports for Unit 65535 to go to
         player 256.)
       - Fixed *.trg exporter to use 1-based player IDs.

1.1.1  - Updated for 1.15.2 (Again, the same as 1.15.0)
1.1.0  - Updated for 1.15.1 (It's the same as 1.15.0. :mad:)
       - Versions and offsets now stored in EUD.ini for easy updating.
       - Signed/Unsigned works better.
       - Added errors for when the address is less than the base address
         or larger than can be reached with EUDs.
       - Calculation bugs fixed (at least I hope so.)
       - Object Length and Signed/Unsigned now saved in EUD.ini.

1.0.1  - Attempted to fix a few calculation bugs.
1.0    - Inital Production & Release.

--- VIII. Disclaimer ---
I will not be held responsible for any damage or losses to you, your
computer, or belongings. This program is tested and works. Use at your
own risk! This program is neither sponsered nor indorsed by Blizzard
Entertainment. They are gods and own the world of StarCraft. Yeah, we
get it.