NASM Forum > Using NASM

exe file is not valid win32 aplication

(1/2) > >>

Alvin_Sanchez12:
Hi there, my name is alvin and im 15 years old and i was beginer in assembly and i want to ask a quesion how i fix test.exe is not valid win32 application currently im using windows

debs3759:
If you show us your code and how you are creating your exe file someone may be able to help you. Without any more info it's impossible to know what the problem is.

Alvin_Sanchez12:
this my test.asm code
section .data
msg db "hello worlds",0
msg_len equ $-msg

section .text
global _start

mov eax, 4
mov ebx, 1
mov ecx, msg
mov edx, msg_len
syscall

mov eax, 1
mov ebx, 1
syscall

i trying run with nasm
nasm -f win64 -o test.obj test.asm

and link with ld
ld -m i386pe -s -o test.exe test.obj

did i get wrong?

Alvin_Sanchez12:
currently im using windows 7

debs3759:
I'm not a Windows coder (yet), but it looks like you are writing 32-bit code, and telling nasm to generate a 64-bit object file, which you then try linking as a 32-bit executable. I don't know if that is the problem though, hopefully someone with Windows and 64-bit experience will be along soon.

Navigation

[0] Message Index

[#] Next page

Go to full version