hexview command line operation instructions

hexview command line operation instructions

Command line operation basic format

hexview.exe infile [option] -o outfile

Extract some content

hexview.exe app.hex /AR:0X200000-0X303404 /s /XI -o app1.hex

/AR: Specifies the range to extract. (Also available /CR, which can specify multiple ranges, /CR:range1[:range2]). The range format can be start address and end address: addr1-addr2, or start address plus length: addr1,length.

/s:Background process. Without starting the GUI interface, you can add /eerrorlog.txtand output error logs.

/XI: Specify the export format as Intel Hexformat.

-o: Output file name.

Extract and convert format

hexview.exe app.hex /AR:0X200000-0X303404 /s /XN /eerror.log -o app1.hex

Function: Extract app.hexthe firmware in the firmware 0x200000-0x203404and convert it into .bina format file.

/XN: Specify the export format as data binaryformat.

Note: Although the above operation can be successfully extracted, all the blocks in the hex will be seamlessly merged together, and the blank parts between the blocks will be removed. Therefore, in order to convert HEX format firmware to BIN format firmware, it is necessary to fill in the blank content before outputting.

hexview.exe app.hex /AR:0x200000-0x303404 /s /elog.txt /FR:0x200000-0x303404 /FP:FF  /XN -o app.bin

/FR: Specify the range to be filled. Multiple ranges can be /FR:range1:range2separated by equals. When filling, within the range, only the blank part will be filled, and the non-blank part will not be covered and filled.

/FP: /FRThe pattern string of the filling content of the part to be filled within the specified range, which is a hexadecimal number, /FPAABBCCDD.

When using this operation to convert HEX to BIN, it can avoid the deletion of blank parts and solve the aforementioned problems.

Convert firmware to C language array

hexview.exe .\StartupBuild.hex /AR:0XFE002888-0XFE002B01 /s /FP:FF /XC -o flashdriver.c

/XC: Specifies that the output file format is a C language file.

Delete a section of content in the firmware

hexview.exe .\StartupBuild.hex /CR:0XFE002B00-0XFE002D7D /s /XI -o StartupBuild.hex

/CR: Clips out the content of the range. :Connect multiple address ranges via . @TOC _

Guess you like

Origin blog.csdn.net/duapple/article/details/131088705