ronin 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/History.txt +25 -0
  2. data/Manifest.txt +36 -11
  3. data/README.txt +6 -8
  4. data/Rakefile +2 -1
  5. data/lib/ronin/config.rb +0 -3
  6. data/lib/ronin/environment.rb +1 -1
  7. data/lib/ronin/extensions/string.rb +0 -11
  8. data/lib/ronin/formatting/extensions/binary/integer.rb +24 -12
  9. data/lib/ronin/formatting/extensions/binary/string.rb +166 -0
  10. data/lib/ronin/formatting/extensions/text/string.rb +4 -4
  11. data/lib/ronin/license.rb +42 -12
  12. data/lib/ronin/os.rb +3 -2
  13. data/lib/ronin/platform/extension.rb +11 -141
  14. data/lib/ronin/platform/extension_cache.rb +11 -0
  15. data/lib/ronin/platform/overlay.rb +56 -25
  16. data/lib/ronin/platform/overlay_cache.rb +1 -1
  17. data/lib/ronin/platform/platform.rb +14 -3
  18. data/lib/ronin/platform/ronin.rb +20 -1
  19. data/lib/ronin/platform/tasks/spec.rb +9 -0
  20. data/lib/ronin/{chars.rb → static.rb} +2 -2
  21. data/lib/ronin/static/finders.rb +144 -0
  22. data/lib/ronin/static/static.rb +53 -0
  23. data/lib/ronin/ui/command_line/commands/add.rb +21 -5
  24. data/lib/ronin/ui/command_line/commands/install.rb +19 -3
  25. data/lib/ronin/ui/command_line/commands/rm.rb +1 -1
  26. data/lib/ronin/ui/command_line/commands/uninstall.rb +1 -1
  27. data/lib/ronin/ui/command_line/commands/update.rb +9 -2
  28. data/lib/ronin/version.rb +1 -1
  29. data/spec/extensions/string_spec.rb +0 -10
  30. data/spec/formatting/binary/helpers/hexdumps.rb +14 -0
  31. data/spec/formatting/binary/helpers/hexdumps/hexdump_decimal_shorts.txt +17 -0
  32. data/spec/formatting/binary/helpers/hexdumps/hexdump_hex_bytes.txt +17 -0
  33. data/spec/formatting/binary/helpers/hexdumps/hexdump_hex_shorts.txt +17 -0
  34. data/spec/formatting/binary/helpers/hexdumps/hexdump_octal_bytes.txt +17 -0
  35. data/spec/formatting/binary/helpers/hexdumps/hexdump_octal_shorts.txt +17 -0
  36. data/spec/formatting/binary/helpers/hexdumps/hexdump_repeated.txt +6 -0
  37. data/spec/formatting/binary/helpers/hexdumps/od_decimal_bytes.txt +17 -0
  38. data/spec/formatting/binary/helpers/hexdumps/od_decimal_ints.txt +17 -0
  39. data/spec/formatting/binary/helpers/hexdumps/od_decimal_quads.txt +17 -0
  40. data/spec/formatting/binary/helpers/hexdumps/od_decimal_shorts.txt +17 -0
  41. data/spec/formatting/binary/helpers/hexdumps/od_hex_bytes.txt +17 -0
  42. data/spec/formatting/binary/helpers/hexdumps/od_hex_ints.txt +17 -0
  43. data/spec/formatting/binary/helpers/hexdumps/od_hex_quads.txt +17 -0
  44. data/spec/formatting/binary/helpers/hexdumps/od_hex_shorts.txt +17 -0
  45. data/spec/formatting/binary/helpers/hexdumps/od_octal_bytes.txt +17 -0
  46. data/spec/formatting/binary/helpers/hexdumps/od_octal_ints.txt +17 -0
  47. data/spec/formatting/binary/helpers/hexdumps/od_octal_quads.txt +17 -0
  48. data/spec/formatting/binary/helpers/hexdumps/od_octal_shorts.txt +17 -0
  49. data/spec/formatting/binary/helpers/hexdumps/od_repeated.txt +6 -0
  50. data/spec/formatting/binary/helpers/hexdumps/repeated.bin +1 -0
  51. data/spec/formatting/binary/integer_spec.rb +61 -1
  52. data/spec/formatting/binary/string_spec.rb +166 -9
  53. data/spec/platform/extension_cache_spec.rb +8 -0
  54. data/spec/platform/helpers/overlays.yaml.erb +3 -0
  55. data/spec/platform/helpers/overlays/hello/ronin.xml +1 -1
  56. data/spec/platform/helpers/overlays/random/random/extension.rb +7 -0
  57. data/spec/platform/helpers/overlays/random/ronin.xml +26 -0
  58. data/spec/platform/helpers/overlays/test1/ronin.xml +2 -2
  59. data/spec/platform/helpers/overlays/test2/ronin.xml +2 -2
  60. data/spec/platform/overlay_cache_spec.rb +5 -3
  61. data/spec/platform/overlay_spec.rb +35 -0
  62. data/spec/platform/ronin_spec.rb +13 -1
  63. data/spec/static/finders_spec.rb +55 -0
  64. data/spec/static/helpers/static.rb +11 -0
  65. data/spec/static/helpers/static1/dir/two.txt +0 -0
  66. data/spec/static/helpers/static1/one.txt +0 -0
  67. data/spec/static/helpers/static2/dir/two.txt +0 -0
  68. data/spec/static/helpers/static_class.rb +7 -0
  69. data/spec/static/static_spec.rb +24 -0
  70. data/static/{overlay.xsl → ronin/platform/overlay.xsl} +0 -0
  71. metadata +50 -17
  72. data/bin/ronin-ext +0 -12
  73. data/bin/ronin-overlay +0 -12
  74. data/lib/ronin/chars/char_set.rb +0 -198
  75. data/lib/ronin/chars/chars.rb +0 -190
  76. data/lib/ronin/ui/command_line/commands/ext.rb +0 -70
  77. data/lib/ronin/ui/command_line/commands/overlay.rb +0 -189
  78. data/spec/chars/char_set_spec.rb +0 -175
  79. data/spec/chars/chars_spec.rb +0 -107
  80. data/static/extension.rb +0 -9
