avatar_SmallHabit

Новые карты и разработки в MU Online:

Автор SmallHabit, 2010 Нояб. 11, 00:45

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

SmallHabit

В общем - САБЖ.

В коде осуществлён фикс визуальных эфектов - (дождя,огня,тумана,статич, обьектов и т.д) для новых карт.
А так-же подргрузка картинок названий этих самых карт. В общем - тем кто в этом разбирается, всё будет понятно =)

#include <Windows.h>
#include <stdio.h>

void __declspec(naked) MapNewNames()
{
_asm
{
cmp esi,34 //MapNumber
jnz JNZNext80
push 0x73B        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx
JNZNext80:
cmp esi,80 //MapNumber
jnz JNZNext59
push 0x914        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx
JNZNext59:
cmp esi,59 //MapNumber
jnz JNZNext60
push 0x914        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx

mov edx, 0x005BF1BF;
jmp edx;
JNZNext60:
cmp esi,60 //MapNumber
jnz JNZNext61
push 0x914        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx

mov edx, 0x005BF1BF;
jmp edx;
JNZNext61:
cmp esi,61 //MapNumber
jnz JNZNext75
push 0x914        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx

mov edx, 0x005BF1BF;
jmp edx;
JNZNext75:
cmp esi,75 //MapNumber
jnz JNZNext76
push 0x73F        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx

mov edx, 0x005BF1BF;
jmp edx;
JNZNext76:
cmp esi,76 //MapNumber
jnz JNZNext77
push 0x73F        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx

mov edx, 0x005BF1BF;
jmp edx;
JNZNext77:
cmp esi,77 //MapNumber
jnz JNZNext78
push 0x73F        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx

mov edx, 0x005BF1BF;
jmp edx;
JNZNext78:
cmp esi,78 //MapNumber
jnz JNZNext81
push 0x73E        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx
JNZNext81:
cmp esi,81 //MapNumber
jnz JNZNext82
push 0x73E        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx
mov edx, 0x005BF1BF;
jmp edx;
JNZNext82:
cmp esi,82 //MapNumber
jnz JNZNext83
push 0x73E        //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx
mov edx, 0x005BF1BF;
jmp edx;
JNZNext83:
cmp esi,83 //MapNumber
jnz JNZNext84
push 0xA7E    //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx
mov edx, 0x005BF1BF;
jmp edx;
JNZNext84:
cmp esi,84 //MapNumber
jnz JNZNext85
push 0xA7E    //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx
mov edx, 0x005BF1BF;
jmp edx;
JNZNext85:
cmp esi,85 //MapNumber
jnz JNZNextEnd
push 0xA7E    //Text Line
mov ecx,0x07BA0588
mov edx, 0x00404020
call edx
mov edx, 0x005BF599
jmp edx
mov edx, 0x005BF1BF;
jmp edx;
JNZNextEnd:
mov edx, 0x005BF1BF;
jmp edx;
}
}

void __declspec(naked) MapNews40()
{
_asm
{
//1
CMP DWORD PTR DS:[0x934540],80;
JE JEOKAY;

//2
CMP DWORD PTR DS:[0x934540],59;
JE JEOKAY;

//3
CMP DWORD PTR DS:[0x934540],60;
JE JEOKAY;

//4
CMP DWORD PTR DS:[0x934540],61;
JE JEOKAY;

//Original
CMP DWORD PTR DS:[0x934540],40;
JE JEOKAY;

mov edx, 0x005D6C9E;
jmp edx;

JEOKAY:
mov edx, 0x005D6D46;
jmp edx;
}
}

void __declspec(naked) MapNew057()
{
_asm
{
PUSH EBP
MOV EBP,ESP
CMP DWORD PTR DS:[0x934540],57 //
JE JNZSecon
CMP DWORD PTR DS:[0x934540],58 //
JE JNZSecon
CMP DWORD PTR DS:[0x934540],65 //
JE JNZSecon
CMP DWORD PTR DS:[0x934540],75 //
JE JNZSecon
CMP DWORD PTR DS:[0x934540],76 //
JE JNZSecon
CMP DWORD PTR DS:[0x934540],77
JNZ JNZFirst
JNZSecon:
MOV AL,1
JMP JMPEnd
JNZFirst:
XOR AL,AL
JMPEnd:
POP EBP
RETN
}
}

void __declspec(naked) MapNewO56()
{
_asm
{
//New 56 Map Effects Enable
PUSH EBP
MOV EBP,ESP
CMP DWORD PTR DS:[0x934540],56 //1
JE JNZSecon
CMP DWORD PTR DS:[0x934540],78 //2
JE JNZSecon
CMP DWORD PTR DS:[0x934540],81 //3
JE JNZSecon
CMP DWORD PTR DS:[0x934540],82 //4
JNZ JNZFirst
JNZSecon:
MOV AL,1
JMP JMPEnd
JNZFirst:
XOR AL,AL
JMPEnd:
POP EBP
RETN
}
}

void __declspec(naked) MapNewO63()
{
_asm
{
//New 63 Map Effects Enable
PUSH EBP
MOV EBP,ESP
CMP DWORD PTR DS:[0x934540],63 //0
JE JNZSecon
CMP DWORD PTR DS:[0x934540],83 //1
JE JNZSecon
CMP DWORD PTR DS:[0x934540],84 //2
JE JNZSecon
CMP DWORD PTR DS:[0x934540],85 //3
JNZ JNZFirst
JNZSecon:
MOV AL,1
JMP JMPEnd
JNZFirst:
XOR AL,AL
JMPEnd:
POP EBP
RETN
}
}

void __declspec(naked) MapNewO40()
{
_asm
{
//New 40 Map Effects Enable
PUSH EBP
MOV EBP,ESP
CMP DWORD PTR DS:[0x934540],80 //1
JE JNZSecon
CMP DWORD PTR DS:[0x934540],59 //2
JE JNZSecon
CMP DWORD PTR DS:[0x934540],60 //3
JE JNZSecon
CMP DWORD PTR DS:[0x934540],61 //4
JE JNZSecon
CMP DWORD PTR DS:[0x934540],37
JNZ JNZFirst
JNZSecon:
MOV AL,1
JMP JMPEnd
JNZFirst:
XOR AL,AL
JMPEnd:
POP EBP
RETN
}
}

void __declspec(naked) MapSwampFog()
{
_asm
{
CMP EAX,56
JNZ Next1
mov edi, 0x0086A9DC
call edi
mov edi, 0x0059912E
jmp edi
Next1:
CMP EAX,78
JNZ Next2
mov edi, 0x0086A9DC
call edi
mov edi, 0x0059912E
jmp edi
Next2:
CMP EAX,81
JNZ Next3
mov edi, 0x0086A9DC
call edi
mov edi, 0x0059912E
jmp edi
Next3:
CMP EAX,82
JNZ Next4
mov edi, 0x0086A9DC
call edi
mov edi, 0x0059912E
jmp edi
Next4:
CMP EAX,83
JNZ CreateFog
mov edi, 0x0086A9DC
call edi
mov edi, 0x0059912E
jmp edi
CreateFog:
mov edi, 0x005990F2
jmp edi
}
}

void __declspec(naked) MapRaklionTele()
{
_asm
{
CMP DWORD PTR DS:[0x934540],57;
JNZ Teleport1;
Teleport1:
CMP DWORD PTR DS:[0x934540],75;
JNZ Teleport2;
Teleport2:
CMP DWORD PTR DS:[0x934540],76;
JNZ Teleport3;
Teleport3:
CMP DWORD PTR DS:[0x934540],77;
JNZ End;
End:
mov esi, 0x00606F88;
jmp esi;
}
}

void __declspec(naked) NewReward()
{
_asm
{
//004C9F5B
MOV EDX,DWORD PTR SS:[EBP-0x10]
MOV EAX,DWORD PTR DS:[EDX+0x8]
PUSH EAX
PUSH 0xCC4
MOV ECX,0x07BA0588
mov esi, 0x00403FC0
call esi
PUSH EAX
MOV ECX,DWORD PTR SS:[EBP-0x18]
IMUL ECX,ECX,0x58
MOV EDX,DWORD PTR SS:[EBP+0x8]
LEA EAX,DWORD PTR DS:[EDX+ECX+0x8]
PUSH EAX
mov esi, 0x008C84F8
call esi
ADD ESP,0x0C

mov esi, 0x004C9F88
jmp esi
}
}

void __declspec(naked) NewReward1()
{
_asm
{
//004C9F5B
MOV EDX,DWORD PTR SS:[EBP-0x10]
MOV EAX,DWORD PTR DS:[EDX+0x8]
PUSH EAX
PUSH 0xCC5
MOV ECX,0x07BA0588
mov esi, 0x00403FC0
call esi
PUSH EAX
MOV ECX,DWORD PTR SS:[EBP-0x18]
IMUL ECX,ECX,0x58
MOV EDX,DWORD PTR SS:[EBP+0x8]
LEA EAX,DWORD PTR DS:[EDX+ECX+0x8]
PUSH EAX
mov esi, 0x008C84F8
call esi
ADD ESP,0x0C

mov esi, 0x004C9F88
jmp esi
}
}

