I can't find anywhere a good useful bin2db or bin2asm tool. Every tool I found does not work in that way I need it.
One tool for example does not accept long filenames, so thats shit.
Another tool has not the option to choose a label.
and so on...

So I decided to make my own, but I don't come along with this ... I need help.

So has anyone some ideas (like code or the right tool)? ... thanx

bye ChigpA
Posted on 2003-01-25 13:46:28 by ChigpA
There is a bin2db.exe in the masm32 package.
Posted on 2003-01-25 14:20:02 by bazik
Or use f0dder's bin2o tool, it writes an .obj file directly, saving the assembler from parsing the all those dbs.

Thomas
Posted on 2003-01-25 14:28:57 by Thomas
I have a GUI one. :grin:

I never tested it extensively but it suffices my needs. This one does not add labels though due to the nature of my style. Just add manually. :grin:
Posted on 2003-01-25 18:17:41 by arkane
since I did not give what the original poster likes. I recoded and added some features. :grin:

+ You can specify labels now

(without colons)

mylabel DB ...
DB ...

or this:

(with colons)

mylabel:
DB ...
DB ...

If you don't specify anything on the label edit box, it will default to the original configuration(same as the .zip file above).

+ Tab stopping
+ Clear button
+ Assuming you already have chosen the target file/s (source and destination) and you don't want to use the open dialog again to choose the file/s, you can just edit directly from the edit control. The original version does not check for filename or filepath changed directly from the edit control.

Just a reminder:

remember there is no overwrite check once you changed the file + path directly from the destination edit control, checking for overwrite is done using the Save As Dialog box, so be careful you might edit files that are important to you.

I didn't add this check because it will annoy people - I will be asking the user twice if he/she wants to overwrite which to me is annoying(first on the windows save as dialog and on my application).

I can subclass the edit control and check if the destination filename is changed but that would be overkill for this kind of app plus this is already bloated. :grin:

If you want to add this feature, just look for the call to DeleteFile, before it, use GetFileAttributes and check for file existence...
Posted on 2003-01-25 21:28:33 by arkane
look for the label __bin2hex and add the codes that are colored blue. This will solve the problems with file sources which are directories. This can happen if you edit the manually.

There is still one stupid mistake that might happen: same source file and destination file. :grin:

I'm not going to add string compare routines here. You can just add one yourself, right after __perform_conv: :grin:

Ok! Ok! I should stop treating people like n00bs. :grin: Sorry to bother ya!. :grin:
[size=9]    __bin2hex:


invoke GetWindowText, hEditSrc, OFFSET g_lpszBfrSrc, 255
cmp BYTE PTR [g_lpszBfrSrc], 0
jne __check_dest_buffer

[color=blue]__missing_source:[/color]

invoke MessageBox, HWND_DESKTOP, OFFSET g_lpszErr01, OFFSET g_dbWndName, MB_OK or MB_ICONEXCLAMATION
invoke SetFocus, hEditSrc
jmp __mxcb

__check_dest_buffer:

invoke GetWindowText, hEditDest, OFFSET g_lpszBfrDest, 255
cmp BYTE PTR [g_lpszBfrDest], 0
jne __check_existence
invoke MessageBox, HWND_DESKTOP, OFFSET g_lpszErr02, OFFSET g_dbWndName, MB_OK or MB_ICONEXCLAMATION
invoke SetFocus, hEditDest
jmp __mxcb

__check_existence:

invoke GetFileAttributes, OFFSET g_lpszBfrSrc
cmp eax, -1
jne __check_dest

invoke MessageBox, HWND_DESKTOP, OFFSET g_lpszErr03, OFFSET g_dbWndName, MB_OK or MB_ICONEXCLAMATION
jmp __mxcb

__check_dest:

[color=blue]cmp eax, FILE_ATTRIBUTE_DIRECTORY
je __missing_source[/color][/size]
if there are any more bugs about files and directories, just edit away, I'm not going to update this one because I'm not going to use it.

I'm going to use the original version not this bloated, waste of processor cycles, overkill second version. :grin:
Posted on 2003-01-25 22:20:36 by arkane