Page 1 of 1

[1.13c] No equipment loss on death

Posted: Wed Jan 23, 2019 7:10 pm
by jessedazebra
.

Re: [1.13c] No equipment loss on death

Posted: Wed Jan 23, 2019 8:08 pm
by huohuowu2
nice man,thank you.
Are these codes easy to find at 1.10?

Re: [1.13c] No equipment loss on death

Posted: Wed Jan 23, 2019 8:52 pm
by jessedazebra
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..

Re: [1.13c] No equipment loss on death

Posted: Wed Jan 23, 2019 10:14 pm
by huohuowu2
you right.I find the codes.but don't know where to jump.

Re: [1.13c] No equipment loss on death

Posted: Wed Jan 23, 2019 10:52 pm
by jessedazebra
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.

Re: [1.13c] No equipment loss on death

Posted: Fri Jan 25, 2019 1:02 am
by thaison
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

Re: [1.13c] No equipment loss on death

Posted: Sun Jan 27, 2019 5:50 pm
by FearedBliss
@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.

Re: [1.13c] No equipment loss on death

Posted: Sun Jan 27, 2019 9:47 pm
by prawn
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

Re: [1.13c] No equipment loss on death

Posted: Tue Jan 29, 2019 5:09 pm
by updawg
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.

Re: [1.13c] No equipment loss on death

Posted: Mon Mar 11, 2019 7:31 am
by csguak
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.

Re: [1.13c] No equipment loss on death

Posted: Tue Mar 12, 2019 11:31 am
by thaison
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

Re: [1.13c] No equipment loss on death

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

[D2Game.dll - 0x7922F]
Change to:

Code: Select all

6FC9922F             E9 C3040000            JMP 6FC996F7

Re: [1.13c] No equipment loss on death

Posted: Tue Mar 12, 2019 9:02 pm
by devurandom
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

Re: [1.13c] No equipment loss on death

Posted: Sat May 04, 2019 7:32 pm
by fty
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:

Re: [1.13c] No equipment loss on death

Posted: Tue Sep 10, 2019 5:17 am
by b1n
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

Re: [1.13c] No equipment loss on death

Posted: Thu Sep 12, 2019 4:57 am
by csguak
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)

Re: [1.13c] No equipment loss on death

Posted: Sun Dec 15, 2019 5:52 pm
by lee_lee
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?

Re: [1.13c] No equipment loss on death

Posted: Wed Jan 29, 2020 9:01 am
by csguak
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

Re: [1.13c] No equipment loss on death

Posted: Wed Jan 31, 2024 4:16 am
by ssjkakaroto
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?