1
#include<stdio.h>
int main()
{
    char buffer[50];
    int a = 10, b = 20, c;
    c = a + b;
    sprintf(buffer, "Sum of %d and %d is %d", a, b, c);

    // The string "sum of 10 and 20 is 30" is stored
    // into buffer instead of printing on stdout
    printf("%s", buffer);

    return 0;
}

How is this code disassembled by IDApro?

2
  • 1
    Do you mean "what does this look like when compiled and disassembled by IDA" or "How does IDA identify that the function I'm calling is sprintf"? For the first case, exactly what you get may depend on the optimization level - why not try it yourself? For the second, it has a dictionary of standard function signatures.
    – Rup
    May 23, 2019 at 16:15
  • please clarify the question so a proper answer can be posted
    – Igor Skochinsky
    May 28, 2019 at 9:41

0

Browse other questions tagged or ask your own question.