DeHackEd

From DoomWiki.org

(Redirected from Code pointer)
DeHackEd 3.0 and 3.1 splash screen

DeHackEd is an editor originally created for vanilla Doom that allows the operation of the executable to be changed. It was developed by Greg Lewis. Hit points, sounds, frame sequences, text strings and several other miscellaneous values can be changed. Modifications can be distributed in the form of DeHackEd "patches" which can be applied to the executable. In order to do this, DeHackEd has the ability to generate an exact copy of the Doom or Doom II executable, which by default is called doomhack.exe.

The most common patches add fast monsters and weapons, player-seeking-self-detonating barrels, and so on. However, more balanced and artistic modifications can and have been made. Even though many advanced effects can be achieved with DeHackEd, it does not offer the complete flexibility that a custom source port can provide. Monster AI and armor classes are fixed for example.

Older DeHackEd patches use a binary format of data to be applied to an executable file using the DeHackEd patching utility. Later versions of DeHackEd save their patches in a human-readable plain text format that can be edited with any text editor.

Editing Doom text-strings

Boom included the ability to load DeHackEd patches and affect changes to the game upon startup without any modification to the executable file. Other source-ports added similar functionality, and command-line loadable DeHackEd support is now common with most modern source-ports. Boom also provided the BEX (Boom EXtended) extensions for DeHackEd support. BEX allows greater flexibility in string editing, application of codepointers to any frame, and extra codepointers.

DoomHack[edit]

Besides being the default name of the executable DeHackEd generates as a copy of the Doom II executable, DoomHack, stylized as doomhack.exe is also an umbrella moniker to describe any custom executable that applies a DeHackEd patch to the Doom executable, commonly that of Doom II. However, the shareware release of Doom may also be used when a user wants to create a patch. In DeHackEd's INI file, one can specify a custom name for the resulting executable, set by the user.

Several WADs, primarily those released as partial conversions and total conversions such as Hacx, Mordeth and Strain, use either custom installer programs or primitive batch files to apply their .deh patch to a copy of the Doom II executable. This is done through the main DeHackEd program in conjunction with DeuSF and NWT to append extra flats and textures to the patch, but can also be used to simply merge the patch and the executable together. These installers also changed the resulting executables to a custom name to distinguish them from the main Doom or Doom II executable. Not every batch file or installer did this however, or confusingly changed the DeHackEd exectuable back to Doom II.

This method was the primary means of modifying the engine before the existence of source ports, as nowadays the user simply loads the .deh patch alongside their port of choice, negating the use of a custom DeHackEd engine.

Supplying a modified DeHackEd doomhack executable with a release instead of relying on a installer/batch file or an instruction (or a combination of these) did also exist and was (and is) considered illegal due to it relying on id Software's executables. Supplying a patch instead avoids this by including only a minimum amount of novel information to apply to the original file and requiring the end user to possess the original. This also leaves the choice to the end user whether to play it in a source port or on vanilla Doom.

In the present day, for those projects that target pure vanilla/DOS compatibility, DoomHack may still be used. Because of this, and because of its prior function as a means to modify the engine, DoomHack can be seen as a predecessor to the later source ports, that made modifications possible before the Doom source code was released.

VULD[edit]

Main article: VULD

The launcher VULD makes heavy use of DoomHack to automatically apply DeHackEd patches and graphics from PWADs to a new executable that can also be automatically renamed using the name of the patch as its template.

Thing numbers[edit]

Editing thing properties

When modifying things in DeHackEd, each thing type has an associated number. These correspond to the index in the thing info table inside the executable (mobjinfo found in info.c in the Doom source code). This number is different from the DoomEd number used to identify things when editing levels. Note that the DeHackEd index starts at 1, while the mobjinfo table index starts at 0.

For convenience, the table also lists the default DoomEd number associated to each thing, as well as the names used in popular editors, the identifier used in the Doom source code, and the corresponding ZDoom class name.

Thing number Usage DoomEd Doom Builder name SLADE name Identifier ZDoom class
1 Player MT_PLAYER DoomPlayer
2 Trooper 3004 Former Human Former Human MT_POSSESSED ZombieMan
3 Sergeant 9 Former Sergeant Former Human Sergeant MT_SHOTGUY ShotgunGuy
4 Arch-vile 64 Archvile Arch-Vile MT_VILE Archvile
5 Arch-vile Fire MT_FIRE ArchvileFire
6 Revenant 66 Revenant Revenant MT_UNDEAD Revenant
7 Revenant Rocket MT_TRACER RevenantTracer
8 Fireball Trail MT_SMOKE RevenantTracerSmoke
9 Mancubus 67 Mancubus Mancubus MT_FATSO Fatso
10 Mancubus Fireball MT_FATSHOT FatShot
11 Chaingunner 65 Chaingunner Chaingunner MT_CHAINGUY ChaingunGuy
12 Imp 3001 Imp Imp MT_TROOP DoomImp
13 Demon 3002 Demon Demon MT_SERGEANT Demon
14 Spectre 58 Spectre Spectre MT_SHADOWS Spectre
15 Cacodemon 3005 Cacodemon Cacodemon MT_HEAD Cacodemon
16 Baron of Hell 3003 Baron of Hell Baron of Hell MT_BRUISER BaronOfHell
17 Baron Fireball MT_BRUISERSHOT BaronBall
18 Hell Knight 69 Hell Knight Hell Knight MT_KNIGHT HellKnight
19 Lost Soul 3006 Lost Soul Lost Soul MT_SKULL LostSoul
20 Spiderdemon 7 Spider Mastermind Spider Mastermind MT_SPIDER SpiderMastermind
21 Arachnotron 68 Arachnotron Arachnotron MT_BABY Arachnotron
22 Cyberdemon 16 Cyberdemon Cyberdemon MT_CYBORG Cyberdemon
23 Pain Elemental 71 Pain Elemental Pain Elemental MT_PAIN PainElemental
24 SS Nazi 84 Wolfenstein SS Wolfenstein 3D SS MT_WOLFSS WolfensteinSS
25 Commander Keen 72 Commander Keen Hanging Keen MT_KEEN CommanderKeen
26 Big Brain 88 Icon of Sin Boss Brain MT_BOSSBRAIN BossBrain
27 Demon Spawner 89 Monster Spawner Boss Shooter MT_BOSSSPIT BossEye
28 Demon Spawn Spot 87 Monster Target Boss Spawn Spot MT_BOSSTARGET BossTarget
29 Demon Spawn Cube MT_SPAWNSHOT SpawnShot
30 Demon Spawn Fire MT_SPAWNFIRE SpawnFire
31 Barrel 2035 Barrel Barrel MT_BARREL ExplosiveBarrel
32 Imp Fireball MT_TROOPSHOT DoomImpBall
33 Caco Fireball MT_HEADSHOT CacodemonBall
34 Rocket (in air) MT_ROCKET Rocket
35 Plasma Bullet MT_PLASMA PlasmaBall
36 BFG Shot MT_BFG BFGBall
37 Arachnotron Fireball MT_ARACHPLAZ ArachnotronPlasma
38 Bullet Puff MT_PUFF BulletPuff
39 Blood Splat MT_BLOOD Blood
40 Teleport Flash MT_TFOG TeleportFog
41 Item Respawn Fog MT_IFOG ItemFog
42 Teleport Exit MT_TELEPORTMAN TeleportDest
43 BFG Hit MT_EXTRABFG BFGExtra
44 Green Armor 2018 Green armor Green Armour MT_MISC0 GreenArmor
45 Blue Armor 2019 Blue armor Blue Armour MT_MISC1 BlueArmor
46 Health Potion 2014 Health bonus Health Potion MT_MISC2 HealthBonus
47 Armor Helmet 2015 Armor bonus Armour Helmet MT_MISC3 ArmorBonus
48 Blue Key Card 5 Blue keycard Blue Keycard MT_MISC4 BlueCard
49 Red Key Card 13 Red keycard Red Keycard MT_MISC5 RedCard
50 Yellow Key Card 6 Yellow keycard Yellow Keycard MT_MISC6 YellowCard
51 Yellow Skull Key 39 Yellow skullkey Yellow Skull Key MT_MISC7 YellowSkull
52 Red Skull Key 38 Red skullkey Red Skull Key MT_MISC8 RedSkull
53 Blue Skull Key 40 Blue skullkey Blue Skull Key MT_MISC9 BlueSkull
54 Stim Pack 2011 Stimpack Stimpack MT_MISC10 Stimpack
55 Medical Kit 2012 Medikit Medikit MT_MISC11 Medikit
56 Soul Sphere 2013 Soulsphere Soul Sphere MT_MISC12 Soulsphere
57 Invulnerability Sphere 2022 Invulnerability Invulnerability Sphere MT_INV InvulnerabilitySphere
58 Berserk Pack 2023 Berserk Berserk Pack MT_MISC13 Berserk
59 Blur Sphere 2024 Invisibility Partial Invisibility Sphere MT_INS BlurSphere
60 Radiation Suit 2025 Radiation suit Radiation Shielding Suit MT_MISC14 RadSuit
61 Computer Map 2026 Computer map Computer Area Map MT_MISC15 Allmap
62 Lite Amp. Visor 2045 Lite Amplification goggles Lite-Amp Goggles MT_MISC16 Infrared
63 Mega Sphere 83 Megasphere Megasphere MT_MEGA Megasphere
64 Ammo Clip 2007 Ammo clip Ammo Clip MT_CLIP Clip
65 Box of Ammo 2048 Box of Ammo Box of Ammo MT_MISC17 ClipBox
66 Rocket 2010 Rocket Rocket MT_MISC18 RocketAmmo
67 Box of Rockets 2046 Box of Rockets Box of Rockets MT_MISC19 RocketBox
68 Energy Cell 2047 Cell charge Energy Cell MT_MISC20 Cell
69 Energy Pack 17 Cell charge pack Energy Pack MT_MISC21 CellPack
70 Shells 2008 Shotgun shells Shotgun Shells MT_MISC22 Shell
71 Box of Shells 2049 Box of Shells Box of Shells MT_MISC23 ShellBox
72 Backpack 8 Backpack Backpack MT_MISC24 Backpack
73 BFG9000 2006 BFG9000 BFG9000 MT_MISC25 BFG9000
74 Chaingun 2002 Chaingun Chaingun MT_CHAINGUN Chaingun
75 Chainsaw 2005 Chainsaw Chainsaw MT_MISC26 Chainsaw
76 Rocket Launcher 2003 Rocket launcher Rocket Launcher MT_MISC27 RocketLauncher
77 Plasma Gun 2004 Plasma gun Plasma Gun MT_MISC28 PlasmaRifle
78 Shotgun 2001 Shotgun Shotgun MT_SHOTGUN Shotgun
79 Super Shotgun 82 Super Shotgun Super Shotgun MT_SUPERSHOTGUN SuperShotgun
80 Tall Lamp 85 Tall techno floor lamp Tall Techno Lamp MT_MISC29 TechLamp
81 Tall Lamp 2 86 Short techno floor lamp Short Techno Lamp MT_MISC30 TechLamp2
82 Short Lamp 2028 Floor lamp Yellow Lamp MT_MISC31 Column
83 Tall Green Pillar 30 Tall green pillar Tall Green Pillar MT_MISC32 TallGreenColumn
84 Short Green Pillar 31 Short green pillar Short Green Pillar MT_MISC33 ShortGreenColumn
85 Tall Red Pillar 32 Tall red pillar Tall Red Pillar MT_MISC34 TallRedColumn
86 Short Red Pillar 33 Short red pillar Short Red Pillar MT_MISC35 ShortRedColumn
87 Pillar with Skull 37 Shrot red pillar (skull) Red Pillar + Skull MT_MISC36 SkullColumn
88 Pillar with Heart 36 Short green pillar (beating heart) Pillar + Pumping Heart MT_MISC37 HeartColumn
89 Eye in Symbol 41 Evil Eye Evil Eye MT_MISC38 EvilEye
90 Flaming Skulls 42 Floating skull rock Flaming Skulls MT_MISC39 FloatingSkull
91 Grey Tree 43 Gray tree Short Grey Tree MT_MISC40 TorchTree
92 Tall Blue Torch 44 Tall blue firestick Tall Blue Torch MT_MISC41 BlueTorch
93 Tall Green torch 45 Tall green firestick Tall Green Torch MT_MISC42 GreenTorch
94 Tall Red Torch 46 Tall red firestick Tall Red Torch MT_MISC43 RedTorch
95 Small Blue Torch 55 Short blue firestick Short Blue Torch MT_MISC44 ShortBlueTorch
96 Small Green Torch 56 Short green firestick Short Green Torch MT_MISC45 ShortGreenTorch
97 Small Red Torch 57 Short red firestick Short Red Torch MT_MISC46 ShortRedTorch
98 Brown Stub 47 Stalagmite Tree Stump MT_MISC47 Stalagtite
99 Technical Column 48 Tall techno pillar Tech Column MT_MISC48 TechPillar
100 Candle 34 Candle Candle MT_MISC49 Candlestick
101 Candelabra 35 Candelabra Candelabra MT_MISC50 Candelabra
102 Swaying Body 49 Hanging victim, twitching (blocking) Hanging Swaying Body (Blocking) MT_MISC51 BloodyTwitch
103 Hanging Arms Out 50 Hanging victim, arms out (blocking) Hanging Body Arms Out (Blocking) MT_MISC52 Meat2
104 One-legged Body 51 Hanging victim, 1-legged (blocking) Hanging One-legged Body (Blocking) MT_MISC53 Meat3
105 Hanging Torso 52 Hanging pair of legs (blocking) Hanging Legs (Blocking) MT_MISC54 Meat4
106 Hanging Leg 53 Hanging leg (blocking) Hanging Leg (Blocking) MT_MISC55 Meat5
107 Hanging Arms Out 2 59 Hanging victim, arms out Hanging Body Arms Out MT_MISC56 NonsolidMeat2
108 Hanging Torso 2 60 Hanging pair of legs Hanging Legs MT_MISC57 NonsolidMeat4
109 One-legged Body 2 61 Hanging victim, 1-legged Hanging One-legged Body MT_MISC58 NonsolidMeat3
110 Hanging Leg 2 62 Hanging leg Hanging Leg MT_MISC59 NonsolidMeat5
111 Swaying Body 2 63 Hanging victim, twitching Hanging Swaying Body MT_MISC60 NonsolidTwitch
112 Dead Cacodemon 22 Dead cacodemon Dead Cacodemon MT_MISC61 DeadCacodemon
113 Dead Marine 15 Dead player Dead Player MT_MISC62 DeadMarine
114 Dead Trooper 18 Dead former human Dead Former Human MT_MISC63 DeadZombieMan
115 Dead Demon 21 Dead demon Dead Demon MT_MISC64 DeadDemon
116 Dead Lost Soul 23 Dead lost soul Dead Lost Soul MT_MISC65 DeadLostSoul
117 Dead Imp 20 Dead imp Dead Imp MT_MISC66 DeadDoomImp
118 Dead Sergeant 19 Dead former sergeant Dead Former Human Sergeant MT_MISC67 DeadShotgunGuy
119 Guts and Bones 10 Bloody mess 1 Guts and Bones MT_MISC68 GibbedMarine
120 Guts and Bones 2 12 Bloody mess 2 Guts and Bones 2 MT_MISC69 GibbedMarineExtra
121 Skewered Heads 28 5 skulls shish kebob Heads on Pole MT_MISC70 HeadsOnAStick
122 Pool of Blood 24 Pool of blood and bones Pool of Blood MT_MISC71 Gibs
123 Pole with Skull 27 Skull on a pole Skull on Pole MT_MISC72 HeadOnAStick
124 Pile of Skulls 29 Pile of skulls and candles Pile of Skulls MT_MISC73 HeadCandles
125 Impaled Body 25 Impaled human Impaled body MT_MISC74 DeadStick
126 Twitching Body 26 Twitching impaled human Impaled Body (Twitching) MT_MISC75 LiveStick
127 Large Tree 54 Large brown tree Large Brown Tree MT_MISC76 BigTree
128 Burning Barrel 70 Burning barrel Burning Barrel MT_MISC77 BurningBarrel
129 Hanging Body 1 73 Hanging victim, guts removed Hanging Body, Guts Removed MT_MISC78 HangNoGuts
130 Hanging Body 2 74 Hanging victim, guts and brain removed Hanging Body, Guts & Brain Removed MT_MISC79 HangBNoBrain
131 Hanging Body 3 75 Hanging torso, looking down Hanging Torso, Looking Down MT_MISC80 HangTLookingDown
132 Hanging Body 4 76 Hanging torso, open skull Hanging Torso, Open Skull MT_MISC81 HangTSkull
133 Hanging Body 5 77 Hanging torso, looking up Hanging Torso, Looking Up MT_MISC82 HangTLookingUp
134 Hanging Body 6 78 Hanging torso, brain removed Hanging Torso, Brain Removed MT_MISC83 HangTNoBrain
135 Pool Of Blood 1 79 Pool of blood and guts Pool of Blood 2 MT_MISC84 ColonGibs
136 Pool Of Blood 2 80 Pool of blood Pool of Blood 3 MT_MISC85 SmallBloodPool
137 Brains 81 Pool of brains Pool of Brains MT_MISC86 BrainStem

