The old Anya resistance fix for 113c

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

0
No votes
 
Total votes: 0

Freddy
Posts: 37
Joined: Sat Apr 28, 2012 3:59 pm

The old Anya resistance fix for 113c

Post by Freddy » Sat May 12, 2012 11:23 pm

I found these on the forum somewhere in an excel file filled with old hex fixes, I assume they used to work properly and had no other side effects. The problem is the combination of hex characters that need to be changed seems to change every version making it hard to track down the right thing. Does anyone know the combination of hex characters that need to be modified to fix this in 113c?
There's a bug with the resistance bonus from the "rescue anya" quest.
Whenever you die, for the duration of the game, you lose all those bonus resistances even though the client does not say so.
Here is the fix for 1.09d :
In D2Game.dll
Memory Offset Offset Bytes Change to
6FCA4621 74621h 53 E8 B7 0B ----> 56 E8 C3 05
6FCA462A 7462Ah 53 E8 AE 0B ----> 56 E8 BA 05
6FCA4633 74633h 53 E8 A5 0B ----> 56 E8 B1 05
6FCA463C 7463Ch 53 E8 9C 0B ----> 56 E8 A8 05

Here is a workaround for 1.09b :
In D2Game.dll
Memory Offset Offset Bytes Change to
6FCA4141 74141h 53 E8 D7 09 ----> 56 E8 E3 03
6FCA414A 7414Ah 53 E8 CE 09 ----> 56 E8 DA 03
6FCA4153 74153h 53 E8 C5 09 ----> 56 E8 D1 03
6FCA415C 7415Ch 53 E8 BC 09 ----> 56 E8 C8 03

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: The old Anya resistance fix for 113c

Post by kidpaddle94 » Sun May 13, 2012 12:08 am

I tried this fix, and seems to change the called function to D2Common.#10157, which I think on v1.09D was, SetUnitStat. Not sure how it is supposed to fix the bug.

mengxuecen
Posts: 33
Joined: Mon Mar 11, 2019 5:34 am

Re: The old Anya resistance fix for 113c

Post by mengxuecen » Sat Mar 23, 2019 2:10 pm

kidpaddle94 wrote:
Sun May 13, 2012 12:08 am
I tried this fix, and seems to change the called function to D2Common.#10157, which I think on v1.09D was, SetUnitStat. Not sure how it is supposed to fix the bug.


Is there a solution to this problem?

User avatar
a000000
Posts: 36
Joined: Mon Apr 10, 2017 6:36 am

Re: The old Anya resistance fix for 113c

Post by a000000 » Sat Feb 15, 2020 7:35 am

Is there a solution to this problem?

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

Re: The old Anya resistance fix for 113c

Post by thaison » Mon Feb 17, 2020 3:04 am

[1.13c] - D2Game.dll - sub_0x5A000
- Just need to change the function D2Common.#10188 -> D2Common.#10887

Asm version:

Code: Select all

0005A036   6A 00            PUSH 0
0005A038   57               PUSH EDI
0005A039   6A 27            PUSH 27
0005A03B   53               PUSH EBX
0005A03C   E8 A106FBFF      CALL 0000A6E2	//D2Common.#10188
0005A041   6A 00            PUSH 0
0005A043   57               PUSH EDI
0005A044   6A 29            PUSH 29
0005A046   53               PUSH EBX
0005A047   E8 9606FBFF      CALL 0000A6E2	//D2Common.#10188
0005A04C   6A 00            PUSH 0
0005A04E   57               PUSH EDI
0005A04F   6A 2B            PUSH 2B
0005A051   53               PUSH EBX
0005A052   E8 8B06FBFF      CALL 0000A6E2	//D2Common.#10188
0005A057   6A 00            PUSH 0
0005A059   57               PUSH EDI
0005A05A   6A 2D            PUSH 2D
0005A05C   53               PUSH EBX
0005A05D   E8 8006FBFF      CALL 0000A6E2	//D2Common.#10188
To

Code: Select all

0005A036   6A 00            PUSH 0
0005A038   57               PUSH EDI
0005A039   6A 27            PUSH 27
0005A03B   53               PUSH ESI
0005A03C   E8 A106FBFF      CALL 0000A472	//D2Common.#10887
0005A041   6A 00            PUSH 0
0005A043   57               PUSH EDI
0005A044   6A 29            PUSH 29
0005A046   53               PUSH ESI
0005A047   E8 9606FBFF      CALL 0000A472	//D2Common.#10887
0005A04C   6A 00            PUSH 0
0005A04E   57               PUSH EDI
0005A04F   6A 2B            PUSH 2B
0005A051   53               PUSH ESI
0005A052   E8 8B06FBFF      CALL 0000A472	//D2Common.#10887
0005A057   6A 00            PUSH 0
0005A059   57               PUSH EDI
0005A05A   6A 2D            PUSH 2D
0005A05C   53               PUSH ESI
0005A05D   E8 8006FBFF      CALL 0000A472	//D2Common.#10887
C++ Version

