[1.13c] No equipment loss on death

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

Post Reply
jessedazebra
Junior Member
Paladin
Posts: 144
Joined: Sun Nov 11, 2012 9:46 am
Zimbabwe

[1.13c] No equipment loss on death

Post by jessedazebra » Wed Jan 23, 2019 7:10 pm

.
Last edited by jessedazebra on Sat Feb 19, 2022 9:44 am, edited 1 time in total.

User avatar
huohuowu2
Junior Member
Paladin
Posts: 154
Joined: Sat Feb 28, 2015 4:20 am
China

Re: [1.13c] No equipment loss on death

Post by huohuowu2 » Wed Jan 23, 2019 8:08 pm

nice man,thank you.
Are these codes easy to find at 1.10?

jessedazebra
Junior Member
Paladin
Posts: 144
Joined: Sun Nov 11, 2012 9:46 am
Zimbabwe

Re: [1.13c] No equipment loss on death

Post by jessedazebra » Wed Jan 23, 2019 8:52 pm

huohuowu2 wrote:
Wed Jan 23, 2019 8:08 pm
nice man,thank you.
Are these codes easy to find at 1.10?
I don't know, they might even look different, I'm not sure. You need someone who works with 1.10, not a noob like me. :P
EDIT: Well, most likely it's what I was looking for:

Code: Select all

