Click here to Skip to main content
15,891,253 members

Comments by Advik Raj (Top 1 by date)

Advik Raj 13-Aug-19 10:15am View    
Well, here's my code as per the link:

#include<stdio.h>


int main() {

__asm__(
"push %ebp;"
"mov %esp,%ebp;"
"and $0xfffffff0,%esp;"
"sub $0x10,%esp;"
"call 0x401950 <__main>;"
"and $0xfffffff0, %esp;"
"sub $0x10, %esp;"
"call 0x401950 < __main >;"
"movl $0x405044, (%esp);"
"call 0x403a90 < printf >;"
"mov $0x0, %eax;"
"leave;"
"ret;"
);
return 0;
}


And here are the errors given by GCC Compiler.

C:\Users\xxxxxx\AppData\Local\Temp\cc8rm2fi.s: Assembler messages:
C:\Users\xxxxxx\AppData\Local\Temp\cc8rm2fi.s:18: Warning: missing operand; zer
o assumed
C:\Users\xxxxxx\AppData\Local\Temp\cc8rm2fi.s:18: Warning: missing operand; zer
o assumed
C:\Users\xxxxxx\AppData\Local\Temp\cc8rm2fi.s:18: Warning: missing operand; zer
o assumed
C:\Users\xxxxxx\AppData\Local\Temp\cc8rm2fi.s:18: Error: invalid operands (*ABS
* and *UND* sections) for `<'
C:\Users\xxxxxx\AppData\Local\Temp\cc8rm2fi.s:18: Error: invalid operands (*ABS
* and *UND* sections) for `<'
C:\Users\xxxxxx\AppData\Local\Temp\cc8rm2fi.s:18: Error: invalid operands (*ABS
* and *UND* sections) for `<'


Explain?
How do i Resolve this??