Code: Select all

void __fastcall AnyaSetResis(int nValue, UnitAny* pUnit, Game* pGame)
{
	if (!pUnit) return;
	if (pUnit->dwType > UNIT_TILE) return;
	if (pUnit->dwUnitId < 0) return;

	StatList* pStatList = D2COMMON_CreateStatList(pGame->pMemPools, 0, 0, pUnit->dwType, pUnit->dwUnitId);
	if (!pStatList) return;

	D2COMMON_AssignStatList(pUnit, pStatList, 1);

	D2COMMON_SetUnitStat(pUnit, STAT_FIRERESIST, nValue, 0);
	D2COMMON_SetUnitStat(pUnit, STAT_LIGHTNINGRESIST, nValue, 0);
	D2COMMON_SetUnitStat(pUnit, STAT_COLDRESIST, nValue, 0);
	D2COMMON_SetUnitStat(pUnit, STAT_POISONRESIST, nValue, 0);

	D2GAME_UpdatePlayerStats(pUnit, STAT_FIRERESIST, nValue, pUnit);
	D2GAME_UpdatePlayerStats(pUnit, STAT_LIGHTNINGRESIST, nValue, pUnit);
	D2GAME_UpdatePlayerStats(pUnit, STAT_COLDRESIST, nValue, pUnit);
	D2GAME_UpdatePlayerStats(pUnit, STAT_POISONRESIST, nValue, pUnit);
}

NAKED void AnyaSetResis_STUB()
{
	// unsigned int __userpurge sub_6FC7A000@<eax>(unsigned int nValue@<edi>, UnitAny* pUnit@<esi>, Game* pGame);
	__asm
	{
		push [esp + 4]
		mov edx, esi
		mov ecx, edi
		call AnyaSetResis
		ret 4
	}
}

Patch(JUMP, "D2Game.dll", 0x5A000, (DWORD)AnyaSetResis_STUB, 7, "Anya Fix Bug Set Resistance");

User avatar
Darkquake
Posts: 69
Joined: Tue Feb 20, 2018 3:38 pm
Australia

Re: The old Anya resistance fix for 113c

Post by Darkquake » Mon Feb 17, 2020 5:26 am

thaison wrote:
Mon Feb 17, 2020 3:04 am
To

Code: Select all

0005A036   6A 00            PUSH 0
0005A038   57               PUSH EDI
0005A039   6A 27            PUSH 27
0005A03B   53               PUSH ESI
0005A03C   E8 A106FBFF      CALL 0000A472	//D2Common.#10887
0005A041   6A 00            PUSH 0
0005A043   57               PUSH EDI
0005A044   6A 29            PUSH 29
0005A046   53               PUSH ESI
0005A047   E8 9606FBFF      CALL 0000A472	//D2Common.#10887
0005A04C   6A 00            PUSH 0
0005A04E   57               PUSH EDI
0005A04F   6A 2B            PUSH 2B
0005A051   53               PUSH ESI
0005A052   E8 8B06FBFF      CALL 0000A472	//D2Common.#10887
0005A057   6A 00            PUSH 0
0005A059   57               PUSH EDI
0005A05A   6A 2D            PUSH 2D
0005A05C   53               PUSH ESI
0005A05D   E8 8006FBFF      CALL 0000A472	//D2Common.#10887
I'm a little confused at the to part here, it doesn't seem like the call addresses were changed. Also it says to call "D2Common.#10887" but isn't "CALL 0000A472" is actually "D2Common.#10058"?
I make things? I make things.
Image
https://www.moddb.com/mods/darkquake

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

Re: The old Anya resistance fix for 113c

Post by thaison » Mon Feb 17, 2020 5:51 am

Did you really use version 1.13c?
Image

User avatar
a000000
Posts: 36
Joined: Mon Apr 10, 2017 6:36 am

Re: The old Anya resistance fix for 113c

Post by a000000 » Mon Feb 17, 2020 12:21 pm

Thank you very much for your reply

mengxuecen
Posts: 33
Joined: Mon Mar 11, 2019 5:34 am

Re: The old Anya resistance fix for 113c

Post by mengxuecen » Mon Feb 24, 2020 2:34 pm

Thank you very much for your reply!!!!!!

mengxuecen
Posts: 33
Joined: Mon Mar 11, 2019 5:34 am

Re: The old Anya resistance fix for 113c

Post by mengxuecen » Mon Feb 24, 2020 3:36 pm

2020/2/24 22:27:21.096 [critical] @: exception 0xC0000005 occured in sys packet handling 6FD882B1
2020/2/24 22:27:21.096 [critical] @: packet data dump: 6b


This error often occurs after modification.

Post Reply

Return to “Code Editing”