This commit is contained in:
parent
a06f53ffc1
commit
87aa13d231
112
test/dllmain.cpp
112
test/dllmain.cpp
|
|
@ -1,14 +1,8 @@
|
|||
// dllmain.cpp : 定义 DLL 应用程序的入口点。
|
||||
#include "pch.h"
|
||||
#include <iostream>
|
||||
#include <Windows.h>
|
||||
#include <string>
|
||||
//#include "函数块.h"
|
||||
|
||||
|
||||
int Nut头地址;
|
||||
int 属性头地址;
|
||||
int 可开始执行判断;
|
||||
|
||||
/*
|
||||
typedef int func(int a,class b);
|
||||
func* f = (func*)0x1127D60;
|
||||
|
|
@ -16,87 +10,48 @@ func* f = (func*)0x1127D60;
|
|||
|
||||
|
||||
|
||||
//获取EXE使用头 号位数据
|
||||
int GetExeNutWrtNum(int Pos)
|
||||
{
|
||||
int num = *(int*)(0x40079F + (Pos * 4));
|
||||
return num;
|
||||
}
|
||||
|
||||
//写EXE使用头 号位数据
|
||||
void SetExeNutWrtNum(int Pos , int num)
|
||||
{
|
||||
int *p = (int*)(0x40079F + (Pos * 4));
|
||||
*p = num;
|
||||
}
|
||||
|
||||
//获取Nut头 号位数据
|
||||
int GetNutArrNum(int Pos)
|
||||
{
|
||||
int num = *(int*)(Nut头地址 + (Pos * 8));
|
||||
return num;
|
||||
}
|
||||
|
||||
//写Nut头 号位数据
|
||||
void SetNutArrNum(int Pos, int num)
|
||||
{
|
||||
int* p = (int*)(Nut头地址 + (Pos * 8));
|
||||
*p = num;
|
||||
}
|
||||
|
||||
//读内存偏移地址
|
||||
int GetHook(int Addr , std::string 地址)
|
||||
{
|
||||
size_t pos = 地址.find("+");
|
||||
size_t size = 地址.size();
|
||||
int GetHookArr[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
|
||||
int i = 0;
|
||||
|
||||
while (pos != std::string::npos)
|
||||
{
|
||||
std::string x = 地址.substr(0, pos);
|
||||
GetHookArr[i] = stoi(x, 0, 16);
|
||||
i++;
|
||||
地址 = 地址.substr(pos + 1, size);
|
||||
pos = 地址.find("+");
|
||||
}
|
||||
|
||||
int num;
|
||||
num = *(int*)(Addr);
|
||||
|
||||
if (num != 0)
|
||||
{
|
||||
for (int z = 0; z < i; z++)
|
||||
{
|
||||
num = *(int*)(num + GetHookArr[z]);
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
typedef DWORD funa();
|
||||
funa* a = (funa*)0x1127EC0;
|
||||
|
||||
typedef DWORD testc;
|
||||
testc* tc = (testc*)0x1AEB6E4;
|
||||
|
||||
|
||||
typedef int(__fastcall* sendp)(DWORD thisc, int de, int a);
|
||||
sendp psendp = (sendp)0x1127D60;
|
||||
|
||||
|
||||
void testcall()
|
||||
{
|
||||
psendp(*tc, 0, 0x2D);
|
||||
a();
|
||||
//_SendpacksType(*_SendClass, 0, 0x2D);
|
||||
//_SendPacks();
|
||||
/*
|
||||
_SendpacksType(*_SendClass, 0, 38);
|
||||
_SendPacksByte(*_SendClass, 0, 1);
|
||||
_SendPacksByte(*_SendClass, 0, 0);
|
||||
_SendPacksWord(*_SendClass, 0, 1109);
|
||||
_SendPacksWord(*_SendClass, 0, 268);
|
||||
_SendPacksByte(*_SendClass, 0, 5);
|
||||
_SendPacksWord(*_SendClass, 0, 0);
|
||||
_SendPacksWord(*_SendClass, 0, 0);
|
||||
_SendPacks();
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
_SendpacksType(*_SendClass, 0, 17);
|
||||
_SendPacksByte(*_SendClass, 3, 1);
|
||||
_SendPacksWord(*_SendClass, 56, 1);
|
||||
_SendPacksDWord(*_SendClass, 0, 1);
|
||||
_SendPacksDWord(*_SendClass, 6, 1);
|
||||
_SendPacks();
|
||||
*/
|
||||
|
||||
_SendpacksType(*_SendClass, 0, 0x3);
|
||||
_SendPacks();
|
||||
}
|
||||
|
||||
|
||||
void ThreadFun(void)
|
||||
{
|
||||
// 下方写全局变量
|
||||
static int Nut头地址;
|
||||
static int 属性头地址;
|
||||
static int 可开始执行判断;
|
||||
|
||||
while (true)
|
||||
{
|
||||
Sleep(500);
|
||||
|
|
@ -111,13 +66,12 @@ void ThreadFun(void)
|
|||
if (GetExeNutWrtNum(61) != 0 && Nut头地址 == 0)Nut头地址 = GetExeNutWrtNum(61);
|
||||
//if (GetExeNutWrtNum(61 != 0))属性头地址 = GetExeNutWrtNum(61);
|
||||
|
||||
//std::cout << GetExeNutWrtNum(0) << std::endl;;
|
||||
if (GetExeNutWrtNum(0) == 666)
|
||||
{
|
||||
std::cout << u8"写成功" << std::endl;;
|
||||
testcall();
|
||||
SetExeNutWrtNum(0, 0);
|
||||
SetNutArrNum(20, 0);
|
||||
SetNutArrNum(Nut头地址 , 20, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,3 +3,5 @@
|
|||
#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容
|
||||
// Windows 头文件
|
||||
#include <windows.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
|
|
|||
44
test/pch.h
44
test/pch.h
|
|
@ -10,4 +10,48 @@
|
|||
// 添加要在此处预编译的标头
|
||||
#include "framework.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//获取EXE使用头 号位数据
|
||||
int GetExeNutWrtNum(int Pos);
|
||||
|
||||
//写EXE使用头 号位数据
|
||||
void SetExeNutWrtNum(int Pos, int num);
|
||||
|
||||
//获取Nut头 号位数据
|
||||
int GetNutArrNum(int Nut头地址, int Pos);
|
||||
|
||||
//写Nut头 号位数据
|
||||
void SetNutArrNum(int Nut头地址, int Pos, int num);
|
||||
|
||||
//读内存偏移地址
|
||||
int GetHook(int Addr, std::string 地址);
|
||||
|
||||
|
||||
//发包函数 地址
|
||||
typedef DWORD SendPacks();
|
||||
static SendPacks* _SendPacks = (SendPacks*)0x1127EC0;
|
||||
|
||||
//发包Class this地址
|
||||
typedef DWORD SendClass;
|
||||
static SendClass* _SendClass = (SendClass*)0x1AEB6E4;
|
||||
|
||||
//发包类型 地址
|
||||
typedef int(__fastcall* SendPacksType)(DWORD thisc, int Seat, int Parm);
|
||||
static SendPacksType _SendpacksType = (SendPacksType)0x1127D60;
|
||||
|
||||
//发包参数 BYTE
|
||||
typedef int(__fastcall* SendPacksByte)(DWORD thisc, int Seat, int Parm);
|
||||
static SendPacksByte _SendPacksByte = (SendPacksByte)0x1128550;
|
||||
|
||||
//发包参数 WORD
|
||||
typedef int(__fastcall* SendPacksWORD)(DWORD thisc, int Seat, int Parm);
|
||||
static SendPacksWORD _SendPacksWord = (SendPacksWORD)0x1128580;
|
||||
|
||||
//发包参数 DWORD
|
||||
typedef int(__fastcall* SendPacksDWORD)(DWORD thisc, int Seat, int Parm);
|
||||
static SendPacksDWORD _SendPacksDWord = (SendPacksDWORD)0x11285B0;
|
||||
|
||||
#endif //PCH_H
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@
|
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="函数块.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
|
|||
|
|
@ -29,5 +29,8 @@
|
|||
<ClCompile Include="pch.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="函数块.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
#include "pch.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//鳳龰EXE妏蚚芛 瘍弇杅擂
|
||||
int GetExeNutWrtNum(int Pos)
|
||||
{
|
||||
int num = *(int*)(0x40079F + (Pos * 4));
|
||||
return num;
|
||||
}
|
||||
|
||||
//迡EXE妏蚚芛 瘍弇杅擂
|
||||
void SetExeNutWrtNum(int Pos, int num)
|
||||
{
|
||||
int* p = (int*)(0x40079F + (Pos * 4));
|
||||
*p = num;
|
||||
}
|
||||
|
||||
//鳳龰Nut芛 瘍弇杅擂
|
||||
int GetNutArrNum(int Nut芛華硊, int Pos )
|
||||
{
|
||||
int num = *(int*)(Nut芛華硊 + (Pos * 8));
|
||||
return num;
|
||||
}
|
||||
|
||||
//迡Nut芛 瘍弇杅擂
|
||||
void SetNutArrNum(int Nut芛華硊, int Pos, int num)
|
||||
{
|
||||
int* p = (int*)(Nut芛華硊 + (Pos * 8));
|
||||
*p = num;
|
||||
}
|
||||
|
||||
//黍囀湔⑴痄華硊
|
||||
int GetHook(int Addr, std::string 華硊)
|
||||
{
|
||||
size_t pos = 華硊.find("+");
|
||||
size_t size = 華硊.size();
|
||||
int GetHookArr[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
|
||||
int i = 0;
|
||||
|
||||
while (pos != std::string::npos)
|
||||
{
|
||||
std::string x = 華硊.substr(0, pos);
|
||||
GetHookArr[i] = stoi(x, 0, 16);
|
||||
i++;
|
||||
華硊 = 華硊.substr(pos + 1, size);
|
||||
pos = 華硊.find("+");
|
||||
}
|
||||
|
||||
int num;
|
||||
num = *(int*)(Addr);
|
||||
|
||||
if (num != 0)
|
||||
{
|
||||
for (int z = 0; z < i; z++)
|
||||
{
|
||||
num = *(int*)(num + GetHookArr[z]);
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
Loading…
Reference in New Issue