Sign up here and you can log into the forum!

unpack / repack a firmware

Have a question about devices internals, memory layout, reverse engineering, etc---This is the place for anything so technical that it would cause a n00b's head to 'splode

Re: unpack / repack a firmware   

Postby avkiev » Tue Sep 14, 2010 10:21 am

zmiki wrote:I am using the script that recreates md5sum for all files, before packing, found it on forum

Please, share this script
avkiev
Developer
 
Posts: 155
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Re: unpack / repack a firmware   

Postby Schenk2302 » Tue Sep 14, 2010 10:26 am

avkiev wrote:
zmiki wrote:I am using the script that recreates md5sum for all files, before packing, found it on forum

Please, share this script



I think he means the one from Tjay in the third post :)
Schenk2302
Patron
 
Posts: 18
Joined: Wed Apr 07, 2010 3:39 am

Re: unpack / repack a firmware   

Postby avkiev » Tue Sep 14, 2010 11:57 am

Schenk2302 wrote:I think he means the one from Tjay in the third post :)


Thanks, it works.
But my question is:
There are >8000 files in fw. In b-rad's fw just 270 entries in file md5sum.txt.
Why ? Which files we have to hash ? What is criteria ?

Empty md5sum.txt - is solution. Is it good solution ?
avkiev
Developer
 
Posts: 155
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Re: unpack / repack a firmware   

Postby b-rad.cc » Tue Sep 14, 2010 8:42 pm

avkiev wrote:Empty md5sum.txt - is solution. Is it good solution ?


it depends, do you care about things like a bad flash or parts on the nand randomly going bad? ;)
PM's are for private matters only, please post public matters on the forum to help others who might have the same issue.
:mrgreen:
User avatar
b-rad.cc
WDLXTV Team
 
Posts: 3002
Joined: Sat Apr 03, 2010 9:35 am
Location: New York

Re: unpack / repack a firmware   

Postby avkiev » Tue Sep 14, 2010 10:54 pm

Ok, understand. To be on safe side we have to hash some files.
But why not all of them ? Why only 270 ? What is criteria ?
avkiev
Developer
 
Posts: 155
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Re: unpack / repack a firmware   

Postby zmiki » Thu Sep 16, 2010 1:24 am

if I checked correctly in original md5 text file there are no files from osd. So if you are replacing just osd
you can keep old md5 text file
right???
zmiki
Developer
 
Posts: 109
Joined: Mon Apr 12, 2010 4:45 am

Re: unpack / repack a firmware   

Postby avkiev » Thu Sep 16, 2010 5:12 am

Imho,
- hash all files - not good idea
- no hashing (empty file md5sum.txt) - not good idea.

So, my solution is: just rehash files, which already hashed (contents of md5sum.txt).
Script:
cut -d" " -f3 md5sum.txt | xargs md5sum > md5sum.new
mv -v md5sum.new md5sum.txt
avkiev
Developer
 
Posts: 155
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Re: unpack / repack a firmware   

Postby bovirus » Thu Nov 11, 2010 3:50 am

I tried to use

cut -d" " -f3 md5sum.txt | xargs md5sum > md5sum.new

on Ununtu 10.04 but the command answer that "" are not in pair and " has a special menaing for xtag except using -0 option.

What's the matter?
bovirus
Global Moderator
 
Posts: 94
Joined: Thu Apr 22, 2010 11:42 pm

Re: unpack / repack a firmware   

Postby jamesr219 » Mon Nov 29, 2010 4:55 am

When using Ty's tool to pack/unpack (thanks BTW!) an release firmware should I expect the filesize of the re-pack to be the same? For me it is growing a bit, but I can't figure out why. I am not touching any files in the unpacked directory.

I'm using the following commands:
Code: Select all
user@ubuntu:~/wdltv$ ./wdtvfw_tool unpack rootfs 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin
stripping firmware ...
unpack cramfs image ...
unpacked to rootfs
user@ubuntu:~/wdltv$ ./wdtvfw_tool pack rootfs 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin.new
create md5sum.txt ...
create cramfs image ...
warning: gids truncated to 8 bits (this may be a security concern)
sign image ...
1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin.new created
user@ubuntu:~/wdltv$ ls -lad 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin*
-rw-r--r-- 1 user user 93159472 2010-10-12 00:05 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin
-rw-r--r-- 1 user user 93372464 2010-11-29 07:51 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin.new


Is it ok for there to be this difference? Will this create a bootable firmware?

thanks,

-jr
jamesr219
WDTVer
 
Posts: 21
Joined: Sat Nov 27, 2010 6:14 am

Re: unpack / repack a firmware   

Postby jamesr219 » Tue May 10, 2011 6:18 pm

jamesr219 wrote:When using Ty's tool to pack/unpack (thanks BTW!) an release firmware should I expect the filesize of the re-pack to be the same? For me it is growing a bit, but I can't figure out why. I am not touching any files in the unpacked directory.

I'm using the following commands:
Code: Select all
user@ubuntu:~/wdltv$ ./wdtvfw_tool unpack rootfs 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin
stripping firmware ...
unpack cramfs image ...
unpacked to rootfs
user@ubuntu:~/wdltv$ ./wdtvfw_tool pack rootfs 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin.new
create md5sum.txt ...
create cramfs image ...
warning: gids truncated to 8 bits (this may be a security concern)
sign image ...
1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin.new created
user@ubuntu:~/wdltv$ ls -lad 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin*
-rw-r--r-- 1 user user 93159472 2010-10-12 00:05 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin
-rw-r--r-- 1 user user 93372464 2010-11-29 07:51 1.03.39_B_WDLXTV.COM_WDLXTV_PLUS-0.4.3.1/wdtvlive2.bin.new


Is it ok for there to be this difference? Will this create a bootable firmware?

thanks,

-jr



Anyone comment on this? I don't want to brick my unit, but need to reconfigure some things for a custom application I am working on with the WDLive devices?

thanks!
jamesr219
WDTVer
 
Posts: 21
Joined: Sat Nov 27, 2010 6:14 am

PreviousNext

Return to WDTV Live

Who is online

Users browsing this forum: No registered users and 1 guest

cron