Reputation: 1
I'm trying to create helloworld C program for windows. I need target executable to be COFF file for some security-related project. Do I use cl.exe? Do I use fasm?
Edit: not necessirily compile on windows, anything goes as long as I can run binary on windows.
Edit2: anything goes as long as I can run binary on windows or load as dynamic library.
Upvotes: 0
Views: 293
Reputation: 79
You would use nasm.
period@D5DZ5WT2 ~/src/metasploit-framework $ nasm -f coff -o obj-intel.o dlexec.asm
period@D5DZ5WT2 ~/src/metasploit-framework $ file -s obj-intel.o
obj-intel.o: Intel 80386 COFF object file, no line number info, not stripped, 1 section, symbol offset=0x16f, 26 symbols
(That was done on WSL the windows subsystem for linux, but you should be able to do the same with cygwin or a native win binary for nasm).
https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/
Upvotes: 0