0004FEAE   8BCE             MOV ECX,ESI
0004FEB0   E8 2B3DFBFF      CALL 00003BE0
0004FEB5   50               PUSH EAX
0004FEB6   57               PUSH EDI
0004FEB7   E8 F2C20900      CALL 000EC1AE
0004FEBC   8D95 D0000000    LEA EDX,DWORD PTR SS:[EBP+D0]
0004FEC2   8BCF             MOV ECX,EDI
0004FEC4   E8 67B70300      CALL 0008B630
0004FEC9   6A 11            PUSH 11
0004FECB   57               PUSH EDI
0004FECC   E8 6DBA0900      CALL 000EB93E
0004FED1   6A 01            PUSH 1
0004FED3   6A 07            PUSH 7
0004FED5   57               PUSH EDI
0004FED6   E8 91B90900      CALL 000EB86C
0004FEDB   8B8F C4000000    MOV ECX,DWORD PTR DS:[EDI+C4]
And the next step is to find where to jump...
EDIT2: Anyway, I can't track where to jump. There's a lot of similar stuff. I think it should be near the code above, but I might be wrong.
You can try to find something similar to this (it's for 1.13c):

Code: Select all

000796F7   5F               POP EDI
000796F8   5E               POP ESI
000796F9   8BC5             MOV EAX,EBP
000796FB   5D               POP EBP
000796FC   5B               POP EBX
000796FD   83C4 18          ADD ESP,18
00079700   C2 1400          RETN 14
and jump onto #000796F7
Just try to use Search for -> Sequence of commands in olly
You can try to find sequence of:
ADD ESP,18
RETN 14
But it might look different in 1.10, who knows..

User avatar
huohuowu2
Junior Member
Paladin
Posts: 154
Joined: Sat Feb 28, 2015 4:20 am
China

Re: [1.13c] No equipment loss on death

Post by huohuowu2 » Wed Jan 23, 2019 10:14 pm

you right.I find the codes.but don't know where to jump.

jessedazebra
Junior Member
Paladin
Posts: 144
Joined: Sun Nov 11, 2012 9:46 am
Zimbabwe

Re: [1.13c] No equipment loss on death

Post by jessedazebra » Wed Jan 23, 2019 10:52 pm

huohuowu2 wrote:
Wed Jan 23, 2019 10:14 pm
you right.I find the codes.but don't know where to jump.
You can try to find it with the method I mentioned above. I'd suggest you to try every similar part of code and test it in the game, until you find the right one. I would test it myself, but I can't switch on 1.10.
Or maybe someone who has experience of modding 1.10 will tell you where to jump.

User avatar
thaison
Junior Member
Paladin
Posts: 108
Joined: Fri Apr 03, 2015 11:59 am
Location: Viet Nam
Vietnam

Re: [1.13c] No equipment loss on death

Post by thaison » Fri Jan 25, 2019 1:02 am

For 1.10:
[D2Game.dll - 0x4FBD0]

Origin:

Code: Select all

6FC7FBD0  /$ 81EC A4000000  SUB ESP,0A4
Change:

Code: Select all

6FC7FBD0     C2 0C00        RETN 0C
6FC7FBD3     90             NOP
6FC7FBD4     90             NOP
6FC7FBD5     90             NOP

FearedBliss
Posts: 82
Joined: Sat Oct 16, 2010 4:29 pm
United States of America

Re: [1.13c] No equipment loss on death

Post by FearedBliss » Sun Jan 27, 2019 5:50 pm

@thaison I was gonna port it to 1.10f now haha but you beat me to it ;D. Thanks.

EDIT: I looked at your solution (Thaison) and it works fine. It's easier than the original solution since you are just returning immediately when the function is called rather than letting part of the code in that function run.

User avatar
prawn
Junior Member
Paladin
Posts: 111
Joined: Sat Oct 27, 2012 12:21 am
Great Britain

Re: [1.13c] No equipment loss on death

Post by prawn » Sun Jan 27, 2019 9:47 pm

thaison wrote:
Fri Jan 25, 2019 1:02 am
For 1.10:
[D2Game.dll - 0x4FBD0]

Origin:

Code: Select all

6FC7FBD0  /$ 81EC A4000000  SUB ESP,0A4
Change:

Code: Select all

6FC7FBD0     C2 0C00        RETN 0C
6FC7FBD3     90             NOP
6FC7FBD4     90             NOP
6FC7FBD5     90             NOP
Brilliant works like a charm! Thanks thaison and jessedazebra

updawg
Posts: 14
Joined: Thu Mar 08, 2012 3:28 pm

Re: [1.13c] No equipment loss on death

Post by updawg » Tue Jan 29, 2019 5:09 pm

Just to mention as I think this mod is implemented in Median XL and people have mentioned that there is a bug associated with this type of mod. Every time you die you have to rebind your equipment for item effects to actually work. Not sure if that is the case here but I thought I would mentioned it.

User avatar
csguak
Posts: 61
Joined: Fri Jul 06, 2012 7:15 am
Location: USA

Re: [1.13c] No equipment loss on death

Post by csguak » Mon Mar 11, 2019 7:31 am

Hello, thank you so much for this! Saves sooo much time in so many occasions.

However, is there anyway to remove the dead bodies? They are unclickable lol

Edit:
Kidpaddle's max corpse count doesn't fix the issue.
"Player Corpse - maximum or disable"

D2Game.dll - 79234 '[Increase the maximum]'

03B29234 83F8 0F CMP EAX,0F <----- 0F is 15 corpses max. I tried setting it to 0, but didn't work.

;Change the 0F to your new value

///

D2Game.dll - 79237 '[Disable corpses]'

03B29234 83F8 0F CMP EAX,0F
03B29237 76 13 JBE SHORT D2Game.03B2924C

TO

03B29234 83F8 0F CMP EAX,0F
03B29237 90 NOP
03B29238 90 NOP

;This disable corpses from spawning. (which will make gear drops like in hardcore by the way)

The new change is unaffected by the MAX Corpse count change.
Disabling corpse works, but it drops all gear on the field.

Our new corpse seems to be a special spawn.

User avatar
thaison
Junior Member
Paladin
Posts: 108
Joined: Fri Apr 03, 2015 11:59 am
Location: Viet Nam
Vietnam

Re: [1.13c] No equipment loss on death

Post by thaison » Tue Mar 12, 2019 11:31 am

For 1.13c:
[D2Game.dll - 0x79210]

Origin:

Code: Select all

6FC99210     83EC 18        SUB ESP, 18
Change:

Code: Select all

6FC99210     C2 0C00        RETN 0C

Znich
Posts: 3
Joined: Tue Jan 08, 2019 8:09 am
Belarus

Re: [1.13c] No equipment loss on death

Post by Znich » Tue Mar 12, 2019 1:15 pm

My solution for 1.13c:

[D2Game.dll - 0x7922F]
Change to:

Code: Select all

6FC9922F             E9 C3040000            JMP 6FC996F7

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: [1.13c] No equipment loss on death

Post by devurandom » Tue Mar 12, 2019 9:02 pm

thaison wrote:
Tue Mar 12, 2019 11:31 am
For 1.13c:
[D2Game.dll - 0x79210]

Origin:

Code: Select all

6FC99210     83EC 18        SUB ESP, 18
Change:

Code: Select all

6FC99210     C2 0C00        RETN 0C
This would corrupt the stack

For 1.10 the function is __fastcall pushes 3 args to the stack and retn is 0x0C
For 1.13 the function is __stdcall pushes 5 args to the stack and retn is 0x14

Znich wrote:
Tue Mar 12, 2019 1:15 pm
My solution for 1.13c:

[D2Game.dll - 0x7922F]
Change to:

Code: Select all

6FC9922F             E9 C3040000            JMP 6FC996F7
This would corrupt the stack too, because the function overwritten has an argument pushed to the stack that's not handled.


The return type for 6FC99210 function [1.13c] is BOOL even though its not evaluated.

Both Methods do the same thing, pick one or the other. - Neither one has been tested against the equipment binding issue mentioned above by csguak.

[1.13c]

Method 1

Code: Select all

6FC99210    83EC 18     SUB ESP,18                    ; D2Game.6FC99210(guessed Arg1,Arg2,Arg3,Arg4,Arg5)
6FC99213    53          PUSH EBX
6FC99214    55          PUSH EBP

Change To:

6FC99210    31C0        XOR EAX,EAX                   ; D2Game.6FC99210(guessed Arg1,Arg2,Arg3,Arg4,Arg5)
6FC99212    C2 1400     RETN 14

Method 2

Code: Select all

6FC99237    76 13       JBE SHORT 6FC9924C

Change To:

6FC99237    EB 08       JMP SHORT 6FC99241
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

fty
Posts: 8
Joined: Thu Aug 19, 2010 8:34 am

Re: [1.13c] No equipment loss on death

Post by fty » Sat May 04, 2019 7:32 pm

devurandom wrote:
Tue Mar 12, 2019 9:02 pm
Both Methods do the same thing, pick one or the other. - Neither one has been tested against the equipment binding issue mentioned above by csguak.

[1.13c]

Method 1

Code: Select all

6FC99210    83EC 18     SUB ESP,18                    ; D2Game.6FC99210(guessed Arg1,Arg2,Arg3,Arg4,Arg5)
6FC99213    53          PUSH EBX
6FC99214    55          PUSH EBP

Change To:

6FC99210    31C0        XOR EAX,EAX                   ; D2Game.6FC99210(guessed Arg1,Arg2,Arg3,Arg4,Arg5)
6FC99212    C2 1400     RETN 14

Method 2

Code: Select all

6FC99237    76 13       JBE SHORT 6FC9924C

Change To:

6FC99237    EB 08       JMP SHORT 6FC99241
Just tried Method 2. Works like a charm. Thank you very much! :beer:

User avatar
b1n
Posts: 66
Joined: Mon Jul 18, 2016 10:55 pm
Contact:

Re: [1.13c] No equipment loss on death

Post by b1n » Tue Sep 10, 2019 5:17 am

Someone tested the equipament binding issue mentioned by updawg ?
I would like this feature to work like this: no equipaments on the dead body, but you can recover exp and maybe your gold by getting your body back
Diablo II Evolution

User avatar
csguak
Posts: 61
Joined: Fri Jul 06, 2012 7:15 am
Location: USA

Re: [1.13c] No equipment loss on death

Post by csguak » Thu Sep 12, 2019 4:57 am

b1n wrote:
Tue Sep 10, 2019 5:17 am
no equipaments on the dead body, but you can recover exp and maybe your gold by getting your body back
What a great suggestion! I would love this too. Because right now, the body just disappear into thin air...(method 2)

lee_lee
Posts: 10
Joined: Sun Dec 08, 2019 6:16 am
Vietnam

Re: [1.13c] No equipment loss on death

Post by lee_lee » Sun Dec 15, 2019 5:52 pm

csguak wrote:
Mon Mar 11, 2019 7:31 am
Hello, thank you so much for this! Saves sooo much time in so many occasions.

However, is there anyway to remove the dead bodies? They are unclickable lol

Edit:
Kidpaddle's max corpse count doesn't fix the issue.
"Player Corpse - maximum or disable"

D2Game.dll - 79234 '[Increase the maximum]'

03B29234 83F8 0F CMP EAX,0F <----- 0F is 15 corpses max. I tried setting it to 0, but didn't work.

;Change the 0F to your new value

///

D2Game.dll - 79237 '[Disable corpses]'

03B29234 83F8 0F CMP EAX,0F
03B29237 76 13 JBE SHORT D2Game.03B2924C

TO

03B29234 83F8 0F CMP EAX,0F
03B29237 90 NOP
03B29238 90 NOP

;This disable corpses from spawning. (which will make gear drops like in hardcore by the way)

The new change is unaffected by the MAX Corpse count change.
Disabling corpse works, but it drops all gear on the field.

Our new corpse seems to be a special spawn.
Hey! Did you found how to remove the dead bodies? Can you explain it?

User avatar
csguak
Posts: 61
Joined: Fri Jul 06, 2012 7:15 am
Location: USA

Re: [1.13c] No equipment loss on death

Post by csguak » Wed Jan 29, 2020 9:01 am

lee_lee wrote:
Sun Dec 15, 2019 5:52 pm
Hey! Did you found how to remove the dead bodies? Can you explain it?
Yes, use the method 2 suggested by Devurandom.
devurandom wrote:
Tue Mar 12, 2019 9:02 pm
6FC99237 76 13 JBE SHORT 6FC9924C

Change To:

6FC99237 EB 08 JMP SHORT 6FC99241

ssjkakaroto
Posts: 5
Joined: Tue Jan 16, 2024 4:02 pm

Re: [1.13c] No equipment loss on death

Post by ssjkakaroto » Wed Jan 31, 2024 4:16 am

Hi guys, a user named taco uploaded a dll for 1.14d that can be loaded by basemod, plugy, etc. You can find it here: https://web.archive.org/web/20240131024 ... s_114d.zip
The ASM source code is in the zip, but I also uploaded it here: https://pastes.io/fbnanvfhrx
I know I could just edit 1.13c D2game.dll like devurandom said, but I think an external dll would be better, except I barely know anything of assembly programming.
Would replacing:

Code: Select all

  cmp     dword ptr [0057F7FCh], 00C88F81h
  jnz     finish
  cmp     dword ptr [0057F800h], 10000000h
  jnz     finish
  cmp     dword ptr [0057F804h], 8F830000h
  jnz     finish
  cmp     dword ptr [0057F808h], 000000C4h
  jnz     finish
  lea     eax, [ebp+08h]
  push    eax                       ; lpflOldProtect
  push    40h                       ; flNewProtect
  push    0Ch                       ; dwSize
  push    0057F7FCh                 ; lpAddress
  call    VirtualProtect
  test    eax, eax
  jz      finish
  mov     dword ptr [0057F7FCh], 0002DAE9h
  mov     dword ptr [0057F800h], 90909000h
  mov     dword ptr [0057F804h], 8F839090h
  lea     eax, [ebp+0Ch]
  push    eax                       ; lpflOldProtect
  push    dword ptr [ebp+08h]       ; flNewProtect
  push    0Ch                       ; dwSize
  push    0057F7FCh                 ; lpAddress
with

Code: Select all

  cmp     word ptr [6FC99237h], 1376h
  jnz     finish
  lea     eax, [ebp+08h]
  push    eax                       ; lpflOldProtect
  push    40h                       ; flNewProtect
  push    02h                       ; dwSize
  push    6FC99237h                 ; lpAddress
  call    VirtualProtect
  test    eax, eax
  jz      finish
  mov     word ptr [6FC99237h], 08EBh
  lea     eax, [ebp+0Ch]
  push    eax                       ; lpflOldProtect
  push    dword ptr [ebp+08h]       ; flNewProtect
  push    02h                       ; dwSize
  push    6FC99237h                 ; lpAddress
in that code work?

Post Reply

Return to “Code Editing”