Simple & EASY DLL Hexing Tutorial for newbies

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

1
100%
 
Total votes: 1

User avatar
HashCasper
Posts: 263
Joined: Mon Apr 28, 2003 6:46 am
Location: Baton Rouge, LA

Simple & EASY DLL Hexing Tutorial for newbies

Post by HashCasper » Mon Jun 30, 2003 12:46 am

Hi Hash here, with a little contribution to dll editing info. I've been reading this forum and have concluded that a lot of people want to mod, but not a lot know about code editing. So here is my easy step by step code editing tutorial. I won't be going into any details like Sir General about the bytes, signed stuff n what not. This is simply to explain how to use a hex editor, and the offsets sheet by spin, and easily change bytes in your dll.

------------------------------
1. Download and install Hex workshop. Hex Workshop

2. Open the program, and go to FILE > OPEN.
3. Open up your dll file. ( In this tut I will use D2game.dll)
4. Download and save the Spin's Offsets sheet. ( STICKY on Code Editing Forums.)
5. Open the offsets.xls file. Its a Microsoft Excel file so you will need a proper viewer to view it.
6. In the offsets file, at the bottom, look for tabs labled such as, Content, MiscChanges, etc. Scroll through these and find out what kind of change you need in your dll. (In this tut I will use the "Make Unique Items Spawn more than once per game". ITs on the MiscChanges tab.
7. Go back to Hex Worshop, and open up D2game.dll (This example uses 1.09d DLL)
8. Now, on the EXTRME left hand corner of the Hex Worshop program, you will see a bunch of numbers sequentially increasing as you scroll down. Starging from 00000000, 0000001C, 00000038, and so forth. These are the OFFSETS.
9. Now look in the offsets file. You will see that to have the game spawn a unique item more than once per game, you will need to go the proper offset described in the offsets file, and change the states bytes.

Spawn Unique Items More Than Once Per Game (D2game.dll 1.09d)

Ignore the Memory Offset, as you only need to worry about the Offset.
The offset for this is, 1BCFBh. Actual offset is 1BCFB, and the small caps h is used to denote that this is in hex code. All offsets are in hex code, but its a convention to lable them as h.

Now go back to Hex Workshop, and click in the left hand pane, where all the offsets are. Now type Ctrl + G (thats Control Key + G). A dialog box will open, titled Goto. Make sure you have checked the radio button HEX, and on the right side, Beginning of file is selected.

Now type in your offset that you saw in the offsets sheet. Make sure you don't type the small caps h. Type in 1BCFB, and click go. It will bring you to that location in the dll file.

Now, go back to the offsets file, and look at the bytes u have to change. In this example, the bytes that we need to change are 89 11.
So look at hexworkshop window. Your cursor in there should be at the offset you just went to after clicking go. Make sure you don't click the mouse anywhere else in that window. If you do, then do ctrl + g again and go the offset and STAY THERE, don't push anything, or type anything, yet.

Now look at where you cursor is. It will say 89 11. Now Simply go to the offsets file, and look at what you need to change it to. We must change this to 90 90 to allow uniques to spawn more than once per game.
So, in hexworkshop, simply hit 90 90 on the keyboard.
This will change 89 11 to 90 90.

Save your work. It might ask you to save a backup copy of the dll file. In my case if I click yes to make backup before save, it doesn't save, but makes a backup. So click NO for this and it will save you dll changes.
Make sure you have already manually backed up your dlls before editing.

WOW, you've just made your first dll edit. Don't you feel like a l337 h4x0r now? :D

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

To implement ANY of the changes in the dlls, simply follow these steps and you will be fine.
Using the offsets sheet, and this simple tutorial, you can make all the dll bug fixes you want. Or any other number of things. Just simply look at the offset you need to go to, do ctrl + g in hexworkshop, go to the offset, look at what bytes u need to change, and change them to what is says. Make sure you always back up your last changes so that if you mess up, you will still have a working copy of your latest changes made what work.

I hope this helps newbie people somewhat.
Sincerely,


Hash
Last edited by HashCasper on Wed May 05, 2004 11:17 am, edited 2 times in total.
"We have a point to work to, to make our nation huge; make our home stretch around the world, increase our army too. We must take over the world, make it our own, the Earth we must control, so you can't F#CK it anymore." --Mathew Chalk--

acdc14235
Junior Member
Paladin
Posts: 142
Joined: Mon Jun 09, 2003 3:28 pm

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by acdc14235 » Mon Jun 30, 2003 1:04 am

Wow! Really sheds some light on code editing! I understand how to edit and find the offsets and all, but How do you people figure out what is what? I mean its all just a bunch of numbers and letters! I am thinking that its like another language, and you just have to learn how to read it!
Thanks!
Last edited by acdc14235 on Mon Jun 30, 2003 1:04 am, edited 1 time in total.
dfagdafh

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12100
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Myhrginoc » Mon Jun 30, 2003 3:48 am

A tip of the hat to Hash for a straightforward discussion of how to use the Offsets Spreadsheet. :mrgreen:

How do we find everything? Working directly with the raw binaries, even in hex form, is the hard way to make new discoveries. It's fine for following a recipe and making changes to a number of known bytes. But to see what the code is doing and make significant changes, we do indeed refer to another language: assembly language. This language replaces hexadecimal riddles such as 6A 05 by PUSH 5. The bible for PC assembly language is the IA-32 Intel Software Developer's Manual Volume 2. (I am sure there is a Mac equivalent, but I haven't worked with Macs.) There are also a number of websites devoted to learning assembly language.

The tool of choice is a disassembler/debugger. Two are in regular use by the code editors: W32Dasm and Ollydbg. ALthough different in style, their application is similar: organize those raw binaries according to specific rules and make it easier to edit them, and run the program in such a way as to let us see how the data is manipulated. There are plenty of threads on techniques and specific examples in the Code Editing Forum. Sir_General's Code Editing Tutorial gets you started with using this tool in the D2 environment. The rest of it is practice, the references already posted (such as the ptUnit thread), and seeing how changes in the Offsets Spreadsheet look when done in the debugger.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
NewbieModder
Angel
Posts: 681
Joined: Fri May 31, 2002 4:41 am
Location: Where the floating goats sing...

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by NewbieModder » Mon Jun 30, 2003 5:06 am

I say sticky this, as a lot of people don't seem to get Sir_Generals tutorial, and my guess is because Sir_General's constantly drifts off the subject into facts that are important for trying to discover things, but for simply following the offset sheet, only confuse the matter.



Oh, and just wondering, but code editing has a LOT of sticky threads. Could any be cleaned up?
[align=center]
Tyromancy:
Divination or magic using CHEESE - [/color]
[/align]
The Waffle Mod Website

User avatar
HashCasper
Posts: 263
Joined: Mon Apr 28, 2003 6:46 am
Location: Baton Rouge, LA

delete me

Post by HashCasper » Mon Jun 30, 2003 5:26 am

 ■
Last edited by HashCasper on Tue Sep 02, 2003 7:16 am, edited 1 time in total.
"We have a point to work to, to make our nation huge; make our home stretch around the world, increase our army too. We must take over the world, make it our own, the Earth we must control, so you can't F#CK it anymore." --Mathew Chalk--

User avatar
Apocalypse Demon
Forum Legend
Arch-Angel
Posts: 1701
Joined: Thu May 23, 2002 2:45 am
Location: Mississauga, Ontario, Canada

Hand-picked

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Apocalypse Demon » Mon Jun 30, 2003 1:52 pm

NewbieModder";p="109874" wrote:I say sticky this, as a lot of people don't seem to get Sir_Generals tutorial, and my guess is because Sir_General's constantly drifts off the subject into facts that are important for trying to discover things, but for simply following the offset sheet, only confuse the matter.
I will sticky this thread too then.
NewbieModder";p="109874" wrote:Oh, and just wondering, but code editing has a LOT of sticky threads. Could any be cleaned up?
I will unsticky the skill descriptions thread, and will delete the patch 1.10 changes thread until 1.10 is released.

Simyri
Posts: 87
Joined: Tue Dec 03, 2002 8:22 am

..

Post by Simyri » Fri Aug 29, 2003 9:31 pm

is there any way you could tell me the offset for 1.10s and what to change to liek u did for 1.10beta

i kinda understand how to do it better... i could use help though :P

but.. i tryd the offset for 1.10beta; 4E223 and got 82 F0 0B 00 00.. i think.. i might need to start 2 numbers before 82 but even if thats so i still dont get 6A 00 57 6A 05 .


can someone please help me?
<)(>

User avatar
HashCasper
Posts: 263
Joined: Mon Apr 28, 2003 6:46 am
Location: Baton Rouge, LA

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by HashCasper » Sat Aug 30, 2003 10:54 am

don't worry about the 1.10 offsets until the final patch is released. DLLs will definitely undergo more changes, so until the final patch is out, and we have dissected the dlls to see whats where, take it easy. Go eat a hotdog or something.
"We have a point to work to, to make our nation huge; make our home stretch around the world, increase our army too. We must take over the world, make it our own, the Earth we must control, so you can't F#CK it anymore." --Mathew Chalk--

User avatar
JimmyT0801
Posts: 87
Joined: Wed Dec 31, 2003 12:34 am
Location: Cherokee, AL

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by JimmyT0801 » Wed Dec 31, 2003 12:44 am

1.10 final has been out for a while. and I am out of hot dogs. I really would love to know what to change to have more stant and skill points per level and the unique thing would also be great.

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12100
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Myhrginoc » Fri Jan 02, 2004 5:09 am

Effective with 1.10 (actually in either beta too):

Skill points per level is beaten to death in the Level-Up Code thread. Stat points is now a txt edit of the StatPerLevel field in Charstats.txt. You can make any or all unique items available more than once per game by putting a 1 in the NoLimit field of UniqueItems.txt.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

vivi_mate
Posts: 78
Joined: Tue Dec 23, 2003 7:54 am

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by vivi_mate » Thu Jan 08, 2004 2:02 am

the tute doesn't work in 1.10. I tried searching for 1BCFB several times... and it wasnt there, can anyone help me?
"A hero is not a hero without a woman."

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12100
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Myhrginoc » Thu Jan 08, 2004 7:46 am

You are confusing location with content. In the tutorial, 1BCFB is the file offset (location) where you would find the bytes 89 11 (content). But keep in mind most code edits are extremely version specific, so this tutorial was written for version 1.09d only. In 1.10 it isn't even necessary, since putting a 1 in the NoLimit field will provide the same result.

The best "starter tutorial" is Sir_General's introduction to code editing, which you can find here. Again, it was written with 1.09b in mind, so discussion about specific code will not carry over to the new version. But the general concepts are still quite valid.
Last edited by Myhrginoc on Sun Mar 27, 2005 5:56 pm, edited 1 time in total.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
HashCasper
Posts: 263
Joined: Mon Apr 28, 2003 6:46 am
Location: Baton Rouge, LA

Post by HashCasper » Mon Oct 10, 2005 10:39 pm

Not to ressurect an old thread, but dll editing in this tutorial holds true no matter what dll versions are used.

My question suggesstions is this, spin made a very good document by getting all the dll offsets in one place.

Could we possibly go ahead and do that for 1.11b/1.10?

I searched for this, but there was no such resource. d2mod.dll, plugy, and all d2mod plugins come with the documentation, but it would also be nice if someone collected all the known offsets for the latest dlls and documented those as well.

we could start with what we alredy know about 1.10, and leave those in, then make another section to say what was changed in 1.11b and what is still the same. You guys get the idea right?

I know this thread is years old, and resurrecting old threads is a *possibly* useless idea, but I thought I needed to bring this to attention. Once again, this would be a great help to the newbie modders, and could help them to implement these changes themselves.

Oh, and if you smite me for bringing up a two year old therad, then well, yer goin' to hell ! :D
"We have a point to work to, to make our nation huge; make our home stretch around the world, increase our army too. We must take over the world, make it our own, the Earth we must control, so you can't F#CK it anymore." --Mathew Chalk--

User avatar
Psycho
Posts: 56
Joined: Sat Nov 15, 2003 10:09 pm
Location: The Dalles, Oregon

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Psycho » Thu Oct 13, 2005 5:45 pm

I like the idea! I'd work on it if someone could get the info in one place. The only problem is that I don't know how to put my work out on the net. If someone could help me put my work out there, I would make something like spin did with his/her/its offset sheet.
Last edited by Psycho on Thu Oct 13, 2005 5:47 pm, edited 1 time in total.

User avatar
HashCasper
Posts: 263
Joined: Mon Apr 28, 2003 6:46 am
Location: Baton Rouge, LA

Post by HashCasper » Thu Oct 13, 2005 8:52 pm

I have been trying to collect as much information possible in one text file on my pc. I could clean it up and organize it a little bit more and you can put it in whichever document format you want.

And sure, I can help you with getting your stuff out. I don't really have too much available to me to do all this. I am also stuck with dialup atm.

Since I only come online for about less than an hour a day, it will take a while for me to get all the information compiled. I also don't have Windows OS, nor any office utilities, I do however have KOffice and OpenOffice.org, but once again, I have hardly anytime to mess with that. I can get the information comiled, but you will most probably have to format it, and put it into an easy readable format.

I will most probably PM you when I get done with this, or I will post here int his thread. I probably won't be able to get anything done soon, it might actually take me a few weeks.
"We have a point to work to, to make our nation huge; make our home stretch around the world, increase our army too. We must take over the world, make it our own, the Earth we must control, so you can't F#CK it anymore." --Mathew Chalk--

User avatar
Doombreed-x
Retired staff
Arch-Angel
Posts: 1304
Joined: Thu Jul 15, 2004 6:40 pm
Location: No more flag. :(

Post by Doombreed-x » Sat Oct 15, 2005 4:53 am

HashCasper";p="243695" wrote:we could start with what we alredy know about 1.10, and leave those in, then make another section to say what was changed in 1.11b and what is still the same. You guys get the idea right?
... Any and everything changed, as the compiler for 1.11 had different settings. Code editors literally start from scratch moving from 1.10 to 1.11. That'd be a whole lot of work that I don't think anyone is up to.

User avatar
HashCasper
Posts: 263
Joined: Mon Apr 28, 2003 6:46 am
Location: Baton Rouge, LA

Post by HashCasper » Sat Oct 15, 2005 5:38 am

Rome wasn't built in a day, neither was spin's offset sheet :)
"We have a point to work to, to make our nation huge; make our home stretch around the world, increase our army too. We must take over the world, make it our own, the Earth we must control, so you can't F#CK it anymore." --Mathew Chalk--

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Sweden

Hand-picked

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by kingpin » Sat Oct 15, 2005 9:08 am

The code editing today compare to past isn't a single change, that's why none have bothered to do a offset list like spin did. You would be needed to add pages of changes, and I'm sure it's not more readable than the forum are :)

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains

Hand-picked

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Nefarius » Sat Oct 15, 2005 9:52 am

Not to forget, most of the knowledge is in personal notes and not the the forum :P
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Psycho
Posts: 56
Joined: Sat Nov 15, 2003 10:09 pm
Location: The Dalles, Oregon

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Psycho » Mon Oct 17, 2005 5:42 pm

HashCasper";p="244058" wrote: I have been trying to collect as much information possible in one text file on my pc. I could clean it up and organize it a little bit more and you can put it in whichever document format you want.

Since I only come online for about less than an hour a day, it will take a while for me to get all the information compiled. I also don't have Windows OS, nor any office utilities, I do however have KOffice and OpenOffice.org, but once again, I have hardly anytime to mess with that. I can get the information comiled, but you will most probably have to format it, and put it into an easy readable format.
OpenOffice.org works for me. But just to make sure that everyone else can read this too, I will also redo one for MS Excel. (I would just do excel, but it gives me wierd errors improting from .xls documents.)
Doombreed-x";p="244180" wrote:
HashCasper";p="243695" wrote:we could start with what we alredy know about 1.10, and leave those in, then make another section to say what was changed in 1.11b and what is still the same. You guys get the idea right?
... Any and everything changed, as the compiler for 1.11 had different settings. Code editors literally start from scratch moving from 1.10 to 1.11. That'd be a whole lot of work that I don't think anyone is up to.
Getting my facts stright, The major versions are: 1.09B, 1.09D, the first 1.10, 1.10S, 1.10F, the first 1.11, and 1.11B. Am I correct, or are there others that I should do? I know I don't need to do all of them, but it couldn't hurt to keep all of the info in one place, and besides, I have lots of time.
HashCasper";p="244058" wrote: And sure, I can help you with getting your stuff out. I don't really have too much available to me to do all this. I am also stuck with dialup atm.

Since I only come online for about less than an hour a day, it will take a while for me to get all the information compiled.
Don't worry, I have dial-up too (about 24K :( ). And usually, I just type these messages in notepad before I post them becuase it really puts a load on the modem. But anyways, thanks for your help!
"Those who haven't felt it will never understand it" ~me

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains

Hand-picked

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Nefarius » Mon Oct 17, 2005 5:58 pm

An offset sheet is only needed for 1.10x-1.11x. We already have a complete 09x sheet. But in light that no one I know of works with the beta 1.10 patches, only 1.10 final and 1.11A and 1.11B are needed.
Last edited by Nefarius on Mon Oct 17, 2005 6:00 pm, edited 1 time in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
HashCasper
Posts: 263
Joined: Mon Apr 28, 2003 6:46 am
Location: Baton Rouge, LA

Post by HashCasper » Tue Oct 18, 2005 12:09 am

Well I guess in a couple of months, the 1.10 is probably going to go *almost obsolete*, since 1.11b is out and I am guessing they will be putting out other patches as well. I see that 1.11 is considerably different from 1.10 in many respects, and thought my idea sounded good at the moment, it seems redundant, and too much of a tast and time consuming. Perhaps we need to wait it out and see where it takes us.

Do keep in mind that 1.09 was THE version for a few years, and now Blizzard have started updating once again. So unless another patch comes out and stays for a number of years(causing almost all modders to work with that particular patch), it is almost useless trying to compile that information.

I personally have not used 1.11 neither do I plan on using it, because the mods I enjoy currently are only available in 1.10, and it works fine for me. I have no need to update to 1.11.

I would however like to do this maybe later on, when it seems reasonable to do.
"We have a point to work to, to make our nation huge; make our home stretch around the world, increase our army too. We must take over the world, make it our own, the Earth we must control, so you can't F#CK it anymore." --Mathew Chalk--

User avatar
I_only_pressed_Esc
Forum Regular
Angel
Posts: 630
Joined: Wed Jan 28, 2004 2:47 am
Location: In the darkest corners of your mind

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by I_only_pressed_Esc » Tue Oct 18, 2005 12:30 am

I personally have not used 1.11 neither do I plan on using it, because the mods I enjoy currently are only available in 1.10, and it works fine for me. I have no need to update to 1.11.
I totally agree :)

