Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dump: Add a command to print out the Data.Macaw.Memory.Memory #459

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

langston-barrett
Copy link
Contributor

No description provided.

@langston-barrett langston-barrett self-assigned this Dec 19, 2024
@langston-barrett langston-barrett force-pushed the lb/dump-memory branch 2 times, most recently from 7e16485 to 3e1e3ea Compare December 19, 2024 18:45
Previously:

    [  base   = 1
      offset = 0x0
      flags  = r
      size   = 0x798,  base   = 1
      offset = 0x1000
      flags  = rx
      size   = 0x2e5,  base   = 1
      offset = 0x2000
      flags  = r
      size   = 0x17c,  base   = 1
      offset = 0x3da0
      flags  = rw
      size   = 0x340]

Now:

    [ base   = 1
      offset = 0x0
      flags  = r
      size   = 0x798
    , base   = 1
      offset = 0x1000
      flags  = rx
      size   = 0x2e5
    , base   = 1
      offset = 0x2000
      flags  = r
      size   = 0x17c
    , base   = 1
      offset = 0x3da0
      flags  = rw
      size   = 0x340 ]
@langston-barrett
Copy link
Contributor Author

Example output:

[ base   = 1
  offset = 0x0
  flags  = r
  size   = 0x798
, base   = 1
  offset = 0x1000
  flags  = rx
  size   = 0x2e5
, base   = 1
  offset = 0x2000
  flags  = r
  size   = 0x17c
, base   = 1
  offset = 0x3da0
  flags  = rw
  size   = 0x340 ]

with --contents:

Lots of text
Contents:
segment1+0x0:                7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 03
                             00 3e 00 01 00 00 00 00 00 00 00 00 00 00 00 40 00
                             00 00 00 00 00 00 88 74 00 00 00 00 00 00 00 00 00
                             00 40 00 38 00 09 00 40 00 25 00 24 00 01 00 00 00
                             04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 98 07 00 00 00 00
                             00 00 98 07 00 00 00 00 00 00 00 10 00 00 00 00 00
                             00 01 00 00 00 05 00 00 00 00 10 00 00 00 00 00 00
                             00 10 00 00 00 00 00 00 00 10 00 00 00 00 00 00 e5
                             02 00 00 00 00 00 00 e5 02 00 00 00 00 00 00 00 10
                             00 00 00 00 00 00 01 00 00 00 04 00 00 00 00 20 00
                             00 00 00 00 00 00 20 00 00 00 00 00 00 00 20 00 00
                             00 00 00 00 7c 01 00 00 00 00 00 00 7c 01 00 00 00
                             00 00 00 00 10 00 00 00 00 00 00 01 00 00 00 06 00
                             00 00 a0 2d 00 00 00 00 00 00 a0 3d 00 00 00 00 00
                             00 a0 3d 00 00 00 00 00 00 38 03 00 00 00 00 00 00
                             40 03 00 00 00 00 00 00 00 10 00 00 00 00 00 00 02
                             00 00 00 06 00 00 00 00 2e 00 00 00 00 00 00 00 3e
                             00 00 00 00 00 00 00 3e 00 00 00 00 00 00 e0 01 00
                             00 00 00 00 00 e0 01 00 00 00 00 00 00 08 00 00 00
                             00 00 00 00 04 00 00 00 04 00 00 00 38 02 00 00 00
                             00 00 00 38 02 00 00 00 00 00 00 38 02 00 00 00 00
                             00 00 24 00 00 00 00 00 00 00 24 00 00 00 00 00 00
                             00 04 00 00 00 00 00 00 00 50 e5 74 64 04 00 00 00
                             7c 20 00 00 00 00 00 00 7c 20 00 00 00 00 00 00 7c
                             20 00 00 00 00 00 00 34 00 00 00 00 00 00 00 34 00
                             00 00 00 00 00 00 04 00 00 00 00 00 00 00 51 e5 74
                             64 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00
                             00 00 52 e5 74 64 04 00 00 00 a0 2d 00 00 00 00 00
                             00 a0 3d 00 00 00 00 00 00 a0 3d 00 00 00 00 00 00
                             60 02 00 00 00 00 00 00 60 02 00 00 00 00 00 00 01
                             00 00 00 00 00 00 00 04 00 00 00 14 00 00 00 03 00
                             00 00 47 4e 55 00 47 b0 b9 4f 7c 96 32 9d 20 09 6a
                             0b b9 04 f1 03 0d ab b0 0d 00 00 00 00 02 00 00 00
                             0e 00 00 00 01 00 00 00 06 00 00 00 00 00 00 00 00
                             00 00 84 0e 00 00 00 00 00 00 00 fb 4f cf d5 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 10 00 00 00 20 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ca
                             00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 55 00 00 00 10 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 d5 00 00 00
                             12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 65 00 00 00 10 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 a4 00 00 00 10 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             70 00 00 00 12 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 01 00 00 00 20 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 8d 00 00
                             00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 2c 00 00 00 20 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 77 00 00 00 10 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 46 00 00 00 22 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 b8 00 00 00 12 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e6 00
                             00 00 11 00 17 00 68 40 00 00 00 00 00 00 70 00 00
                             00 00 00 00 00 00 5f 5f 67 6d 6f 6e 5f 73 74 61 72
                             74 5f 5f 00 5f 49 54 4d 5f 64 65 72 65 67 69 73 74
                             65 72 54 4d 43 6c 6f 6e 65 54 61 62 6c 65 00 5f 49
                             54 4d 5f 72 65 67 69 73 74 65 72 54 4d 43 6c 6f 6e
                             65 54 61 62 6c 65 00 5f 5f 63 78 61 5f 66 69 6e 61
                             6c 69 7a 65 00 61 70 5f 68 6f 6f 6b 5f 68 61 6e 64
                             6c 65 72 00 61 70 72 5f 70 61 6c 6c 6f 63 00 73 74
                             72 63 6d 70 00 61 70 5f 73 65 74 75 70 5f 63 6c 69
                             65 6e 74 5f 62 6c 6f 63 6b 00 61 70 5f 73 68 6f 75
                             6c 64 5f 63 6c 69 65 6e 74 5f 62 6c 6f 63 6b 00 61
                             70 5f 67 65 74 5f 63 6c 69 65 6e 74 5f 62 6c 6f 63
                             6b 00 62 36 34 5f 65 6e 63 6f 64 65 5f 75 6e 73 61
                             66 65 00 61 70 5f 72 70 72 69 6e 74 66 00 5f 5f 73
                             74 61 63 6b 5f 63 68 6b 5f 66 61 69 6c 00 6d 6f 64
                             69 66 79 5f 72 65 71 75 65 73 74 5f 6d 6f 64 75 6c
                             65 00 6c 69 62 62 36 34 2e 73 6f 00 6c 69 62 63 2e
                             73 6f 2e 36 00 6d 6f 64 5f 6d 6f 64 69 66 79 5f 72
                             65 71 75 65 73 74 5f 68 65 61 64 65 72 2e 73 6f 00
                             47 4c 49 42 43 5f 32 2e 32 2e 35 00 47 4c 49 42 43
                             5f 32 2e 34 00 00 00 00 01 00 01 00 01 00 02 00 01
                             00 01 00 03 00 01 00 01 00 01 00 01 00 03 00 01 00
                             01 00 00 00 00 00 00 00 01 00 02 00 06 01 00 00 10
                             00 00 00 00 00 00 00 75 1a 69 09 00 00 03 00 2d 01
                             00 00 10 00 00 00 14 69 69 0d 00 00 02 00 39 01 00
                             00 00 00 00 00 a0 3d 00 00 00 00 00 00 08 00 00 00
                             00 00 00 00 80 11 00 00 00 00 00 00 a8 3d 00 00 00
                             00 00 00 08 00 00 00 00 00 00 00 40 11 00 00 00 00
                             00 00 b0 3d 00 00 00 00 00 00 08 00 00 00 00 00 00
                             00 3a 20 00 00 00 00 00 00 b8 3d 00 00 00 00 00 00
                             08 00 00 00 00 00 00 00 b0 11 00 00 00 00 00 00 d0
                             3d 00 00 00 00 00 00 08 00 00 00 00 00 00 00 47 20
                             00 00 00 00 00 00 60 40 00 00 00 00 00 00 08 00 00
                             00 00 00 00 00 60 40 00 00 00 00 00 00 78 40 00 00
                             00 00 00 00 08 00 00 00 00 00 00 00 00 20 00 00 00
                             00 00 00 c0 40 00 00 00 00 00 00 08 00 00 00 00 00
                             00 00 b0 3d 00 00 00 00 00 00 c8 40 00 00 00 00 00
                             00 08 00 00 00 00 00 00 00 90 11 00 00 00 00 00 00
                             e0 3f 00 00 00 00 00 00 06 00 00 00 01 00 00 00 00
                             00 00 00 00 00 00 00 e8 3f 00 00 00 00 00 00 06 00
                             00 00 08 00 00 00 00 00 00 00 00 00 00 00 f0 3f 00
                             00 00 00 00 00 06 00 00 00 0a 00 00 00 00 00 00 00
                             00 00 00 00 f8 3f 00 00 00 00 00 00 06 00 00 00 0c
                             00 00 00 00 00 00 00 00 00 00 00 18 40 00 00 00 00
                             00 00 07 00 00 00 02 00 00 00 00 00 00 00 00 00 00
                             00 20 40 00 00 00 00 00 00 07 00 00 00 03 00 00 00
                             00 00 00 00 00 00 00 00 28 40 00 00 00 00 00 00 07
                             00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 30 40
                             00 00 00 00 00 00 07 00 00 00 05 00 00 00 00 00 00
                             00 00 00 00 00 38 40 00 00 00 00 00 00 07 00 00 00
                             06 00 00 00 00 00 00 00 00 00 00 00 40 40 00 00 00
                             00 00 00 07 00 00 00 07 00 00 00 00 00 00 00 00 00
                             00 00 48 40 00 00 00 00 00 00 07 00 00 00 09 00 00
                             00 00 00 00 00 00 00 00 00 50 40 00 00 00 00 00 00
                             07 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00 58
                             40 00 00 00 00 00 00 07 00 00 00 0d 00 00 00 00 00
                             00 00 00 00 00 00
