I'm trying to return argc in assembly but the program returns 0. I'm using GNU 2.28 on Windows 10 !
There is my code:
.section .text
.globl main
main:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movl %ebp, %esp
popl %ebp
ret
.globl _start
_start:
pushl 0(%esp)
call main
addl 4, %esp
movl %eax, %ebx
movl $1, %eax
int $0x80
I'm using the following commands to generate my exe:
as --32 test.s -o test.obj ld -m i386pe test -o test.exe