//=================================
// LCTeam 1.00S Main Project v0.2b
// Started : 22.03.2010
// Coder : SmallHabit
//=================================
#include "Jewels.h"
#include "Utils.h"
void JewelsInitHook()
{
//Hook NewJewelColor
BYTE JewelsNewsPrice[] = { 0xFF, 0x25, 0x00, 0x63, 0x90, 0x00, 0x90, 0x90, 0x90, 0x90 };
memcpy((int*)0x0052BBCB,JewelsNewsPrice,sizeof(Jew elsNewsPrice)); //1.00Y
*(unsigned int*)0x00906300 = (unsigned int)JewelsNewPrice; //
//Hook NewJewelColor
BYTE JewelsColors[] = { 0xFF, 0x25, 0x10, 0x63, 0x90, 0x00, 0x90, 0x90, 0x90, 0x90 };
memcpy((int*)0x005D5649,JewelsColors,sizeof(Jewels Colors)); //1.00Y
*(unsigned int*)0x00906310 = (unsigned int)JewelsColor; //
//Hook JewelText
BYTE JewelText[] = { 0xFF, 0x25, 0x20, 0x63, 0x90, 0x00, 0x90, 0x90, 0x90, 0x90 };
SetNop(0x005DA181,62); //1.00Y
memcpy((int*)0x005DA17B,JewelText,sizeof(JewelText )); //1.00Y
*(unsigned int*)0x00906320 = (unsigned int)JewelInfoText; //
//Hook NewJewelDrop
BYTE JewelDrop[] = { 0xFF, 0x25, 0x30, 0x63, 0x90, 0x00, 0x90, 0x90, 0x90, 0x90 };
memcpy((int*)0x005E3A45,JewelDrop,sizeof(JewelDrop )); //1.00Y
*(unsigned int*)0x00906330 = (unsigned int)JewelNewDrop; //
//Hook JewelMoveItem1
BYTE JewelMove1[] = { 0xFF, 0x25, 0x40, 0x63, 0x90, 0x00, 0x90, 0x90, 0x90, 0x90 };
memcpy((int*)0x00798F1C,JewelMove1,sizeof(JewelMov e1)); //1.00Y
*(unsigned int*)0x00906340 = (unsigned int)JewelMoveOnItem1; //
//Hook JewelMoveItem2
BYTE JewelMove2[] = { 0xFF, 0x25, 0x50, 0x63, 0x90, 0x00, 0x90, 0x90, 0x90, 0x90 };
memcpy((int*)0x0079A4AF,JewelMove2,sizeof(JewelMov e2)); //1.00Y
*(unsigned int*)0x00906350 = (unsigned int)JewelMoveOnItem2; //
//Hook JewelsSwitcher2
BYTE JewelsSwitchers2[] = { 0xFF, 0x25, 0x80, 0x3F, 0x8F, 0x00, 0x90, 0x90, 0x90, 0x90 };
memcpy((int*)0x00792719,JewelsSwitchers2,sizeof(Je welsSwitchers2)); //1.03Y
*(unsigned int*)0x008F3F80 = (unsigned int)JewelsSwitcher2; //
}
void __declspec(naked) JewelsSwitcher2()
{
_asm
{
//Original
MOV EDX,DWORD PTR SS:[EBP-0x14]
MOVSX EAX,WORD PTR DS:[EDX]
CMP EAX,0x1C0D
JE ItemAllowed
//Jewel Of Luck
MOV EDX,DWORD PTR SS:[EBP-0x14]
MOVSX EAX,WORD PTR DS:[EDX]
CMP EAX,0x1C9B
JE ItemAllowed
//Jewel Of Skill
MOV EDX,DWORD PTR SS:[EBP-0x14]
MOVSX EAX,WORD PTR DS:[EDX]
CMP EAX,0x1C9C
JE ItemAllowed
mov eax,0x00792726 //new
jmp eax
ItemAllowed:
mov eax,0x0079276F //new
jmp eax
}
}
void __declspec(naked) JewelsColor()
{
_asm
{
//Original Soul
cmp ax, 0x1C0E;
je AddColor;
//Jewel Of Luck
cmp ax, 0x1C9B;
je AddColor;
//Jewel Of Skill
cmp ax, 0x1C9C;
je AddColor;
mov edx, COLOR_ADR_RETURN;
jmp edx;
AddColor:
mov edx, COLOR_ADR_ALLOW;
jmp edx;
}
}
void __declspec(naked) JewelInfoText()
{
_asm
{
//Original (Bless)
JNZ Item1 //Next Item
PUSH 0x23C //Text Line
MOV ECX, 0x07BAF2C0
mov esi, 0x00403A60
call esi
PUSH EAX
MOV EAX,DWORD PTR DS:[0x7D2739C]
LEA EAX,DWORD PTR DS:[EAX+EAX*4]
LEA EDX,DWORD PTR DS:[EAX+EAX*4]
LEA EAX,DWORD PTR DS:[EDX*4+0x7CF42A0]
PUSH EAX
mov esi, 0x008C5E68
call esi
MOV EAX,DWORD PTR DS:[0x7D2739C]
ADD ESP,8
MOV DWORD PTR DS:[EAX*4+0x7CF5490],EBX
MOV DWORD PTR DS:[EAX*4+0x7D24968],EBX
INC EAX
Item1:
//Jewel Of Luck
MOV DWORD PTR DS:[0x7D2739C],EAX
CMP WORD PTR SS:[EBP],0x1C9B //Item Number
JNZ Item2 //Jnz to Next Item or Return
PUSH 2555 //Text Line
MOV ECX, 0x07BAF2C0
mov esi, 0x00403A60
call esi
PUSH EAX
MOV EAX,DWORD PTR DS:[0x7D2739C]
LEA EAX,DWORD PTR DS:[EAX+EAX*4]
LEA EDX,DWORD PTR DS:[EAX+EAX*4]
LEA EAX,DWORD PTR DS:[EDX*4+0x7CF42A0]
PUSH EAX
mov esi, 0x008C5E68
call esi
MOV EAX,DWORD PTR DS:[0x7D2739C]
ADD ESP,8
MOV DWORD PTR DS:[EAX*4+0x7CF5490],EBX
MOV DWORD PTR DS:[EAX*4+0x7D24968],EBX
INC EAX
MOV DWORD PTR DS:[0x7D2739C],EAX
Item2:
//Jewel Of Skill
MOV DWORD PTR DS:[0x7D2739C],EAX
CMP WORD PTR SS:[EBP],0x1C9C //Item Number
JNZ Return //Jnz to Next Item or Return
PUSH 2556 //Text Line
MOV ECX, 0x07BAF2C0
mov esi, 0x00403A60
call esi
PUSH EAX
MOV EAX,DWORD PTR DS:[0x7D2739C]
LEA EAX,DWORD PTR DS:[EAX+EAX*4]
LEA EDX,DWORD PTR DS:[EAX+EAX*4]
LEA EAX,DWORD PTR DS:[EDX*4+0x7CF42A0]
PUSH EAX
mov esi, 0x008C5E68
call esi
MOV EAX,DWORD PTR DS:[0x7D2739C]
ADD ESP,8
MOV DWORD PTR DS:[EAX*4+0x7CF5490],EBX
MOV DWORD PTR DS:[EAX*4+0x7D24968],EBX
INC EAX
MOV DWORD PTR DS:[0x7D2739C],EAX
Return:
mov edi, 0x005DA1C1 //1.00Y
jmp edi;
}
}
void __declspec(naked) JewelsNewPrice()
{
_asm
{
//Soul Original
cmp ecx,0x1C0E
jnz Price1
mov dword ptr ss:[ebp-8],0x5B8D80
mov dword ptr ss:[ebp-4],0x0
mov esi, 0x0052D06F //1.00Y
jmp esi;
Price1:
mov edx,dword ptr ss:[ebp+8]
movsx eax,word ptr ds:[edx]
mov esi, JewelOfLuck;
jmp esi;
//Jewel of Luck
JewelOfLuck:
cmp ecx,0x1C9B
jnz Price2
mov dword ptr ss:[ebp-8],0x989680
mov dword ptr ss:[ebp-4],0x0
mov esi, 0x0052D06F
jmp esi;
Price2:
mov edx,dword ptr ss:[ebp+8]
movsx eax,word ptr ds:[edx]
mov esi, JewelOfSkill;
jmp esi;
//Jewel of Skill
JewelOfSkill:
cmp ecx,0x1C9C
jnz Price3
mov dword ptr ss:[ebp-8],0x17D7840
mov dword ptr ss:[ebp-4],0x0
mov esi, 0x0052D06F
jmp esi;
Price3:
mov edx,dword ptr ss:[ebp+8]
movsx eax,word ptr ds:[edx]
mov esi, 0x0052BBEC;
jmp esi;
}
}
void __declspec(naked) JewelNewDrop()
{
_asm
{
//Original
CMP AX,0x1C0E
JE Return
//Jewel Of Luck
CMP AX,0x1C9B
JE Return
//Jewel Of Skill
CMP AX,0x1C9C
JE Return
mov edi, 0x005E3A4F
jmp edi;
Return:
mov edi, 0x005E3C52;
jmp edi;
}
}
void __declspec(naked) JewelMoveOnItem2()
{
_asm
{
//Original
MOV EDX,DWORD PTR SS:[EBP+0x08]
MOVSX EAX,WORD PTR DS:[EDX]
CMP EAX,0x1C0E
JNZ Next1
CMP DWORD PTR SS:[EBP-0x4],0x00
JL Next1
CMP DWORD PTR SS:[EBP-0x4],0x08
JG Next1
MOV AL,0x01
mov edi, 0x0079A4CE
jmp edi
Next1:
//Jewel Of Luck
MOV EDX,DWORD PTR SS:[EBP+0x08]
MOVSX EAX,WORD PTR DS:[EDX]
CMP EAX,0x1C9B
JNZ Next2
CMP DWORD PTR SS:[EBP-0x4],0x00
JL Next2
CMP DWORD PTR SS:[EBP-0x4],0x08
JG Next2
MOV AL,0x01
mov edi, 0x0079A4CE
jmp edi
Next2:
//Jewel Of Skill
MOV EDX,DWORD PTR SS:[EBP+0x08]
MOVSX EAX,WORD PTR DS:[EDX]
CMP EAX,0x1C9C
JNZ Next
CMP DWORD PTR SS:[EBP-0x4],0x00
JL Next
CMP DWORD PTR SS:[EBP-0x4],0x08
JG Next
MOV AL,0x01
mov edi, 0x0079A4CE
jmp edi
Next:
mov edi, 0x0079A4CC
jmp edi
}
}
void __declspec(naked) JewelMoveOnItem1()
{
_asm
{
//Original
MOV EDX,DWORD PTR SS:[EBP-0x78]
MOVSX EAX,WORD PTR DS:[EDX]
CMP EAX,0x1C0E //Item
JNZ Next1
MOV ECX,DWORD PTR SS:[EBP-0x9C]
PUSH ECX
MOV EDX,DWORD PTR SS:[EBP-0x78]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0xB4]
mov edi, 0x0079A40F
call edi
MOV BYTE PTR SS:[EBP-0xA0],AL
Next1:
//Jewel Of Luck
MOV EDX,DWORD PTR SS:[EBP-0x78]
MOVSX EAX,WORD PTR DS:[EDX]
CMP EAX,0x1C9B //Item
JNZ Next2
MOV ECX,DWORD PTR SS:[EBP-0x9C]
PUSH ECX
MOV EDX,DWORD PTR SS:[EBP-0x78]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0xB4]
mov edi, 0x0079A40F
call edi
MOV BYTE PTR SS:[EBP-0xA0],AL
mov esi, 0x0079901A
jmp esi
Next2:
//Jewel Of Luck
MOV EDX,DWORD PTR SS:[EBP-0x78]
MOVSX EAX,WORD PTR DS:[EDX]
CMP EAX,0x1C9C //Item
JNZ Next
MOV ECX,DWORD PTR SS:[EBP-0x9C]
PUSH ECX
MOV EDX,DWORD PTR SS:[EBP-0x78]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0xB4]
mov edi, 0x0079A40F
call edi
MOV BYTE PTR SS:[EBP-0xA0],AL
mov esi, 0x0079901A
jmp esi
Next:
mov esi, 0x00798F4A
jmp esi
}
}
creditos :
SmallHabit
Marcadores