Page 1 of 2

[1.13d] code edits collection

Posted: Sun Apr 05, 2015 1:16 am
by devurandom
Greetings,

I'm uploading my small collection of 1.13d code edits. I can't take much credit for this.
only a couple code enhancements. :roll:

These are basic code edits that many will find useful for 1.13d.

Credits should go to the person(s) that found the original code edits, since that is much more difficult and time consuming that porting code edits to a different version. I've listed references in most of these code edits to others work here on the Keep, but I apologize if it is not the original person(s) to give proper credit..

In General I want to give credit the people who've posted many of the code edits for previous versions.

Nefarious
Kidpaddle94
Necrolis
Kingpin
Lolet

and others


Edit: Changed method for Charsi Imbue.
Updated notes on Nihlathak portal fix.
Add A1Q3 reward

Edit:
Force 6 affix rares
Bypass Intro
Force prefix-suffix on magic item drops

Edit:
Adds 7 more items and update to some others

Re: [1.13d] code edits collection

Posted: Sun Apr 05, 2015 12:51 pm
by Xibalba
Thanks for sharing, continue sharing stuff :)

Re: [1.13d] code edits collection

Posted: Fri Oct 09, 2015 6:13 pm
by borg
That's awesome work and worthy of respect.
I am looking forward to potential support for patch 1.13c or PlugY.

Re: [1.13d] code edits collection

Posted: Fri Oct 09, 2015 8:23 pm
by devurandom
I'm looking at converting my mod to a plugin, once that's done It could also add support for 1.13c.
But this is going to take some time.

Re: [1.13d] code edits collection

Posted: Wed Oct 14, 2015 7:58 pm
by Wuffie888
Thank you

:) Ive been using them in a tool called modexe from PPM forums
[url]hxxp://www.ppmsite.com/forum/viewtopic.php?p=512422[/url]

Re: [1.13d] code edits collection

Posted: Wed Oct 14, 2015 8:47 pm
by devurandom
Hope you scanned this before you install it on your pc. I don't know if
PE:Malware.RDM.36!5.2A[F1] is keylogger or FP?


Ollydbg 2.01 is the only tool I use, just as easy as once you learn how to use it.

Re: [1.13d] code edits collection

Posted: Wed Oct 14, 2015 8:55 pm
by Wuffie888
ooo :) didn't see that when I scanned it with Virus total.com, I want to Crawl it with a debugger but have just been running it in the trail version of sandboxie. its good practice for Any software you dont know/trust.

Thanks for the quick response ill check my system, it could be a false positive, do you have a link to the virus scan results !?

:edit:
https://www.virustotal.com/en/file/087a ... /analysis/

Re: [1.13d] code edits collection

Posted: Wed Oct 14, 2015 9:26 pm
by devurandom
I checked both: The download you have here, and download at the link to the website.
Both report back with the same detection results..

Edit:
http://www.virustotal.com/en/file/47d27 ... /analysis/

-But anyway, a simple way to find he code edit offset in Olly is to load the module without the game running right click the address then select addressing, next select relative to module base, then find the offset listed in the code edit. simple and quick.

cheers ;)

Re: [1.13d] code edits collection

Posted: Wed Oct 14, 2015 9:30 pm
by Wuffie888
lol, well this isnt going to look good,.. Rising is detecting one of the ini files having byte code for a shellcode that is OLD :) good on rising... I put it in as a joke, it doesnt point to any of diablos files (or any files), sure it could be used as a reference for some other part to load but its for the Russian xp sp3 unpatched.... as for the original websites file having a viral payload im checking that now since, ive been running it for a few days im as curious about it as you.

Re: [1.13d] code edits collection

Posted: Wed Oct 14, 2015 9:39 pm
by Wuffie888
If you go to the [Contained files] section on the [File Details] Tab in VT, you can check the files and see the exe is clean so I dont get IT :P

Chur :)

Re: [1.13d] code edits collection

Posted: Wed Oct 14, 2015 11:46 pm
by devurandom
Wuffie888" wrote:lol, well this isnt going to look good,.. Rising is detecting one of the ini files having byte code for a shellcode that is OLD :) good on rising...
I think that would explain it.

Re: [1.13d] code edits collection

Posted: Sun Feb 26, 2017 8:30 pm
by meinerdeiner
Hey is there a way to use Extended Level for 1.13d ?

Re: [1.13d] code edits collection