segment1+0x1000:             f3 0f 1e fa 48 83 ec 08 48 8b 05 d9 2f 00 00 48 85
                             c0 74 02 ff d0 48 83 c4 08 c3 00 00 00 00 00 ff 35
                             e2 2f 00 00 ff 25 e4 2f 00 00 0f 1f 40 00 ff 25 e2
                             2f 00 00 68 00 00 00 00 e9 e0 ff ff ff ff 25 da 2f
                             00 00 68 01 00 00 00 e9 d0 ff ff ff ff 25 d2 2f 00
                             00 68 02 00 00 00 e9 c0 ff ff ff ff 25 ca 2f 00 00
                             68 03 00 00 00 e9 b0 ff ff ff ff 25 c2 2f 00 00 68
                             04 00 00 00 e9 a0 ff ff ff ff 25 ba 2f 00 00 68 05
                             00 00 00 e9 90 ff ff ff ff 25 b2 2f 00 00 68 06 00
                             00 00 e9 80 ff ff ff ff 25 aa 2f 00 00 68 07 00 00
                             00 e9 70 ff ff ff ff 25 a2 2f 00 00 68 08 00 00 00
                             e9 60 ff ff ff ff 25 32 2f 00 00 66 90 00 00 00 00
                             00 00 00 00 48 8d 3d 01 30 00 00 48 8d 05 fa 2f 00
                             00 48 39 f8 74 15 48 8b 05 f6 2e 00 00 48 85 c0 74
                             09 ff e0 0f 1f 80 00 00 00 00 c3 0f 1f 80 00 00 00
                             00 48 8d 3d d1 2f 00 00 48 8d 35 ca 2f 00 00 48 29
                             fe 48 89 f0 48 c1 ee 3f 48 c1 f8 03 48 01 c6 48 d1
                             fe 74 14 48 8b 05 c5 2e 00 00 48 85 c0 74 08 ff e0
                             66 0f 1f 44 00 00 c3 0f 1f 80 00 00 00 00 f3 0f 1e
                             fa 80 3d 8d 2f 00 00 00 75 2b 55 48 83 3d a2 2e 00
                             00 00 48 89 e5 74 0c 48 8b 3d fe 2e 00 00 e8 59 ff
                             ff ff e8 64 ff ff ff c6 05 65 2f 00 00 01 5d c3 0f
                             1f 00 c3 0f 1f 80 00 00 00 00 f3 0f 1e fa e9 77 ff
                             ff ff 0f 1f 80 00 00 00 00 48 8d 3d 39 00 00 00 31
                             f6 31 d2 b9 0a 00 00 00 e9 9b fe ff ff 66 66 2e 0f
                             1f 84 00 00 00 00 00 53 48 89 d3 48 8b 7f 40 be 08
                             00 00 00 e8 9e fe ff ff 48 89 18 31 c0 5b c3 0f 1f
                             80 00 00 00 00 41 57 41 56 41 54 53 48 81 ec 08 20
                             00 00 49 89 fe 64 48 8b 04 25 28 00 00 00 48 89 84
                             24 00 20 00 00 48 8b bf 18 01 00 00 bb ff ff ff ff
                             48 85 ff 0f 84 a8 00 00 00 48 8d 35 4d 0e 00 00 e8
                             6d fe ff ff 85 c0 0f 85 94 00 00 00 31 db 41 83 7e
                             6c 02 0f 85 87 00 00 00 4c 89 f7 be 02 00 00 00 e8
                             6b fe ff ff bb f4 01 00 00 85 c0 75 71 4c 89 f7 e8
                             4a fe ff ff 31 db 85 c0 74 42 48 89 e6 ba fe 1f 00
                             00 4c 89 f7 e8 14 fe ff ff 45 31 ff 85 c0 7e 2e 49
                             89 e4 66 2e 0f 1f 84 00 00 00 00 00 25 ff ff ff 7f
                             49 01 c7 ba fe 1f 00 00 4c 89 f7 4c 89 e6 e8 e8 fd
                             ff ff 85 c0 7f e4 eb 03 45 31 ff 31 ff 4c 89 fe e8
                             15 fe ff ff 48 8d 35 c0 0d 00 00 4c 89 f7 48 89 c2
                             31 c0 e8 81 fd ff ff 64 48 8b 04 25 28 00 00 00 48
                             3b 84 24 00 20 00 00 75 11 89 d8 48 81 c4 08 20 00
                             00 5b 41 5c 41 5e 41 5f c3 e8 78 fd ff ff f3 0f 1e
                             fa 48 83 ec 08 48 83 c4 08 c3
segment1+0x2000:             73 72 63 2f 6d 6f 64 5f 6d 6f 64 69 66 79 5f 72 65
                             71 75 65 73 74 5f 68 65 61 64 65 72 2f 6d 6f 64 5f
                             6d 6f 64 69 66 79 5f 72 65 71 75 65 73 74 5f 68 65
                             61 64 65 72 2e 63 00 43 75 73 74 6f 6d 48 65 61 64
                             65 72 00 53 65 74 20 61 20 63 75 73 74 6f 6d 20 68
                             65 61 64 65 72 00 62 61 73 65 36 34 00 52 65 63 65
                             69 76 65 64 20 50 4f 53 54 20 64 61 74 61 3a 20 25
                             73 0a 00 00 00 01 1b 03 3b 30 00 00 00 05 00 00 00
                             a4 ef ff ff 4c 00 00 00 44 f0 ff ff 74 00 00 00 14
                             f1 ff ff 8c 00 00 00 34 f1 ff ff a0 00 00 00 54 f1
                             ff ff bc 00 00 00 14 00 00 00 00 00 00 00 01 7a 52
                             00 01 78 10 01 1b 0c 07 08 90 01 00 00 24 00 00 00
                             1c 00 00 00 50 ef ff ff a0 00 00 00 00 0e 10 46 0e
                             18 4a 0f 0b 77 08 80 00 3f 1a 3b 2a 33 24 22 00 00
                             00 00 14 00 00 00 44 00 00 00 c8 ef ff ff 08 00 00
                             00 00 00 00 00 00 00 00 00 10 00 00 00 5c 00 00 00
                             80 f0 ff ff 15 00 00 00 00 00 00 00 18 00 00 00 70
                             00 00 00 8c f0 ff ff 19 00 00 00 00 41 0e 10 83 02
                             57 0e 08 00 00 00 3c 00 00 00 8c 00 00 00 90 f0 ff
                             ff 08 01 00 00 00 42 0e 10 42 0e 18 42 0e 20 41 0e
                             28 47 0e b0 40 83 05 8c 04 8e 03 8f 02 02 ed 0e 28
                             41 0e 20 42 0e 18 42 0e 10 42 0e 08 41 0e b0 40 00
                             00 00 00 00 00 00