void __declspec(naked) NewReward2()
{
_asm
{
//004C9F5B
MOV EDX,DWORD PTR SS:[EBP-0x10]
MOV EAX,DWORD PTR DS:[EDX+0x8]
PUSH EAX
PUSH 0xCC6
MOV ECX,0x07BA0588
mov esi, 0x00403FC0
call esi
PUSH EAX
MOV ECX,DWORD PTR SS:[EBP-0x18]
IMUL ECX,ECX,0x58
MOV EDX,DWORD PTR SS:[EBP+0x8]
LEA EAX,DWORD PTR DS:[EDX+ECX+0x8]
PUSH EAX
mov esi, 0x008C84F8
call esi
ADD ESP,0x0C

mov esi, 0x004C9F88
jmp esi
}
}

void __declspec(naked) NewReward3()
{
_asm
{
//004C9F5B
MOV EDX,DWORD PTR SS:[EBP-0x10]
MOV EAX,DWORD PTR DS:[EDX+0x8]
PUSH EAX
PUSH 0xCC7
MOV ECX,0x07BA0588
mov esi, 0x00403FC0
call esi
PUSH EAX
MOV ECX,DWORD PTR SS:[EBP-0x18]
IMUL ECX,ECX,0x58
MOV EDX,DWORD PTR SS:[EBP+0x8]
LEA EAX,DWORD PTR DS:[EDX+ECX+0x8]
PUSH EAX
mov esi, 0x008C84F8
call esi
ADD ESP,0x0C

mov esi, 0x004C9F88
jmp esi
}
}

void __declspec(naked) MapTest()
{
_asm
{
//Original 00469039
MOV DWORD PTR SS:[EBP-0xFC],79
PUSH 0x00930068 //LorenMarket
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 80
MOV DWORD PTR SS:[EBP-0xFC],80
PUSH 0x0095DB58 //Silent
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 59
MOV DWORD PTR SS:[EBP-0xFC],59
PUSH 0x0095DB58 //Silent
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 60
MOV DWORD PTR SS:[EBP-0xFC],60
PUSH 0x0095DB58 //Silent
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 61
MOV DWORD PTR SS:[EBP-0xFC],61
PUSH 0x0095DB58 //Silent
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 75
MOV DWORD PTR SS:[EBP-0xFC],75
PUSH 0x0095DB71 //Raklion
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 76
MOV DWORD PTR SS:[EBP-0xFC],76
PUSH 0x0095DB71 //Raklion
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 77
MOV DWORD PTR SS:[EBP-0xFC],77
PUSH 0x0095DB71 //Raklion
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 78
MOV DWORD PTR SS:[EBP-0xFC],78
PUSH 0x0095DB91 //Swamp
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 81
MOV DWORD PTR SS:[EBP-0xFC],81
PUSH 0x0095DB91 //Swamp
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 82
MOV DWORD PTR SS:[EBP-0xFC],82
PUSH 0x0095DB91 //Swamp
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 83
MOV DWORD PTR SS:[EBP-0xFC],83
PUSH 0x0095DBB2 //Vulcanus
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 84
MOV DWORD PTR SS:[EBP-0xFC],84
PUSH 0x0095DBB2 //Vulcanus
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 85
MOV DWORD PTR SS:[EBP-0xFC],85
PUSH 0x0095DBB2 //Vulcanus
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

//New Map 86
MOV DWORD PTR SS:[EBP-0xFC],86
PUSH 0x00930068 //LorenMarket
LEA EDX,DWORD PTR SS:[EBP-0xFC]
PUSH EDX
MOV ECX,DWORD PTR SS:[EBP-0x100]
ADD ECX,0x04
mov esi, 0x00469530
CALL esi
MOV ECX,EAX
mov esi, 0x00401C50
call esi

mov esi, 0x00469064
jmp esi;
}
}

void Init()
{
DWORD OldProtect;
LPVOID lpAddress = (LPVOID)0x00401000;

if(VirtualProtect(lpAddress,5873152,PAGE_EXECUTE_READWRITE,&OldProtect))
{
char MapN1[] = "Interface\Silent.tga";
memcpy((int*)0x0095DB58,(BYTE*)MapN1,sizeof(MapN1));

char MapN2[] = "Interface\Mapname_Raklion.tga";
memcpy((int*)0x0095DB71,(BYTE*)MapN2,sizeof(MapN2));

char MapN3[] = "Interface\SwampOfCalmness.tga";
memcpy((int*)0x0095DB91,(BYTE*)MapN3,sizeof(MapN3));

char MapN4[] = "Interface\pkfield.tga";
memcpy((int*)0x0095DBB2,(BYTE*)MapN4,sizeof(MapN4));

BYTE MapNew[] = { 0xFF, 0x25, 0x43, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x00469039,MapNew,sizeof(MapNew));
*(unsigned int*)0x008F3F43 = (unsigned int)MapTest;

BYTE MapNew40[] = { 0xFF, 0x25, 0x10, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x005D6C91,MapNew40,sizeof(MapNew40));
*(unsigned int*)0x008F3F10 = (unsigned int)MapNews40;

BYTE MapNewo40[] = { 0xFF, 0x25, 0x15, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x008060BF,MapNewo40,sizeof(MapNewo40));
*(unsigned int*)0x008F3F15 = (unsigned int)MapNewO40;

BYTE MapNewNameS[] = { 0xFF, 0x25, 0x20, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x005BF1A6,MapNewNameS,sizeof(MapNewNameS));
*(unsigned int*)0x008F3F20 = (unsigned int)MapNewNames;

BYTE MapNewo57[] = { 0xFF, 0x25, 0x25, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x00822F4C,MapNewo57,sizeof(MapNewo57));
*(unsigned int*)0x008F3F25 = (unsigned int)MapNew057;

BYTE MapLimit[] = { 0xFF, 87, 0x0F };
memcpy((int*)0x006039C6,MapLimit,sizeof(MapLimit));

BYTE MapRaklion[] = { 0xFF, 0x25, 0x29, 0x3F, 0x8F, 0x00,0x00 };
memcpy((int*)0x00606F7B,MapRaklion,sizeof(MapRaklion));
*(unsigned int*)0x008F3F29 = (unsigned int)MapRaklionTele;

BYTE MapNewo56[] = { 0xFF, 0x25, 0xAA, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x0086A9CB,MapNewo56,sizeof(MapNewo56));
*(unsigned int*)0x008F3FAA = (unsigned int)MapNewO56;

BYTE Map56Fog[] = { 0xFF, 0x25, 0xAE, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x005990E6,Map56Fog,sizeof(Map56Fog));
*(unsigned int*)0x008F3FAE = (unsigned int)MapSwampFog;

BYTE MapNewo63[] = { 0xFF, 0x25, 0xB2, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x0081B9A0,MapNewo63,sizeof(MapNewo63));
*(unsigned int*)0x008F3FB2 = (unsigned int)MapNewO63;

BYTE RewardAdd[] = { 0xFF, 0x25, 0xBC, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x008F3FB6,RewardAdd,sizeof(RewardAdd));
*(unsigned int*)0x008F3FBC = (unsigned int)NewReward;

//Quest rewards
BYTE RewardCnt[] = { 0xFF, 0x14, 0x0F };
memcpy((int*)0x00004C9DFD,RewardCnt,sizeof(RewardCnt));

BYTE RewardAdd1[] = { 0xFF, 0x25, 0xC7, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x008F3FC1,RewardAdd1,sizeof(RewardAdd1));
*(unsigned int*)0x008F3FC7 = (unsigned int)NewReward1;

BYTE RewardAdd2[] = { 0xFF, 0x25, 0xD2, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x008F3FCC,RewardAdd2,sizeof(RewardAdd2));
*(unsigned int*)0x008F3FD2 = (unsigned int)NewReward2;

BYTE RewardAdd3[] = { 0xFF, 0x25, 0xDD, 0x3F, 0x8F, 0x00 };
memcpy((int*)0x008F3FD7,RewardAdd3,sizeof(RewardAdd3));
*(unsigned int*)0x008F3FDD = (unsigned int)NewReward3;
}
else
{
MessageBox(NULL,"wz_zm.dll failed to load.","Error",MB_OK);
::ExitProcess(0);
}

}

bool APIENTRY DllMain(HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
Init();
break;
}
return true;
}

Спасибо :
SmallHabit

Похожие темы (5)

Сообщений: 37
Просмотров: 22933

Сообщений: 127
Просмотров: 40406

Сообщений: 32
Просмотров: 13875