Skip to content

Conversation

heheda123123
Copy link
Contributor

@heheda123123 heheda123123 commented Sep 16, 2025

set_comment(address, comment, in_decompile_window): Set a comment for a given address in the function disassembly or pseudocode.
#132
#133

@heheda123123 heheda123123 changed the title modify set_comment modify set_comment to support add comment in disassembly window Sep 16, 2025
@mrexodia
Copy link
Owner

This has exactly the same issue as the PR I just closed though? The intention of set_comment is that is transparently sets a comment. It should put the comment on the disassembly and the decompilation, whatever is possible.

@heheda123123
Copy link
Contributor Author

This has exactly the same issue as the PR I just closed though? The intention of set_comment is that is transparently sets a comment. It should put the comment on the disassembly and the decompilation, whatever is possible.

However, in IDA, the comments in the disassembly window and the decompilation window are not interoperable. Moreover, the number of lines of code in the decompiled code does not completely correspond to the decompiled code. For example, 3 lines of assembly code correspond to one line of pseudo code. I add comments to each line of assembly code. How can I add them to the pseudo code?

@mrexodia
Copy link
Owner

It's not very important in my opinion. The goal of the MCP server is to do the right thing and if you set a comment it should do a best-effort to set it in both the disassembly and the decompilation. The main work is done with the decompilation, so setting a comment there is the most common action. Every line has a corresponding address in the API so setting a comment there should set it in both the decompilation at that line as well as the disassembly at that address. If you set a comment in the disassembly at an address that does not have a line just don't set it in the decompilation?

@heheda123123
Copy link
Contributor Author

It's not very important in my opinion. The goal of the MCP server is to do the right thing and if you set a comment it should do a best-effort to set it in both the disassembly and the decompilation. The main work is done with the decompilation, so setting a comment there is the most common action. Every line has a corresponding address in the API so setting a comment there should set it in both the decompilation at that line as well as the disassembly at that address. If you set a comment in the disassembly at an address that does not have a line just don't set it in the decompilation?

But there are two situations, one is the obfuscation situation, the other is the pure assembly code

@mrexodia
Copy link
Owner

Okay, but if the decompilation fails the idea is to just use the disassembly instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants