|
a command line
free external tools,
java sources
cpp sources
articles
|
- download the free swiss file knife base from sourceforge. - unpack the tool using winzip or unzip. - open the Windows Command Line or a Linux shell.
sfk ... +hextobin outfile convert lines of text containing hexdump to binary. chain-only command. hextobin can be used only after another command, typically filter, which reads and prepares the input data. examples: sfk filter dump.txt +hextobin out.dat requires dump.txt to contain pure hex data, e.g. 7466696C 65732F46 6F726D61 74732F31 blanks and some chars like <> are skipped automatically. sfk filter dump.txt "-+ >" -rep "_<*__" +hextobin out.dat takes a verbose hexdump produced by "sfk hexdump": >73746669 6C65732F 42617365 4C69622F< stfiles/BaseLib/ 00000020 using only lines starting with " >" (skipping a possible filename line), stripping the ascii and offset infos after "< ", extracting and converting pure hex data. sfk fromclip +hextobin %TEMP%\tmp1.dat +hexdump takes a hex sequence like 22737769 73732066 from clipboard, printing its text via a temporary file and hexdump. example: write a list of bytes into a binary file let's say we want to write the binary data 0x01 0x02 0x03 0x04 0x05 into a binary file "target.exe" at offset 0x9876, then this can be achieved by these steps: sfk echo "01 02 03 04 05" +hextobin tmp1.dat writes the byte sequence into a temporary file. sfk partcopy tmp1.dat 0 5 target.exe 0x9876 -yes copies these bytes from tmp1.dat into target.exe, which must exist, at the offset 0x9876 (39030 decimal). finally, you may sfk hexdump target.exe -offlen 0x9870 20 to check the result by dumping the bytes around that area: :file target.exe >28C80000 10C20102 03040500 00000000< (............... 00009870 >00000000 06C90000 44C20000 00000000< ........D....... 00009880 see also: sfk hexdump - creating hexdumps from binary data. sfk partcopy - copy parts of a binary file. sfk is a free open-source tool, running instantly without installation efforts. no DLL's, no registry changes - just get sfk.exe from the zip package and use it (binaries for windows, linux and mac are included). read more about all sfk functions here.
|
|