segment1+0x3da0:             [areloc,base_addr,ffffffffffffd3e0,64,LE]
segment1+0x3da8:             [areloc,base_addr,ffffffffffffd398,64,LE]
segment1+0x3db0:             [areloc,base_addr,ffffffffffffe28a,64,LE]
segment1+0x3db8:             [areloc,base_addr,ffffffffffffd3f8,64,LE]
segment1+0x3dc0:             00 00 00 00 00 00 00 00 1f 00 00 00 01 00 00 00
segment1+0x3dd0:             [areloc,base_addr,ffffffffffffe277,64,LE]
segment1+0x3dd8:             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 01 00 00 00 00 00 00 00 fc 00 00
                             00 00 00 00 00 01 00 00 00 00 00 00 00 06 01 00 00
                             00 00 00 00 0e 00 00 00 00 00 00 00 10 01 00 00 00
                             00 00 00 0c 00 00 00 00 00 00 00 00 10 00 00 00 00
                             00 00 0d 00 00 00 00 00 00 00 d8 12 00 00 00 00 00
                             00 19 00 00 00 00 00 00 00 a0 3d 00 00 00 00 00 00
                             1b 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 1a
                             00 00 00 00 00 00 00 a8 3d 00 00 00 00 00 00 1c 00
                             00 00 00 00 00 00 08 00 00 00 00 00 00 00 f5 fe ff
                             6f 00 00 00 00 60 02 00 00 00 00 00 00 05 00 00 00
                             00 00 00 00 f0 03 00 00 00 00 00 00 06 00 00 00 00
                             00 00 00 88 02 00 00 00 00 00 00 0a 00 00 00 00 00
                             00 00 43 01 00 00 00 00 00 00 0b 00 00 00 00 00 00
                             00 18 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00
                             00 40 00 00 00 00 00 00 02 00 00 00 00 00 00 00 d8
                             00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 07 00
                             00 00 00 00 00 00 17 00 00 00 00 00 00 00 c0 06 00
                             00 00 00 00 00 07 00 00 00 00 00 00 00 88 05 00 00
                             00 00 00 00 08 00 00 00 00 00 00 00 38 01 00 00 00
                             00 00 00 09 00 00 00 00 00 00 00 18 00 00 00 00 00
                             00 00 fe ff ff 6f 00 00 00 00 58 05 00 00 00 00 00
                             00 ff ff ff 6f 00 00 00 00 01 00 00 00 00 00 00 00
                             f0 ff ff 6f 00 00 00 00 34 05 00 00 00 00 00 00 f9
                             ff ff 6f 00 00 00 00 09 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00
segment1+0x3fe0:             [areloc,_ITM_deregisterTMCloneTable,0,64,LE]
segment1+0x3fe8:             [areloc,__gmon_start__,0,64,LE]
segment1+0x3ff0:             [areloc,_ITM_registerTMCloneTable,0,64,LE]
segment1+0x3ff8:             [areloc,[email protected](GLIBC_2.2.5),0,64,LE]
segment1+0x4000:             00 3e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00
segment1+0x4018:             [areloc,ap_rprintf,0,64,LE]
segment1+0x4020:             [areloc,ap_hook_handler,0,64,LE]
segment1+0x4028:             [areloc,[email protected](GLIBC_2.4),0,64,LE]
segment1+0x4030:             [areloc,apr_palloc,0,64,LE]
segment1+0x4038:             [areloc,ap_get_client_block,0,64,LE]
segment1+0x4040:             [areloc,[email protected](GLIBC_2.2.5),0,64,LE]
segment1+0x4048:             [areloc,ap_should_client_block,0,64,LE]
segment1+0x4050:             [areloc,ap_setup_client_block,0,64,LE]
segment1+0x4058:             [areloc,b64_encode_unsafe,0,64,LE]
segment1+0x4060:             [areloc,base_addr,0,64,LE]
segment1+0x4068:             93 02 33 01 86 00 00 00 ff ff ff ff 00 00 00 00
segment1+0x4078:             [areloc,base_addr,ffffffffffffdf88,64,LE]
segment1+0x4080:             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34
                             32 50 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                             00 00 00 00 00 00 00 00 00 00 00 00 00
segment1+0x40c0:             [areloc,base_addr,fffffffffffffcf0,64,LE]
segment1+0x40c8:             [areloc,base_addr,ffffffffffffd0c8,64,LE]
segment1+0x40d0:             00 00 00 00 00 00 00 00
segment1+0x40d8:             [bss,0x8]

macaw-dump/src/Data/Macaw/Dump/Memory.hs Outdated Show resolved Hide resolved
@langston-barrett langston-barrett marked this pull request as ready for review December 19, 2024 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants