Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

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

0 Miembros and 1 Guest are viewing this topic.

Offline hovelisco Posteado: April 25, 2017, 10:17:54 PM

  • 0 puntos por ventas
  • *
  • Rank: Dedicado
  • Posts: 41
  • Gracias recibida: 1389
  • 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
   

Offline lily coliins #1 Posteado: August 07, 2022, 03:49:29 AM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 1
  • Gracias recibida: 0
  • us
Thanks for your post! Great article I've ever read, amazing!


Offline danielusa #2 Posteado: November 02, 2022, 02:58:20 AM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 3
  • Gracias recibida: 0
  • us
I am really happy to know this site. it gives me more useful knowledge. I will come back getting over it and hopefully have more good information.


Offline Seby1 #3 Posteado: November 27, 2022, 08:12:39 AM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 7
  • Gracias recibida: 0
  • ro
Thanks for sharing! Your blog seems useful to many people, so keep it up! As I see, you have many followers here, so it would be nice if I could share my blog. We promote the best 5x5 grow tent, so read more and find more information about it! Grow plants safely and fastly with just 1 click!!!


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
5 Replies
2129 Views
Last post September 19, 2017, 01:00:35 PM
by Tauro14
1 Replies
3254 Views
Last post January 17, 2020, 09:30:37 PM
by PRONEXUS
3 Replies
2619 Views
Last post July 30, 2017, 04:00:45 AM
by rodrigovila22
7 Replies
2525 Views
Last post November 10, 2018, 03:56:20 PM
by Cloud
1 Replies
833 Views
Last post May 15, 2019, 08:55:53 AM
by implotion