Skip to content

Commit a2ea880

Browse files
dmaloney-r7dmaloney-r7
authored andcommitted
Merge pull request #12 from tabassassin/tabs-pr3181
Retabbed PR rapid7#3181
2 parents b426449 + 6faa3d9 commit a2ea880

File tree

216 files changed

+67740
-67740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+67740
-67740
lines changed

lib/metasm/metasm.rb

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -5,84 +5,84 @@
55

66

77
module Metasm
8-
# root directory for metasm files
9-
# used by some scripts, eg to find samples/dasm-plugin directory
10-
Metasmdir = File.dirname(__FILE__)
11-
# add it to the ruby library path
12-
$: << Metasmdir
8+
# root directory for metasm files
9+
# used by some scripts, eg to find samples/dasm-plugin directory
10+
Metasmdir = File.dirname(__FILE__)
11+
# add it to the ruby library path
12+
$: << Metasmdir
1313

14-
# constants defined in the same file as another
15-
Const_autorequire_equiv = {
16-
'X86' => 'Ia32', 'PPC' => 'PowerPC',
17-
'X64' => 'X86_64', 'AMD64' => 'X86_64',
18-
'MIPS64' => 'MIPS',
19-
'UniversalBinary' => 'MachO', 'COFFArchive' => 'COFF',
20-
'DEY' => 'DEX',
21-
'PTrace' => 'LinOS', 'FatELF' => 'ELF',
22-
'LoadedELF' => 'ELF', 'LoadedPE' => 'PE',
23-
'LoadedAutoExe' => 'AutoExe',
24-
'LinuxRemoteString' => 'LinOS',
25-
'LinDebugger' => 'LinOS',
26-
'WinAPI' => 'WinOS',
27-
'WindowsRemoteString' => 'WinOS', 'WinDbgAPI' => 'WinOS',
28-
'WinDebugger' => 'WinOS',
29-
'GdbRemoteString' => 'GdbClient', 'GdbRemoteDebugger' => 'GdbClient',
30-
'DecodedInstruction' => 'Disassembler', 'DecodedFunction' => 'Disassembler',
31-
'InstructionBlock' => 'Disassembler',
32-
}
14+
# constants defined in the same file as another
15+
Const_autorequire_equiv = {
16+
'X86' => 'Ia32', 'PPC' => 'PowerPC',
17+
'X64' => 'X86_64', 'AMD64' => 'X86_64',
18+
'MIPS64' => 'MIPS',
19+
'UniversalBinary' => 'MachO', 'COFFArchive' => 'COFF',
20+
'DEY' => 'DEX',
21+
'PTrace' => 'LinOS', 'FatELF' => 'ELF',
22+
'LoadedELF' => 'ELF', 'LoadedPE' => 'PE',
23+
'LoadedAutoExe' => 'AutoExe',
24+
'LinuxRemoteString' => 'LinOS',
25+
'LinDebugger' => 'LinOS',
26+
'WinAPI' => 'WinOS',
27+
'WindowsRemoteString' => 'WinOS', 'WinDbgAPI' => 'WinOS',
28+
'WinDebugger' => 'WinOS',
29+
'GdbRemoteString' => 'GdbClient', 'GdbRemoteDebugger' => 'GdbClient',
30+
'DecodedInstruction' => 'Disassembler', 'DecodedFunction' => 'Disassembler',
31+
'InstructionBlock' => 'Disassembler',
32+
}
3333