I would like to see this post go further as I am NO code editor but an offset sheet or whatever would be brilliant with easy to use instructions. :)
Custom health-mana bubbles. Custom loading video's. Custom Hireling graphics.
'Do what thou wilt shall be the whole of the Law'

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12100
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Myhrginoc » Tue Oct 18, 2005 12:58 am

There is no offset sheet for v1.10 final, so something like that might be of value to some people. However, many of the things we did with 1.09x offsets can now be handled by new txt fields and tables, and more are easily manipulated using d2mod plugins. The biggie almost everybody asks for (skillpts/lvl) is documented in the Level-Up Code thread here.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
Psycho
Posts: 56
Joined: Sat Nov 15, 2003 10:09 pm
Location: The Dalles, Oregon

Re: Simple & EASY DLL Hexing Tutorial for newbies

Post by Psycho » Tue Oct 18, 2005 6:22 pm

I personally have not used 1.11 neither do I plan on using it, because the mods I enjoy currently are only available in 1.10, and it works fine for me. I have no need to update to 1.11.
Plus, it seems like the only good things it changes are for multiplayer only. The only intrest I would have with it is to help everyone else who does work with it, which is the first reason I would include the 1.10 Betas. The second being that I have some info for them and I just want to keep all the info together.
HashCasper";p="244452" wrote:Well I guess in a couple of months, the 1.10 is probably going to go *almost obsolete*, since 1.11b is out and I am guessing they will be putting out other patches as well.
It'll probably be more than a couple of months IMO, seeing how some plugns *coughD2Extra* most likely won't be converted to 1.11B.
Myhrginoc";p="244465" wrote:However, many of the things we did with 1.09x offsets can now be handled by new txt fields and tables, and more are easily manipulated using d2mod plugins. The biggie almost everybody asks for (skillpts/lvl) is documented in the Level-Up Code thread here.
The only problem I have is that you can't do things like use stats for calculations. For me, I have the following:

Stats per level = 5 + (Vitality / 50)
Skills per level = 2 + (Energy / 100)

Sorry if I got off-topic.
"Those who haven't felt it will never understand it" ~me

Return to “Code Editing”