Diablo 2 LoD 1.14d Single-player Mod and Editing [Single-player] D2S Files

Welcome! This is the portion of my website that I use to try my best to contribute to the Diablo II LoD 1.14d community. Here you will find my mod + source code to edit D2s character save files + source code to observe changes in D2S files so that you can edit as you will. Although this isn't a full-fledged Editor, you can do some cool stuff like copy/paste items between d2s files (especially if they're located in the horadric cube), edit skills (between levels 0-99), edit stats (strength [1-1024], dexterity [1-1024], vitality, energy, & free stat points [1-1024]), and insert any pgems/runes into the horadric cube.

- News - May 31 (2017) 12:34AM PDT
Added the OGG filesize (111KB/111,119-bytes) information to the audio-player at the top of this page (I know important stuff).

May 19 (2017) 10:08PM PDT
You can download and view a Diablo II character named GeneralQor that uses CMod on Diablo II 1.14d. He's level 58 Necromancer and in Act 1 difficulty #3.
Here are a couple sample (OK, 90% sample, 10% example) screenshots of what would drop in Act 4 difficulty #1 with CMod on 1.14d: CMod-drop-example1.jpg & CMod-drop-example2.jpg.
CMod has not changed within the last 6 months.

Δ View all diablo 2 LoD 1.14d downloads
Δ Diablo II mod: CMod (aka Lord of the Rings -- because it's fun to collect rare rings)
Download CMod.zip (77kb) (this is the one and only, and was built for patch 1.14d in mind)
  1. +Dragon; 3os body-armor/shield; Sur+Lo+Sol; lvl 31 holy fire aura (originally lvl 14); replaced +3-5 to all attributes with +155% MF
  2. +Dream; 3os shield; Io+Jah+Pul; lvl 31 holy shock aura (originally lvl 15), +155% MF
  3. +Edge; 3os missile; Tir+Tal+Amn; lvl 31 thorns aura (originally lvl 15), replaced +5-10 to all attributes with +155% MF, reduce vendor prices 80%
  4. Enigma; 3os body-armor; Jah+Ith+Ber; +260% to defense (originally +750 defense), +155% to magic find (originally +8%MF/lvl), +60 to Teleport (originally +1), +60 to Find Item, removed +2 to all skills, removed +str/lvl, removed +45% movement speed, removed heal-kill, required level 24
  5. +Insight; 4os polearm/staff; Ral+Tir+Tal+Sol; lvl 31 meditation aura (originally lvl 12-17), +155% MF (originally 23%), required level 7
  6. +Lawbringer; 3os hammer/sceptor/sword; Amn+Lem+Ko; lvl 31 sanctuary aura (originally 16-18), replaced cold dmg with +155% MF
  7. Lore; 2os helm; Ort+Sol; +3 to all skills (originally +1), +155% magic find
  8. Malice; 3os melee weapon; Hel+Amn+Ith (originally Ith+El+Eth); +40% faster attack speed, +50 max damage, +10% mana steal, +190% damage, +13% life steal, -5 life regen, removed +100% chance of open wounds
  9. Rhyme; 2os shield; Shael+Eth; +155% magic find
(take note: in vanilla/non-modded Diablo II, the items with the most MF [Magic Find] gain is Wealth, Cow King complete set, M'avina's complete set, and the Gull dagger -- all of which give +100% MF each. source: http://fabd.github.io/diablo2/wiki/itemswith.html#mag%)

Installation instructions:
  1. Once you have the ZIP file downloaded, extract the files. In Windows it's right-click and click "Extract All..."
  2. You should have a CMod\ folder in the directory of your CMod.zip file. Go into that folder. You should see a data\ folder.
  3. Move the "data" folder to C:\Program Files (x86)\Diablo II\ You can do this by right-clicking the "data" folder and selecting "Cut" and then cruising to C:\Program Files (x86)\Diablo II\ with Windows-Explorer/File-browser and right-clicking a blank spot and clicking "Paste" What is in this "data" folder is the mod. Now we need to create a way to execute Diablo II in a way that uses these files, that is, this mod:
  4. Warning: If you are using Windows 8.0 your Screenshots you take in game and sometimes old mod outputs get put into C:\Users\yourWin8Username\AppData\Local\VirtualStore\Program Files (x86)\Diablo II\ in that directory and in the data folder in that directory, respectively. If you have used another mod in the past, continue to install this mod in C:\Program Files (x86)\Diablo II\ However, delete the data folder in C:\Users\yourWin8Username\AppData\Local\VirtualStore\Program Files (x86)\Diablo II\ The reason Windows 8.0 has this directory is because Windows 8.0 doesn't allow a typical user to have write access to anything in C:\Program Files (x86)\, so if you want your Diablo II.exe to have updated files only for your user in C:\Program Files (x86)\Diablo II\ you put them in C:\Users\yourWin8Username\AppData\Local\VirtualStore\Program Files (x86)\Diablo II\. Take note that C:\Users\yourWin8Username\AppData\ is Hidden so you'll need to go into the menu at the top of your File Explorer window and look for the option to be able to View Hidden Files.
  5. Inside of C:\Program Files (x86)\Diablo II\ right-click Diablo II.exe and create shortcut, which is automatically put onto the Desktop on Windows 8.0. On Windows 10 you'll want to cut and paste that shortcut file (its name will be Diablo II.exe - Shortcut) to the Desktop. I'd recommend renaming your shortcut to something like Diablo II CMod.
  6. Go your Desktop and right-click your shortcut and select "Properties" at the bottom of the context menu that pops up.
  7. Put " -direct -txt" in front of the text in the Target: textfield so that it says something like: "C:\Program Files (x86)\Diablo II\Diablo II.exe" -direct -txt
  8. Click "Apply" button at the bottom-right of the Properties window.
  9. Click "OK" button at the bottom-left of the Properties window. The window will close.
Now when you want to start Diablo II with this mod double-left-click this shortcut and it'll run Diablo II with the mod! All other ways you ran Diablo II will run Diablo II like normal without this mod because by default Diablo II does not process the C:\Program Files (x86)\Diablo II\data\ Folder unless 'Diablo II.exe' is executed with the -direct -txt command-line options. You will know you're playing this mod when you go to Charsi and some items will have much higher numbers than vanilla/normal's Diablo 2 to certain magic attributes (like +5 Light Radius than +1 Light Radius). (Be sure to use this shortcut for SINGLE PLAYER ONLY...do not try to enter battle.net with it..I really do not know what happens when you try to xd)

Notice: after running Diablo II with this mod around 20 .bin files are gonna show up in C:\Program Files (x86)\Diablo II\data\global\excel\ on Windows 10 and around 20 .bin files are gonna show up in C:\Users\yourWin8Username\AppData\Local\VirtualStore\Program Files (x86)\Diablo II\data\global\excel\ on Windows 8.0. Diablo II.exe creates these bin files with the -txt command-line option that you executed through your CMod shortcut to Diablo II.exe. The reason there are more bin files than the 7 txt files that CMod originally came with is because Diablo II.exe pre-compiles (ie. make them faster to read for itself due to the smaller filesize) all of the txt files that are in its MPQ files (basically Blizzard's compression file format and filetype: https://en.wikipedia.org/wiki/MPQ) in-memory, and Diablo II.exe sees your -txt flag passed through your Diablo II.exe CMod shortcut and immediately says: "You need the txts in the data/ folder in Diablo II's installation root directory (ie. on Windows 10 is exclusively at C:\Program Files (x86)\Diablo II\ and in Windows 8.0 you can replace stuff in that [ie. C:\Program Files (x86)\Diablo II\] with the stuff in C:\Users\yourWin8Username\AppData\Local\VirtualStore\Program Files (x86)\Diablo II\) to be converted from txt to bin so that it can be read by Diablo II with your -direct option. So I'm just gonna dump all of the MPQ txts in the global MPQ collection at address /data/global/excel/" and walla! There you have .bin files in those directories I described above. I'm 39% sure they should never be a problem. In my mod 90% of those .bin generated files are actually originals generated from the vanilla game configuration/engine/settings/internal-data extracted from its MPQ files (primarily d2data.mpq, d2exp.mpq, & Patch_D2.mpq, I'm 20% sure).

My Diablo II ChangeLog:

Patch 1.14d (7th of June, 2016): implemented Blizzard Error & System Survey to aid troubleshoot Diablo II.exe assertions/crashes.

Patch 1.14c (18th of May, 2016): nGlide wrapper now work?

Patch 1.14b (7th of April, 2016): -3dfx glide wrapper works? Capped frame rate at 200 (although single-player is still capped at 25) Minor gameplay fix: mercs can't become "An Evil Force"

Patch 1.14a (10th of March, 2016): Windows 7/8.0/8.1/10 now work without XP mode
Characters now saved in C:\Users\yourWindowsXP7810Username\Saved Games\Diablo II\
instead of C:\whateverIdon'tCareanymoreContactMeAndIWillTellYou

Patch 1.13d (27th of October, 2011): Ignoring players in battle.net functionality has implemented a filtering file mechanism.
2 Major gameplay bugs fixed (duping & unintended aura stacking)
4 Minor gameplay bugs fixed (merc aura stacking, color coded game names, disconnection when watching cinematics, & game crash in windowed mode with sound disabled and playing a cinematic)

Patch 1.13c (23rd of March, 2010): Special bosses for the top 3% players.
4 major gameplay bugs fixed (duping, tppking, remote player disconnect, unintended aura stacking)
20+ other things have changed. However here are the highlights:
- game music doesn't stop when the Diablo II.exe window gains/loses focus.
- Barb's leap would lock if hit just before leaping.
- Den of Evil quest now gives Respecialization capabilities: that is, you get all of your stat/skill points back to completely redistribute!
- when Diablo II.exe is in windowed mode the window can now be maximized -- stretched.
- gold bank limit not bound by level.
- hardcore character creation has no requirements. It used to be that you had to defeat Normal difficulty with another character on your system to create a hardcore character (I'm 19-47% sure).
- Oblivion Knight's Iron Maiden curse, which was prominent in Act 4 normal if you're at all any type of melee strategist at any level, has been removed.
- added (?) -nosound Diablo II.exe option
- WW on Barb mana cost cut in half. Masteries with Barb critical strike increased by 10%. Werebear for druid's health increased by 25%, & 12 other skills (these being virtually meaningless) were changed aross Assassin, Paladin, Druid, Necro, & Sorc.

Patch 1.12 (17th of June, 2008)

Patch 1.10 (28th of October, 2003) implemented Synergy bonuses.
Implemented the World Event (which is virtually reserved for the top 2% best players on Battle.net)

Patch 1.0 (29th of June, 2000)

Refer to Blizzard Entertainment's Patch.txt (Diablo II's ChangeLog/Revision-History/Patch-Change-Information) that gets installed when you install Diablo II on your computer and update Diablo II with the latest patch (in this case, 1.14d). This Patch.txt is located and called:
C:\Program Files (x86)\Diablo II\Patch.txt



will have much higher numbers than vanilla/normal's Diablo 2: OK so 90% of the time there will be at least one magical item in Charsi's shop items that has attributes that are much (like x5+) more than in normal/vanilla Diablo 2. If Charsi doesn't, then go into the Blood Moor for 1 second and come back to Charsi and relook at what she has. Here are some screenshots that I took installing this mod with the current CMod.zip and given installation instructions with a fresh/pure/legit level 1:
  1. diablo-2-images/d2-screenshot-win10_1.jpg
  2. diablo-2-images/d2-screenshot-win10_2.jpg
  3. diablo-2-images/d2-screenshot-win10_3.jpg
  4. diablo-2-images/d2-screenshot-win10_4.jpg
  5. diablo-2-images/d2-screenshot-win10_5.jpg
  6. diablo-2-images/d2-screenshot-win10_6.jpg
  7. diablo-2-images/d2-screenshot-win8_1_1.jpg
  8. diablo-2-images/d2-screenshot-win8_1_2.jpg
  9. diablo-2-images/d2-screenshot-win8_1_3.jpg
  10. diablo-2-images/d2-screenshot-win8_1_4.jpg
  11. diablo-2-images/d2-screenshot-win8_1_5.jpg
  12. diablo-2-images/d2-screenshot-win8_2_1.jpg
I did these in Windowed mode (instead of fullscreen-mode). To enable that mode, in your Diablo II.exe shortcut on your Desktop:
Put " -w" in front of the text in the Target: textfield of your Diablo II.exe Shortcut so that it says something like: "C:\Program Files (x86)\Diablo II\Diablo II.exe" -direct -txt -w

Hacking Diablo 2 below


Δ What are the system requirements for using my scripts?:
The perl scripts require perl5 to run. You have two options for getting perl on Windows:
1) Strawberry Perl (google it).
2) Cygwin (google it) and select to install perl when you get the list of installable software.
The go program/script runner/interpreter/compiler can be downloaded from the Go Language (google it) website.
Both with go1.7 and perl5 you run via cmd.exe on Windows:
perl my-perl-script.pl
go run my-go-script-code.go
Δ How can I edit/change the hex code of my d2s file while loading properly in Diablo II?
Use my perl script change.pl (this can edit/overwrite, but does not add-to or insert.)
Simply call it like so with your perl interpreter via cmd.exe:
perl change.pl "@5make00000000"
This will make at address 5 (that is, byte offset/address 0x05/0x5/5) in your targeted d2s file to binary value 00000000.
With this script not only is the value at address 5 changed (which it never is in this case) but the checksum in the file is fixed. change.pl targets the D2s file at environmental variable %DIABLO_II_CHAR%.
Here is another example of changing a d2s file (notice: this only alters, not adds to):
perl change.pl "@37make00001111" "@643make11111111" "@644make11111111" "@645make11111111"
This at address 37 makes the character/toon able to go to nightmare and hell difficulties.
The others partially makes all waypoints for the character/toon, which apparently is at d2s file byte offset 643, 644, and 645. NOTICE: these are bytes we are dealing with, which is composed of 8 binary values: from 00000000 to 11111111 which could also be hexically called 0x00 and 0xff or from 0 to 255.
Δ How do I add environmental variable %DIABLO_II_CHAR% on windows?
right-click My Computer, select Properties, select Environmental Variables, add "DIABLO_II_CHAR" without the quotes and give a value to something like:
C:\Users\yourWindowsUsername\Saved Games\Diablo II\yourDiabloIICharacterName.d2s
close/restart all instances of cmd.exe to make sure it is updated. Type "echo %DIABLO_II_CHAR%" without the quotes into your cmd.exe terminal to see if the terminal has updated with the system-wide environmental variables.
Δ How do I use cmd.exe on windows?
Hold windows key and press r. Type in cmd.exe and press ENTER. This is your Windows DOS shell/terminal that you use to execute Perl and Go code/scripts/files. If you want to open your cmd.exe in a particular directory, in the windows explorer hold shift and right-click on a blank space and select "open command window here" without the quotes..this works with Windows 8 and Windows 10 for sure.
Δ How do I create/use .bat files on Windows?
Fire up notepad and type this in:
echo %DIABLO_II_CHAR%
perl -e "print('This is perl')"
Save the file as "whatever.bat" (without the quotes) to your Desktop.
Hold shift and right-click an empty space on your desktop.
Select the "Open command window here" option.
Now type: .\whatever.bat
Great!
Now you can use this text-file/batch-file/.bat-file to call the change.pl and the JM-inserter.go, for example:
go run JM-inserter.go runes_zod
perl change.pl "@5make00000000"
Assuming you also have change.pl and JM-inserter.go in the CWD (current work directory) (that is, in this case, on the desktop) and you have the Go Language and Perl5 installed.
Δ How can I edit my player stats including free stat points?
Note: boosting Vitality and Energy does not increase health points or mana points. You must put points (from free stat points) in the game to vitality/energy to increase your health/mana. So even if you have 1000 health points you can set vitality to 25 and your health points will not suffer.
Assuming you have free stat & free skill points you can use this perl script to write it into the d2s file:
View give-stats.pl
This tool outputs what you use with see about change.pl.
You can use a batch/.bat file to make this easier.
Δ How do I insert/add items into my d2s file?:
View JM-inserter.go
This is a Go1.7 script/program that you call with Go like:
(When you have Go installed.. from within a cmd.exe terminal.)
go run JM-inserter.go 1000800065000022f6860782251813be86e03f
go run JM-inserter.go runes_shael
go run JM-inserter.go runes_zod
go run JM-inserter.go gems_skull
go run JM-inserter.go gems_sapphire
The first command inserts a horadric cube into the top-left of the inventory...be sure the space is available before inserting. And be sure to backup your .d2s file before doing this.
The other commands insert a shael rune, a zod rune, a perfect skull, and a perfect sapphire respectively into the top-left part of the cube space..be sure the space is available for doing this, so only call one of these commands at a time while physically moving the item out of the cube & Save and Exit & insert the next item.
This edits the d2s file that is in the system's environmental variable DIABLO_II_CHAR which in windows is Right-click My Computer, advanced settings, environmental variables and then have DIABLO_II_CHAR set to something like:
C:\Users\Nile7\Saved Games\Diablo II\YetAnotherToon.d2s
ie. C:\Users\yourWindowsUsername\Saved Games\Diablo II\yourDiabloIICharacterName.d2s
That is, the character save file you wish to insert an/the item into.
This adds the item to your d2s file..however you'll need to fix the checksum because your d2s file has been altered (if you try loading the d2s file now in Diablo II you'll get the error: "Generic bad file"), so...a solution is to call see about change.pl:
perl change.pl "@5make00000000"
Which virtually makes no change to the file other than fix its checksum.
See also using a batch/.bat file to make this easier to edit your commands.
Δ How do I get the JM/item codes to insert using the Go script/code JM-inserter.go?
Here are the two perl scripts to get the JM/item codes (If you look at a D2s character save file in hex format every item you have starts with 'JM') and where they are (belt/cube/inventory/stash).
View JM-find-codes.pl
View print-item-location.pl (this is called from JM-find-codes.pl)
Δ How can I edit my skill tree?
So depending on the stats you have -- free stat points, free skill points, gold in inventory, gold in stash, the location of your skills is going to change.
I created a perl script to create output that you can copy and paste into an HTML5 program (that you open with your web browser):
View get-skill-data.pl
Goto change-skill-data/view.html (I use sorceress images but the tool can be used for any class.)
Download offline version of the change-skill-data HTML5 program (353kb)
The above gives-you/outputs that use see about change.pl
See also using a batch/.bat file to make this easier to edit your commands.
Δ How can I make my d2s toon/character free to go into any difficulty and have all waypoints?
I've got some good news and bad news..
good news: we can do virtually all of this.
bad news: you have to start in act 1 in all difficulties.
View make-free.pl
The output of this perl script can edit your character to give them complete freedom using see about change.pl
Which can be accomplished like so via cmd.exe:
perl make-free.pl > mychanges.bat
Then edit mychanges.bat to something like:
perl change.pl "Whatever is already there in changes.bat"
And in cmd.exe/your-command-line you type in to execute the .bat/batch-file:
.\mychanges.bat
See also using a batch/.bat file to make this easier to edit your commands.
Δ How do I observe changes to my d2s file?
I know what you mean. Figuring out what has changed between files using a hex editor is a pain.
To know the changes of the d2s file after playing a session of Diablo 2 I created these handy perl scripts:
View load_d2s.pl
View myconfig.pm
View changes.pl
So basically what you do is is you go:
perl load_d2s.pl #this copies your D2S character save file to loaded.d2s
#Play some Diablo II and Save and Exit
perl changes.pl #observe the changes!
But wait, there's more! These scripts make it easy to prevent catastrophe and clean up the CWD (that is, current working directory):
View revert.pl (replace your current d2s file with the one provided in the CWD created by load_d2s.pl)
View make-perma.pl (make your current d2s file permanent by removing the loaded d2s file in the CWD)
Aaaaand...this is pretty important..to actually make changes to your d2s file (& to fix its checksum to-boot) see about change.pl
Δ What are the checksum algorithms for various programming languages?:
// C, C++, C#, Java8, Perl5, Python3
// They all do the same thing: calculate/generate/compute the checksum of a given d2s file and output it into the console/screen/cout/stdout/terminal/shell.
// Actually the perl not only computes the checksum, but also gives the checksum already in the file.
Download Checksums.zip (4.6kb)
View Checksums code (contained in the ZIP file)
To actually compile/run these programs google as follows:
Visual Studio Express Desktop Edition (this will allow you to compile C/C++/C#; Open developer prompt: cl chksum.c; cl /EHsc chksum.cpp; csc chksum.cs)
JDK download (this will allow you to compile/run java8 code/class-files; javac chksum.java && java chksum)
Strawberry Perl
Python 3 download



A funny Diablo 2 meshed/created 17 second audio OGG I created with official Diablo 2 sound effects and Audacity

Sorceress VS evil Necromancer.
(17 seconds, Ogg data, Vorbis audio, mono, 22050 Hz, 111,119-bytes/111KB)
(wav shorts ripped from d2sfx.mpq & d2xtalk.mpq with MPQExtractor (for i in d2sfx d2xtalk; do mkdir $i-out || break; ./MPQExtractor -l $i-list.txt -e '*' -f -o $i-out/ $i.mpq; done) and mixed together in Audacity [1] [2] [3])