Bin files saved as txt.. Convert

A place For General Chit Chat Etc
VX L67 Getrag
Posts: 2971
Joined: Sun Aug 02, 2009 11:16 am
Location: Bayside, Melbourne, Victoria

Bin files saved as txt.. Convert

Post by VX L67 Getrag »

Just wondering I have some bin files saved as txt, when I try & open them in hex editor they ad OD OA every 3rd & 4th byte is there anyway to open it as hex without that?
User avatar
antus
Site Admin
Posts: 10015
Joined: Sat Feb 28, 2009 10:34 am
cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007

Re: Bin files saved as txt.. Convert

Post by antus »

0D 0A is carriage return then line feed (think type writers) which is just the end of line marker where there is an "enter" in a text file. its probably either motorola srec or intel hex both of which you can find programs to convert formats. Or, better, the GQ-4X software can read those formats without conversion. But if that doesnt help you'll need to post a few lines to ID it by eye.

http://en.wikipedia.org/wiki/SREC_%28file_format%29
http://en.wikipedia.org/wiki/Intel_HEX
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
VX L67 Getrag
Posts: 2971
Joined: Sun Aug 02, 2009 11:16 am
Location: Bayside, Melbourne, Victoria

Re: Bin files saved as txt.. Convert

Post by VX L67 Getrag »

Thanks Antus, I had a feeling you'd know best about it!

I tried opening it in GQ program & then save as BIN but still the same layout!

I've attached the text file I just want to look at in HEX editor in normal bin layout, if I click on it to open in hex workshop it show the old typewriter return (good analogy) & then if I click on it to open in ultraedit it opens in the row like it does in word!

Thanks again!!!!
You do not have the required permissions to view the files attached to this post.
User avatar
festy
Posts: 1039
Joined: Sat Apr 30, 2011 8:27 am
cars: Alfa Romeos
Location: Narellan, NSW

Re: Bin files saved as txt.. Convert

Post by festy »

each byte has been converted to an ascii representation, with a space, CR and LF.
So the first bytes should be a 0x13 0x4A, but they're 0x31 ("1"), 0x33 ("3") 0x20 (space), 0x0D, 0x0A.
You'd need a tool that could read the ascii byte pairs, and convert to the actual byte.
I don't know of a tool that will do that, but if you have a few of them that you need converting I can write you something....
User avatar
Jayme
Posts: 2585
Joined: Sat Feb 28, 2009 10:59 pm
Location: North Coast, NSW

Re: Bin files saved as txt.. Convert

Post by Jayme »

old VS $84 file.bin

its an odd file size but thats the bytes thats in the text file :S
You do not have the required permissions to view the files attached to this post.
VX L67 Getrag
Posts: 2971
Joined: Sun Aug 02, 2009 11:16 am
Location: Bayside, Melbourne, Victoria

Re: Bin files saved as txt.. Convert

Post by VX L67 Getrag »

Festy Thanks for the reply, yeah I do have a few of them & dont want you to go to any trouble!

SO JAYME smarty pants how did you do that? & thank you to for the reply!
User avatar
Jayme
Posts: 2585
Joined: Sat Feb 28, 2009 10:59 pm
Location: North Coast, NSW

Re: Bin files saved as txt.. Convert

Post by Jayme »

opened the file in notepad, ctrl+a, copied then pasted into excel, used a formula to stitch together the hex chars as one long string, then copied that and pasted into xvi32 hex editor as a hex string then saved the bin
:wtf:
VX L67 Getrag
Posts: 2971
Joined: Sun Aug 02, 2009 11:16 am
Location: Bayside, Melbourne, Victoria

Re: Bin files saved as txt.. Convert

Post by VX L67 Getrag »

WOW , OK I'll give that a go with all the others I have, THANKS HEAPS!!!! :thumbup:

BTW just figured that file is Stock BWCT just missing the first 6000 bytes!

EDIT: actually for me to do it can you share the formula for excel? thats the main thing I'm missing!
User avatar
festy
Posts: 1039
Joined: Sat Apr 30, 2011 8:27 am
cars: Alfa Romeos
Location: Narellan, NSW

Re: Bin files saved as txt.. Convert

Post by festy »

I like perl ;)

Code: Select all

$ cat 84.txt | perl -ne 'chomp; print chr(hex($_))' >84.bin
VX L67 Getrag
Posts: 2971
Joined: Sun Aug 02, 2009 11:16 am
Location: Bayside, Melbourne, Victoria

Re: Bin files saved as txt.. Convert

Post by VX L67 Getrag »

I've had perl for a while but never figured out how to use it :?: