|
吾爱游客
发表于 2015-3-28 18:55
1、申 请 I D:LCatro
2、个人邮箱:lcatro@sina.cn
3、原创技术文章: 扫雷作弊器
在观测XP 版扫雷的内存状态看到下面这块内存
随意测试一下,内存数据有变化
经过测试可以知道,10 是场景的边界,8F 是地雷,41 是旁边有1 个地雷提示,42 代表有2 个,以此类推
于是写了一段代码去读出这些数据:
#include <stdio.h>
#include "ui_window.h"
#include "io_memory.h"
static void output_flag(unsigned char in_flag_num) {
switch (in_flag_num) {
case 0x10:
printf("| ");
break;
case 0x40:
printf(" ");
break;
case 0x41:
printf("1 ");
break;
case 0x42:
printf("2 ");
break;
case 0x43:
printf("3 ");
break;
case 0x44:
printf("4 ");
break;
case 0x45:
printf("5 ");
break;
case 0x0F:
printf("_ ");
break;
case 0x8E:
printf("+ ");
break;
case 0x8F:
printf("* ");
break;
}
}
void output_print(mine_buffer in_buffer) {
if (in_buffer.line && in_buffer.comulate) {
printf("\n\n\n\n");
unsigned char* output_data_point=in_buffer.data_buffer;
for (unsigned long line=0;line<in_buffer.line;++line) {
for (unsigned long comulate=0;comulate<in_buffer.comulate;++comulate,++output_data_point)
output_flag(*output_data_point);
printf("\n");
}
} else
printf("ERR!");
}
void main(void) {
memory mine_memory=create_memory_by_form_name(WINDOW_TITEL);
unsigned char* mine_buffer_data=(unsigned char*)malloc(MINE_MAP_SIZE);
if (mine_memory!=INVALID_MEMORY && mine_buffer_data!=INVALID_MEMORY) {
memset(mine_buffer_data,0,MINE_MAP_SIZE);
mine_buffer new_cheat;
new_cheat.line=MINE_MAP_LINE;
new_cheat.comulate=MINE_MAP_COMULATE;
new_cheat.data_buffer=mine_buffer_data;
get_buffer_data(mine_memory,mine_buffer_data);
output_print(new_cheat);
free(mine_buffer_data);
destory_memory(mine_memory);
} else
printf("no mine game!");
}
库里面还有些其它代码就省略了,下面是程序运行结果
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|