Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: callother id, load/store struct #8

Closed
chf0x opened this issue Aug 29, 2024 · 4 comments
Closed

Question: callother id, load/store struct #8

chf0x opened this issue Aug 29, 2024 · 4 comments

Comments

@chf0x
Copy link
Contributor

chf0x commented Aug 29, 2024

Hi, could you please help me with interpreting the following structure?

    CallOther {
        output: Option<VarNode>,
        inputs: Vec<VarNode>,
    },

From the documentation, I understand that:

Each CALLOTHER must have a unique name, and as a p-code operation, it takes varnode inputs and may produce a varnode output. However, the exact effect of the operation is not specified.

How can I retrieve the callother ID/name in Jingle?

@chf0x
Copy link
Contributor Author

chf0x commented Aug 29, 2024

I would appreciate your help with a few more opcodes if possible:

    Store {
        output: IndirectVarNode,
        input: VarNode,
    },

According to the documentation:

Parameter   | Description
------------|----------------------------------------
input0      | (special) Constant ID of space to store into.
input1      | Varnode containing pointer offset of destination.
input2      | Varnode containing data to be stored.

It seems that output corresponds to input2, and input corresponds to input1. Is that correct?

I have the same question for the Load opcode:

    Load {
        input: IndirectVarNode,
        output: VarNode,
    },

According to the documentation:

Parameter   | Description
------------|----------------------------------------
input0      | (special) Constant ID of space to load from.
input1      | Varnode containing pointer offset to data.
output      | Destination varnode.

Does output map to output, and input to input1?

Thank you!

@chf0x chf0x changed the title Question: callother id? Question: callother id, load/store struct Aug 29, 2024
@toolCHAINZ
Copy link
Owner

toolCHAINZ commented Aug 29, 2024

Hello! For callother, the argument varnodes I have there are just what sleigh gives. My understanding is that the first varnode input uniquely identifies the callother operation, which has been enough for my needs thus far (it might also be good to split this out: assert there will always be at least one input and store that one separately from the others). I assume there is some sleigh API for doing lookups on this number to get the name of the operation but I haven't looked into it. I can make a follow-up issue (edit: see #9). Happy to review if you figure that out yourself!

@toolCHAINZ
Copy link
Owner

For the indirect varnode stuff, I was trying to reduce the cognitive overhead of remembering the "special purposes" of load and store's inputs by grouping the inputs involved in the indirect access.

For store, output is the combination of input0 and input1; I called it output since it is identifying how to construct the output destination of the store operation.
For load, input is the combination of input0 and input1.

@chf0x
Copy link
Contributor Author

chf0x commented Aug 29, 2024

Thank you very much for the clarifications! Having only callother ID would be sufficient for my purposes as well; I just could not find any information on where it is located

@chf0x chf0x closed this as completed Aug 29, 2024
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

No branches or pull requests

2 participants