Jump to content
News Ticker
  • Bem vindos a Web Cheats
  • News ticker sample

    [Hook] Adicionar novos Trajes 7.59


    Recommended Posts

    Fala galera blz ?

     

    GuGaRMP aqui, como prometido para alguns estarei postando o hook atualizado para trajes na 7.59.

     

    enum Costumes
    {
    	Anubis = 0x23
    };
    
    enum Bones
    {
    	Masculino,
    	Feminino
    };

     

    //Ajuste para novos ID (4151 ~ 4250)
    WYD.SetValue<DWORD>(0x4DCA09 + 1, 4250);
    
    WYD.SetHook(eHookType::JMP, 0x519D60, WYD.GetPtr(&HookNaked::NKD_FixIndex));
    WYD.SetHook(eHookType::JMP, 0x4DE210, WYD.GetPtr(&HookNaked::NKD_CorrectBones), 1);
    WYD.SetHook(eHookType::JMP, 0x4CFDAF, WYD.GetPtr(&HookNaked::NKD_LoadFiles), 4);

     

    __declspec(naked) void HookNaked::NKD_LoadFiles()
    {
    
    	__asm
    	{
    		CMP DWORD PTR SS : [EBP + 0x8] , 0x21
    		JNZ lblContinue
    		PUSH 0x4CFDB9
    		RETN 4
    
    
    		lblContinue :
    		MOV EAX, DWORD PTR SS : [EBP + 0x10]
    		PUSH EAX // Mesh (MSH)
    		MOV ECX, DWORD PTR SS : [EBP + 0xC]
    		PUSH ECX // Texture (WYT)
    		MOV EDX, DWORD PTR SS : [EBP + 0x8]
    		PUSH EDX // Id
    		CALL CallBack::HKD_LoadFile
    		PUSH 0x4CFEB6
    		RETN 4
    	}
    }
    
    __declspec (naked) void HookNaked::NKD_CorrectBones()
    {
    	__asm
    	{
    		MOV EDX, DWORD PTR SS : [EBP - 0x350]
    		LEA EDX, DWORD PTR DS : [EDX + 0x5C]
    		PUSH EDX
    		MOV EAX, DWORD PTR SS : [EBP - 0x14]
    		PUSH EAX
    		CALL CallBack::HKD_CorrectBone
    		MOV EDX, DWORD PTR SS : [EBP - 0x350]
    		PUSH 0x004DE216
    		RETN 4
    	}
    }
    
    __declspec(naked) void HookNaked::NKD_FixIndex()
    {
    	__asm
    	{
    		CMP EAX, 0x1037
    		JNZ lblContinue
    		PUSH 0x519E05
    		RETN 4
    
    		lblContinue:
    
    			//Costume
    			LEA ECX, DWORD PTR SS : [EBP - 0x4]
    			PUSH ECX
    
    			//st Body
    			MOV EDX, DWORD PTR SS : [EBP - 0x18]
    			PUSH EDX
    
    			CALL CallBack::HKD_FixIndex
    			PUSH 0x519E36
    			RETN 4
    	}
    }

     

    void CallBack::HKD_FixIndex(DWORD* sTraje, int32_t* Costume)
    {
    	int ItemID = *(WORD*)((int)sTraje + 2656);
    	
    	switch (ItemID)
    	{
    	case 4200:
    	{
    		*Costume = Anubis;
    		break;
    	}
    
    	default:
    		break;
    	}
    }
    
    void CallBack::HKD_CorrectBone(int32_t index, int32_t* bone)
    {
    	switch (index)
    	{
    
    	case Anubis:
    		*bone = Feminino;
    		break;
    
    	default:
    		break;
    	}
    }
    
    void CallBack::HKD_LoadFile(int32_t index, char* textureName, char* meshName)
    {
    	auto loadCostume = [textureName, meshName](char* texture, char* msh1, char* msh2, char* msh3, char* msh4, char* msh5, char* msh6)
    	{
    		auto counter = reinterpret_cast<int32_t*>(0x616D18);
    
    		strcpy(textureName, texture);
    
    		switch (*counter)
    		{
    		case 1:
    			strcpy(meshName, msh1); *counter = 2;
    			break;
    		case 2:
    			strcpy(meshName, msh2); *counter = 3;
    			break;
    		case 3:
    			strcpy(meshName, msh3); *counter = 4;
    			break;
    		case 4:
    			strcpy(meshName, msh4); *counter = 5;
    			break;
    		case 5:
    			strcpy(meshName, msh5); *counter = 6;
    			break;
    		case 6:
    			strcpy(meshName, msh6); *counter = 1;
    			break;
    		}
    	};
    
    
    	switch (index)
    	{
    		case Anubis:
    			loadCostume("mesh\\ch0201103.wys",
    				"mesh\\ch0201103.msh",
    				"mesh\\ch0202103.msh",
    				"mesh\\ch0203103.msh",
    				"mesh\\ch0204103.msh",
    				"mesh\\ch0205103.msh",
    				"mesh\\ch0206103.msh");
    			break;
    
    	default:
    		break;
    	}
    }

     

    ObsI: Alguns trajes possuem efeitos, os mesmos ainda não foram ajustados.

    ObsII: O código apenas foi migrado da 7.56>7.59 então quem souber o autor do código antigo por favor me avise.

     

    Créditos:

    GuGaRMP

    @ϟ Sanji ϟ (Ajudou com alguns addr)

    • Like 4
    • Haha 4
    Link to post
    Share on other sites
    3 horas atrás, rpg2008 disse:

    Fala galera blz ?

     

    GuGaRMP aqui, como prometido para alguns estarei postando o hook atualizado para trajes na 7.59.

     

    
    enum Costumes
    {
    	Anubis = 0x23
    };
    
    enum Bones
    {
    	Masculino,
    	Feminino
    };

     

    
    //Ajuste para novos ID (4151 ~ 4250)
    WYD.SetValue<DWORD>(0x4DCA09 + 1, 4250);
    
    WYD.SetHook(eHookType::JMP, 0x519D60, WYD.GetPtr(&HookNaked::NKD_FixIndex));
    WYD.SetHook(eHookType::JMP, 0x4DE210, WYD.GetPtr(&HookNaked::NKD_CorrectBones), 1);
    WYD.SetHook(eHookType::JMP, 0x4CFDAF, WYD.GetPtr(&HookNaked::NKD_LoadFiles), 4);

     

    
    __declspec(naked) void HookNaked::NKD_LoadFiles()
    {
    
    	__asm
    	{
    		CMP DWORD PTR SS : [EBP + 0x8] , 0x21
    		JNZ lblContinue
    		PUSH 0x4CFDB9
    		RETN 4
    
    
    		lblContinue :
    		MOV EAX, DWORD PTR SS : [EBP + 0x10]
    		PUSH EAX // Mesh (MSH)
    		MOV ECX, DWORD PTR SS : [EBP + 0xC]
    		PUSH ECX // Texture (WYT)
    		MOV EDX, DWORD PTR SS : [EBP + 0x8]
    		PUSH EDX // Id
    		CALL CallBack::HKD_LoadFile
    		PUSH 0x4CFEB6
    		RETN 4
    	}
    }
    
    __declspec (naked) void HookNaked::NKD_CorrectBones()
    {
    	__asm
    	{
    		MOV EDX, DWORD PTR SS : [EBP - 0x350]
    		LEA EDX, DWORD PTR DS : [EDX + 0x5C]
    		PUSH EDX
    		MOV EAX, DWORD PTR SS : [EBP - 0x14]
    		PUSH EAX
    		CALL CallBack::HKD_CorrectBone
    		MOV EDX, DWORD PTR SS : [EBP - 0x350]
    		PUSH 0x004DE216
    		RETN 4
    	}
    }
    
    __declspec(naked) void HookNaked::NKD_FixIndex()
    {
    	__asm
    	{
    		CMP EAX, 0x1037
    		JNZ lblContinue
    		PUSH 0x519E05
    		RETN 4
    
    		lblContinue:
    
    			//Costume
    			LEA ECX, DWORD PTR SS : [EBP - 0x4]
    			PUSH ECX
    
    			//st Body
    			MOV EDX, DWORD PTR SS : [EBP - 0x18]
    			PUSH EDX
    
    			CALL CallBack::HKD_FixIndex
    			PUSH 0x519E36
    			RETN 4
    	}
    }

     

    
    void CallBack::HKD_FixIndex(DWORD* sTraje, int32_t* Costume)
    {
    	int ItemID = *(WORD*)((int)sTraje + 2656);
    	
    	switch (ItemID)
    	{
    	case 4200:
    	{
    		*Costume = Anubis;
    		break;
    	}
    
    	default:
    		break;
    	}
    }
    
    void CallBack::HKD_CorrectBone(int32_t index, int32_t* bone)
    {
    	switch (index)
    	{
    
    	case Anubis:
    		*bone = Feminino;
    		break;
    
    	default:
    		break;
    	}
    }
    
    void CallBack::HKD_LoadFile(int32_t index, char* textureName, char* meshName)
    {
    	auto loadCostume = [textureName, meshName](char* texture, char* msh1, char* msh2, char* msh3, char* msh4, char* msh5, char* msh6)
    	{
    		auto counter = reinterpret_cast<int32_t*>(0x616D18);
    
    		strcpy(textureName, texture);
    
    		switch (*counter)
    		{
    		case 1:
    			strcpy(meshName, msh1); *counter = 2;
    			break;
    		case 2:
    			strcpy(meshName, msh2); *counter = 3;
    			break;
    		case 3:
    			strcpy(meshName, msh3); *counter = 4;
    			break;
    		case 4:
    			strcpy(meshName, msh4); *counter = 5;
    			break;
    		case 5:
    			strcpy(meshName, msh5); *counter = 6;
    			break;
    		case 6:
    			strcpy(meshName, msh6); *counter = 1;
    			break;
    		}
    	};
    
    
    	switch (index)
    	{
    		case Anubis:
    			loadCostume("mesh\\ch0201103.wys",
    				"mesh\\ch0201103.msh",
    				"mesh\\ch0202103.msh",
    				"mesh\\ch0203103.msh",
    				"mesh\\ch0204103.msh",
    				"mesh\\ch0205103.msh",
    				"mesh\\ch0206103.msh");
    			break;
    
    	default:
    		break;
    	}
    }

     

    ObsI: Alguns trajes possuem efeitos, os mesmos ainda não foram ajustados.

    ObsII: O código apenas foi migrado da 7.56>7.59 então quem souber o autor do código antigo por favor me avise.

     

    Créditos:

    GuGaRMP

    @ϟ Sanji ϟ (Ajudou com alguns addr)

    Top obrigado por compartilhar ! 

    Edited by Destiny Of Kersef
    • Like 1
    Link to post
    Share on other sites
    3 horas atrás, rpg2008 disse:

    muito obrigado por ter liberado !
    a muito tempo eu tava procurando
    se possivel teria como criar um tutorial de como achou os hook 
    pois eu queria tentar fazer algo parecido pros trajes de montaria mais eu nao por onde começar 

     

    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • Create New...