34-
# files to require to get the definition of those constants
35-
Const_autorequire = {
36-
'Ia32' => 'cpu/ia32', 'MIPS' => 'cpu/mips', 'PowerPC' => 'cpu/ppc', 'ARM' => 'cpu/arm',
37-
'X86_64' => 'cpu/x86_64', 'Sh4' => 'cpu/sh4', 'Dalvik' => 'cpu/dalvik', 'ARC' => 'cpu/arc',
38-
'Python' => 'cpu/python', 'Z80' => 'cpu/z80', 'CY16' => 'cpu/cy16', 'BPF' => 'cpu/bpf',
39-
'MSP430' => 'cpu/msp430',
40-
'C' => 'compile_c',
41-
'MZ' => 'exe_format/mz', 'PE' => 'exe_format/pe',
42-
'ELF' => 'exe_format/elf', 'COFF' => 'exe_format/coff',
43-
'Shellcode' => 'exe_format/shellcode', 'AutoExe' => 'exe_format/autoexe',
44-
'AOut' => 'exe_format/a_out', 'MachO' => 'exe_format/macho',
45-
'DEX' => 'exe_format/dex',
46-
'NDS' => 'exe_format/nds', 'XCoff' => 'exe_format/xcoff',
47-
'GameBoyRom' => 'exe_format/gb',
48-
'Bflt' => 'exe_format/bflt', 'Dol' => 'exe_format/dol',
49-
'PYC' => 'exe_format/pyc', 'JavaClass' => 'exe_format/javaclass',
50-
'SWF' => 'exe_format/swf', 'ZIP' => 'exe_format/zip',
51-
'Shellcode_RWX' => 'exe_format/shellcode_rwx',
52-
'Gui' => 'gui',
53-
'WindowsExports' => 'os/windows_exports',
54-
'GNUExports' => 'os/gnu_exports',
55-
'Debugger' => 'debug',
56-
'LinOS' => 'os/linux', 'WinOS' => 'os/windows',
57-
'GdbClient' => 'os/remote',
58-
'Disassembler' => 'disassemble',
59-
'Decompiler' => 'decompile',
60-
'DynLdr' => 'dynldr',
61-
}
34+
# files to require to get the definition of those constants
35+
Const_autorequire = {
36+
'Ia32' => 'cpu/ia32', 'MIPS' => 'cpu/mips', 'PowerPC' => 'cpu/ppc', 'ARM' => 'cpu/arm',
37+
'X86_64' => 'cpu/x86_64', 'Sh4' => 'cpu/sh4', 'Dalvik' => 'cpu/dalvik', 'ARC' => 'cpu/arc',
38+
'Python' => 'cpu/python', 'Z80' => 'cpu/z80', 'CY16' => 'cpu/cy16', 'BPF' => 'cpu/bpf',
39+
'MSP430' => 'cpu/msp430',
40+
'C' => 'compile_c',
41+
'MZ' => 'exe_format/mz', 'PE' => 'exe_format/pe',
42+
'ELF' => 'exe_format/elf', 'COFF' => 'exe_format/coff',
43+
'Shellcode' => 'exe_format/shellcode', 'AutoExe' => 'exe_format/autoexe',
44+
'AOut' => 'exe_format/a_out', 'MachO' => 'exe_format/macho',
45+
'DEX' => 'exe_format/dex',
46+
'NDS' => 'exe_format/nds', 'XCoff' => 'exe_format/xcoff',
47+
'GameBoyRom' => 'exe_format/gb',
48+
'Bflt' => 'exe_format/bflt', 'Dol' => 'exe_format/dol',
49+
'PYC' => 'exe_format/pyc', 'JavaClass' => 'exe_format/javaclass',
50+
'SWF' => 'exe_format/swf', 'ZIP' => 'exe_format/zip',
51+
'Shellcode_RWX' => 'exe_format/shellcode_rwx',
52+
'Gui' => 'gui',
53+
'WindowsExports' => 'os/windows_exports',
54+
'GNUExports' => 'os/gnu_exports',
55+
'Debugger' => 'debug',
56+
'LinOS' => 'os/linux', 'WinOS' => 'os/windows',
57+
'GdbClient' => 'os/remote',
58+
'Disassembler' => 'disassemble',
59+
'Decompiler' => 'decompile',
60+
'DynLdr' => 'dynldr',
61+
}
6262

63-
# use the Module.autoload ruby functionnality to load framework components on demand
64-
Const_autorequire.each { |cst, file|
65-
autoload cst, File.join('metasm', file)
66-
}
63+
# use the Module.autoload ruby functionnality to load framework components on demand
64+
Const_autorequire.each { |cst, file|
65+
autoload cst, File.join('metasm', file)
66+
}
6767

68-
Const_autorequire_equiv.each { |cst, eqv|
69-
file = Const_autorequire[eqv]
70-
autoload cst, File.join('metasm', file)
71-
}
68+
Const_autorequire_equiv.each { |cst, eqv|
69+
file = Const_autorequire[eqv]
70+
autoload cst, File.join('metasm', file)
71+
}
7272
end
7373

7474
# load Metasm core files
7575
%w[main encode decode render exe_format/main os/main].each { |f|
76-
require File.join('metasm', f)
76+
require File.join('metasm', f)
7777
}
7878

7979

8080
# remove an 1.9 warning, couldn't find a compatible way...
8181
if Hash.new.respond_to?(:key)
82-
puts "using ruby1.9 workaround for Hash#index warning" if $DEBUG
83-
class Hash
84-
alias index_premetasm index rescue nil
85-
undef index rescue nil
86-
alias index key
87-
end
82+
puts "using ruby1.9 workaround for Hash#index warning" if $DEBUG
83+
class Hash
84+
alias index_premetasm index rescue nil
85+
undef index rescue nil
86+
alias index key
87+
end
8888
end

0 commit comments

Comments
 (0)