1 more moment regarding extracting FW:

1st - really THANKS for such great visual tool!

2nd, ;-) I would like to share with community the way how to do extracting 
with just simple linux tools (my experience), so

what we have - we have module .ko file.
and any Linux console
1) Lets look which type it is with file -s 
file -s gslx68x_ts.ko 
gslx68x_ts.ko: ELF 32-bit LSB  relocatable, Intel 80386, version 1 (SYSV), 
BuildID[sha1]=bd38533d698d51d8e343010888638c68ed28fd92, not stripped

2) Sounds good - from now our toolset are: objdump and readelf.

3) Lets guess constant names - for example lets use strings gslx68x_ts.ko | 
less
as result we have seen strings with prefix  GSLX680_FW
thats definitely what we are looking for!
4) From 2 we remember that we need to analyze elf file.
Briefly - usually constants and static vars are resided in .rodata section 
and .data section of the elf. Constants usually in .rodata.
5) Lets exam if it is so - I just used objdump -x  gslx68x_ts.ko | grep GSL 
- this means to read all headers of the  sections and display what is 
inside.
as result we see that all GSLX680 vars are resided inside .rodata
 the final step = just extract their binary values.
what we do next
6) take the segment .rodata start adress inside our module .ko file
readelf -e gslx68x_ts.ko or the same readelf -h -l -S gslx68x_ts.ko   - 
look into 5th column (offset of this segment inside .ko file) and for row 
.rodata
ot the same even more simple objdump -h ./gslx68x_ts.ko   - column "File"
7) Than, open .ko in any hex editor and jump to segment start adress  - as 
result you will see the 1st byte of .rodata segment  = 0000c8a0   (remember 
this value is like 0 = begining of the segment!)
 8 .rodata       000866f0  00000000  00000000  0000c8a0  2**5

8) from the symbol table determine the offset of the var inside segment 
readelf -s ./gslx68x_ts.ko  | grep FW

61: 0000b840 37224 OBJECT  LOCAL  DEFAULT   13 GSLX680_FW_I81_GSL3676B_8

We need 2nd and 3rd column. 2 = offset=0000b840 inside segment of the var 
value, 3d = length in bytes of the var = 37224
So begining of the var will be (start inside .ko file) from the such hex: 
0000c8a0 (segment adress inside .ko) + 0000b840 (variable offset inside 
segment) = 180e0 (total adress of the begining of var inside .ko) -
9) So to grab var  = just jump to the 180e0 and copy from there 37224 
bytes. or you could  for example using dd or dd rescue instead hex editor.

this portion (9) howto use dd and ddrescue is well documented, so I will 
not detalize it.

Regards, 
       Serge Kolotylo.
                        


On Monday, May 18, 2015 at 9:46:55 AM UTC+3, Alexis Jeandet wrote:
>
> Hi,
>
> You can do it with readelf and dd, it's not straight forward, you need to 
> find the symbol offset(table offset + symbol ofset) and size in the file 
> then you dump it with dd.
> I made a graphical tool to make this easier:
> https://hephaistos.lpp.polytechnique.fr/redmine/projects/execut/wiki
> You have the choice between sources, rpm for fedora and static Win32 exe.
>
> Best regards,
> Alexis.
> On Monday, May 18, 2015 at 3:31:00 AM UTC+2, [email protected] wrote:
>>
>> Hello.
>>
>> Could anyone share or describe the way how to extract it firmware for 
>> GSL1680 on 8" with 800x1280?
>>
>> What I have - rooted Android and binaries of kenel module (driver) fw is 
>> inside.
>> Also I have original fw from Windows 8.1.
>>
>> More technical details for Linux Guru: I need assistance of extracting 
>> from ELFfile .data segment declared their static (constant) values.
>>
>> Look at the objdump
>>
>> objdump -t gslx68x_ts.ko  | grep gsl_config
>> 00000140 g     O .data    0000035c gsl_config_data_id_gsl_customer
>> 000054a0 g     O .data    00000800 
>> gsl_config_data_id_I81_GSL3676B_8001280_OGS_SG
>> 00005ca0 g     O .data    00000800 
>> gsl_config_data_id_I802_GSL3676B_8001280_OGS_SG
>> 000064a0 g     O .data    00000800 
>> gsl_config_data_id_I802_GSL3676B_8001280_OGS_DZ
>> 00004ca0 g     O .data    00000800 
>> gsl_config_data_id_I100_GSL3692_1280800_GG_SG
>> 000044a0 g     O .data    00000800 
>> gsl_config_data_id_I89_GSL3676B_19201200_OGS_SG
>> 000034a0 g     O .data    00000800 
>> gsl_config_data_id_I71_GSL1686F_1024600_PG_XLL
>> 000024a0 g     O .data    00000800 
>> gsl_config_data_id_I86_GSL3676B_8001280_PG_FC
>> 00001ca0 g     O .data    00000800 
>> gsl_config_data_id_I86_GSL3676B_8001280_OGS_SG
>> 00002ca0 g     O .data    00000800 
>> gsl_config_data_id_I706_GSL1686_OGS_6001024_DZ_70F2
>> 00003ca0 g     O .data    00000800 
>> gsl_config_data_id_I89_GSL3676B_19201200_OGS_DZ
>> 00000ca0 g     O .data    00000800 
>> gsl_config_data_id_I101_GSL3692_1280800_GG_FC_FC101S123
>> 000014a0 g     O .data    00000800 
>> gsl_config_data_id_I86_GSL3676B_8001280_PG_FC_W
>> 000004a0 g     O .data    00000800 
>> gsl_config_data_id_I892_GSL3676B_8001280_OGS_SG
>>
>> objdump -x gslx68x_ts.ko | grep .data
>>
>> I am attaching linux driver module to this message. If it is needed 
>> windows fw file - please let me know - I will send it too.
>> PS: Suppose this helps to have more fw for new screen!
>> RELOCATION RECORDS FOR [.data]:
>> 00000040 R_386_32          gsl_config_data_id_gsl_customer
>> 00000044 R_386_32          gsl_config_data_id_I81_GSL3676B_8001280_OGS_SG
>> 00000048 R_386_32          gsl_config_data_id_I802_GSL3676B_8001280_OGS_SG
>> 0000004c R_386_32          gsl_config_data_id_I802_GSL3676B_8001280_OGS_DZ
>> 00000050 R_386_32          gsl_config_data_id_I100_GSL3692_1280800_GG_SG
>> 00000054 R_386_32          gsl_config_data_id_I89_GSL3676B_19201200_OGS_SG
>> 00000058 R_386_32          gsl_config_data_id_I71_GSL1686F_1024600_PG_XLL
>> 0000005c R_386_32          gsl_config_data_id_I86_GSL3676B_8001280_PG_FC
>> 00000060 R_386_32          gsl_config_data_id_I86_GSL3676B_8001280_OGS_SG
>> 00000064 R_386_32          
>> gsl_config_data_id_I706_GSL1686_OGS_6001024_DZ_70F2
>> 00000068 R_386_32          gsl_config_data_id_I89_GSL3676B_19201200_OGS_DZ
>> 0000006c R_386_32          
>> gsl_config_data_id_I101_GSL3692_1280800_GG_FC_FC101S123
>> 00000070 R_386_32          gsl_config_data_id_I86_GSL3676B_8001280_PG_FC_W
>> 00000074 R_386_32          gsl_config_data_id_I892_GSL3676B_8001280_OGS_SG
>>
>> Kind regards,
>>       Serge Kolotylo.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to