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?

closed as unclear what you're asking by Igor Skochinsky May 28 at 9:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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 at 16:15
  • please clarify the question so a proper answer can be posted – Igor Skochinsky May 28 at 9:41

Browse other questions tagged or ask your own question.