@@ -0,0 +1,17 @@
1
+ 00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |................|
2
+ 00000010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f |................|
3
+ 00000020 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f | !"#$%&'()*+,-./|
4
+ 00000030 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f |0123456789:;<=>?|
5
+ 00000040 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f |@ABCDEFGHIJKLMNO|
6
+ 00000050 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f |PQRSTUVWXYZ[\]^_|
7
+ 00000060 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f |`abcdefghijklmno|
8
+ 00000070 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f |pqrstuvwxyz{|}~.|
9
+ 00000080 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f |................|
10
+ 00000090 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f |................|
11
+ 000000a0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af |................|
12
+ 000000b0 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf |................|
13
+ 000000c0 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf |................|
14
+ 000000d0 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df |................|
15
+ 000000e0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef |................|
16
+ 000000f0 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff |................|
17
+ 00000100
@@ -0,0 +1,17 @@
1
+ 0000000 0100 0302 0504 0706 0908 0b0a 0d0c 0f0e
2
+ 0000010 1110 1312 1514 1716 1918 1b1a 1d1c 1f1e
3
+ 0000020 2120 2322 2524 2726 2928 2b2a 2d2c 2f2e
4
+ 0000030 3130 3332 3534 3736 3938 3b3a 3d3c 3f3e
5
+ 0000040 4140 4342 4544 4746 4948 4b4a 4d4c 4f4e
6
+ 0000050 5150 5352 5554 5756 5958 5b5a 5d5c 5f5e
7
+ 0000060 6160 6362 6564 6766 6968 6b6a 6d6c 6f6e
8
+ 0000070 7170 7372 7574 7776 7978 7b7a 7d7c 7f7e
9
+ 0000080 8180 8382 8584 8786 8988 8b8a 8d8c 8f8e
10
+ 0000090 9190 9392 9594 9796 9998 9b9a 9d9c 9f9e
11
+ 00000a0 a1a0 a3a2 a5a4 a7a6 a9a8 abaa adac afae
12
+ 00000b0 b1b0 b3b2 b5b4 b7b6 b9b8 bbba bdbc bfbe
13
+ 00000c0 c1c0 c3c2 c5c4 c7c6 c9c8 cbca cdcc cfce
14
+ 00000d0 d1d0 d3d2 d5d4 d7d6 d9d8 dbda dddc dfde
15
+ 00000e0 e1e0 e3e2 e5e4 e7e6 e9e8 ebea edec efee
16
+ 00000f0 f1f0 f3f2 f5f4 f7f6 f9f8 fbfa fdfc fffe
17
+ 0000100
@@ -0,0 +1,17 @@
1
+ 0000000 000 001 002 003 004 005 006 007 010 011 012 013 014 015 016 017
2
+ 0000010 020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
3
+ 0000020 040 041 042 043 044 045 046 047 050 051 052 053 054 055 056 057
4
+ 0000030 060 061 062 063 064 065 066 067 070 071 072 073 074 075 076 077
5
+ 0000040 100 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117
6
+ 0000050 120 121 122 123 124 125 126 127 130 131 132 133 134 135 136 137
7
+ 0000060 140 141 142 143 144 145 146 147 150 151 152 153 154 155 156 157
8
+ 0000070 160 161 162 163 164 165 166 167 170 171 172 173 174 175 176 177
9
+ 0000080 200 201 202 203 204 205 206 207 210 211 212 213 214 215 216 217
10
+ 0000090 220 221 222 223 224 225 226 227 230 231 232 233 234 235 236 237
11
+ 00000a0 240 241 242 243 244 245 246 247 250 251 252 253 254 255 256 257
12
+ 00000b0 260 261 262 263 264 265 266 267 270 271 272 273 274 275 276 277
13
+ 00000c0 300 301 302 303 304 305 306 307 310 311 312 313 314 315 316 317
14
+ 00000d0 320 321 322 323 324 325 326 327 330 331 332 333 334 335 336 337
15
+ 00000e0 340 341 342 343 344 345 346 347 350 351 352 353 354 355 356 357
16
+ 00000f0 360 361 362 363 364 365 366 367 370 371 372 373 374 375 376 377
17
+ 0000100
@@ -0,0 +1,17 @@
1
+ 0000000 000400 001402 002404 003406 004410 005412 006414 007416
2
+ 0000010 010420 011422 012424 013426 014430 015432 016434 017436
3
+ 0000020 020440 021442 022444 023446 024450 025452 026454 027456
4
+ 0000030 030460 031462 032464 033466 034470 035472 036474 037476
5
+ 0000040 040500 041502 042504 043506 044510 045512 046514 047516
6
+ 0000050 050520 051522 052524 053526 054530 055532 056534 057536
7
+ 0000060 060540 061542 062544 063546 064550 065552 066554 067556
8
+ 0000070 070560 071562 072564 073566 074570 075572 076574 077576
9
+ 0000080 100600 101602 102604 103606 104610 105612 106614 107616
10
+ 0000090 110620 111622 112624 113626 114630 115632 116634 117636
11
+ 00000a0 120640 121642 122644 123646 124650 125652 126654 127656
12
+ 00000b0 130660 131662 132664 133666 134670 135672 136674 137676
13
+ 00000c0 140700 141702 142704 143706 144710 145712 146714 147716
14
+ 00000d0 150720 151722 152724 153726 154730 155732 156734 157736
15
+ 00000e0 160740 161742 162744 163746 164750 165752 166754 167756
16
+ 00000f0 170760 171762 172764 173766 174770 175772 176774 177776
17
+ 0000100
@@ -0,0 +1,6 @@
1
+ 00000000 68 65 6c 6c 6f 20 20 20 20 20 20 20 20 20 20 20 |hello |
2
+ 00000010 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
3
+ *
4
+ 00000030 20 20 20 20 20 20 20 20 20 20 20 67 6f 6f 64 62 | goodb|
5
+ 00000040 79 65 0a |ye.|
6
+ 00000043
@@ -0,0 +1,17 @@
1
+ 0000000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2
+ 0000020 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
3
+ 0000040 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
4
+ 0000060 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
5
+ 0000100 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
6
+ 0000120 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
7
+ 0000140 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
8
+ 0000160 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
9
+ 0000200 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
10
+ 0000220 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
11
+ 0000240 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
12
+ 0000260 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
13
+ 0000300 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
14
+ 0000320 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
15
+ 0000340 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
16
+ 0000360 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 50462976 117835012 185207048 252579084
2
+ 0000020 319951120 387323156 454695192 522067228
3
+ 0000040 589439264 656811300 724183336 791555372
4
+ 0000060 858927408 926299444 993671480 1061043516
5
+ 0000100 1128415552 1195787588 1263159624 1330531660
6
+ 0000120 1397903696 1465275732 1532647768 1600019804
7
+ 0000140 1667391840 1734763876 1802135912 1869507948
8
+ 0000160 1936879984 2004252020 2071624056 2138996092
9
+ 0000200 2206368128 2273740164 2341112200 2408484236
10
+ 0000220 2475856272 2543228308 2610600344 2677972380
11
+ 0000240 2745344416 2812716452 2880088488 2947460524
12
+ 0000260 3014832560 3082204596 3149576632 3216948668
13
+ 0000300 3284320704 3351692740 3419064776 3486436812
14
+ 0000320 3553808848 3621180884 3688552920 3755924956
15
+ 0000340 3823296992 3890669028 3958041064 4025413100
16
+ 0000360 4092785136 4160157172 4227529208 4294901244
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 506097522914230528 1084818905618843912
2
+ 0000020 1663540288323457296 2242261671028070680
3
+ 0000040 2820983053732684064 3399704436437297448
4
+ 0000060 3978425819141910832 4557147201846524216
5
+ 0000100 5135868584551137600 5714589967255750984
6
+ 0000120 6293311349960364368 6872032732664977752
7
+ 0000140 7450754115369591136 8029475498074204520
8
+ 0000160 8608196880778817904 9186918263483431288
9
+ 0000200 9765639646188044672 10344361028892658056
10
+ 0000220 10923082411597271440 11501803794301884824
11
+ 0000240 12080525177006498208 12659246559711111592
12
+ 0000260 13237967942415724976 13816689325120338360
13
+ 0000300 14395410707824951744 14974132090529565128
14
+ 0000320 15552853473234178512 16131574855938791896
15
+ 0000340 16710296238643405280 17289017621348018664
16
+ 0000360 17867739004052632048 18446460386757245432
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 256 770 1284 1798 2312 2826 3340 3854
2
+ 0000020 4368 4882 5396 5910 6424 6938 7452 7966
3
+ 0000040 8480 8994 9508 10022 10536 11050 11564 12078
4
+ 0000060 12592 13106 13620 14134 14648 15162 15676 16190
5
+ 0000100 16704 17218 17732 18246 18760 19274 19788 20302
6
+ 0000120 20816 21330 21844 22358 22872 23386 23900 24414
7
+ 0000140 24928 25442 25956 26470 26984 27498 28012 28526
8
+ 0000160 29040 29554 30068 30582 31096 31610 32124 32638
9
+ 0000200 33152 33666 34180 34694 35208 35722 36236 36750
10
+ 0000220 37264 37778 38292 38806 39320 39834 40348 40862
11
+ 0000240 41376 41890 42404 42918 43432 43946 44460 44974
12
+ 0000260 45488 46002 46516 47030 47544 48058 48572 49086
13
+ 0000300 49600 50114 50628 51142 51656 52170 52684 53198
14
+ 0000320 53712 54226 54740 55254 55768 56282 56796 57310
15
+ 0000340 57824 58338 58852 59366 59880 60394 60908 61422
16
+ 0000360 61936 62450 62964 63478 63992 64506 65020 65534
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
2
+ 0000020 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
3
+ 0000040 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
4
+ 0000060 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
5
+ 0000100 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
6
+ 0000120 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
7
+ 0000140 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
8
+ 0000160 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f
9
+ 0000200 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f
10
+ 0000220 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f
11
+ 0000240 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af
12
+ 0000260 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf
13
+ 0000300 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf
14
+ 0000320 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df
15
+ 0000340 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef
16
+ 0000360 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 03020100 07060504 0b0a0908 0f0e0d0c
2
+ 0000020 13121110 17161514 1b1a1918 1f1e1d1c
3
+ 0000040 23222120 27262524 2b2a2928 2f2e2d2c
4
+ 0000060 33323130 37363534 3b3a3938 3f3e3d3c
5
+ 0000100 43424140 47464544 4b4a4948 4f4e4d4c
6
+ 0000120 53525150 57565554 5b5a5958 5f5e5d5c
7
+ 0000140 63626160 67666564 6b6a6968 6f6e6d6c
8
+ 0000160 73727170 77767574 7b7a7978 7f7e7d7c
9
+ 0000200 83828180 87868584 8b8a8988 8f8e8d8c
10
+ 0000220 93929190 97969594 9b9a9998 9f9e9d9c
11
+ 0000240 a3a2a1a0 a7a6a5a4 abaaa9a8 afaeadac
12
+ 0000260 b3b2b1b0 b7b6b5b4 bbbab9b8 bfbebdbc
13
+ 0000300 c3c2c1c0 c7c6c5c4 cbcac9c8 cfcecdcc
14
+ 0000320 d3d2d1d0 d7d6d5d4 dbdad9d8 dfdedddc
15
+ 0000340 e3e2e1e0 e7e6e5e4 ebeae9e8 efeeedec
16
+ 0000360 f3f2f1f0 f7f6f5f4 fbfaf9f8 fffefdfc
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 0706050403020100 0f0e0d0c0b0a0908
2
+ 0000020 1716151413121110 1f1e1d1c1b1a1918
3
+ 0000040 2726252423222120 2f2e2d2c2b2a2928
4
+ 0000060 3736353433323130 3f3e3d3c3b3a3938
5
+ 0000100 4746454443424140 4f4e4d4c4b4a4948
6
+ 0000120 5756555453525150 5f5e5d5c5b5a5958
7
+ 0000140 6766656463626160 6f6e6d6c6b6a6968
8
+ 0000160 7776757473727170 7f7e7d7c7b7a7978
9
+ 0000200 8786858483828180 8f8e8d8c8b8a8988
10
+ 0000220 9796959493929190 9f9e9d9c9b9a9998
11
+ 0000240 a7a6a5a4a3a2a1a0 afaeadacabaaa9a8
12
+ 0000260 b7b6b5b4b3b2b1b0 bfbebdbcbbbab9b8
13
+ 0000300 c7c6c5c4c3c2c1c0 cfcecdcccbcac9c8
14
+ 0000320 d7d6d5d4d3d2d1d0 dfdedddcdbdad9d8
15
+ 0000340 e7e6e5e4e3e2e1e0 efeeedecebeae9e8
16
+ 0000360 f7f6f5f4f3f2f1f0 fffefdfcfbfaf9f8
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 0100 0302 0504 0706 0908 0b0a 0d0c 0f0e
2
+ 0000020 1110 1312 1514 1716 1918 1b1a 1d1c 1f1e
3
+ 0000040 2120 2322 2524 2726 2928 2b2a 2d2c 2f2e
4
+ 0000060 3130 3332 3534 3736 3938 3b3a 3d3c 3f3e
5
+ 0000100 4140 4342 4544 4746 4948 4b4a 4d4c 4f4e
6
+ 0000120 5150 5352 5554 5756 5958 5b5a 5d5c 5f5e
7
+ 0000140 6160 6362 6564 6766 6968 6b6a 6d6c 6f6e
8
+ 0000160 7170 7372 7574 7776 7978 7b7a 7d7c 7f7e
9
+ 0000200 8180 8382 8584 8786 8988 8b8a 8d8c 8f8e
10
+ 0000220 9190 9392 9594 9796 9998 9b9a 9d9c 9f9e
11
+ 0000240 a1a0 a3a2 a5a4 a7a6 a9a8 abaa adac afae
12
+ 0000260 b1b0 b3b2 b5b4 b7b6 b9b8 bbba bdbc bfbe
13
+ 0000300 c1c0 c3c2 c5c4 c7c6 c9c8 cbca cdcc cfce
14
+ 0000320 d1d0 d3d2 d5d4 d7d6 d9d8 dbda dddc dfde
15
+ 0000340 e1e0 e3e2 e5e4 e7e6 e9e8 ebea edec efee
16
+ 0000360 f1f0 f3f2 f5f4 f7f6 f9f8 fbfa fdfc fffe
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 000 001 002 003 004 005 006 007 010 011 012 013 014 015 016 017
2
+ 0000020 020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
3
+ 0000040 040 041 042 043 044 045 046 047 050 051 052 053 054 055 056 057
4
+ 0000060 060 061 062 063 064 065 066 067 070 071 072 073 074 075 076 077
5
+ 0000100 100 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117
6
+ 0000120 120 121 122 123 124 125 126 127 130 131 132 133 134 135 136 137
7
+ 0000140 140 141 142 143 144 145 146 147 150 151 152 153 154 155 156 157
8
+ 0000160 160 161 162 163 164 165 166 167 170 171 172 173 174 175 176 177
9
+ 0000200 200 201 202 203 204 205 206 207 210 211 212 213 214 215 216 217
10
+ 0000220 220 221 222 223 224 225 226 227 230 231 232 233 234 235 236 237
11
+ 0000240 240 241 242 243 244 245 246 247 250 251 252 253 254 255 256 257
12
+ 0000260 260 261 262 263 264 265 266 267 270 271 272 273 274 275 276 277
13
+ 0000300 300 301 302 303 304 305 306 307 310 311 312 313 314 315 316 317
14
+ 0000320 320 321 322 323 324 325 326 327 330 331 332 333 334 335 336 337
15
+ 0000340 340 341 342 343 344 345 346 347 350 351 352 353 354 355 356 357
16
+ 0000360 360 361 362 363 364 365 366 367 370 371 372 373 374 375 376 377
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 00300400400 00701402404 01302404410 01703406414
2
+ 0000020 02304410420 02705412424 03306414430 03707416434
3
+ 0000040 04310420440 04711422444 05312424450 05713426454
4
+ 0000060 06314430460 06715432464 07316434470 07717436474
5
+ 0000100 10320440500 10721442504 11322444510 11723446514
6
+ 0000120 12324450520 12725452524 13326454530 13727456534
7
+ 0000140 14330460540 14731462544 15332464550 15733466554
8
+ 0000160 16334470560 16735472564 17336474570 17737476574
9
+ 0000200 20340500600 20741502604 21342504610 21743506614
10
+ 0000220 22344510620 22745512624 23346514630 23747516634
11
+ 0000240 24350520640 24751522644 25352524650 25753526654
12
+ 0000260 26354530660 26755532664 27356534670 27757536674
13
+ 0000300 30360540700 30761542704 31362544710 31763546714
14
+ 0000320 32364550720 32765552724 33366554730 33767556734
15
+ 0000340 34370560740 34771562744 35372564750 35773566754
16
+ 0000360 36374570760 36775572764 37376574770 37777576774
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 0034060120200300400400 0074160320601302404410
2
+ 0000020 0134260521202304410420 0174360721603306414430
3
+ 0000040 0234461122204310420440 0274561322605312424450
4
+ 0000060 0334661523206314430460 0374761723607316434470
5
+ 0000100 0435062124210320440500 0475162324611322444510
6
+ 0000120 0535262525212324450520 0575362725613326454530
7
+ 0000140 0635463126214330460540 0675563326615332464550
8
+ 0000160 0735663527216334470560 0775763727617336474570
9
+ 0000200 1036064130220340500600 1076164330621342504610
10
+ 0000220 1136264531222344510620 1176364731623346514630
11
+ 0000240 1236465132224350520640 1276565332625352524650
12
+ 0000260 1336665533226354530660 1376765733627356534670
13
+ 0000300 1437066134230360540700 1477166334631362544710
14
+ 0000320 1537266535232364550720 1577366735633366554730
15
+ 0000340 1637467136234370560740 1677567336635372564750
16
+ 0000360 1737667537236374570760 1777767737637376574770
17
+ 0000400
@@ -0,0 +1,17 @@
1
+ 0000000 000400 001402 002404 003406 004410 005412 006414 007416
2
+ 0000020 010420 011422 012424 013426 014430 015432 016434 017436
3
+ 0000040 020440 021442 022444 023446 024450 025452 026454 027456
4
+ 0000060 030460 031462 032464 033466 034470 035472 036474 037476
5
+ 0000100 040500 041502 042504 043506 044510 045512 046514 047516
6
+ 0000120 050520 051522 052524 053526 054530 055532 056534 057536
7
+ 0000140 060540 061542 062544 063546 064550 065552 066554 067556
8
+ 0000160 070560 071562 072564 073566 074570 075572 076574 077576
9
+ 0000200 100600 101602 102604 103606 104610 105612 106614 107616
10
+ 0000220 110620 111622 112624 113626 114630 115632 116634 117636
11
+ 0000240 120640 121642 122644 123646 124650 125652 126654 127656
12
+ 0000260 130660 131662 132664 133666 134670 135672 136674 137676
13
+ 0000300 140700 141702 142704 143706 144710 145712 146714 147716
14
+ 0000320 150720 151722 152724 153726 154730 155732 156734 157736
15
+ 0000340 160740 161742 162744 163746 164750 165752 166754 167756
16
+ 0000360 170760 171762 172764 173766 174770 175772 176774 177776
17
+ 0000400
@@ -0,0 +1,6 @@
1
+ 0000000 062550 066154 020157 020040 020040 020040 020040 020040
2
+ 0000020 020040 020040 020040 020040 020040 020040 020040 020040
3
+ *
4
+ 0000060 020040 020040 020040 020040 020040 063440 067557 061144
5
+ 0000100 062571 000012
6
+ 0000103
@@ -0,0 +1 @@
1
+ hello goodbye
@@ -3,6 +3,10 @@ require 'ronin/formatting/binary'
3
3
  require 'spec_helper'
4
4
 
5
5
  describe Integer do
6
+ it "should provide Integer#bytes" do
7
+ Integer.instance_method('bytes').should_not be_nil
8
+ end
9
+
6
10
  it "should provide Integer#pack" do
7
11
  Integer.instance_method('pack').should_not be_nil
8
12
  end
@@ -11,6 +15,62 @@ describe Integer do
11
15
  Integer.instance_method('hex_escape').should_not be_nil
12
16
  end
13
17
 
18
+ describe "bytes" do
19
+ before(:all) do
20
+ @integer = 0x1337
21
+
22
+ @little_endian_char = [0x37]
23
+ @little_endian_short = [0x37, 0x13]
24
+ @little_endian_long = [0x37, 0x13, 0x0, 0x0]
25
+ @little_endian_quad = [0x37, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
26
+
27
+ @big_endian_char = [0x37]
28
+ @big_endian_short = [0x13, 0x37]
29
+ @big_endian_long = [0, 0, 0x13, 0x37]
30
+ @big_endian_quad = [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13, 0x37]
31
+ end
32
+
33
+ it "should return the bytes in little endian ordering" do
34
+ @integer.bytes(4).should == @little_endian_long
35
+ end
36
+
37
+ it "should return the bytes for a char in little endian ordering" do
38
+ @integer.bytes(1).should == @little_endian_char
39
+ end
40
+
41
+ it "should return the bytes for a short in little endian ordering" do
42
+ @integer.bytes(2).should == @little_endian_short
43
+ end
44
+
45
+ it "should return the bytes for a long in little endian ordering" do
46
+ @integer.bytes(4).should == @little_endian_long
47
+ end
48
+
49
+ it "should return the bytes for a quad in little endian ordering" do
50
+ @integer.bytes(8).should == @little_endian_quad
51
+ end
52
+
53
+ it "should return the bytes in big endian ordering" do
54
+ @integer.bytes(4, :big).should == @big_endian_long
55
+ end
56
+
57
+ it "should return the bytes for a char in big endian ordering" do
58
+ @integer.bytes(1, :big).should == @big_endian_char
59
+ end
60
+
61
+ it "should return the bytes for a short in big endian ordering" do
62
+ @integer.bytes(2, :big).should == @big_endian_short
63
+ end
64
+
65
+ it "should return the bytes for a long in big endian ordering" do
66
+ @integer.bytes(4, :big).should == @big_endian_long
67
+ end
68
+
69
+ it "should return the bytes for a quad in big endian ordering" do
70
+ @integer.bytes(8, :big).should == @big_endian_quad
71
+ end
72
+ end
73
+
14
74
  describe "pack" do
15
75
  before(:all) do
16
76
  @integer = 0x1337
@@ -34,7 +94,7 @@ describe Integer do
34
94
  @integer.pack(Arch.i386,2).should == @i386_packed_short
35
95
  end
36
96
 
37
- it "Integer#pack should pack itself as a long for a little-endian architecture" do
97
+ it "should pack itself as a long for a little-endian architecture" do
38
98
  @integer.pack(Arch.i386,4).should == @i386_packed_long
39
99
  end
40
100
 
@@ -1,6 +1,7 @@
1
1
  require 'ronin/formatting/binary'
2
2
 
3
3
  require 'spec_helper'
4
+ require 'formatting/binary/helpers/hexdumps'
4
5
 
5
6
  describe String do
6
7
  it "should provide String#depack" do
@@ -11,11 +12,19 @@ describe String do
11
12
  String.instance_method('hex_escape').should_not be_nil
12
13
  end
13
14
 
15
+ it "should provide String#hex_unescape" do
16
+ String.instance_method('hex_unescape').should_not be_nil
17
+ end
18
+
14
19
  it "should provide String#xor" do
15
20
  String.instance_method('xor').should_not be_nil
16
21
  end
17
22
 
18
- describe "pack" do
23
+ it "should provide String#unhexdump" do
24
+ String.instance_method('unhexdump').should_not be_nil
25
+ end
26
+
27
+ describe "depack" do
19
28
  before(:all) do
20
29
  @integer = 0x1337
21
30
 
@@ -30,35 +39,35 @@ describe String do
30
39
  @ppc_packed_quad = "\000\000\000\000\000\000\0237"
31
40
  end
32
41
 
33
- it "should pack itself for a little-endian architecture" do
42
+ it "should depack itself for a little-endian architecture" do
34
43
  @i386_packed_int.depack(Arch.i386).should == @integer
35
44
  end
36
45
 
37
- it "should pack itself as a short for a little-endian architecture" do
46
+ it "should depack itself as a short for a little-endian architecture" do
38
47
  @i386_packed_short.depack(Arch.i386,2).should == @integer
39
48
  end
40
49
 
41
- it "Integer#pack should pack itself as a long for a little-endian architecture" do
50
+ it "should depack itself as a long for a little-endian architecture" do
42
51
  @i386_packed_long.depack(Arch.i386,4).should == @integer
43
52
  end
44
53
 
45
- it "should pack itself as a quad for a little-endian architecture" do
54
+ it "should depack itself as a quad for a little-endian architecture" do
46
55
  @i386_packed_quad.depack(Arch.i386,8).should == @integer
47
56
  end
48
57
 
49
- it "should pack itself for a big-endian architecture" do
58
+ it "should depack itself for a big-endian architecture" do
50
59
  @ppc_packed_int.depack(Arch.ppc).should == @integer
51
60
  end
52
61
 
53
- it "should pack itself as a short for a big-endian architecture" do
62
+ it "should depack itself as a short for a big-endian architecture" do
54
63
  @ppc_packed_short.depack(Arch.ppc,2).should == @integer
55
64
  end
56
65
 
57
- it "should pack itself as a long for a big-endian architecture" do
66
+ it "should depack itself as a long for a big-endian architecture" do
58
67
  @ppc_packed_long.depack(Arch.ppc,4).should == @integer
59
68
  end
60
69
 
61
- it "should pack itself as a quad for a big-endian architecture" do
70
+ it "should depack itself as a quad for a big-endian architecture" do
62
71
  @ppc_packed_quad.depack(Arch.ppc,8).should == @integer
63
72
  end
64
73
  end
@@ -73,6 +82,24 @@ describe String do
73
82
  end
74
83
  end
75
84
 
85
+ describe "hex_unescape" do
86
+ it "should unescape a normal String" do
87
+ "hello".hex_unescape.should == "hello"
88
+ end
89
+
90
+ it "should unescape a hex String" do
91
+ "\\x68\\x65\\x6c\\x6c\\x6f\\x4e".hex_unescape.should == "hello\x4e"
92
+ end
93
+
94
+ it "should unescape an octal String" do
95
+ "hello\012".hex_unescape.should == "hello\n"
96
+ end
97
+
98
+ it "should unescape control characters" do
99
+ "hello\\n".hex_unescape.should == "hello\n"
100
+ end
101
+ end
102
+
76
103
  describe "xor" do
77
104
  before(:all) do
78
105
  @string = 'hello'
@@ -91,4 +118,134 @@ describe String do
91
118
  @string.xor(@key).xor(@key).should == @string
92
119
  end
93
120
  end
121
+
122
+ describe "unhexdump" do
123
+ describe "GNU hexdump" do
124
+ before(:all) do
125
+ @ascii = load_binary_data('ascii')
126
+ @repeated = load_binary_data('repeated')
127
+ end
128
+
129
+ it "should unhexdump octal-byte hexdump output" do
130
+ hexdump = load_hexdump('hexdump_octal_bytes')
131
+
132
+ hexdump.unhexdump(:format => :hexdump, :encoding => :octal_bytes).should == @ascii
133
+ end
134
+
135
+ it "should unhexdump hex-byte hexdump output" do
136
+ hexdump = load_hexdump('hexdump_hex_bytes')
137
+
138
+ hexdump.unhexdump(:format => :hexdump, :encoding => :hex_bytes).should == @ascii
139
+ end
140
+
141
+ it "should unhexdump decimal-short hexdump output" do
142
+ hexdump = load_hexdump('hexdump_decimal_shorts')
143
+
144
+ hexdump.unhexdump(:format => :hexdump, :encoding => :decimal_shorts).should == @ascii
145
+ end
146
+
147
+ it "should unhexdump octal-short hexdump output" do
148
+ hexdump = load_hexdump('hexdump_octal_shorts')
149
+
150
+ hexdump.unhexdump(:format => :hexdump, :encoding => :octal_shorts).should == @ascii
151
+ end
152
+
153
+ it "should unhexdump hex-short hexdump output" do
154
+ hexdump = load_hexdump('hexdump_hex_shorts')
155
+
156
+ hexdump.unhexdump(:format => :hexdump, :encoding => :hex_shorts).should == @ascii
157
+ end
158
+
159
+ it "should unhexdump repeated hexdump output" do
160
+ hexdump = load_hexdump('hexdump_repeated')
161
+
162
+ hexdump.unhexdump(:format => :hexdump, :encoding => :hex_bytes).should == @repeated
163
+ end
164
+ end
165
+
166
+ describe "od" do
167
+ before(:all) do
168
+ @ascii = load_binary_data('ascii')
169
+ @repeated = load_binary_data('repeated')
170
+ end
171
+
172
+ it "should unhexdump octal-byte hexdump output" do
173
+ hexdump = load_hexdump('od_octal_bytes')
174
+
175
+ hexdump.unhexdump(:format => :od, :encoding => :octal_bytes).should == @ascii
176
+ end
177
+
178
+ it "should unhexdump octal-shorts hexdump output" do
179
+ hexdump = load_hexdump('od_octal_shorts')
180
+
181
+ hexdump.unhexdump(:format => :od, :encoding => :octal_shorts).should == @ascii
182
+ end
183
+
184
+ it "should unhexdump octal-ints hexdump output" do
185
+ hexdump = load_hexdump('od_octal_ints')
186
+
187
+ hexdump.unhexdump(:format => :od, :encoding => :octal_ints).should == @ascii
188
+ end
189
+
190
+ it "should unhexdump octal-quads hexdump output" do
191
+ hexdump = load_hexdump('od_octal_quads')
192
+
193
+ hexdump.unhexdump(:format => :od, :encoding => :octal_quads).should == @ascii
194
+ end
195
+
196
+ it "should unhexdump decimal-byte hexdump output" do
197
+ hexdump = load_hexdump('od_decimal_bytes')
198
+
199
+ hexdump.unhexdump(:format => :od, :encoding => :decimal_bytes).should == @ascii
200
+ end
201
+
202
+ it "should unhexdump decimal-shorts hexdump output" do
203
+ hexdump = load_hexdump('od_decimal_shorts')
204
+
205
+ hexdump.unhexdump(:format => :od, :encoding => :decimal_shorts).should == @ascii
206
+ end
207
+
208
+ it "should unhexdump decimal-ints hexdump output" do
209
+ hexdump = load_hexdump('od_decimal_ints')
210
+
211
+ hexdump.unhexdump(:format => :od, :encoding => :decimal_ints).should == @ascii
212
+ end
213
+
214
+ it "should unhexdump decimal-quads hexdump output" do
215
+ hexdump = load_hexdump('od_decimal_quads')
216
+
217
+ hexdump.unhexdump(:format => :od, :encoding => :decimal_quads).should == @ascii
218
+ end
219
+
220
+ it "should unhexdump hex-byte hexdump output" do
221
+ hexdump = load_hexdump('od_hex_bytes')
222
+
223
+ hexdump.unhexdump(:format => :od, :encoding => :hex_bytes).should == @ascii
224
+ end
225
+
226
+ it "should unhexdump hex-shorts hexdump output" do
227
+ hexdump = load_hexdump('od_hex_shorts')
228
+
229
+ hexdump.unhexdump(:format => :od, :encoding => :hex_shorts).should == @ascii
230
+ end
231
+
232
+ it "should unhexdump hex-ints hexdump output" do
233
+ hexdump = load_hexdump('od_hex_ints')
234
+
235
+ hexdump.unhexdump(:format => :od, :encoding => :hex_ints).should == @ascii
236
+ end
237
+
238
+ it "should unhexdump hex-quads hexdump output" do
239
+ hexdump = load_hexdump('od_hex_quads')
240
+
241
+ hexdump.unhexdump(:format => :od, :encoding => :hex_quads).should == @ascii
242
+ end
243
+
244
+ it "should unhexdump repeated hexdump output" do
245
+ hexdump = load_hexdump('od_repeated')
246
+
247
+ hexdump.unhexdump(:format => :od, :encoding => :octal_shorts).should == @repeated
248
+ end
249
+ end
250
+ end
94
251
  end