Loading...
Loading...
Compare original and translation side by side
Get decompilation/data at focus point:
- get-decompilation (limit=20-50 lines, includeIncomingReferences=true, includeReferenceContext=true)
- find-cross-references (direction="to"/"from", includeContext=true)
- get-data or read-memory for data structures获取焦点处的反编译/数据:
- get-decompilation (limit=20-50 lines, includeIncomingReferences=true, includeReferenceContext=true)
- find-cross-references (direction="to"/"from", includeContext=true)
- get-data 或 read-memory 用于查看数据结构rename-variables: var_1 → encryption_key, iVar2 → buffer_size
change-variable-datatypes: local_10 from undefined4 to uint32_t
set-function-prototype: void FUN_00401234(uint8_t* data, size_t len)
apply-data-type: Apply uint8_t[256] to S-box constant
set-decompilation-comment: Document key findings in code
set-comment: Document assumptions at address levelrename-variables: var_1 → encryption_key, iVar2 → buffer_size
change-variable-datatypes: local_10 从 undefined4 改为 uint32_t
set-function-prototype: void FUN_00401234(uint8_t* data, size_t len)
apply-data-type: 为S-box常量应用 uint8_t[256]
set-decompilation-comment: 在代码中记录关键发现
set-comment: 在地址层面记录假设get-decompilation again → Verify changes improved readability再次调用 get-decompilation → 验证修改是否提升了可读性Follow xrefs to called/calling functions
Trace data flow through variables
Check string/constant usage
Search for similar patterns追踪被调用/调用函数的交叉引用
通过变量追踪数据流
检查字符串/常量的使用
搜索相似模式set-bookmark type="Analysis" category="[Topic]" → Mark important findings
set-bookmark type="TODO" category="DeepDive" → Track unanswered questions
set-bookmark type="Note" category="Evidence" → Document key evidenceset-bookmark type="Analysis" category="[主题]" → 标记重要发现
set-bookmark type="TODO" category="DeepDive" → 追踪未解决的问题
set-bookmark type="Note" category="Evidence" → 记录关键证据位置get-decompilationincludeIncomingReferences=truefind-cross-referencesget-dataread-memoryrename-variableschange-variable-datatypesset-decompilation-commentget-decompilationincludeIncomingReferences=truefind-cross-referencesget-dataread-memoryrename-variableschange-variable-datatypesset-decompilation-commentsearch-strings-regexsearch-decompilationget-symbolsfind-cross-referencesget-decompilationread-memoryrename-variablesapply-data-typeset-commentsearch-strings-regexsearch-decompilationget-symbolsfind-cross-referencesget-decompilationread-memoryrename-variablesapply-data-typeset-commentsearch-strings-regexget-symbolssearch-decompilationfind-cross-referencesget-decompilationrename-variablesset-decompilation-commentset-bookmarksearch-strings-regexget-symbolssearch-decompilationfind-cross-referencesget-decompilationrename-variablesset-decompilation-commentset-bookmarkget-decompilationchange-variable-datatypesapply-structureapply-data-typeset-function-prototypeget-decompilationget-decompilationchange-variable-datatypesapply-structureapply-data-typeset-function-prototypeget-decompilationsearch-decompilation pattern="..." → Find functions doing X
search-strings-regex pattern="..." → Find strings matching pattern
get-strings-by-similarity searchString="..." → Find similar strings
get-functions-by-similarity searchString="..." → Find similar functions
find-cross-references location="..." direction="to" → Who references this?search-decompilation pattern="..." → 查找执行X操作的函数
search-strings-regex pattern="..." → 查找匹配模式的字符串
get-strings-by-similarity searchString="..." → 查找相似字符串
get-functions-by-similarity searchString="..." → 查找相似函数
find-cross-references location="..." direction="to" → 哪些内容引用了它?get-decompilation:
- includeIncomingReferences=true (see callers on function line)
- includeReferenceContext=true (get code snippets from callers)
- limit=20-50 (start small, expand as needed)
- offset=1 (paginate through large functions)
find-cross-references:
- includeContext=true (get code snippets)
- contextLines=2 (lines before/after)
- direction="both" (see full picture)
get-data addressOrSymbol="..." → Inspect data structures
read-memory addressOrSymbol="..." length=... → Check constantsget-decompilation:
- includeIncomingReferences=true(在函数行查看调用方)
- includeReferenceContext=true(获取调用方的代码片段)
- limit=20-50(从小范围开始,按需扩展)
- offset=1(分页查看大型函数)
find-cross-references:
- includeContext=true(获取代码片段)
- contextLines=2(前后各2行)
- direction="both"(查看完整关联)
get-data addressOrSymbol="..." → 检查数据结构
read-memory addressOrSymbol="..." length=... → 查看常量rename-variables:
- Use descriptive names based on usage
- Example: var_1 → encryption_key, iVar2 → buffer_size
- Rename only what you understand (don't guess)change-variable-datatypes:
- Use evidence from operations/APIs
- Example: local_10 from undefined4 to uint32_t
- Check decompilation improves after changeset-function-prototype:
- Use C-style signatures
- Example: "void encrypt_data(uint8_t* buffer, size_t len, uint8_t* key)"apply-data-type or apply-structure:
- Apply when pattern is clear (repeated field access)
- Example: Apply AES_CTX structure at ctx pointerset-decompilation-comment:
- Document behavior at specific lines
- Example: line 15: "Initializes AES context with 256-bit key"
set-comment type="pre":
- Document at address level
- Example: "Entry point for encryption routine"rename-variables:
- 根据使用场景使用描述性名称
- 示例:var_1 → encryption_key, iVar2 → buffer_size
- 仅重命名你理解的变量(不要猜测)change-variable-datatypes:
- 基于操作/API的证据
- 示例:local_10 从 undefined4 改为 uint32_t
- 检查修改后反编译代码是否更清晰set-function-prototype:
- 使用C风格签名
- 示例:"void encrypt_data(uint8_t* buffer, size_t len, uint8_t* key)"apply-data-type 或 apply-structure:
- 当模式明确时应用(重复字段访问)
- 示例:在ctx指针处应用AES_CTX结构set-decompilation-comment:
- 在特定行记录行为
- 示例:line 15: "使用256位密钥初始化AES上下文"
set-comment type="pre":
- 在地址层面记录
- 示例:"加密例程的入口点"type="Analysis" category="[Topic]" → Current investigation findings
type="TODO" category="DeepDive" → Unanswered questions for later
type="Note" category="Evidence" → Key evidence locations
type="Warning" category="Assumption" → Document assumptions madesearch-bookmarks type="Analysis" → Review all findings
search-comments searchText="[keyword]" → Find documented assumptionscheckin-program message="..." → Save significant improvementstype="Analysis" category="[Topic]" → 当前调查结果
type="TODO" category="DeepDive" → 后续需解决的问题
type="Note" category="Evidence" → 关键证据位置
type="Warning" category="Assumption" → 记录做出的假设search-bookmarks type="Analysis" → 查看所有调查结果
search-comments searchText="[keyword]" → 查找已记录的假设checkin-program message="..." → 保存重要优化Claim: "This function uses AES-256 encryption"
Evidence:
1. String "AES-256-CBC" at 0x404010 (referenced in function)
2. S-box constant at 0x404100 (matches standard AES S-box)
3. 14-round loop at 0x401245:15 (AES-256 uses 14 rounds)
4. 256-bit key parameter (32 bytes, function signature)
Confidence: High结论:"此函数使用AES-256加密"
证据:
1. 字符串"AES-256-CBC"位于0x404010(被函数引用)
2. S-box常量位于0x404100(匹配标准AES S-box)
3. 14轮循环位于0x401245:15(AES-256使用14轮)
4. 256位密钥参数(32字节,函数签名)
置信度:高Claim: "This looks like encryption"
Evidence: "There's a loop and some XOR operations"
Confidence: Low结论:"这看起来像加密"
证据:"存在循环和一些XOR操作"
置信度:低set-bookmark type="Warning" category="Assumption"
comment="Assuming AES key is hardcoded - needs verification"set-bookmark type="Warning" category="Assumption"
comment="假设AES密钥为硬编码 - 需验证"search-bookmarks type="Warning" category="Suspicious"
search-bookmarks type="TODO" category="Triage"search-bookmarkssearch-bookmarks type="Warning" category="Suspicious"
search-bookmarks type="TODO" category="Triage"search-bookmarks{
"question": "Does function sub_401234 use encryption?",
"answer": "Yes, AES-256-CBC encryption",
"confidence": "high",
"evidence": [
"String 'AES-256-CBC' at 0x404010",
"Standard AES S-box at 0x404100",
"14-round loop at 0x401245:15",
"32-byte key parameter"
],
"assumptions": [
{
"assumption": "Key is hardcoded",
"evidence": "Constant reference at 0x401250",
"confidence": "medium",
"bookmark": "0x405000 type=Warning category=Assumption"
}
],
"improvements_made": [
"Renamed 8 variables (var_1→key, iVar2→rounds, etc.)",
"Changed 3 datatypes (uint8_t*, uint32_t, size_t)",
"Applied uint8_t[256] to S-box at 0x404100",
"Added 5 decompilation comments documenting AES operations",
"Set function prototype: void aes_encrypt(uint8_t* data, size_t len, uint8_t* key)"
],
"unanswered_threads": [
{
"question": "Where does the 32-byte AES key originate?",
"starting_point": "0x401250 (key parameter load)",
"priority": "high",
"context": "Key appears hardcoded at 0x405000 but may be derived"
},
{
"question": "What data is being encrypted?",
"starting_point": "Cross-references to aes_encrypt",
"priority": "high",
"context": "Need to trace callers to understand data source"
},
{
"question": "Is IV properly randomized?",
"starting_point": "0x401260 (IV initialization)",
"priority": "medium",
"context": "IV appears to use time-based seed, check entropy"
}
]
}{
"question": "函数sub_401234是否使用加密?",
"answer": "是,使用AES-256-CBC加密",
"confidence": "high",
"evidence": [
"字符串'AES-256-CBC'位于0x404010",
"标准AES S-box位于0x404100",
"14轮循环位于0x401245:15",
"32字节密钥参数"
],
"assumptions": [
{
"assumption": "密钥为硬编码",
"evidence": "0x401250处的常量引用",
"confidence": "medium",
"bookmark": "0x405000 type=Warning category=Assumption"
}
],
"improvements_made": [
"重命名8个变量(var_1→key, iVar2→rounds等)",
"修改3个数据类型(uint8_t*, uint32_t, size_t)",
"为0x404100处的S-box应用uint8_t[256]类型",
"添加5条反编译注释记录AES操作",
"设置函数原型:void aes_encrypt(uint8_t* data, size_t len, uint8_t* key)"
],
"unanswered_threads": [
{
"question": "32字节AES密钥来自哪里?",
"starting_point": "0x401250(密钥参数加载处)",
"priority": "high",
"context": "密钥似乎硬编码在0x405000,但可能是派生的"
},
{
"question": "哪些数据正在被加密?",
"starting_point": "aes_encrypt的交叉引用",
"priority": "high",
"context": "需要追踪调用方以了解数据源"
},
{
"question": "IV是否正确随机化?",
"starting_point": "0x401260(IV初始化处)",
"priority": "medium",
"context": "IV似乎使用基于时间的种子,需检查熵值"
}
]
}includeIncomingReferences=trueincludeIncomingReferences=trueset-bookmark type=TODOset-bookmark type=TODOget-decompilation functionNameOrAddress="..." limit=30
includeIncomingReferences=true
includeReferenceContext=trueget-strings-by-similarity searchString="..."
find-cross-references location="[string address]" direction="to"search-decompilation pattern="..."
search-strings-regex pattern="..."get-decompilation functionNameOrAddress="..." limit=30
includeIncomingReferences=true
includeReferenceContext=trueget-strings-by-similarity searchString="..."
find-cross-references location="[字符串地址]" direction="to"search-decompilation pattern="..."
search-strings-regex pattern="..."set-bookmark type="Analysis" category="[Question Topic]"
addressOrSymbol="[starting point]"
comment="Investigating: [original question]"set-bookmark type="Analysis" category="[问题主题]"
addressOrSymbol="[起始点]"
comment="调查:[原始问题]""Partially answered: Likely uses AES (medium confidence), needs verification"
Threads: ["Verify S-box matches AES standard", "Confirm key schedule"]“部分回答:可能使用AES(置信度:中),需验证”
线索:["验证S-box是否匹配AES标准", "确认密钥调度"]User: "Does function FUN_00401234 use encryption?"
[Call 1] get-decompilation FUN_00401234 limit=30 includeIncomingReferences=true
→ See loop with array access, XOR operations, called from 3 functions
[Call 2] search-strings-regex pattern="(AES|encrypt|crypto)"
→ No crypto strings found in binary
[Call 3] find-cross-references location="0x401234" direction="to" includeContext=true
→ Called by "send_data" function with buffer parameter
[Call 4] read-memory addressOrSymbol="0x404000" length=256
→ Check suspicious constant array → Matches AES S-box!
[Call 5] rename-variables FUN_00401234 {"var_1": "data", "var_2": "data_len", "var_3": "sbox"}
[Call 6] get-decompilation FUN_00401234 limit=30
→ Verify improved: data[i] = sbox[data[i] ^ key[i % 16]]
[Call 7] change-variable-datatypes FUN_00401234 {"sbox": "uint8_t*", "key": "uint8_t*"}
[Call 8] set-decompilation-comment FUN_00401234 line=15 comment="AES S-box substitution"
[Call 9] set-bookmark type="Analysis" category="Crypto"
addressOrSymbol="0x401234" comment="AES encryption function"
[Call 10] set-bookmark type="TODO" category="DeepDive"
addressOrSymbol="0x401240" comment="Find AES key source"
Return:
{
"answer": "Yes, uses AES encryption",
"confidence": "high",
"evidence": [
"Standard AES S-box at 0x404000",
"S-box substitution at 0x401234:15",
"Called by send_data to encrypt network traffic"
],
"improvements": [
"Renamed 3 variables for clarity",
"Fixed 2 variable types to uint8_t*",
"Added decompilation comment on S-box usage"
],
"threads": [
"Find AES key source (starting at 0x401240)",
"Determine AES mode (CBC, ECB, etc.)",
"Check if IV is properly randomized"
]
}用户:“函数FUN_00401234是否使用加密?”
[调用1] get-decompilation FUN_00401234 limit=30 includeIncomingReferences=true
→ 看到带数组访问、XOR操作的循环,被3个函数调用
[调用2] search-strings-regex pattern="(AES|encrypt|crypto)"
→ 二进制文件中未找到加密相关字符串
[调用3] find-cross-references location="0x401234" direction="to" includeContext=true
→ 被“send_data”函数调用,传递buffer参数
[调用4] read-memory addressOrSymbol="0x404000" length=256
→ 检查可疑常量数组 → 匹配AES S-box!
[调用5] rename-variables FUN_00401234 {"var_1": "data", "var_2": "data_len", "var_3": "sbox"}
[调用6] get-decompilation FUN_00401234 limit=30
→ 验证优化效果:data[i] = sbox[data[i] ^ key[i % 16]]
[调用7] change-variable-datatypes FUN_00401234 {"sbox": "uint8_t*", "key": "uint8_t*"}
[调用8] set-decompilation-comment FUN_00401234 line=15 comment="AES S-box替换"
[调用9] set-bookmark type="Analysis" category="Crypto"
addressOrSymbol="0x401234" comment="AES加密函数"
[调用10] set-bookmark type="TODO" category="DeepDive"
addressOrSymbol="0x401240" comment="查找AES密钥来源"
返回结果:
{
"answer": "是,使用AES加密",
"confidence": "high",
"evidence": [
"标准AES S-box位于0x404000",
"S-box替换操作位于0x401234:15",
"被send_data调用以加密网络流量"
],
"improvements": [
"重命名3个变量提升可读性",
"将2个变量类型修正为uint8_t*",
"添加S-box使用的反编译注释"
],
"threads": [
"查找AES密钥来源(起始点0x401240)",
"确定AES模式(CBC、ECB等)",
"检查IV是否正确随机化"
]
}