Skip to content

hexdumpmem is hexdump-like tool to dump memory and write memory. When developing a system on a SoC, I usually need to dump or write memory-map registers of the SoC for debugging. I write this program to do it on my developing Android phone.

License

Notifications You must be signed in to change notification settings

hwangcc23/hexdumpmem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexdumpmem
==========

[About]:
hexdumpmem is hexdump-like tool to dump memory and write memory. When 
developing a system on a SoC, I usually need to dump or write 
memory-map registers of the SoC for debugging. I write this program
to do it on my developing Android phone. 

[Usage]:
1. Dump a memory region:
        % hexdumpmem -a 0x1000
        Memory region 0x00001000 ~ 0x0000116f
        addr              0        4        8        C
        ==============================================
        00001000h: 4CFE8941 4CD47D8D 102A258B 8D4C0000
        00001010h: 000DFA2D 008CE900 0F660000 0000441F
        00001020h: 21058B48 48000010 F631388B 000010BA
        00001030h: 092EE800 45890000 836BEBAC 850F73FA
        00001040h: 00000090 FD058B48 4800000F C9E8388B
        00001050h: 89000008 4EEBC445 756CFA83 058B4877
        00001060h: 00000FE4 31388B48 0010BAF6 F1E80000
        00001070h: 89000008 2EEBB845 7577FA83 058B4857
        00001080h: 00000FC4 31388B48 0010BAF6 D1E80000
        00001090h: C7000008 0001C845 45890000 C607EBD0
        000010A0h: 00113A05 89440100 DE8948F7 2F058D48
        000010B0h: 4800000D 8D48C289 00104305 C1894800
        000010C0h: E8F8894D 00000878 8960F883 83157FC2
        000010D0h: 4374FFFA 243C8B49 894CC030 084CE8EE
        000010E0h: C2EB0000 7F76FA83 72FA838F FF498F0F
        000010F0h: FA83FFFF 5D8F0F6B 83FFFFFF 840F61FA
        00001100h: FFFFFF1C 7464FA83 68FA8396 3DE8C675
        00001110h: 31000007 483CEBC0 0F32058B 39440000
        00001120h: 83067530 75FFAC7D 058B4839 00000F08
        00001130h: 48088B48 0CF63D8D 01BE0000 BA000000
        00001140h: 00000032 0007F1E8 0702E800 FFB80000
        00001150h: 48FFFFFF 5B68C483 5D415C41 5F415E41
        00001160h: 4D8BC35D AC558BB8 FF0A4C8D CD058B48

2. Dump a memory region in half-word:
        % hexdumpmem -a 0x1000 -s 2
        Memory region 0x00001000 ~ 0x0000116f
        addr          0    2    4    6    8    A    C    E
        ==================================================
        00001000h: 8941 4CFE 7D8D 4CD4 258B 102A 0000 8D4C
        00001010h: FA2D 000D E900 008C 0000 0F66 441F 0000
        00001020h: 8B48 2105 0010 4800 388B F631 10BA 0000
        00001030h: E800 092E 0000 4589 EBAC 836B 73FA 850F
        00001040h: 0090 0000 8B48 FD05 000F 4800 388B C9E8
        00001050h: 0008 8900 C445 4EEB FA83 756C 4877 058B
        00001060h: 0FE4 0000 8B48 3138 BAF6 0010 0000 F1E8
        00001070h: 0008 8900 B845 2EEB FA83 7577 4857 058B
        00001080h: 0FC4 0000 8B48 3138 BAF6 0010 0000 D1E8
        00001090h: 0008 C700 C845 0001 0000 4589 EBD0 C607
        000010A0h: 3A05 0011 0100 8944 48F7 DE89 8D48 2F05
        000010B0h: 000D 4800 C289 8D48 4305 0010 4800 C189
        000010C0h: 894D E8F8 0878 0000 F883 8960 7FC2 8315
        000010D0h: FFFA 4374 8B49 243C C030 894C E8EE 084C
        000010E0h: 0000 C2EB FA83 7F76 838F 72FA 8F0F FF49
        000010F0h: FFFF FA83 0F6B 5D8F FFFF 83FF 61FA 840F
        00001100h: FF1C FFFF FA83 7464 8396 68FA C675 3DE8
        00001110h: 0007 3100 EBC0 483C 058B 0F32 0000 3944
        00001120h: 7530 8306 AC7D 75FF 4839 058B 0F08 0000
        00001130h: 8B48 4808 3D8D 0CF6 0000 01BE 0000 BA00
        00001140h: 0032 0000 F1E8 0007 E800 0702 0000 FFB8
        00001150h: FFFF 48FF C483 5B68 5C41 5D41 5E41 5F41
        00001160h: C35D 4D8B 8BB8 AC55 4C8D FF0A 8B48 CD05

3. Dump a memory region in byte:
        % hexdumpmem -a 0x1000 -s 1
        Memory region 0x00001000 ~ 0x0000116f
        addr        0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
        ==========================================================
        00001000h: 41 89 FE 4C 8D 7D D4 4C 8B 25 2A 10 00 00 4C 8D
        00001010h: 2D FA 0D 00 00 E9 8C 00 00 00 66 0F 1F 44 00 00
        00001020h: 48 8B 05 21 10 00 00 48 8B 38 31 F6 BA 10 00 00
        00001030h: 00 E8 2E 09 00 00 89 45 AC EB 6B 83 FA 73 0F 85
        00001040h: 90 00 00 00 48 8B 05 FD 0F 00 00 48 8B 38 E8 C9
        00001050h: 08 00 00 89 45 C4 EB 4E 83 FA 6C 75 77 48 8B 05
        00001060h: E4 0F 00 00 48 8B 38 31 F6 BA 10 00 00 00 E8 F1
        00001070h: 08 00 00 89 45 B8 EB 2E 83 FA 77 75 57 48 8B 05
        00001080h: C4 0F 00 00 48 8B 38 31 F6 BA 10 00 00 00 E8 D1
        00001090h: 08 00 00 C7 45 C8 01 00 00 00 89 45 D0 EB 07 C6
        000010A0h: 05 3A 11 00 00 01 44 89 F7 48 89 DE 48 8D 05 2F
        000010B0h: 0D 00 00 48 89 C2 48 8D 05 43 10 00 00 48 89 C1
        000010C0h: 4D 89 F8 E8 78 08 00 00 83 F8 60 89 C2 7F 15 83
        000010D0h: FA FF 74 43 49 8B 3C 24 30 C0 4C 89 EE E8 4C 08
        000010E0h: 00 00 EB C2 83 FA 76 7F 8F 83 FA 72 0F 8F 49 FF
        000010F0h: FF FF 83 FA 6B 0F 8F 5D FF FF FF 83 FA 61 0F 84
        00001100h: 1C FF FF FF 83 FA 64 74 96 83 FA 68 75 C6 E8 3D
        00001110h: 07 00 00 31 C0 EB 3C 48 8B 05 32 0F 00 00 44 39
        00001120h: 30 75 06 83 7D AC FF 75 39 48 8B 05 08 0F 00 00
        00001130h: 48 8B 08 48 8D 3D F6 0C 00 00 BE 01 00 00 00 BA
        00001140h: 32 00 00 00 E8 F1 07 00 00 E8 02 07 00 00 B8 FF
        00001150h: FF FF FF 48 83 C4 68 5B 41 5C 41 5D 41 5E 41 5F
        00001160h: 5D C3 8B 4D B8 8B 55 AC 8D 4C 0A FF 48 8B 05 CD

4. Fill a memory region with a pattern 0x55aa55aa
        % hexdumpmem -a 0x1000 -s 4 -l 0x20 -w 0x5555aaaa
        Memory region 0x00001000 ~ 0x0000101f
        % hexdumpmem -a 0x1000 -s 4 -l 0x20
        Memory region 0x00001000 ~ 0x0000101f
        addr              0        4        8        C
        ==============================================
        00001000h: 5555AAAA 5555AAAA 5555AAAA 5555AAAA
        00001010h: 5555AAAA 5555AAAA 5555AAAA 5555AAAA

About

hexdumpmem is hexdump-like tool to dump memory and write memory. When developing a system on a SoC, I usually need to dump or write memory-map registers of the SoC for debugging. I write this program to do it on my developing Android phone.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published