2016-04-18 09:08:37 +00:00
/*=================================================================
File created by Yohann NICOLAS .
2016-04-18 09:10:35 +00:00
Add support 1.13 d by L ' Autour .
2016-04-18 09:08:37 +00:00
More little options .
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
# include "common.h"
# include "error.h"
# include "d2functions.h"
# include <stdio.h>
int active_RunLODs = false ;
int active_alwaysRegenMapInSP = false ;
DWORD nbPlayersCommandByDefault = 1 ;
int active_DisplayItemLevel = false ;
int active_AlwaysDisplayLifeMana = false ;
int active_EnabledTXTFilesWithMSExcel = false ;
int active_DisplayBaseStatsValue = false ;
int active_LadderRunewords = false ;
int active_EnabledCowPortalWhenCowKingWasKill = false ;
/****************************************************************************************************/
void STDCALL displayItemlevel ( LPWSTR popup , Unit * ptItem )
{
if ( onRealm & & ( selectModParam = = MOD_NO ) ) return ;
WCHAR text [ 0x50 ] ;
2016-04-18 09:10:35 +00:00
//swprintf(text, L"Item Level: %u\n", D2GetItemLevel(ptItem));
swprintf ( text , getTranslatedString ( STR_ITEM_LEVEL ) , D2GetItemLevel ( ptItem ) ) ;
wcscat ( text , L " \n " ) ;
2016-04-18 09:08:37 +00:00
D2SetColorPopup ( text , WHITE ) ;
wcscat ( popup , text ) ;
}
FCT_ASM ( caller_displayItemlevel_113 )
PUSH ECX
PUSH EAX
PUSH EAX
LEA EAX , DWORD PTR SS : [ ESP + 0x1E70 ]
PUSH EAX
CALL displayItemlevel
POP EAX
POP ECX
POP EDX
PUSH 0x100
JMP EDX
} }
FCT_ASM ( caller_displayItemlevel_111 )
PUSH ECX
PUSH EDX
PUSH ECX
LEA EAX , DWORD PTR SS : [ ESP + 0x1E74 ]
PUSH EAX
CALL displayItemlevel
POP EDX
POP ECX
POP EAX
PUSH 0x100
JMP EAX
} }
FCT_ASM ( caller_displayItemlevelSet_111 )
PUSH ECX
PUSH EDX
PUSH ECX
LEA EAX , DWORD PTR SS : [ ESP + 0x1958 ]
PUSH EAX
CALL displayItemlevel
POP EDX
POP ECX
POP EAX
PUSH 0x100
JMP EAX
} }
FCT_ASM ( caller_displayItemlevel )
PUSH ECX
PUSH EDX
PUSH ECX
LEA EAX , DWORD PTR SS : [ ESP + 0x5018 ]
PUSH EAX
CALL displayItemlevel
POP EDX
POP ECX
POP EAX
PUSH 0x100
JMP EAX
} }
FCT_ASM ( caller_displayItemlevelSet )
PUSH ECX
PUSH EDX
PUSH ECX
LEA EAX , DWORD PTR SS : [ ESP + 0x1220 ]
PUSH EAX
CALL displayItemlevel
POP EDX
POP ECX
POP EAX
PUSH 0x100
JMP EAX
} }
FCT_ASM ( caller_displayItemlevel_9 )
PUSH ECX
PUSH EDX
PUSH ECX
LEA EAX , DWORD PTR SS : [ ESP + 0x501C ]
PUSH EAX
CALL displayItemlevel
POP EDX
POP ECX
POP EAX
PUSH 0x100
JMP EAX
} }
FCT_ASM ( caller_displayItemlevelSet_9 )
PUSH ECX
PUSH EDX
PUSH ECX
LEA EAX , DWORD PTR SS : [ ESP + 0x1224 ]
PUSH EAX
CALL displayItemlevel
POP EDX
POP ECX
POP EAX
PUSH 0x100
JMP EAX
} }
void Install_DisplayItemLevel ( )
{
static int isInstalled = false ;
if ( isInstalled ) return ;
log_msg ( " Patch D2Client for display item popup. (DisplayPopup) \n " ) ;
// print the text in the final buffer
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 3 D47C , 3 D47C , 438 A1 , ADD0A , 789 DA , AE0AA , 941 C0 , 98590 ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0x68 , 0xE8 ) ;
2016-04-18 09:10:35 +00:00
MEMT_REF4 ( 0x100 , version_D2Client > = V113c ? caller_displayItemlevel_113 : version_D2Client > = V111 ? caller_displayItemlevel_111 : version_D2Client = = V110 ? caller_displayItemlevel : caller_displayItemlevel_9 ) ;
2016-04-18 09:08:37 +00:00
//6FAE38A1 . 68 00010000 PUSH 100
//6FB5DD0A |. 68 00010000 PUSH 100
//6FB289DA |. 68 00010000 PUSH 100
//6FB5E0AA |. 68 00010000 PUSH 100
//6FB441C0 |. 68 00010000 PUSH 100
2016-04-18 09:10:35 +00:00
//6FB48590 |. 68 00010000 PUSH 100
2016-04-18 09:08:37 +00:00
// print the text in the final buffer (for set items)
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 3 C452 , 3 C452 , 427 BE , AC773 , 77773 , ACEB3 , 92F E3 , 973 B3 ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0x68 , 0xE8 ) ;
MEMT_REF4 ( 0x100 , version_D2Client > = V111 ? caller_displayItemlevelSet_111 : version_D2Client = = V110 ? caller_displayItemlevelSet : caller_displayItemlevelSet_9 ) ;
//6FAE27BE . 68 00010000 PUSH 100
//6FB5C773 |. 68 00010000 PUSH 100
//6FB27773 |. 68 00010000 PUSH 100
//6FB5CEB3 |. 68 00010000 PUSH 100
//6FB42FE3 |. 68 00010000 PUSH 100
2016-04-18 09:10:35 +00:00
//6FB473B3 |. 68 00010000 PUSH 100
2016-04-18 09:08:37 +00:00
log_msg ( " \n " ) ;
isInstalled = true ;
}
/****************************************************************************************************/
char * msgNBPlayersString = " players %u " ;
DWORD * infoEnabledSendPlayersCommand ;
void SendPlayersCommand ( )
{
# pragma pack(1)
struct {
BYTE displayType ; //0x15 main msg; 0x14: char popup
BYTE un ;
BYTE zero ;
char string [ 0xFF ] ;
char null ;
} data ;
# pragma pack()
if ( ! needToInit | | onRealm ) return ;
needToInit = 0 ;
DWORD info = * infoEnabledSendPlayersCommand ;
if ( ( info ! = 0 ) & & ( info ! = 1 ) & & ( info ! = 6 ) & & ( info ! = 8 ) ) return ;
D2SetNbPlayers ( nbPlayersCommandByDefault ) ;
memset ( & data , 0 , sizeof ( data ) ) ;
data . displayType = 0x15 ;
data . un = 1 ;
data . zero = 0 ; //*(BYTE*)(offset_D2Client+0x112CFC); in 1.10
data . null = NULL ;
sprintf ( data . string , msgNBPlayersString , nbPlayersCommandByDefault ) ;
D2SendMsgToAll ( ( BYTE * ) & data ) ;
}
FCT_ASM ( caller_SendPlayersCommand )
CALL SendPlayersCommand
JMP D2GetResolution
} }
void Install_SendPlayersCommand ( )
{
static int isInstalled = false ;
if ( isInstalled ) return ;
log_msg ( " Patch D2Client for init default nb /players. (SendPlayersCommand) \n " ) ;
2016-04-18 09:10:35 +00:00
infoEnabledSendPlayersCommand = ( DWORD * ) R7 ( D2Client , 111 D60 , 110 BC0 , 107960 , 11 BFBC , 11 C2AC , 11 BFF8 , 11 C394 , 11 D1DC ) ;
2016-04-18 09:08:37 +00:00
if ( version_D2Client > = V110 )
2016-04-18 09:10:35 +00:00
msgNBPlayersString = ( char * ) R7 ( D2Client , 0000 , 0000 , D8448 , D06A8 , D4748 , D4680 , D4E00 , D470C ) ;
2016-04-18 09:08:37 +00:00
// Set nb Player to default
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 8723 B , 865 BB , 81 B8B , A3602 , 66 A02 , 90162 , C39F2 , 1 D3F2 ) ; //6FB1C7B7-6FAA0000
2016-04-18 09:08:37 +00:00
MEMJ_REF4 ( D2GetResolution , caller_SendPlayersCommand ) ;
//6FB2723A |. E8 7D8E0300 CALL <JMP.&D2gfx.#10005>
//6FB265BA |. E8 7D8E0300 CALL <JMP.&D2gfx.#10005>
//6FB21B8A . E8 4F9C0400 CALL <JMP.&D2gfx.#10005>
//6FB53601 |. E8 E099F6FF CALL <JMP.&D2gfx.#10000>
//6FB16A01 |. E8 AA65FAFF CALL <JMP.&D2gfx.#10063>
//6FB40161 |. E8 1ECFF7FF CALL <JMP.&D2gfx.#10043>
//6FB739F1 |. E8 B896F4FF CALL <JMP.&D2gfx.#10031>
2016-04-18 09:10:35 +00:00
//6FACD3F1 |. E8 EAFBFEFF CALL <JMP.&D2gfx.#10012>
2016-04-18 09:08:37 +00:00
log_msg ( " \n " ) ;
isInstalled = true ;
}
/****************************************************************************************************/
void Install_AlwaysRegenMapInSP ( )
{
static int isInstalled = false ;
if ( isInstalled ) return ;
log_msg ( " Patch D2Game for always regenerate maps in Single player. (AlwaysRegenMapInSP) \n " ) ;
// Always regenerate maps in Single player
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Game , 517 ED , 51 BFA , 5 DE88 , 6235 D , 2966 D , 1E1 FE , ED3BE , 26 D7E ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0x74 , 0xEB ) ; // JMP SHORT D2Game.01FE2368
//6FC8DE88 |. 74 09 JE SHORT D2Game.6FC8DE93
//01FE235D |. 74 09 JE SHORT D2Game.01FE2368
//01F9966D |. 74 09 JE SHORT D2Game.01F99678
//6FC3E1FE |. 74 09 JE SHORT D2Game.6FC3E209
//6FD0D3BE |. 74 09 JE SHORT D2Game.6FD0D3C9
2016-04-18 09:10:35 +00:00
//6FC46D7E |. 74 09 JE SHORT D2Game.6FC46D89
2016-04-18 09:08:37 +00:00
log_msg ( " \n " ) ;
isInstalled = true ;
}
/****************************************************************************************************/
void Install_RunLODs ( )
{
static int isInstalled = false ;
if ( isInstalled ) return ;
log_msg ( " Patch D2gfx for launch any number of Diablo II game in the same computer. (RunLODs) \n " ) ;
// execute if it's our packet else continue
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2gfx , 447 C , 447 C , 446 A , 84 CF , 84 AF , 894F , 85 BF , B6B0 ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0x74 , 0xEB ) ; // JMP SHORT D2gfx.6FA884F6
//6FA884AF |. 74 45 JE SHORT D2gfx.6FA884F6
//6FA8894F |. 74 45 JE SHORT D2gfx.6FA88996
//6FA885BF |. 74 45 JE SHORT D2gfx.6FA88606
2016-04-18 09:10:35 +00:00
//6FA8B6B0 |. 74 45 JE SHORT D2gfx.6FA8B6F7
2016-04-18 09:08:37 +00:00
log_msg ( " \n " ) ;
isInstalled = true ;
}
/****************************************************************************************************/
FCT_ASM ( caller_AlwaysDisplayLife_113 )
POP EAX
CMP onRealm , 0
JNZ normalDisplayLife
CMP active_AlwaysDisplayLifeMana , 0
JE normalDisplayLife
ADD EAX , 0x28
JMP EAX
normalDisplayLife :
CMP EDX , 0x1E
JGE cont
ADD EAX , 0xBC
cont :
JMP EAX
} }
FCT_ASM ( caller_AlwaysDisplayLife_111 )
CMP onRealm , 0
JNZ normalDisplayLife
CMP active_AlwaysDisplayLifeMana , 0
JE normalDisplayLife
POP EAX
ADD EAX , 0x25
JMP EAX
normalDisplayLife :
MOV EAX , ptResolutionY
MOV EAX , DWORD PTR DS : [ EAX ]
RETN
} }
FCT_ASM ( caller_AlwaysDisplayLife )
CMP onRealm , 0
JNZ normalDisplayLife
CMP active_AlwaysDisplayLifeMana , 0
JE normalDisplayLife
POP EAX
ADD EAX , 0x28
JMP EAX
normalDisplayLife :
MOV EAX , ptResolutionY
MOV EAX , DWORD PTR DS : [ EAX ]
RETN
} }
FCT_ASM ( caller_AlwaysDisplayMana_113 )
MOV EAX , DWORD PTR DS : [ ptResolutionY ]
MOV EAX , DWORD PTR DS : [ EAX ]
CMP onRealm , 0
JNZ normalDisplayMana
CMP active_AlwaysDisplayLifeMana , 0
JE normalDisplayMana
POP EAX
ADD EAX , 0x3C
JMP EAX
normalDisplayMana :
RETN
} }
FCT_ASM ( caller_AlwaysDisplayMana )
CMP onRealm , 0
JNZ normalDisplayMana
CMP active_AlwaysDisplayLifeMana , 0
JE normalDisplayMana
POP EAX
MOV WORD PTR SS : [ ESP + 0x14 ] , 0
ADD EAX , 0x38
JMP EAX
normalDisplayMana :
POP EAX
POP EDI
POP ESI
POP EBP
POP EBX
ADD ESP , 0x25C
RETN
} }
FCT_ASM ( caller_AlwaysDisplayMana_9 )
CMP onRealm , 0
JNZ normalDisplayMana
CMP active_AlwaysDisplayLifeMana , 0
JE normalDisplayMana
ADD DWORD PTR SS : [ ESP ] , 0x32
LEA ECX , DWORD PTR SS : [ ESP + 0x24 ]
PUSH DWORD PTR SS : [ ESP + 0xC ]
PUSH DWORD PTR SS : [ ESP + 0xC ]
PUSH DWORD PTR SS : [ ESP + 0xC ]
CALL D2PrintString
MOV WORD PTR SS : [ ESP + 0x24 ] , 0
RETN 0xC
normalDisplayMana :
POP EAX
ADD EAX , 0xC2
JMP EAX
} }
void Install_AlwaysDisplayLifeMana ( )
{
static int isInstalled = false ;
if ( isInstalled ) return ;
log_msg ( " Patch D2Client for always display life and mana. (ALwaysPrintLifeMana) \n " ) ;
2016-04-18 09:10:35 +00:00
if ( version_D2Client > = V113c )
2016-04-18 09:08:37 +00:00
{
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 0000 , 0000 , 0000 , 0000 , 0000 , 0000 , 2764 A , 6 D6FA ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0x0F , 0x90 ) ;
memt_byte ( 0x8C , 0xE8 ) ;
MEMT_REF4 ( 0x000000BC , caller_AlwaysDisplayLife_113 ) ;
//6FAD764A |. 0F8C BC000000 JL D2Client.6FAD770C
//6FAD7650 |. 83FA 6E CMP EDX,6E
//6FAD7653 |. 0F8F B3000000 JG D2Client.6FAD770C
//6FAD7659 |. A1 4CBCB86F MOV EAX,DWORD PTR DS:[6FB8BC4C]
//6FAD7667 |. 0F8C A4000000 JL D2Client.6FAD7711
2016-04-18 09:10:35 +00:00
//--
//6FB1D717 |. 0F8C A4000000 JL D2Client.6FB1D7C1
2016-04-18 09:08:37 +00:00
} else {
// Always display life.
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 58 B32 , 58 B32 , 5F 102 , 2 D713 , B5DF3 , 81733 , 0000 , 0000 ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0xA1 , 0xE8 ) ;
MEMT_REF4 ( ptResolutionY , version_D2Client > = V111 ? caller_AlwaysDisplayLife_111 : caller_AlwaysDisplayLife ) ;
//6FADD713 |. A1 605CBA6F MOV EAX,DWORD PTR DS:[6FBA5C60]
//6FB65DF3 |. A1 C84FBA6F MOV EAX,DWORD PTR DS:[6FBA4FC8]
//6FB31733 |. A1 E4C6B86F MOV EAX,DWORD PTR DS:[6FB8C6E4]
}
// Always display mana.
2016-04-18 09:10:35 +00:00
if ( version_D2Client > = V113c )
2016-04-18 09:08:37 +00:00
{
//mem_seek R7(D2Client, 0000, 0000, 0000, 0000, 0000, 0000, 27711);
//memt_byte( 0x8B , 0x90);
//memt_byte( 0x0D , 0xE8);
//MEMT_REF4( offset_D2Client + 0x11C4B4 , caller_AlwaysDisplayMana_113);
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 0000 , 0000 , 0000 , 0000 , 0000 , 0000 , 2770 C , 6 D7BC ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0xA1 , 0xE8 ) ;
MEMT_REF4 ( ptResolutionY , caller_AlwaysDisplayMana_113 ) ;
//6FAD770C |> A1 4CBCB86F MOV EAX,DWORD PTR DS:[6FB8BC4C]
//6FAD7711 |> 8B0D B4C4BC6F MOV ECX,DWORD PTR DS:[6FBCC4B4]
//6FAD7708 |. 8B5424 10 MOV EDX,DWORD PTR SS:[ESP+10]
//6FAD77C7 |> 5F POP EDI
//6FAD77C8 |. 5E POP ESI
//6FAD77C9 |. 5D POP EBP
//6FAD77CA |. 5B POP EBX
//6FAD77CB |. 81C4 28030000 ADD ESP,328
//6FAD77D1 \. C3 RETN
2016-04-18 09:10:35 +00:00
//--
//6FB1D7BC |> A1 3870BA6F MOV EAX,DWORD PTR DS:[6FB8BC4C]
2016-04-18 09:08:37 +00:00
}
else if ( version_D2Client > = V110 )
{
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 0000 , 0000 , 5F 1E6 , 2 D7FB , B5EDB , 8181 B , 0000 , 0000 ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0x5F , 0xE8 ) ;
MEMT_REF4 ( 0x815B5D5E , caller_AlwaysDisplayMana ) ;
memt_byte ( 0xC4 , 0x90 ) ; // NOP
memt_byte ( 0x5C , 0x90 ) ; // NOP
memt_byte ( 0x02 , 0x90 ) ; // NOP
memt_byte ( 0x00 , 0x90 ) ; // NOP
memt_byte ( 0x00 , 0x90 ) ; // NOP
//6FADD7FB |. 5F POP EDI
//6FADD7FC |. 5E POP ESI
//6FADD7FD |. 5D POP EBP
//6FADD7FE |. 5B POP EBX
//6FADD7FF |. 81C4 5C020000 ADD ESP,25C
//6FB65EDB |. 5F POP EDI
//6FB65EDC |. 5E POP ESI
//6FB65EDD |. 5D POP EBP
//6FB65EDE |. 5B POP EBX
//6FB65EDF |. 81C4 5C020000 ADD ESP,25C
//6FB3181B |. 5F POP EDI
//6FB3181C |. 5E POP ESI
//6FB3181D |. 5D POP EBP
//6FB3181E |. 5B POP EBX
//6FB3181F |. 81C4 5C020000 ADD ESP,25C
//6FB31825 |. C3 RETN
} else {
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 58 C09 , 58 C09 , 0000 , 0000 , 0000 , 0000 , 0000 , 0000 ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0xE9 , 0xE8 ) ;
MEMT_REF4 ( 0x000000C2 , caller_AlwaysDisplayMana_9 ) ;
//6FAF8C09 . E9 C2000000 JMP D2Client.6FAF8CD0
}
if ( active_AlwaysDisplayLifeMana = = 2 )
active_AlwaysDisplayLifeMana = 0 ;
log_msg ( " \n " ) ;
isInstalled = true ;
}
/****************************************************************************************************/
void Install_EnabledTXTFilesWithMSExcel ( )
{
static int isInstalled = false ;
if ( isInstalled ) return ;
log_msg ( " Patch D2Client for enabled the opening of files already opened by MS Excel. (EnabledTXTFilesWithMSExcel) \n " ) ;
mem_seek ( ( DWORD ) D2StormMPQOpenFile + ( version_Storm > = V111 ? 0x12A : 0xFF ) ) ;
memt_byte ( 0x01 , 0x03 ) ; //; |ShareMode = FILE_SHARE_READ|FILE_SHARE_WRITE
//6FC1C969 |. 6A 01 PUSH 1 ; |ShareMode = FILE_SHARE_READ
log_msg ( " \n " ) ;
isInstalled = true ;
}
/****************************************************************************************************/
void STDCALL printDisplayBaseStatsValue ( WORD statID , sDrawImageInfo * data , DWORD x , DWORD y , DWORD p4 , DWORD p5 , DWORD p6 )
{
if ( onRealm | | ! D2isLODGame ( ) )
{
D2PrintImage ( data , x , y , p4 , p5 , p6 ) ;
return ;
}
Unit * ptChar = D2GetClientPlayer ( ) ;
CharStatsBIN * charStats = D2GetCharStatsBIN ( ptChar - > nPlayerClass ) ;
int minValue = 1 ;
switch ( statID )
{
case STATS_STRENGTH : minValue = charStats - > baseSTR ; break ;
case STATS_DEXTERITY : minValue = charStats - > baseDEX ; break ;
case STATS_VITALITY : minValue = charStats - > baseVIT ; break ;
case STATS_ENERGY : minValue = charStats - > baseENE ; break ;
}
int statValue = D2GetPlayerBaseStat ( ptChar , statID , 0 ) ;
if ( isOnRect ( D2GetMouseX ( ) , D2GetMouseY ( ) , x + 5 , y + 5 , 32 , 32 ) )
{
WCHAR text [ 100 ] ;
swprintf ( text , getTranslatedString ( STR_STATS_BASE_MIN ) , statValue , minValue ) ;
D2SetFont ( 1 ) ;
D2PrintPopup ( text , x + 18 , y - 32 , WHITE , 1 ) ;
}
if ( D2GetPlayerBaseStat ( ptChar , 4 , 0 ) < = 0 )
setFrame ( data , 2 ) ;
D2PrintImage ( data , x , y , p4 , p5 , p6 ) ;
}
FCT_ASM ( caller_displayBaseStatsValue )
POP EAX
XOR ECX , ECX
MOV CX , WORD PTR DS : [ ESI + 8 ]
PUSH ECX
PUSH EAX
JMP printDisplayBaseStatsValue
} }
void Install_DisplayBaseStatsValue ( )
{
static int isInstalled = false ;
if ( isInstalled ) return ;
log_msg ( " Patch D2Client for display base stats value. (DisplayBaseStatsValue) \n " ) ;
// Always print stat button images.
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 29 B12 , 29 B02 , 30073 , 82 BBA , 8963 A , 6 B59A , BD1B5 , BF955 ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0x8B , 0xEB ) ; // JMP SHORT D2Client.6FAD0088
2016-04-18 09:10:35 +00:00
memt_byte ( 0x4C , V7 ( D2Client , 12 , 12 , 13 , 13 , 13 , 13 , 13 , 13 ) ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0x24 , 0x90 ) ; // NOP
2016-04-18 09:10:35 +00:00
memt_byte ( V7 ( D2Client , 20 , 20 , 14 , 1 C , 1 C , 1 C , 1 C , 1 C ) , 0x90 ) ; // NOP (V109d:0x20 , V110:0x14
2016-04-18 09:08:37 +00:00
//6FAD0073 8B4C24 14 MOV ECX,DWORD PTR SS:[ESP+14]
//6FB32BBA > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
//6FB3963A > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
//6FB1B59A > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
//6FB6D1B5 |> 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
2016-04-18 09:10:35 +00:00
//6FB6F955 |> 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
2016-04-18 09:08:37 +00:00
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Client , 29 B9D , 29 B8D , 300F D , 82 C54 , 896 D4 , 6 B637 , BD23E , BF9DE ) ;
2016-04-18 09:08:37 +00:00
MEMJ_REF4 ( D2PrintImage , caller_displayBaseStatsValue ) ;
//6FB32C53 . E8 82A3F8FF CALL <JMP.&D2gfx.#10047>
//6FB396D3 . E8 D238F8FF CALL <JMP.&D2gfx.#10044>
//6FB1B636 . E8 431AFAFF CALL <JMP.&D2gfx.#10024>
//6FB6D23D |. E8 54FEF4FF |CALL <JMP.&D2gfx.#10041>
2016-04-18 09:10:35 +00:00
//6FB6F9DD |. E8 54FEF4FF |CALL <JMP.&D2gfx.#10042>
2016-04-18 09:08:37 +00:00
log_msg ( " \n " ) ;
isInstalled = true ;
}
/****************************************************************************************************/
RunesBIN * STDCALL compileRunesTxt ( DWORD unused , const char * filename , BINField * ptFields , DWORD * ptRecordCount , DWORD recordLength )
{
RunesBIN * ptRunesBin = ( RunesBIN * ) D2CompileTxtFile ( u nused , filename , ptFields , ptRecordCount , recordLength ) ;
for ( DWORD i = 0 ; i < * ptRecordCount ; i + + )
ptRunesBin [ i ] . Server = 0 ;
return ptRunesBin ;
}
void Install_LadderRunewords ( )
{
static int isInstalled = false ;
if ( isInstalled ) return ;
if ( version_D2Common < V110 )
return ;
log_msg ( " Patch D2Common for enabled the ladder only runewords. (LadderRunewords) \n " ) ;
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Common , 0000 , 0000 , 1E965 , 61762 , 43 A72 , 5 D492 , 724 B2 , 63782 ) ;
2016-04-18 09:08:37 +00:00
MEMC_REF4 ( D2CompileTxtFile , compileRunesTxt ) ;
//01B6E964 |. E8 0714FFFF CALL D2Common.#10578 ; \#10578
//6FDB1761 |. E8 FAA8FCFF CALL D2Common.#10653 ; \#10653
//6FD93A71 |. E8 EAADFCFF CALL D2Common.#10496 ; \#10496
//6FDAD491 |. E8 BA49FEFF CALL D2Common.#10244 ; \#10244
//6FDC24B1 |. E8 8ACAFEFF CALL D2Common.#10849 ; \#10849
2016-04-18 09:10:35 +00:00
//6FDB3781 |. E8 5A93FAFF CALL D2Common.#10037 ; \#10037
2016-04-18 09:08:37 +00:00
log_msg ( " \n " ) ;
isInstalled = true ;
}
/****************************************************************************************************/
void Install_EnabledCowPortalWhenCowKingWasKill ( )
{
static int isInstalled = false ;
if ( isInstalled ) return ;
log_msg ( " Patch D2Game for enabled the opening of Cow Portal when player have already kill the cow king in that difficulty. (EnabledCowPortalWhenCowKingWasKill) \n " ) ;
2016-04-18 09:10:35 +00:00
mem_seek R7 ( D2Game , 5 DFF7 , 5E457 , 6 C5E7 , B1278 , 5 DB68 , 75 C68 , 67508 , EBE8 ) ;
2016-04-18 09:08:37 +00:00
memt_byte ( 0x85 , 0x33 ) ; // XOR EAX,EAX
//6FC8DFF7 . 85C0 TEST EAX,EAX
//6FC8E457 . 85C0 TEST EAX,EAX
//6FC9C5E7 . 85C0 TEST EAX,EAX
//02061278 |. 85C0 TEST EAX,EAX
//01FEDB68 |. 85C0 TEST EAX,EAX
//6FC95C68 |. 85C0 TEST EAX,EAX
//6FC87508 |. 85C0 TEST EAX,EAX
2016-04-18 09:10:35 +00:00
//6FC2EBE8 |. 85C0 TEST EAX,EAX
2016-04-18 09:08:37 +00:00
log_msg ( " \n " ) ;
isInstalled = true ;
}
/*================================= END OF FILE =================================*/