LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-20-2015, 09:34 AM   #1
WSRaptor
LQ Newbie
 
Registered: Apr 2015
Posts: 1

Rep: Reputation: Disabled
Combine two or more bin files into another bin file at specific addresses in bash


I'm looking to create a script that will take two or more bin files as an input and output a new new bin file which has the two files combined at specific addresses (with any blank areas being filled by FF).

For example:

Input these files at these addresses
- file1.bin @ address 0x00010
- file2.bin @ address 0x20000

both files will not fill the entire address range so any empty space is filled with FF.

So the result will be something like this (viewed in HEX):

00000000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00000010 0A 05 01 08 00 00 00 00 53 01 BE 00 64 00 64 00
00000020 EB 6C 70 C1 E1 C1 E0 40 00 9E 5B 34 C1 D3 C1 DE
00000030 A5 AE 69 78 24 BE BC BF BB C1 D2 87 6C 13 07 94
00000040 C1 D6 3C 88 C1 DA C1 CC C1 D1 7B 60 3C 32 AB C1
.
.
.
000FFD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
000FFE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
000FFF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0020000 C3 05 01 08 07 1A 38 12 53 01 BE 00 64 33 64 00
0020010 E9 9F AA C1 FD A0 B3 C1 C2 8B BE 71 24 C1 DC C1
0020020 EB 6C 70 C1 E1 C1 E0 40 00 9E 5B 34 C1 D3 C1 DE
.
.
.

Can anyone help me?
 
Old 04-20-2015, 02:36 PM   #2
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 852

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Hello,
is this a homework?
What have you done so far and where are you stuck?
I would start by reading the documentation for the dd program.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or director irlogo Red Hat 5 03-12-2012 04:38 AM
[SOLVED] bash: /usr/local/bin/xdsi: /usr/bin/wish: bad interpreter: No such file or directory Berwhale Linux - Newbie 2 09-15-2011 02:59 PM
Installing .bin-files, leave the file in /usr/local/bin/ ? lagu2653 Linux - Software 1 11-08-2005 08:30 PM
/bin/bash how to remove specific file anywhere on harddrive cjagdish69 Linux - Software 1 01-07-2005 05:42 AM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration