82.网游逆向分析与插件开发-背包的获取-装备栏数据与算法的C++还原

内容参考于:易道云信息技术研究院VIP课

上一个内容:装备栏数据结构的逆向分析-CSDN博客

码云地址(ui显示角色数据 分支):https://gitee.com/dye_your_fingers/sro_-ex.git

码云版本号:ba1c13df690ff86842b0f6077c1723d4634b2fd1

代码下载地址,在 SRO_EX 目录下,文件名为:SRO_Ex-装备栏数据与算法的C++还原.zip

链接:https://pan.baidu.com/s/1W-JpUcGOWbSJmMdmtMzYZg

提取码:q9n5

--来自百度网盘超级会员V4的分享

HOOK引擎,文件名为:黑兔sdk.zip

链接:https://pan.baidu.com/s/1IB-Zs6hi3yU8LC2f-8hIEw

提取码:78h8

--来自百度网盘超级会员V4的分享

以 自动化助手显示物品数据-CSDN博客 它的代码为基础进行修改

Pack.cpp文件的修改,新加GetEquipBack函数、_GetEquipPack变量初始化

#include "pch.h"
#include "Pack.h"

Pack::PROC Pack::_GetPackPack{};
Pack::PROC Pack::_GetEquipPack{};

PBackPack Pack::GetPackBack()
{
    return (PBackPack)(this->*_GetPackPack)();
}

PEquipPack Pack::GetEquipBack()
{
    return (PEquipPack)(this->*_GetEquipPack)();
}

Pack.h文件的修改,新加 _GetEquipPack变量、GetEquipBack函数

#pragma once
#include"BackPack.h"
#include "EquipPack.h"

typedef class Pack
{
	typedef LPVOID(Pack::* PROC)();
public:
	static PROC _GetPackPack;
	static PROC _GetEquipPack;
public:
	PBackPack GetPackBack();
	PEquipPack GetEquipBack();
}*PPack;

GameBase.cpp文件的修改,修改了Init函数

#include "pch.h"
#include "GameBase.h"

GameBase* _pgamebase;

void GameBase::Init()
{
	unsigned* addrRead = (unsigned*)0x1256E3C;

	SRO_Res = (PRes)0x1036518;
	SRO_Control = (PControl)addrRead[0];
	addrRead = (unsigned*)0x1037D3C;
	SRO_Player = (PAIM)addrRead[0];
	
	InitClassProc(&Res::_ReadTitle, 0x9A46C0);
	InitClassProc(&Res::_ReadItemTitle, 0x9A4640);
	InitClassProc(&Control::_NormalNotice, 0x848580);
	InitClassProc(&Control::_NetNotice, 0x844E40);
	InitClassProc(&Control::_ChatNotice, 0x844E80);
	InitClassProc(&Control::_GetPPack, 0x866140);
	InitClassProc(&ITEM::_GetItemRes, 0x995800);
	InitClassProc(&Pack::_GetPackPack, 0x7722C0);
	InitClassProc(&Pack::_GetEquipPack, 0x772300);

}

void GameBase::InitClassProc(LPVOID proc_addr, unsigned value)
{
	unsigned* uWrite = (unsigned*)proc_addr;
	uWrite[0] = value;
}

GameBase::GameBase()
{
	_pgamebase = this;
	// Init();// 初始化机制,完成游戏与我们dll的对接
}

新加EquipPack.cpp文件

#include "pch.h"
#include "EquipPack.h"

PITEM EquipPack::GetItem(EquipType index)
{
    sizeof(ITEM);
    PITEM itemBase = (PITEM)((DWORD)this + 0x22D0);
    return &itemBase[(int)index];
}

新加EquipPack.h文件

#pragma once
#include "ITEM.h"

// 装备栏格子索引
enum class EquipType {
	Hat = 0,
	Jacket = 1,
	Showlder = 2,
	Hand = 3,
	Trousers = 4,
	Shoe = 5,
	Weapon = 6,
	WeaponEx = 7,
	Ol = 8,
	Earring = 9,
	NeckLace = 10,
	RingLeft = 11,
	RingRight = 12
};

typedef class EquipPack
{

	PITEM GetItem(EquipType index);
}*PEquipPack;

你可能感兴趣的:(c++,开发语言,网游逆向,游戏)