Opcodes 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +2 -0
- data/module/Arch.c +7 -1
- data/module/Opcodes.c +4 -4
- data/tests/ut_opcodes_bfd.rb +1 -1
- metadata +24 -43
data/ChangeLog
CHANGED
data/module/Arch.c
CHANGED
@@ -17,6 +17,8 @@ static int generic_print_address_wrapper(bfd_vma vma, disassemble_info *info ) {
|
|
17
17
|
static const Opcodes_disasm_def disasm_definitions[] = {
|
18
18
|
/* Goddamn GNU. They make it near-impossible to get a list of supported
|
19
19
|
* architectures at build OR run time. */
|
20
|
+
// this got broken again.
|
21
|
+
#if 0
|
20
22
|
#ifdef ARCH_ALPHA
|
21
23
|
{"alpha", bfd_arch_alpha, bfd_mach_alpha_ev4, print_insn_alpha},
|
22
24
|
{"alphaev4", bfd_arch_alpha, bfd_mach_alpha_ev4,
|
@@ -27,7 +29,7 @@ static const Opcodes_disasm_def disasm_definitions[] = {
|
|
27
29
|
print_insn_alpha},
|
28
30
|
#endif
|
29
31
|
#ifdef ARCH_ARM
|
30
|
-
{"big_arm", bfd_arch_arm,
|
32
|
+
{"big_arm", bfd_arch_arm, bfd_mach_arm_unknown,
|
31
33
|
print_insn_big_arm},
|
32
34
|
{"little_arm", bfd_arch_arm, bfd_mach_arm_unknown,
|
33
35
|
print_insn_little_arm},
|
@@ -103,6 +105,7 @@ static const Opcodes_disasm_def disasm_definitions[] = {
|
|
103
105
|
#ifdef ARCH_I370
|
104
106
|
{"i370", bfd_arch_i370, 0, print_insn_i370},
|
105
107
|
#endif
|
108
|
+
#endif
|
106
109
|
#ifdef ARCH_I386
|
107
110
|
{"8086", bfd_arch_i386, bfd_mach_i386_i8086, print_insn_i386},
|
108
111
|
{"x86", bfd_arch_i386, bfd_mach_i386_i386, print_insn_i386},
|
@@ -115,6 +118,8 @@ static const Opcodes_disasm_def disasm_definitions[] = {
|
|
115
118
|
{"x86_64_intel", bfd_arch_i386, bfd_mach_x86_64_intel_syntax,
|
116
119
|
print_insn_i386},
|
117
120
|
#endif
|
121
|
+
// ditto
|
122
|
+
#if 0
|
118
123
|
#ifdef ARCH_i860
|
119
124
|
{"i860", bfd_arch_i860, 0, print_insn_i860},
|
120
125
|
#endif
|
@@ -316,6 +321,7 @@ static const Opcodes_disasm_def disasm_definitions[] = {
|
|
316
321
|
{"z8001", bfd_arch_z8k, bfd_mach_z8001, print_insn_z8001},
|
317
322
|
{"z8002", bfd_arch_z8k, bfd_mach_z8002, print_insn_z8002},
|
318
323
|
#endif
|
324
|
+
#endif
|
319
325
|
/* NULL entry to ensure table ends up ok */
|
320
326
|
{"INVALID", bfd_arch_unknown, 0, generic_print_address_wrapper}
|
321
327
|
};
|
data/module/Opcodes.c
CHANGED
@@ -95,7 +95,6 @@ static void get_available_disassemblers( VALUE * ary ) {
|
|
95
95
|
static const char * insn_type_to_str( enum dis_insn_type t ) {
|
96
96
|
const char *s;
|
97
97
|
switch (t) {
|
98
|
-
case dis_noninsn: s = "Invalid"; break;
|
99
98
|
case dis_nonbranch: s = "Not branch"; break;
|
100
99
|
case dis_branch: s = "Unconditional branch"; break;
|
101
100
|
case dis_condbranch: s = "Conditional branch"; break;
|
@@ -103,6 +102,8 @@ static const char * insn_type_to_str( enum dis_insn_type t ) {
|
|
103
102
|
case dis_condjsr: s = "Conditional jump to subroutine"; break;
|
104
103
|
case dis_dref: s = "Data reference"; break;
|
105
104
|
case dis_dref2: s = "Two data references"; break;
|
105
|
+
case dis_noninsn:
|
106
|
+
default: s = "Invalid";
|
106
107
|
}
|
107
108
|
return s;
|
108
109
|
}
|
@@ -219,7 +220,7 @@ static void config_libopcodes_for_target( struct disassemble_info * info,
|
|
219
220
|
|
220
221
|
if (! sym.value || (sym.value > sec->vma + sec->size ) ) {
|
221
222
|
rb_raise(rb_eRuntimeError, "Invalid symbol value 0x%X",
|
222
|
-
((unsigned
|
223
|
+
((unsigned int) sym.value));
|
223
224
|
}
|
224
225
|
|
225
226
|
vma_off = sym.value - sec->vma;
|
@@ -256,7 +257,7 @@ static void load_target( VALUE tgt, struct disasm_target * dest ) {
|
|
256
257
|
|
257
258
|
} else if ( Qtrue == rb_obj_is_kind_of( tgt, rb_cArray) ) {
|
258
259
|
/* array of bytes */
|
259
|
-
int i;
|
260
|
+
unsigned int i;
|
260
261
|
dest->buf_len = RARRAY_LEN(tgt);
|
261
262
|
dest->buf = calloc(dest->buf_len, 1);
|
262
263
|
for( i=0; i < dest->buf_len; i++ ) {
|
@@ -312,7 +313,6 @@ static void unload_target( struct disasm_target * tgt ) {
|
|
312
313
|
static void disasm_init( struct disassemble_info * info,
|
313
314
|
struct disasm_target * target, bfd_vma * vma,
|
314
315
|
VALUE class, VALUE tgt, VALUE hash ) {
|
315
|
-
const char *opts;
|
316
316
|
bfd_vma vma_arg;
|
317
317
|
VALUE var;
|
318
318
|
|
data/tests/ut_opcodes_bfd.rb
CHANGED
@@ -543,7 +543,7 @@ class TC_OpcodesModuleBfd < Test::Unit::TestCase
|
|
543
543
|
def test_buffer
|
544
544
|
|
545
545
|
Bfd::Target.from_buffer( TARGET_BUF ) do |tgt|
|
546
|
-
|
546
|
+
Opcodes::Disassembler.new( :bfd => tgt ) do |dis|
|
547
547
|
ops = dis.disasm( tgt.sections['.text'] )
|
548
548
|
assert_equal( 145, ops.length )
|
549
549
|
assert_equal( 'xor', ops.first[:insn][0].strip )
|
metadata
CHANGED
@@ -1,35 +1,25 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: Opcodes
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.3.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 3
|
9
|
-
- 1
|
10
|
-
version: 1.3.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- TG Community
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2013-03-03 00:00:00 Z
|
12
|
+
date: 2013-03-05 00:00:00.000000000 Z
|
19
13
|
dependencies: []
|
20
|
-
|
21
|
-
|
22
|
-
Libopcodes is the disassembler library used by
|
23
|
-
GNU binutils. This extension provides access to libopcodes for Ruby
|
24
|
-
IO and BFD objects.
|
14
|
+
description: ! "Libopcodes is the disassembler library used by\n GNU binutils. This
|
15
|
+
extension provides access to libopcodes for Ruby\n IO and BFD objects."
|
25
16
|
email: community@thoughtgang.org
|
26
17
|
executables: []
|
27
|
-
|
28
|
-
extensions:
|
18
|
+
extensions:
|
29
19
|
- module/extconf.rb
|
30
|
-
extra_rdoc_files:
|
20
|
+
extra_rdoc_files:
|
31
21
|
- module/rdoc_input/Opcodes.rb
|
32
|
-
files:
|
22
|
+
files:
|
33
23
|
- module/Opcodes.c
|
34
24
|
- module/Arch.c
|
35
25
|
- module/ruby_compat.c
|
@@ -50,40 +40,31 @@ files:
|
|
50
40
|
- module/rdoc_input/Opcodes.rb
|
51
41
|
- module/extconf.rb
|
52
42
|
homepage: http://rubyforge.org/projects/opdis/
|
53
|
-
licenses:
|
43
|
+
licenses:
|
54
44
|
- GPLv3
|
55
45
|
post_install_message:
|
56
46
|
rdoc_options: []
|
57
|
-
|
58
|
-
require_paths:
|
47
|
+
require_paths:
|
59
48
|
- lib
|
60
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
50
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
hash: 57
|
66
|
-
segments:
|
67
|
-
- 1
|
68
|
-
- 8
|
69
|
-
- 7
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
70
54
|
version: 1.8.7
|
71
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
56
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
|
78
|
-
- 0
|
79
|
-
version: "0"
|
80
|
-
requirements:
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements:
|
81
62
|
- GNU binutils library and headers
|
82
63
|
rubyforge_project: opdis
|
83
|
-
rubygems_version: 1.8.
|
64
|
+
rubygems_version: 1.8.10
|
84
65
|
signing_key:
|
85
66
|
specification_version: 3
|
86
67
|
summary: Ruby extension library providing an API to GNU libopcodes
|
87
|
-
test_files:
|
68
|
+
test_files:
|
88
69
|
- tests/ut_opcodes.rb
|
89
70
|
- tests/ut_opcodes_bfd.rb
|