This commit is contained in:
Yosin-Lenheart
2022-02-07 03:31:00 +08:00
parent a06f53ffc1
commit 87aa13d231
6 changed files with 147 additions and 79 deletions

View File

@@ -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);
}
}
}