查看: 972|回复: 0

香肠派对绘制CPP

[复制链接]
发表于 2021-1-26 11:50 | 显示全部楼层 |阅读模式
非法程序、 2021-1-26 11:50 972 0 显示全部楼层
香肠派对绘制CPP
绘制插件自己找数据都对也可以套其他模板
#include "MemoryTools.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include


long int jzAddr = (long int)malloc(8 * 10);
long int *posAddr = (long int *)malloc(8 * 100);
float matrix[50];
int zgs = 0;
int sock_fd;
int len;
float px = 2259.0 / 2.0;
float py = 1080.0 / 2.0;
void getm();
void getjz();
void func();
struct sockaddr_in addr_serv;

//获取矩阵地址
void getm() {


MemorySearch("1", TYPE_DWORD);
MemoryOffset("100000", 0x12C, TYPE_FLOAT);
int count = GetResultCount();
printf("共偏移%d个数据\n", count);
if (count == 0) {
puts("矩阵地址获取失败");
exit(1);
}
PMAPS temp = GetResults();
jzAddr = temp->addr-68;
printf("地址: 0x%lX\n", jzAddr);
ClearResults();
free(temp);
}




//获取数值
void getjz() {
puts("持续获取矩阵数据");
while(true) {
MemorySearch("1.25", TYPE_FLOAT);
MemoryOffset("1.5", 4, TYPE_FLOAT);
zgs = GetResultCount();
PMAPS res = GetResults();
for (int i = 0; i < zgs; i++) {
posAddr[i] = res->addr;
res = res->next;
}
if (zgs == 0){
puts("获取地址失败");
exit(1);
}
ClearResults();
free(res);
sleep(3);
}
}

void checkrun(){
char recv_buf[20];
puts("持续检测运行");
if (recvfrom(sock_fd, recv_buf, sizeof(recv_buf), 0, (struct sockaddr *)&addr_serv, (socklen_t *)&len) >= 0) {
puts("结束运行");
close(sock_fd);
exit(1);
}
//puts("持续检测运行");
}


int main(int argc, char *argv[]) {
char *bm = (char *)"com.sofunny.Sausage";
initXMemoryTools(argv, bm, MODE_NO_ROOT);

float fx = 2280;
float fy = 1080.0;
if (argc == 3) {
fx = atof(argv[2]);
fy = atof(argv[1]);
}
SetSearchRange(A_ANONMYOUS); //设置搜索内存范围
puts("开始搜索数据");
//获取矩阵地址
getm();
//使用线程获取矩阵数值
std::thread t(getjz);
//检测游戏运行
std::thread t2(checkrun);
//开始获取相关信息
int rwgs = 0;
int cs = 1;
while(true) {
char aaa[2048] = "";
char b[164];

for (int i = 0; i < 16; i++) {
matrix[i] = GetAddressValue_FLOAT(jzAddr + i * 4);
}

for (int i = 0; i < zgs; i++) {
float px = fx / 2.0;
float py = fy / 2.0;

// 血量
float hp = GetAddressValue_FLOAT(posAddr[i] - 0xC8;
//队伍编号
float db = GetAddressValue_DWORD(posAddr[i] - 0x248);

// 对象坐标
float obj_x = GetAddressValue_FLOAT(posAddr[i] - 0x1F4);
float obj_y = GetAddressValue_FLOAT(posAddr[i] - 0x1EC);
float obj_z = GetAddressValue_FLOAT(posAddr[i] - 0x1F0);



// 去除队友和自身的坐标
float isr = GetAddressValue_FLOAT(posAddr[i] - 1E8);
if (isr != 0.0){
continue;
}

// 距离
// 距离
float camear_z = matrix[3] * obj_x + matrix[7] * obj_z + matrix[11] * obj_y + matrix[15];//相机Z
double pfg = camear_z/1.5;


// 矩阵
float r_x = px + (matrix[0] * obj_x + matrix[4] * obj_z + matrix[8] * obj_y + matrix[12]) / camear_z * px;//视角高

float r_y = py - (matrix[1] * obj_x + matrix[5] * (obj_z +2.2) + matrix[9] * obj_y + matrix[13]) / camear_z * py;//;视角宽

float r_w = py - (matrix[1] * obj_x + matrix[5] * (obj_z + 4.4) + matrix[9] * obj_y + matrix[13]) / camear_z * py;
sprintf(b, "%f,%f,%f,%f,%.1f,%.1f%.1f;\n",
r_x - (r_y - r_w) / 4 - 80, // x
r_y, // y
(r_y - r_w) / 2, // w
r_y - r_w, // h
pfg - 3,
hp // 血量
db //队编


);
strcat(aaa, b);
rwgs += 1;

}
rwgs = 0;
int fd = open("/sdcard/b.log", O_WRONLY);
write(fd, aaa, sizeof(aaa));
close(fd);
}
/*
int fd = open("/sdcard/b.log", O_WRONLY);
write(fd, aaa, sizeof(aaa));
close(fd);
*/
usleep(1);
//sleep(0.999);
}

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则 返回列表 发新帖

快速回复 返回顶部 返回列表