Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夜猫逐梦
MyOpen
提交
d082be9c
M
MyOpen
项目概览
夜猫逐梦
/
MyOpen
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
MyOpen
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d082be9c
编写于
3月 19, 2024
作者:
K
Knine
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【Frida】 06_分析扫雷游戏的数据,显示地雷位置
【Frida】 07_让系统重新绘制指定窗口
上级
990b0012
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
145 addition
and
5 deletion
+145
-5
course/frida/05_读取棋盘数据/index.ts
course/frida/05_读取棋盘数据/index.ts
+4
-4
course/frida/06_分析扫雷游戏的数据,显示地雷位置/index.ts
course/frida/06_分析扫雷游戏的数据,显示地雷位置/index.ts
+49
-0
course/frida/07_让系统重新绘制指定窗口/index.ts
course/frida/07_让系统重新绘制指定窗口/index.ts
+63
-0
course/frida/package.json
course/frida/package.json
+3
-1
course/frida/winapi/user32.ts
course/frida/winapi/user32.ts
+26
-0
未找到文件。
course/frida/05_读取棋盘数据/index.ts
浏览文件 @
d082be9c
class
L0
7
{
class
L0
5
{
private
module_name_winmine
=
"
winmine.exe
"
;
private
module_winmine
:
Module
;
private
offset地雷数量
:
number
=
0x56A4
;
...
...
@@ -37,5 +37,5 @@ class L07 {
}
}
let
l07
=
new
L07
();
l07
.
board_info
();
\ No newline at end of file
let
l05
=
new
L05
();
l05
.
board_info
();
\ No newline at end of file
course/frida/06_分析扫雷游戏的数据,显示地雷位置/index.ts
0 → 100644
浏览文件 @
d082be9c
class
L06
{
private
module_name_winmine
=
"
winmine.exe
"
;
private
module_winmine
:
Module
;
private
offset地雷数量
:
number
=
0x56a4
;
private
offset棋盘高度
:
number
=
0x56a8
;
private
offset棋盘宽度
:
number
=
0x56ac
;
private
height
:
number
=
0
;
private
width
:
number
=
0
;
private
mine_count
:
number
=
0
;
private
head
:
NativePointer
=
ptr
(
0
);
constructor
()
{
console
.
log
(
"
======================
"
,
new
Date
().
toISOString
(),
"
==========================
"
);
console
.
log
(
"
Frida.version
"
,
Frida
.
version
);
//获取模块基址
this
.
module_winmine
=
Process
.
getModuleByName
(
this
.
module_name_winmine
);
// 初始化游戏相关数据
this
.
height
=
this
.
module_winmine
.
base
.
add
(
this
.
offset棋盘高度
).
readU32
();
this
.
width
=
this
.
module_winmine
.
base
.
add
(
this
.
offset棋盘宽度
).
readU32
();
this
.
mine_count
=
this
.
module_winmine
.
base
.
add
(
this
.
offset地雷数量
).
readU32
();
this
.
head
=
this
.
module_winmine
.
base
.
add
(
0x5340
);
}
run
()
{
//遍历棋盘,按行遍历
for
(
let
i
=
0
;
i
<
this
.
height
+
2
;
i
++
)
{
//按列遍历
let
data
=
[];
for
(
let
j
=
0
;
j
<
this
.
width
+
2
;
j
++
)
{
let
byte_data
=
this
.
head
.
add
(
j
+
0x20
*
i
).
readU8
();
data
.
push
(
byte_data
.
toString
(
16
).
padStart
(
2
,
"
0
"
));
// 如果是地雷,将其状态改为标记
if
(
byte_data
==
0x8F
)
{
this
.
head
.
add
(
j
+
0x20
*
i
).
writeU8
(
0x8E
);
}
}
console
.
log
(
data
.
join
(
"
"
));
}
}
}
let
l06
=
new
L06
();
l06
.
run
();
course/frida/07_让系统重新绘制指定窗口/index.ts
0 → 100644
浏览文件 @
d082be9c
import
User32
from
'
../winapi/user32
'
class
L07
{
private
module_name_winmine
=
"
winmine.exe
"
;
private
module_winmine
:
Module
;
private
offset地雷数量
:
number
=
0x56a4
;
private
offset棋盘高度
:
number
=
0x56a8
;
private
offset棋盘宽度
:
number
=
0x56ac
;
private
height
:
number
=
0
;
private
width
:
number
=
0
;
private
mine_count
:
number
=
0
;
private
head
:
NativePointer
=
ptr
(
0
);
private
hWnd
:
NativePointer
=
ptr
(
0
);
constructor
()
{
console
.
log
(
"
======================
"
,
new
Date
().
toISOString
(),
"
==========================
"
);
console
.
log
(
"
Frida.version
"
,
Frida
.
version
);
//获取模块基址
this
.
module_winmine
=
Process
.
getModuleByName
(
this
.
module_name_winmine
);
// 初始化游戏相关数据
this
.
height
=
this
.
module_winmine
.
base
.
add
(
this
.
offset棋盘高度
).
readU32
();
this
.
width
=
this
.
module_winmine
.
base
.
add
(
this
.
offset棋盘宽度
).
readU32
();
this
.
mine_count
=
this
.
module_winmine
.
base
.
add
(
this
.
offset地雷数量
).
readU32
();
this
.
head
=
this
.
module_winmine
.
base
.
add
(
0x5340
);
this
.
hWnd
=
this
.
module_winmine
.
base
.
add
(
0x5B24
).
readPointer
();
}
board_repaint
()
{
const
lpRect
=
Memory
.
alloc
(
4
*
4
);
User32
.
GetClientRect
(
this
.
hWnd
,
lpRect
);
User32
.
InvalidateRect
(
this
.
hWnd
,
lpRect
,
1
);
}
run
()
{
//遍历棋盘,按行遍历
for
(
let
i
=
0
;
i
<
this
.
height
+
2
;
i
++
)
{
//按列遍历
let
data
=
[];
for
(
let
j
=
0
;
j
<
this
.
width
+
2
;
j
++
)
{
let
byte_data
=
this
.
head
.
add
(
j
+
0x20
*
i
).
readU8
();
data
.
push
(
byte_data
.
toString
(
16
).
padStart
(
2
,
"
0
"
));
// 如果是地雷,将其状态改为标记
if
(
byte_data
==
0x8F
)
{
this
.
head
.
add
(
j
+
0x20
*
i
).
writeU8
(
0x8E
);
}
}
console
.
log
(
data
.
join
(
"
"
));
}
// 重绘窗口区域
this
.
board_repaint
()
}
}
let
l07
=
new
L07
();
l07
.
run
();
course/frida/package.json
浏览文件 @
d082be9c
...
...
@@ -7,7 +7,9 @@
"build"
:
"frida-compile 04_frida_with_typescript/src/index.ts -o build/04.js -c"
,
"watch04"
:
"frida-compile 04_frida_with_typescript/src/index.ts -o build/04.js -w"
,
"watch05"
:
"frida-compile ./05_读取棋盘数据/index.ts -o ./build/05.js -w"
,
"runx"
:
"D:/Python/Python371/Scripts/frida.exe -n winmine.exe -l ./build/05.js"
"watch06"
:
"frida-compile ./06_分析扫雷游戏的数据,显示地雷位置/index.ts -o ./build/06.js -w"
,
"watch07"
:
"frida-compile ./07_让系统重新绘制指定窗口/index.ts -o ./build/07.js -w"
,
"runx"
:
"D:/Python/Python371/Scripts/frida.exe -n winmine.exe -l ./build/07.js -q"
},
"keywords"
:
[],
"author"
:
""
,
...
...
course/frida/winapi/user32.ts
0 → 100644
浏览文件 @
d082be9c
export
default
class
User32
{
// BOOL GetClientRect(
// [in] HWND hWnd,
// [out] LPRECT lpRect
// );
private
static
address_GetClientRect
:
NativePointerValue
|
null
;
static
GetClientRect
(
hWnd
:
NativePointerValue
,
lpRect
:
NativePointerValue
):
number
{
if
(
this
.
address_GetClientRect
==
null
)
{
this
.
address_GetClientRect
=
Module
.
findExportByName
(
"
User32.dll
"
,
"
GetClientRect
"
);
}
return
new
NativeFunction
(
this
.
address_GetClientRect
!
,
"
bool
"
,
[
"
pointer
"
,
"
pointer
"
])(
hWnd
,
lpRect
);
}
// BOOL InvalidateRect(
// [in] HWND hWnd,
// [in] const RECT * lpRect,
// [in] BOOL bErase
// );
private
static
address_InvalidateRect
:
NativePointerValue
|
null
;
static
InvalidateRect
(
hWnd
:
NativePointerValue
,
lpRect
:
NativePointerValue
,
bErase
:
number
):
number
{
if
(
this
.
address_InvalidateRect
==
null
)
{
this
.
address_InvalidateRect
=
Module
.
findExportByName
(
"
User32.dll
"
,
"
InvalidateRect
"
);
}
return
new
NativeFunction
(
this
.
address_InvalidateRect
!
,
"
bool
"
,
[
"
pointer
"
,
"
pointer
"
,
'
bool
'
])(
hWnd
,
lpRect
,
bErase
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录