int len(char *s) { return strlen(s); } void iptoa(char *s, long *p) { long val = *p; sprintf(s, "%ld", val); } // int inlen(long x) // x in %rdi // without canary // // intlen: // subq $40, %rsp allocate 5*8 bytes // movq %rdi, 24(%rsp) put x on the stack // leaq 24(%rsp), %rsi set &v = &x to the second argument // movq %rsp, %rdi set buf[12] to %rsp // call iptoa // // 0