- 逆向:Ghidra/IDA 全量反编译 CoreSDKLib.dll/ThermalSDK.dll/libthermalSDK.so/ libcoresdk.so(ARM64)/libmagcore.so,导出 analysis/ida/export/ - 解码官方渲染管线:DDT 校准表加载->快门端点选择->Q12 插值->ref(4x type1 帧 均值)->NUC 查表->盲元补偿->窗口->LUT1024 重建->2x 升采样->调色板 - 逐像素验证:NUC+盲元 0/19200、插值 0 误差、2x 0/76800、窗口一致 - demo3 v5:完整复刻官方管线(含 DDT 解析、FFC 状态机、快门温度驱动), 修复 load_ddt 表错位导致的零像素问题 - 鬼影根因分析写入 analysis/reverse_20260813_full.md - 心跳/恢复机制:analysis/session_state.md + tools/resume_rev.ps1 - 新增 tsdk_pair3 增强采集工具;历史工具归档 csdk/tools/legacy/; 根目录抓帧残留删除,历史文档归档 analysis/history/ - csdk/README.md 完整使用文档;.gitignore/.gitattributes 补 LFS 规则
86 lines
2.0 KiB
C
86 lines
2.0 KiB
C
#include <idc.idc>
|
|
|
|
static first_func()
|
|
{
|
|
auto seed, ea;
|
|
seed = get_func_attr(0x180001000, FUNCATTR_START);
|
|
if (seed == BADADDR)
|
|
{
|
|
ea = get_first_seg();
|
|
while (ea != BADADDR)
|
|
{
|
|
if (get_segm_name(ea) == ".text" || get_segm_name(ea) == "CODE" ||
|
|
get_segm_name(ea) == "text" || get_segm_name(ea) == ".plt")
|
|
break;
|
|
ea = get_next_seg(ea);
|
|
}
|
|
if (ea != BADADDR)
|
|
seed = ea;
|
|
}
|
|
if (seed == BADADDR)
|
|
seed = get_func_attr(get_imagebase() + 0x1000, FUNCATTR_START);
|
|
if (seed == BADADDR)
|
|
{
|
|
warning("cannot find seed function");
|
|
return BADADDR;
|
|
}
|
|
ea = get_prev_func(seed);
|
|
while (ea != BADADDR)
|
|
{
|
|
seed = ea;
|
|
ea = get_prev_func(seed);
|
|
}
|
|
return seed;
|
|
}
|
|
|
|
static dump_func_disasm(f, from, to)
|
|
{
|
|
auto ea;
|
|
ea = from;
|
|
while (ea != BADADDR && ea < to)
|
|
{
|
|
fprintf(f, "%08X: %s\n", ea, generate_disasm_line(ea, 0));
|
|
ea = next_head(ea, to);
|
|
}
|
|
fprintf(f, "\n");
|
|
}
|
|
|
|
static main()
|
|
{
|
|
auto f, of, ea, n, end;
|
|
f = fopen("C:\\Project\\MAG160C\\analysis\\ida\\export\\all_functions_disasm.txt", "w");
|
|
if (f == 0)
|
|
{
|
|
warning("cannot open output");
|
|
return;
|
|
}
|
|
of = fopen("C:\\Project\\MAG160C\\analysis\\ida\\export\\all_functions.txt", "w");
|
|
if (of == 0)
|
|
{
|
|
warning("cannot open map output");
|
|
fclose(f);
|
|
return;
|
|
}
|
|
ea = first_func();
|
|
if (ea == BADADDR)
|
|
{
|
|
fclose(f);
|
|
fclose(of);
|
|
return;
|
|
}
|
|
n = 0;
|
|
while (ea != BADADDR)
|
|
{
|
|
end = get_func_attr(ea, FUNCATTR_END);
|
|
fprintf(f, "### FUNC %08X - %08X (%d bytes) name=%s\n", ea, end, end - ea, get_func_name(ea));
|
|
dump_func_disasm(f, ea, end);
|
|
fprintf(of, "%08X %08X %s\n", ea, end, get_func_name(ea));
|
|
ea = get_next_func(ea);
|
|
n = n + 1;
|
|
}
|
|
fprintf(of, "TOTAL %d\n", n);
|
|
fclose(f);
|
|
fclose(of);
|
|
msg("all export done: %d funcs\n", n);
|
|
}
|