Hello,all
How do i create file.bin or convert a file.exe to file.bin?
expect exe2bin.

regards
Posted on 2006-02-28 21:35:26 by dcskm4200

There is EXEBIN.EXE:
EXE to BINary converter. Copyright (c) RaMax 1995,96 Part of FreeDOS.

This prog help me when EXE2BIN was not be able to convert file
Posted on 2006-03-01 09:11:49 by MikDay
Hey,MikDay
exebin is a MS-DOS utility. NASM has a macros for such using. i'v searched information about it with google, but no any useful msg.  ;)

by anyway, Thanks you.

regards
Posted on 2006-03-01 09:46:48 by dcskm4200

How do i create file.bin


Speaking from a nasm standpoint you don't need any macros at all. Nasm is fully capable of outputing flat binary files (.bin) with the -f option.


C:\Documents and Settings\bkeller\cgos>nasmw -h
usage: nasm [-@ response file] [-o outfile] [-f format] [-l listfile] [--] filename
    or nasm -r  for version info

    -e          preprocess only (writes output to stdout by default)
    -a          don't preprocess (assemble only)
    -M          generate Makefile dependencies on stdout

    -E<file>    redirect error messages to file
    -s          redirect error messages to stdout

    -g          enable debug info
    -F format  select a debugging format

    -I<path>    adds a pathname to the include file path
    -P<file>    pre-includes a file
    -D<macro>[=<value>] pre-defines a macro
    -U<macro>  undefines a macro
    -w+foo      enables warnings about foo; -w-foo disables them where foo can be:
    macro-params    macro calls with wrong no. of params (default off)
    orphan-labels  labels alone on lines without trailing `:' (default off)
    number-overflow numeric constants greater than 0xFFFFFFFF (default on)

response files should contain command line parameters, one per line.

For a list of valid output formats, use -hf.
For a list of debug formats, use -f <form> -y.

C:\Documents and Settings\bkeller\cgos>dir
Volume in drive C has no label.
Volume Serial Number is CCC2-AA1D

Directory of C:\Documents and Settings\bkeller\cgos

11/21/2005  01:32p      <DIR>          .
11/21/2005  01:32p      <DIR>          ..
04/06/2005  08:16p              5,457 bochsout.txt
05/14/2004  05:47p                645 boot.asm
05/13/2004  07:35p                763 cgos.bxrc
05/13/2004  08:39p                541 floppy.img
05/14/2004  05:48p                181 image.asm
05/14/2004  05:47p                353 kernel.asm
              6 File(s)          7,940 bytes
              2 Dir(s)  28,898,308,096 bytes free

C:\Documents and Settings\bkeller\cgos>nasmw -f bin -o image.bin image.asm
C:\Documents and Settings\bkeller\cgos>dir
Volume in drive C has no label.
Volume Serial Number is CCC2-AA1D

Directory of C:\Documents and Settings\bkeller\cgos

03/01/2006  03:54p      <DIR>          .
03/01/2006  03:54p      <DIR>          ..
04/06/2005  08:16p              5,457 bochsout.txt
05/14/2004  05:47p                645 boot.asm
05/13/2004  07:35p                763 cgos.bxrc
05/13/2004  08:39p                541 floppy.img
05/14/2004  05:48p                181 image.asm
03/01/2006  03:54p                542 image.bin          <<<=(new flat binary)
05/14/2004  05:47p                353 kernel.asm
              7 File(s)          8,482 bytes
              2 Dir(s)  28,898,308,096 bytes free

C:\Documents and Settings\bkeller\cgos>



convert a file.exe to file.bin?


I'm not exactly sure why you would want to do this, if it's an MZ/EXE that's cool, just strip out the header, but a PE/EXE has a lot of your imports and other stuff needed by the application. EXEBIN.EXE seems like probably what you are looking for (as stated by MikDay) but you made mention of a NASM macro and I figure if you are using NASM anyways just output the flat binary with the above commands. Unfortunately I'm not familiar enough with Masm's command lines to tell you how to do it with it if that is your prefered assembler, you might could ask some of the guys at masmforum in the 16BIT section if that is the case. Hope I've been of some help to ya.

Regards,
Bryant Keller
Posted on 2006-03-01 14:59:22 by Synfire
Hello,Synfire
Thanks you for answer.
Posted on 2006-03-14 20:48:27 by dcskm4200