当前位置: 首页 > news >正文

攻防世界RE-reverse_re3

打开main函数:

一步一步来,先看sub_11B4():

dword_202AB0=0

sub_940()中:

这里函数较多,不过已经可以知道大概思路了,即输入的内容能够让函数跑到以下位置的,就是flag:

然后分析while函数,100,119,27,97,对应的是w,a,s,d这几个常用的游戏方向键,再加上word_202020的值,大概知道了这是一个迷宫题,那就好办了,提取word_202020的数据,从迷宫的判断函数可以知道,迷宫是15*15大小的,让ai整理一下,得到迷宫。

import re# 读取文件
with open("export_results.txt", "r") as file:content = file.read()# 使用正则表达式提取所有数字
numbers = re.findall(r"\b\d+\b", content)  # 匹配整数
numbers = [int(num) for num in numbers]   # 转为整数列表
j=0
for i in range(0,len(numbers),15):print(numbers[i:i+15])j+=1if j%15==0:print()
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 1, 1, 1, 1, 0, 3, 1, 1, 0, 0, 0, 0, 0, 0]
[1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]
[1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]
[1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0]
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0]
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0]
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0]
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]
[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0]

有三个迷宫,3为角色位置,4为出口,1为可走道路。

编写代码走迷宫:

import numpy as np
from collections import deque# 定义迷宫 (1=路, 0=墙, 3=玩家, 4=出口)
maze = np.array([[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],[1, 1, 1, 1, 1, 0, 3, 1, 1, 0, 0, 0, 0, 0, 0],[1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],[1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],[1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0],[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0],[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],[1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0],[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
])# 初始玩家位置 (3的位置)
player_pos = np.argwhere(maze == 3)[0]
exit_pos = np.argwhere(maze == 4)[0]# 方向映射 (WASD)
directions = {'w': (-1, 0),  # 上's': (1, 0),  # 下'a': (0, -1),  # 左'd': (0, 1),  # 右
}# BFS 计算最短路径
def find_shortest_path(maze, start, end):queue = deque([(start, [])])visited = set()visited.add(tuple(start))while queue:(x, y), path = queue.popleft()if (x, y) == tuple(end):return pathfor dir_name, (dx, dy) in directions.items():nx, ny = x + dx, y + dyif 0 <= nx < 15 and 0 <= ny < 15 and maze[nx][ny] != 0 and (nx, ny) not in visited:visited.add((nx, ny))queue.append(((nx, ny), path + [dir_name]))return None  # 无解# 获取最短路径
shortest_path = find_shortest_path(maze, player_pos, exit_pos)
print("最短路径:", ''.join(shortest_path) if shortest_path else "无解")# 游戏主循环
while True:# 打印迷宫for row in maze:print(' '.join(map(str, row)))print("当前路径:", ''.join(shortest_path) if shortest_path else "无解")# 玩家移动move = input("输入 WASD 移动 (q 退出): ").lower()if move == 'q':breakif move not in directions:print("无效输入!")continuedx, dy = directions[move]new_x, new_y = player_pos[0] + dx, player_pos[1] + dy# 检查移动是否合法if 0 <= new_x < 15 and 0 <= new_y < 15 and maze[new_x][new_y] != 0:maze[player_pos[0]][player_pos[1]] = 1  # 旧位置恢复为路player_pos = [new_x, new_y]maze[new_x][new_y] = 3  # 新位置设为玩家# 检查是否到达出口if (new_x, new_y) == tuple(exit_pos):print("恭喜!你找到了出口!")breakelse:print("不能往那里走!")

1:ddsssddddsssdss

2:dddddsssddddsssaassssddds

3,ddssddwddssssssdddssssdddss

整合一下:

ddsssddddsssdssdddddsssddddsssaassssdddsddssddwddssssssdddssssdddss

from hashlib import md5data = 'ddsssddddsssdssdddddsssddddsssaassssdddsddssddwddssssssdddssssdddss'
a=md5(data.encode("utf-8")).hexdigest()
print(a)

 flag:flag{aeea66fcac7fa80ed8f79f38ad5bb953}

相关文章:

  • 深入解析 BlockingQueue:并发编程面试中的高频考点!
  • vue3 浮点数计算
  • 架空线路智能云台监控系统介绍
  • ODBC简介
  • UNet 改进(28):结合Coordinate Attention+FPN架构
  • 字节开源 Dolphin: 通过异构锚点提示进行文档图像解析
  • 如何在 Windows 10 PC 上获取 iPhone短信
  • Ubuntu的shell脚本
  • 按键状态机
  • 深度学习算法模型概念整理----模型量化、校准、模型蒸馏、算子、算子融合
  • 第17章 发布和部署应用程序
  • ArcGIS Pro 3.4 二次开发 - 几何
  • Powershell实现服务守护进程功能(服务意外终止则重启)
  • LSTM模型进行天气预测Pytorch版本
  • 【EdgeYOLO】《EdgeYOLO: An Edge-Real-Time Object Detector》
  • Kubernetes Service 类型与实例详解
  • 阿里云国际版注册邮箱格式详解
  • MyBatis 拦截器的应用场景及实践
  • 矩阵链乘法问题
  • Vue:axios(POST请求)
  • 什么网站做执法仪/搜索引擎有哪几个网站
  • 怎么给我 的网站做关键词/市场调研报告模板ppt
  • 网站的pdf目录怎么做的/天津网站建设技术外包
  • 营销网站推荐/网站优化的意义
  • wordpress 正在执行例行维护/app关键词优化
  • 盐城微信公众平台网站制作/全网营销策划公司