-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhowtouse.rb
24 lines (20 loc) · 1.06 KB
/
howtouse.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
dmp = %q(0xffffcd9c: 0xf7d12f5b 0x00000000 0x00000000 0x10001080
0xffffcdac: 0x10001080 0x10001070 0x10001110 0x10001060
0xffffcdbc: 0x10001030 0x100010e0 0x10001040 0x10001100
0xffffcdcc: 0x10001090 0x10001030 0x10001010 0x10001090
0xffffcddc: 0x10001090 0x100010a0 0x10001060 0x10001030
0xffffcdec: 0x100010f0 0x100010e0 0x100010a0 0x100010b0
0xffffcdfc: 0x100010d0 0x10001100 0x100010e0 0x10001040
0xffffce0c: 0x100010f0 0x100010f0 0x10001040 0x10001100
0xffffce1c: 0x10001050 0x10001050 0x100010e0 0x10001050
0xffffce2c: 0x10001060 0x10001010 0x10001100 0x10001050
0xffffce3c: 0x10001100 0x10001020 0x100010c0 0x100010b0
0xffffce4c: 0x10001050 0x10001040 0x100010f0 0x10001120)
c = File.read('howtouse.dmp')
dmp.split[4..-1].each do |d|
next if d =~ /:/
d.sub!(/0x/, '')
ch = c[/#{d}:\s+.*?mov\s+\$0x(\h+),/, 1]
raise d if !ch
putc ch.hex
end