I am newbie in IDA Pro. I have a basic question, what is the difference between instruction and function in IDA Pro? Is function contains some instructions on it ?!

Thanks in advance :)

  • 1
    The difference between instruction and function is exactly the same as in a piece of Assembly Code.
    – 0xec
    Aug 6 '14 at 9:14
  • 1
    This is not the official definition of the terms, I'ld define them as: A Function is a set of instructions, while an instruction is an operation to the processor. (bytes/opcodes) This is not specific to IDA Pro. Aug 6 '14 at 10:39

An instruction is bytes that can be decoded. They may or may not be real instruction by virtue of not being called. Might be data that looks like possible code.

Functions is instructions that have been indicated are called and this is the start. The indication might be a user action like pressing P or auto analysis following call locations in other code/functions.

But, in either case you can tell IDA that something is or is not code or functions. The only trick is if some bytes of a function are not valid instructions, then IDA will not lets you create a function.

  • 1
    Thank you very much. You said "bytes that can be decided." What does your means? Aug 6 '14 at 12:00
  • @HosseinMobasher decided should be decoded. Burned by auto correct. Will fix. Aug 6 '14 at 19:20
  • Thanks :) Another question is. You said "An instruction is bytes that can be decoded." and you also said "They (=Instructions) may or may not be real instruction ..." ?! Instructions may or may not be real instructions ? Aug 7 '14 at 8:01
  • @HosseinMobasher yes, just because a sequence of bytes forms "valid instructions" does not mean those bytes will be excuted, thus instructions they may not be. It's a common anti static analysis pattern (x86) for code to jumping into the middle of a byte stream thus the instructions are different. On more RISC like processors (ARM,MIPS) code must be on byte alignment boundaries. But this is a large topic, and more than one question will answer, go forth and read. Aug 7 '14 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.