(Redirected from DeHacked)
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.


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.


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.

Thing number Usage
1 Player
2 Trooper
3 Sergeant
4 Arch-vile
5 Arch-vile Fire
6 Revenant
7 Revenant Rocket
8 Fireball Trail
9 Mancubus
10 Mancubus Fireball
11 Chaingunner
12 Imp
13 Demon
14 Spectre
15 Cacodemon
16 Baron of Hell
17 Baron Fireball
18 Hell Knight
19 Lost Soul
20 Spiderdemon
21 Arachnotron
22 Cyberdemon
23 Pain Elemental
24 SS Nazi
25 Commander Keen
26 Big Brain
27 Demon Spawner
28 Demon Spawn Spot
29 Demon Spawn Cube
30 Demon Spawn Fire
31 Barrel
32 Imp Fireball
33 Caco Fireball
34 Rocket (in air)
35 Plasma Bullet
36 BFG Shot
37 Arachnotron Fireball
38 Bullet Puff
39 Blood Splat
40 Teleport Flash
41 Item Respawn Fog
42 Teleport Exit
43 BFG Hit
44 Green Armor
45 Blue Armor
46 Health Potion
47 Armor Helmet
48 Blue Key Card
49 Red Key Card
50 Yellow Key Card
51 Yellow Skull Key
52 Red Skull Key
53 Blue Skull Key
54 Stim Pack
55 Medical Kit
56 Soul Sphere
57 Invulnerability Sphere
58 Berserk Pack
59 Blur Sphere
60 Radiation Suit
61 Computer Map
62 Lite Amp. Visor
63 Mega Sphere
64 Ammo Clip
65 Box of Ammo
66 Rocket
67 Box of Rockets
68 Energy Cell
69 Energy Pack
70 Shells
71 Box of Shells
72 Backpack
73 BFG9000
74 Chaingun
75 Chainsaw
76 Rocket Launcher
77 Plasma Gun
78 Shotgun
79 Super Shotgun
80 Tall Lamp
81 Tall Lamp 2
82 Short Lamp
83 Tall Green Pillar
84 Short Green Pillar
85 Tall Red Pillar
86 Short Red Pillar
87 Pillar with Skull
88 Pillar with Heart
89 Eye in Symbol
90 Flaming Skulls
91 Grey Tree
92 Tall Blue Torch
93 Tall Green torch
94 Tall Red Torch
95 Small Blue Torch
96 Small Green Torch
97 Small Red Torch
98 Brown Stub
99 Technical Column
100 Candle
101 Candelabra
102 Swaying Body
103 Hanging Arms Out
104 One-legged Body
105 Hanging Torso
106 Hanging Leg
107 Hanging Arms Out 2
108 Hanging Torso 2
109 One-legged Body 2
110 Hanging Leg 2
111 Swaying Body 2
112 Dead Cacodemon
113 Dead Marine
114 Dead Trooper
115 Dead Demon
116 Dead Lost Soul
117 Dead Imp
118 Dead Sergeant
119 Guts and Bones
120 Guts and Bones 2
121 Skewered Heads
122 Pool of Blood
123 Pole with Skull
124 Pile of Skulls
125 Impaled Body
126 Twitching Body
127 Large Tree
128 Burning Barrel
129 Hanging Body 1
130 Hanging Body 2
131 Hanging Body 3
132 Hanging Body 4
133 Hanging Body 5
134 Hanging Body 6
135 Pool Of Blood 1
136 Pool Of Blood 2
137 Brains

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]