Code pointers[edit]

Player code pointers[edit]

Frame # Pointer # BEX equivalent Function
1 187520 Light0 Light restore (after flash)
2 185392 WeaponReady Weapon bobbing pointer
3 185808 Lower Weapon select pointer
4 185872 Raise Weapon deselect pointer
6 186000 Punch Player punch
9 185648 ReFire If fire button is held, jumps back to first shooting frame instead of frame with this pointer
14 186832 FirePistol Player pistol shot
17 187536 Light1 Light flash (dim)
22 186960 FireShotgun Player shotgun blast
31 187552 Light2 Light flash (bright)
36 187120 FireShotgun2 Player super shotgun blast
38 185760 CheckReload Check shells (if 1 or 0 left, skip reloading frames and select different weapon)
39 166848 OpenShotgun2 Play sound DBOPN
41 166864 LoadShotgun2 Play sound DBLOAD
43 166880 CloseShotgun2 Play sound DBCLS
52 187312 FireCGun Player chaingun shot (check ammo; don't go to -1 ammo, change weapon)
60 185936 GunFlash Display firing frame
61 186432 FireMissile Player launch rocket
71 186176 Saw Player use chainsaw
77 186528 FirePlasma Player fire plasma bullet
84 187744 BFGsound Play sound BFG
86 186480 FireBFG Player fire BFG shot

Monster / thing code pointers[edit]

Frame # Pointer # BEX equivalent Function
119 187568 BFGSpray BFG blast effect
127 166160 Explode Radius explosion
157 166112 Pain Play pain sound
159 167808 PlayerScream Play sound PLDETH or PDIEHI
160 166144 Fall Dead body mode
166 166096 XScream Play sound SLOP
174 161536 Look Wait to wake up
176 161744 Chase Standard monster walking code pointer
184 162224 FaceTarget Turn to face the direction of the current target
185 162320 PosAttack Trooper pistol shot
190 165984 Scream Play death sound
243 164160 VileChase Arch-vile walking code pointer (check to resurrect monsters)
255 164496 VileStart Play sound VILATK
257 164704 VileTarget Create Arch-vile flame on target, enable radius blast for frame 264
264 164784 VileAttack Target jumps in air, takes 20 points of damage
281 164512 StartFire Play sound FLAMEST
282 164576 Fire Continuously reposition Arch-vile flame on target
285 164544 FireCrackle Play sound FLAME
316 163424 Tracer Revenant fireball homing & smoke trail code pointer
336 163808 SkelWhoosh Play sound SKESWG
338 163840 SkelFist Revenant punch, play sound SKEPCH if hit
341 163328 SkelMissile Launch Revenant fireball with possible homing (and smoke trail) effect
376 164992 FatRaise Play sound MANATK
377 165024 FatAttack1 Launch 2 Mancubus fireballs: one straight, one left
380 165152 FatAttack2 Launch 2 Mancubus fireballs: one straight, one right
383 165280 FatAttack3 Launch 2 Mancubus fireballs: one left, one right
397 166208 BossDeath Check for special sector lowering (666/667)
417 162592 CPosAttack Chaingunner or Wolfenstein SS shoot chaingun, fires 2 successive hitscan pellets
419 162720 CPosRefire Check line of sight to stop firing
454 162896 TroopAttack Launch Imp fireball or scratch at close range
487 163008 SargAttack Demon bite
506 163088 HeadAttack Launch Cacodemon fireball or bite at close range
539 163232 BruisAttack Launch baron of Hell / Hell Knight fireball or scratch at close range
590 165472 SkullAttack Lost Soul attack
603 166784 Metal Play sound METAL & standard walking pointer
616 162448 SPosAttack Spiderdemon shoot chaingun (same as Sergeant's attack), fires 3 hitscan pellets
618 162784 SpidRefire Check line of sight to stop firing
635 166816 BabyMetal Play sound BSPWLK & standard walking pointer
648 162848 BspiAttack Launch Arachnotron plasma bullet
676 166752 Hoof Play sound HOOF & standard walking pointer
685 163184 CyberAttack Launch Cyberdemon rocket
711 165888 PainAttack Spawn Lost Soul
718 165920 PainDie Spawn 3 or 4 Lost Souls & set body to dead
774 161440 KeenDie Check for special sector lowering (tag 666) and dead body mode
779 167008 BrainPain Play sound BOSPN
780 167024 BrainScream Play sound BOSDTH and create explosions (frames 799-801) at 320 units south from Romero's head at heights between 128 and 640 units
783 167312 BrainDie End level
785 166912 BrainAwake Play sound BOSSIT and initialize boss spawn spots list (game will crash if too many spots are present)
786 167328 BrainSpit Fire spawn cube - landing required on level or game will crash
787 167488 SpawnSound Play sound BOSCUB
788 167520 SpawnFly Check for spawn point (spawn monster other than former humans, cyberdemons or spiderdemons)
801 167184 BrainExplode Create explosion (frames 127 - 129)

Source port code pointers[edit]

Code pointer Function Source port
NULL Zeroes out an existing codepointer Boom

Linux version[edit]

DeHackEd (version 2.3) was ported to Linux in 1995 by Sam Lantinga as Linux Doom Hack Editor or ldhe. Compared to DOS, LDHE is slower and has no mouse support, but it does support running on X11 and the Linux console. X11 and SVGA Doom Linux binaries are supported. It also supports SGI Doom 1.8, allowing DeHackEd to be used and compiled on a SGI machine alongside a specifically compiled Deutex binary.

See also[edit]

  • WhackEd - an enhanced DeHackEd/BEX editor for Windows.
  • HHE v1.1 at Doomworld/idgames - Heretic variant of DeHackEd. The copy of the executable that HHE applies its .HHE patches to is named HereHack.
  • DEH 9000 - a "programmer's dehacked"
  • DeMackEd - a Macintosh equivalent
  • DOOMinator - another Macintosh equivalent

External links[edit]