Posted: Mon Feb 27, 2017 7:17 am
by devurandom
Lolet Posted Code for 1.13d Extended Level on this page. (255 level)

http://www.d2mods.info/forum/viewtopic.php?p=482799

Edit:
If that doesn't work for you.. I'll see if I can find the edited binaries. and upload them.

Re: [1.13d] code edits collection

Posted: Mon Feb 27, 2017 11:20 pm
by meinerdeiner
devurandom" wrote:Lolet Posted Code for 1.13d Extended Level on this page. (255 level)

http://www.d2mods.info/forum/viewtopic.php?p=482799

Edit:
If that doesn't work for you.. I'll see if I can find the edited binaries. and upload them.
I think you mean this :

Code: Select all

Misc::Patch(CALL, GetDllOffset("D2Common.dll", 0x4F330), (DWORD)ExExtendedLevels::GetActByLevel, 22, "Replace inline GetActByLevel"); //  Ordinal11007
Misc::Patch(CALL, GetDllOffset("D2Common.dll", 0x4F3C7), (DWORD)ExExtendedLevels::GetActByLevel, 26, "Replace inline GetActByLevel"); //  Ordinal11051
Misc::Patch(CALL, GetDllOffset("D2Common.dll", 0x4F160), (DWORD)ExExtendedLevels::GetActByRoom2, 22, "Replace inline GetActByLevel"); //  Ordinal10301

Misc::Patch(CALL, GetDllOffset("D2Common.dll", 0x2AD76), (DWORD)ExExtendedLevels::GetActByLevelNo_STUB1, 20, "Replace inline GetActByLevel"); //  sub_6FD7AD60
Misc::Patch(CALL, GetDllOffset("D2Common.dll", 0x56F40), (DWORD)ExExtendedLevels::GetActByLevelNo_STUB1, 20, "Replace inline GetActByLevel"); //  sub_6FDA6EA0
Misc::Patch(CALL, GetDllOffset("D2Common.dll", 0x510A0), (DWORD)ExExtendedLevels::GetActByLevelNo_STUB2, 20, "Replace inline GetActByLevel"); //  sub_6FDA1070

Misc::Patch(JUMP, GetDllOffset("D2Common.dll", -10864), (DWORD)ExExtendedLevels::GetActByLevelNo, 5, "Replace original GetActByLevelNo");

// The original value is 400
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x6FFFB + 1), 4096, 4, "Automap patch I");
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x7100B + 1), 4096, 4, "Automap patch I");
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x71044 + 1), 4096, 4, "Automap patch I");
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x710D9 + 1), 4096, 4, "Automap patch I");
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x728EA + 1), 4096, 4, "Automap patch I");

Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x70FD6 + 2), 4256, 4, "Automap patch II - stack fix"); // The original value is 416
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x728A6 + 2), 4172, 4, "Automap patch II - stack fix"); // The original value is 472

// The original value is 99
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x70FF6 + 1), 399, 4, "Automap patch III");
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x728D9 + 1), 399, 4, "Automap patch III");

// The original value is 400
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x7101B + 4), 4096, 4, "Automap patch IV");
Misc::Patch(CUSTOM, GetDllOffset("D2Client.dll", 0x728FE + 4), 4096, 4, "Automap patch IV");
But i Dont know how i can port this to the D2template style

Re: [1.13d] code edits collection

Posted: Mon Feb 27, 2017 11:59 pm
by devurandom
Not sure that I can help much with porting that to work in D2Template. I use a custom patching method, which is different from either of the 2.

Re: [1.13d] code edits collection

Posted: Tue Feb 28, 2017 12:01 am
by meinerdeiner
devurandom" wrote:Not sure that I can help much with porting that to work in D2Template. I use a custom patching method, which is totally different way from the method above and also totally different than D2Template.
Is this Public or Its your own ?

Re: [1.13d] code edits collection

Posted: Tue Feb 28, 2017 12:22 am
by devurandom
Its Not public... Using my own custom code.

Re: [1.13d] code edits collection

Posted: Tue Oct 16, 2018 7:22 pm
by RobertSx
Hello Everyone!

I found this forum a few days ago and it's really useful and interesting.
I myself am not a programmer and don't really have any deep computer knowledge, but sometimes I like to try out things or read upon something new.

I also play some modded Diablo 2 when I have the time and that is how I found this forum.

I have a question:

