Page 1 of 1

Cow Portal Crashing with Basemod.dll

Posted: Wed Dec 04, 2019 8:45 pm
by Specktro
HI guys...

I was using basemod on my mod, but when I open cow portal it crashes, dunno if its something about the cow quest check I removed so I can kill king cow? I have the CowLevelCheck code edit from Kidpaddle on my mod... any solution that I can use and still have the cow king quest not checking?

Re: Cow Portal Crashing with Basemod.dll

Posted: Thu Dec 05, 2019 1:11 am
by devurandom
Cow portal uses the original code, but if using custom cube red portals to go to the cow level it won't work.. There's a level check in custom red portals that rejects destination to the cow level to force people to use the original cow portal code.

Just retested this and cow portal works in BaseMod. ;)

From my notes the Cow Portal level check done with CE shows this for 1.13c

Code: Select all

reference
https://d2mods.info/forum/viewtopic.php?t=38611

Code section

00067503   E8 6030FAFF      CALL 0000A568
00067508   85C0             TEST EAX,EAX
0006750A  ▼0F85 C5010000    JNE 000676D5
00067510   8B45 70          MOV EAX,DWORD PTR [EBP+70]


Change

0006750A  ▼0F85 C5010000    JNE 000676D5

to


0006750A   90               NOP
0006750B   90               NOP
0006750C   90               NOP
0006750D   90               NOP
0006750E   90               NOP
0006750F   90               NOP

Re: Cow Portal Crashing with Basemod.dll

Posted: Fri Dec 06, 2019 3:10 am
by Specktro
devurandom wrote:
Thu Dec 05, 2019 1:11 am
Cow portal uses the original code, but if using custom cube red portals to go to the cow level it won't work.. There's a level check in custom red portals that rejects destination to the cow level to force people to use the original cow portal code.

Just retested this and cow portal works in BaseMod. ;)

From my notes the Cow Portal level check done with CE shows this for 1.13c

Code: Select all

reference
https://d2mods.info/forum/viewtopic.php?t=38611

Code section

00067503   E8 6030FAFF      CALL 0000A568
00067508   85C0             TEST EAX,EAX
0006750A  ▼0F85 C5010000    JNE 000676D5
00067510   8B45 70          MOV EAX,DWORD PTR [EBP+70]


Change

0006750A  ▼0F85 C5010000    JNE 000676D5

to


0006750A   90               NOP
0006750B   90               NOP
0006750C   90               NOP
0006750D   90               NOP
0006750E   90               NOP
0006750F   90               NOP
Mine is just like this:
6FC87503 |. E8 6030FAFF CALL 6FC2A568 ; <JMP.&D2Common.#10174>
6FC87508 |. 85C0 TEST EAX,EAX
6FC8750A |. 90 NOP
6FC8750B |. 90 NOP
6FC8750C |. 90 NOP
6FC8750D |. 90 NOP
6FC8750E |. 90 NOP
6FC8750F |. 90 NOP

But still crashing when opening cow level, using the original cube recipe...
When I remove basemod.dll from D2 folder it opens ok...
I'll try testing from original dlls and make every modification I have on them and test after each one... Maybe I find what is corrupting when put together...

Re: Cow Portal Crashing with Basemod.dll

Posted: Fri Dec 06, 2019 3:39 am
by Specktro
Got it...

Using basemod makes the CowLevelCheck edit unnecessary... just made it back to original code on d2game.dll and now its ok...

Re: Cow Portal Crashing with Basemod.dll

Posted: Sun Dec 08, 2019 10:18 am
by devurandom
This is likely the reason why it crashed with the normal code edit patch listed above. It's because you'd endup with a hybrid patch, after BaseMod applies its patch.

In BaseMod the Cow Level patch is made differently than using NOP's with a 2 byte patch instead of a 6 byte patch.

CowLevelCheck Alternate CE [1.13c]

Code: Select all

change

6FC8750A    0F85 C5010000  JNZ 6FC876D5

to

6FC8750A    0F85 00000000  JNZ 6FC87510
I wished I'd added less Code Edits to BaseMod, but If I take them out some will complain.
:roll:

Re: Cow Portal Crashing with Basemod.dll

Posted: Sun Dec 08, 2019 3:23 pm
by Specktro
devurandom wrote:
Sun Dec 08, 2019 10:18 am
This is likely the reason why it crashed with the normal code edit patch listed above. It's because you'd endup with a hybrid patch, after BaseMod applies its patch.

In BaseMod the Cow Level patch is made differently than using NOP's with a 2 byte patch instead of a 6 byte patch.

CowLevelCheck Alternate CE [1.13c]

Code: Select all

change

6FC8750A    0F85 C5010000  JNZ 6FC876D5

to

6FC8750A    0F85 00000000  JNZ 6FC87510
I wished I'd added less Code Edits to BaseMod, but If I take them out some will complain.
:roll:
If I'd read ALL the features before using it I'd see it was gonna happen... :oops: