Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: FixItemLimit desde tu DLL para main 1.04D  (Visto 995 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline hovelisco on: April 25, 2017, 09:17:54 PM

  • 0 puntos por ventas
  • *
  • Rank: Dedicado
  • Posts: 50
  • Gracias recibida: 782
  • ve
buenas tardes querida omunidad en esta ocacion vengo a compartirle el fix item limit para main !.04D
Archivo FixLimitItem.cpp
Code: [Select]
#include "stdafx.h"
#include "FixLimitItem.h"
#include "ToolKit.h"

char * ItemDir = "Data\\Item\\";
char * ItemFolder = "Item\\";
char * PlayerDir = "Data\\Player\\";
char * PlayerFolder = "Player\\";
char Item[15];
char Sets[30];
int i;
int z;

void InitModel(int ItemID, char* ModelName, char* Folder, char* Form)
{
_asm
{
PUSH - 1
PUSH ModelName
PUSH Form
PUSH ItemID
mov eax, BMDModelLoad
CALL eax

PUSH 1
PUSH 0x2600
PUSH 0x2901
PUSH Folder
PUSH ItemID
mov eax, OpenTexture
CALL eax
}
}

void InitSets(int ItemID, char* ModelName, char* Folder, char* Form)
{
_asm
{
PUSH - 1
PUSH ModelName
PUSH Form
PUSH ItemID
mov eax, BMDModelLoad
CALL eax

PUSH 1
PUSH 0x2600
PUSH 0x2901
PUSH Folder
PUSH ItemID
mov eax, OpenTexture
CALL eax
}
}

__declspec(naked) void PatchNewModel()
{
// Load Items Models
for (i = 9; i < 511; i++)
{

if (i > 36)//Swords
{
sprintf_s(Item, "Sword%d", i + 1);
InitModel(ITEM2(0, i), Item, ItemFolder, ItemDir);
}
if (i > 9)//Axes
{
sprintf_s(Item, "Axe%d", i + 1);
InitModel(ITEM2(1, i), Item, ItemFolder, ItemDir);
}
if (i > 19)//Maces
{
sprintf_s(Item, "Mace%d", i + 1);
InitModel(ITEM2(2, i), Item, ItemFolder, ItemDir);
}
if (i > 12)//Spears
{
sprintf_s(Item, "Spear%d", i + 1);
InitModel(ITEM2(3, i), Item, ItemFolder, ItemDir);
}
if (i > 25)//Bow
{
sprintf_s(Item, "Bow%d", i + 1);
InitModel(ITEM2(4, i), Item, ItemFolder, ItemDir);
}
if (i > 35)//Staffs
{
sprintf_s(Item, "Staff%d", i + 1);
InitModel(ITEM2(5, i), Item, ItemFolder, ItemDir);
}
if (i > 22)//Shields
{
sprintf_s(Item, "Shield%d", i + 1);
InitModel(ITEM2(6, i), Item, ItemFolder, ItemDir);
}

}
_asm
{
PUSH - 1
PUSH 0x00D2F7C4
PUSH 0x00D2F7CC
PUSH 0x20B2
mov eax, BMDModelLoad
CALL eax
ADD ESP, 0x10
mov eax, ReturnOffset
JMP eax
}
}

__declspec(naked) void PatchNewSets()
{
for (i = 5; i < 512; i++)
{
if(i > 73)//helms
{
sprintf_s(Sets, "HelmMale%d", i+1);
InitSets(LOAD_ITEM(7, i), Sets, PlayerFolder, PlayerDir);
}
if(i > 73)//armors
{
sprintf_s(Sets, "ArmorMale%d", i+1);
InitSets(LOAD_ITEM(8, i), Sets, PlayerFolder, PlayerDir);
}
if(i > 72)//pants (fix Phoenix soul pants)
{
sprintf_s(Sets, "PantMale%d", i+1);
InitSets(LOAD_ITEM(9, i), Sets, PlayerFolder, PlayerDir);
}
if(i > 73)//gloves
{
sprintf_s(Sets, "GloveMale%d", i+1);
InitSets(LOAD_ITEM(10, i), Sets, PlayerFolder, PlayerDir);
}
if(i > 73)//boots
{
sprintf_s(Sets, "BootMale%d", i+1);
InitSets(LOAD_ITEM(11, i), Sets, PlayerFolder, PlayerDir);
}
}
_asm
{
PUSH - 1
PUSH 0x00D2D790
PUSH 0x00D2D79C
PUSH 0x14DC
mov eax, BMDModelLoad
CALL eax
ADD ESP, 0x10
mov eax, ReturnSetOffset
JMP eax
}
}

void InitItems()
{
//Patch new model in game
PatchJMP g_ModelPatch;
ToolKit.SetNop(LoadModel, 25);
g_ModelPatch.Command = 0xE9;
g_ModelPatch.Pointer = (DWORD)&PatchNewModel;
memcpy((int*)LoadModel, &g_ModelPatch, sizeof(g_ModelPatch));
ToolKit.HookThis((DWORD)&PatchNewModel, LoadModel);
}

void InitSets()
{
//Patch new sets in game
PatchJMP g_SetsPatch;
ToolKit.SetNop(LoadSetModel, 25);
g_SetsPatch.Command = 0xE9;
g_SetsPatch.Pointer = (DWORD)&PatchNewSets;
memcpy((int*)LoadSetModel, &g_SetsPatch, sizeof(g_SetsPatch));
ToolKit.HookThis((DWORD)&PatchNewSets, LoadSetModel);
}
Archivo FixLimitItem.h
Code: [Select]
#ifndef _FixLimitItem_H
#define _FixLimitItem_H

#include "Stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
#include <math.h>
#include <cmath>
#include <tlhelp32.h>
#include <mmsystem.h>
#include <windows.h>
#include <iostream>
#include <fstream>
#include <process.h>
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"advapi32.lib")
#pragma comment(lib,"gdi32.lib")
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"glu32.lib")
#pragma comment(lib,"glaux.lib")

#define ItemAdder 1171
#define ITEM(x, y) ((x * 512) + y)
#define ITEM2(x, y) ((x * 512) + y + ItemAdder)
#define LOAD_ITEM(x, y) ((x) * 512 + (y) + ItemAdder)
#define LoadModel 0x006194DD
#define LoadSetModel 0x00615DB4
#define BMDModelLoad 0x00614D10
#define ReturnOffset 0x006194F6
#define ReturnSetOffset 0x00615DE6
#define OpenTexture 0x00614710
struct PatchJMP
{
BYTE Command;
DWORD Pointer;
};

void InitModel(int ItemID, char* ModelName, char* Folder, char* Form);
void InitSets(int ItemID, char* ModelName, char* Folder, char* Form);
void PatchNewModel();
void PatchNewSets();
void InitItems();
void InitSets();
 
#endif
llaman el archivo con un #include "FixLimitItem.h" y cargar la funcion
Code: [Select]
	InitSets();
InitItems();

Crediitos:
Hovelisco por aportarlos
ikenylee por estructurarlos
Lo que sea
   

Gracias:


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
1021 Views
Last post September 19, 2017, 12:00:35 PM
by Tauro14
0 Replies
1087 Views
Last post July 11, 2017, 08:33:35 AM
by Dann
3 Replies
586 Views
Last post July 30, 2017, 03:00:45 AM
by rodrigovila22
37 Replies
4635 Views
Last post October 29, 2019, 03:03:03 PM
by ZabiinoOo
8 Replies
611 Views
Last post November 10, 2018, 03:56:20 PM
by Cloud