I'd like to make some of the edits from devurandom's colelction but I can't really figure out the offsets in those files.
For example in the "Remove Ancients Level Up Experience Cap" file the offset I have to make the edit at is 6FC40D7A, but in my D2Game.dll file I found that piece of code at offset 0005bffa.
For another edit the offset listed in the txt is 6FAD7713 but the code in my file is at 0003CB83.

I was able to find these because I had enough code from the txt files to search for, but in some cases there is just not enough.

Like in the "Bypass_intro.txt" the only code piece listed that needs to be edited is 85C0, but there are 500+ exact same bytes in my dll so I couldn't find this exact address.

How can I figure out the right offset to search for from devurandom's edits?

Thank you!

Re: [1.13d] code edits collection

Posted: Wed Oct 17, 2018 3:50 am
by devurandom
Hello,

For reference you can subtract the address values from the base address for the modules to
get the offset

Offset = Address - Base Address


Base Address for [1.13d] modules

D2Game 6FC20000
D2Common 6FD50000
D2Client 6FAB0000


The base addresses above are the same values listed for v1.11b in this Diablo II Assembly Tutorial. https://d2mods.info/resources/diablo_ii ... 0v2.01.htm
RobertSx wrote:
Tue Oct 16, 2018 7:22 pm
For example in the "Remove Ancients Level Up Experience Cap" file the offset I have to make the edit at is 6FC40D7A, but in my D2Game.dll file I found that piece of code at offset 0005bffa.
For another edit the offset listed in the txt is 6FAD7713 but the code in my file is at 0003CB83.

You may want to double check your math, because something in the offsets you listed doesn't look correct.
;)

Re: [1.13d] code edits collection

Posted: Wed Nov 07, 2018 9:40 am
by darkmage1991
how come when i try to find any of the address's that are listed using ollydbg it cant find them? i can find the address ok with ida7 perfectly fine but ida doesnt let me edit the instruction.

from what i can see ollydbg is messed up somehow and is putting a bunch of 0's infront of the addresses and wont go high enough to reach the listed address's in the file.

unless im missing a setting or using the wrong decompiler for diablo.

any help would be great. would love to try some of these mods.

BTW this is the error i get when i try to go to the listed address for allowing hirelings to equip more: https://imgur.com/a/CzoBFxI

Re: [1.13d] code edits collection

Posted: Wed Nov 07, 2018 10:29 am
by devurandom
Its usually because the module has relocated itself, in that case you calculate the offset from the base address.
Try editing the module when the game isn't running, and see if that helps.

Re: [1.13d] code edits collection

Posted: Thu Nov 08, 2018 1:41 am
by darkmage1991
i was only opening the dll with the game not running. i was under the impression you only run the game and edit it if you want to test the changes in realtime.

Re: [1.13d] code edits collection

Posted: Thu Nov 08, 2018 3:11 am
by devurandom
Then I'd suggest learn how to calculate the address using the offset. Address = Base Address + offset.

Code Edit Tutorial
https://d2mods.info/resources/diablo_ii ... 0v2.01.htm

Its a bit long, but covers every aspect. Just use the base addresses for 1.11b from that tutorial for 1.13d. Its the same for both.

Re: [1.13d] code edits collection

Posted: Mon Nov 19, 2018 1:07 am
by darkmage1991
ok i finally got it working. alot of trial and error, reading and understanding hex address's isnt my forte but i finally learned if my base address for d2game is different(which it was everytime) i had to subtract the base used in the file from the one my game was using and use that difference to figure out how much to add/subtract to my base to get me the right offset.

i might not be able to explain what i did very well but it worked =P

thanks for the tutorial though i didnt realize i had to attach olly to the process not jut open up the dll in it.

EDIT:
Oh something else, the code edit: "Drop Magic items as identified" is there a way to make this apply to all items not just magic? IE: set/rare/uniques.
I tried searching and i see where people talk about it being possible but no one really stating how to go about doing it.



EDIT2: NVM using the same code section as a starting point i started searching for PUSH 10 and changing any section that had
PUSH 0
PUSH 10

changed it to PUSH 1 and so far i have found uniques, looking for sets right now.

Re: [1.13d] code edits collection

Posted: Mon Nov 19, 2018 1:57 am
by darkmage1991
here is the offsets i found for making rares/uniques/sets drop identified. if they help someone that is awesome. if wanted you can add these to your code edit collection.