furnace-avm2 0.0.9 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +4 -3
  3. data/LICENSE +20 -0
  4. data/bin/furnace-avm2 +36 -6
  5. data/bin/furnace-avm2-decompiler +141 -0
  6. data/furnace-avm2.gemspec +2 -2
  7. data/lib/furnace-avm2.rb +1 -0
  8. data/lib/furnace-avm2/abc.rb +24 -7
  9. data/lib/furnace-avm2/abc/metadata/{option_detail.rb → default_value.rb} +5 -1
  10. data/lib/furnace-avm2/abc/metadata/initializer_body.rb +8 -0
  11. data/lib/furnace-avm2/abc/metadata/instance_info.rb +19 -4
  12. data/lib/furnace-avm2/abc/metadata/klass_info.rb +1 -4
  13. data/lib/furnace-avm2/abc/metadata/method_body_info.rb +27 -10
  14. data/lib/furnace-avm2/abc/metadata/method_info.rb +20 -13
  15. data/lib/furnace-avm2/abc/metadata/multiname_info.rb +6 -0
  16. data/lib/furnace-avm2/abc/metadata/multiname_kind_genericname.rb +8 -5
  17. data/lib/furnace-avm2/abc/metadata/multiname_kind_multiname.rb +4 -0
  18. data/lib/furnace-avm2/abc/metadata/multiname_kind_qname.rb +5 -1
  19. data/lib/furnace-avm2/abc/metadata/record_with_value.rb +90 -0
  20. data/lib/furnace-avm2/abc/metadata/script_info.rb +25 -1
  21. data/lib/furnace-avm2/abc/metadata/trait_class.rb +7 -3
  22. data/lib/furnace-avm2/abc/metadata/trait_info.rb +8 -4
  23. data/lib/furnace-avm2/abc/metadata/trait_method.rb +4 -0
  24. data/lib/furnace-avm2/abc/metadata/trait_slot.rb +5 -51
  25. data/lib/furnace-avm2/abc/opcodes/bitwise/as3_lshift.rb +1 -1
  26. data/lib/furnace-avm2/abc/opcodes/bitwise/as3_rshift.rb +1 -1
  27. data/lib/furnace-avm2/abc/opcodes/bitwise/as3_urshift.rb +1 -1
  28. data/lib/furnace-avm2/abc/opcodes/debug/as3_debug.rb +15 -0
  29. data/lib/furnace-avm2/abc/opcodes/debug/as3_debugfile.rb +12 -0
  30. data/lib/furnace-avm2/abc/opcodes/debug/as3_debugline.rb +12 -0
  31. data/lib/furnace-avm2/abc/opcodes/function_invocation/as3_callproplex.rb +21 -0
  32. data/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushbyte.rb +1 -1
  33. data/lib/furnace-avm2/abc/opcodes/push_literal/as3_pushshort.rb +1 -1
  34. data/lib/furnace-avm2/binary/record.rb +21 -1
  35. data/lib/furnace-avm2/source/declaration_tokens/argument_declaration_token.rb +4 -0
  36. data/lib/furnace-avm2/source/declaration_tokens/arguments_token.rb +15 -0
  37. data/lib/furnace-avm2/source/declaration_tokens/callee_token.rb +72 -0
  38. data/lib/furnace-avm2/source/declaration_tokens/class_implementations_token.rb +21 -0
  39. data/lib/furnace-avm2/source/declaration_tokens/class_inheritance_token.rb +17 -0
  40. data/lib/furnace-avm2/source/declaration_tokens/class_name_token.rb +21 -0
  41. data/lib/furnace-avm2/source/declaration_tokens/class_specifiers_token.rb +12 -0
  42. data/lib/furnace-avm2/source/declaration_tokens/class_token.rb +21 -0
  43. data/lib/furnace-avm2/source/declaration_tokens/comment_token.rb +22 -0
  44. data/lib/furnace-avm2/source/declaration_tokens/constructor_specifiers_token.rb +12 -0
  45. data/lib/furnace-avm2/source/declaration_tokens/constructor_token.rb +15 -0
  46. data/lib/furnace-avm2/source/declaration_tokens/function_name_token.rb +14 -0
  47. data/lib/furnace-avm2/source/declaration_tokens/import_token.rb +17 -0
  48. data/lib/furnace-avm2/source/declaration_tokens/initialization_token.rb +7 -0
  49. data/lib/furnace-avm2/source/declaration_tokens/method_specifiers_token.rb +13 -0
  50. data/lib/furnace-avm2/source/declaration_tokens/method_token.rb +15 -0
  51. data/lib/furnace-avm2/source/declaration_tokens/multiname_token.rb +41 -0
  52. data/lib/furnace-avm2/source/declaration_tokens/namespace_name_token.rb +16 -0
  53. data/lib/furnace-avm2/source/declaration_tokens/package_name_token.rb +17 -0
  54. data/lib/furnace-avm2/source/declaration_tokens/package_token.rb +29 -0
  55. data/lib/furnace-avm2/source/declaration_tokens/rest_argument_token.rb +12 -0
  56. data/lib/furnace-avm2/source/declaration_tokens/scope_token.rb +23 -0
  57. data/lib/furnace-avm2/source/declaration_tokens/script_token.rb +14 -0
  58. data/lib/furnace-avm2/source/declaration_tokens/slot_name_token.rb +17 -0
  59. data/lib/furnace-avm2/source/declaration_tokens/slot_token.rb +23 -0
  60. data/lib/furnace-avm2/source/declaration_tokens/specifiers_token.rb +32 -0
  61. data/lib/furnace-avm2/source/declaration_tokens/token_with_traits.rb +51 -0
  62. data/lib/furnace-avm2/source/declaration_tokens/type_token.rb +7 -0
  63. data/lib/furnace-avm2/source/decompiler.rb +669 -0
  64. data/lib/furnace-avm2/source/implementation_tokens/access_token.rb +9 -0
  65. data/lib/furnace-avm2/source/implementation_tokens/array_token.rb +17 -0
  66. data/lib/furnace-avm2/source/implementation_tokens/as_token.rb +9 -0
  67. data/lib/furnace-avm2/source/implementation_tokens/assignment_token.rb +9 -0
  68. data/lib/furnace-avm2/source/implementation_tokens/binary_operator_token.rb +14 -0
  69. data/lib/furnace-avm2/source/implementation_tokens/break_token.rb +9 -0
  70. data/lib/furnace-avm2/source/implementation_tokens/call_token.rb +5 -0
  71. data/lib/furnace-avm2/source/implementation_tokens/continue_token.rb +9 -0
  72. data/lib/furnace-avm2/source/implementation_tokens/control_flow_token.rb +26 -0
  73. data/lib/furnace-avm2/source/implementation_tokens/control_transfer_token.rb +20 -0
  74. data/lib/furnace-avm2/source/implementation_tokens/delete_token.rb +9 -0
  75. data/lib/furnace-avm2/source/implementation_tokens/do_token.rb +9 -0
  76. data/lib/furnace-avm2/source/implementation_tokens/else_if_token.rb +9 -0
  77. data/lib/furnace-avm2/source/implementation_tokens/else_token.rb +22 -0
  78. data/lib/furnace-avm2/source/implementation_tokens/for_each_token.rb +9 -0
  79. data/lib/furnace-avm2/source/implementation_tokens/for_token.rb +9 -0
  80. data/lib/furnace-avm2/source/implementation_tokens/generic_specializers_token.rb +17 -0
  81. data/lib/furnace-avm2/source/implementation_tokens/generic_type_token.rb +9 -0
  82. data/lib/furnace-avm2/source/implementation_tokens/if_token.rb +9 -0
  83. data/lib/furnace-avm2/source/implementation_tokens/immediate_token.rb +14 -0
  84. data/lib/furnace-avm2/source/implementation_tokens/immediate_typename_token.rb +14 -0
  85. data/lib/furnace-avm2/source/implementation_tokens/in_token.rb +9 -0
  86. data/lib/furnace-avm2/source/implementation_tokens/index_token.rb +9 -0
  87. data/lib/furnace-avm2/source/implementation_tokens/is_complex.rb +7 -0
  88. data/lib/furnace-avm2/source/implementation_tokens/is_simple.rb +7 -0
  89. data/lib/furnace-avm2/source/implementation_tokens/is_token.rb +9 -0
  90. data/lib/furnace-avm2/source/implementation_tokens/label_declaration_token.rb +12 -0
  91. data/lib/furnace-avm2/source/implementation_tokens/label_token.rb +12 -0
  92. data/lib/furnace-avm2/source/implementation_tokens/local_variable_token.rb +7 -0
  93. data/lib/furnace-avm2/source/implementation_tokens/new_token.rb +9 -0
  94. data/lib/furnace-avm2/source/implementation_tokens/object_pair_token.rb +9 -0
  95. data/lib/furnace-avm2/source/implementation_tokens/object_token.rb +17 -0
  96. data/lib/furnace-avm2/source/implementation_tokens/parentheses_token.rb +11 -0
  97. data/lib/furnace-avm2/source/implementation_tokens/property_name_token.rb +14 -0
  98. data/lib/furnace-avm2/source/implementation_tokens/return_token.rb +16 -0
  99. data/lib/furnace-avm2/source/implementation_tokens/rtname_token.rb +9 -0
  100. data/lib/furnace-avm2/source/implementation_tokens/statement_token.rb +8 -0
  101. data/lib/furnace-avm2/source/implementation_tokens/super_token.rb +9 -0
  102. data/lib/furnace-avm2/source/implementation_tokens/switch_token.rb +9 -0
  103. data/lib/furnace-avm2/source/implementation_tokens/ternary_operator_token.rb +13 -0
  104. data/lib/furnace-avm2/source/implementation_tokens/throw_token.rb +12 -0
  105. data/lib/furnace-avm2/source/implementation_tokens/typeof_token.rb +13 -0
  106. data/lib/furnace-avm2/source/implementation_tokens/unary_operator_token.rb +14 -0
  107. data/lib/furnace-avm2/source/implementation_tokens/unary_post_operator_token.rb +14 -0
  108. data/lib/furnace-avm2/source/implementation_tokens/variable_name_token.rb +14 -0
  109. data/lib/furnace-avm2/source/implementation_tokens/while_token.rb +9 -0
  110. data/lib/furnace-avm2/transform.rb +5 -1
  111. data/lib/furnace-avm2/transform/ast_build.rb +22 -7
  112. data/lib/furnace-avm2/transform/ast_normalize.rb +61 -20
  113. data/lib/furnace-avm2/transform/cfg_build.rb +86 -0
  114. data/lib/furnace-avm2/transform/cfg_reduce.rb +249 -0
  115. data/lib/furnace-avm2/transform/nf_normalize.rb +130 -0
  116. data/lib/furnace-avm2/version.rb +4 -2
  117. data/test/basic.as +239 -0
  118. metadata +110 -38
  119. data/lib/furnace-avm2/abc/metadata/option_info.rb +0 -5
  120. data/test/exception.as +0 -29
  121. data/test/literal.as +0 -5
  122. data/test/logic.as +0 -23
  123. data/test/loops.as +0 -30
  124. data/test/number.as +0 -14
  125. data/test/switch.as +0 -38
  126. data/test/ternary.as +0 -22
@@ -7,23 +7,24 @@ module Furnace::AVM2::ABC
7
7
  SET_DXNS = 0x40
8
8
  HAS_PARAM_NAMES = 0x80
9
9
 
10
- vuint30 :param_count, :value => lambda { param_types.count }
10
+ vuint30 :param_count, :value => lambda { param_types.count }
11
11
 
12
- const_ref :return_type, :multiname
13
- const_array :param_types, :multiname, :initial_length => :param_count
12
+ const_ref :return_type, :multiname
13
+ const_array :param_types, :multiname, :initial_length => :param_count
14
14
 
15
- const_ref :name, :string
15
+ const_ref :name, :string
16
16
 
17
- uint8 :flags
18
- flag :needs_arguments, :flags, NEED_ARGUMENTS
19
- flag :needs_activation, :flags, NEED_ACTIVATION
20
- flag :needs_rest, :flags, NEED_REST
21
- flag :has_optional, :flags, HAS_OPTIONAL
22
- flag :set_dxns, :flags, SET_DXNS
23
- flag :has_param_names, :flags, HAS_PARAM_NAMES
17
+ uint8 :flags
18
+ flag :needs_arguments, :flags, NEED_ARGUMENTS
19
+ flag :needs_activation, :flags, NEED_ACTIVATION
20
+ flag :needs_rest, :flags, NEED_REST
21
+ flag :has_defaults, :flags, HAS_OPTIONAL
22
+ flag :set_dxns, :flags, SET_DXNS
23
+ flag :has_param_names, :flags, HAS_PARAM_NAMES
24
24
 
25
- nested :options, :class => OptionInfo, :if => lambda { flags & HAS_OPTIONAL != 0 }
26
- const_array :param_names, :string, :initial_length => :param_count, :if => lambda { flags & HAS_PARAM_NAMES != 0 }
25
+ abc_array_of :default, :nested, :class => DefaultValue, :if => :has_defaults?
26
+
27
+ const_array :param_names, :string, :initial_length => :param_count, :if => :has_param_names?
27
28
 
28
29
  def to_astlet(index, name=nil)
29
30
  root = AST::Node.new(:method)
@@ -53,5 +54,11 @@ module Furnace::AVM2::ABC
53
54
 
54
55
  root.normalize_hierarchy!
55
56
  end
57
+
58
+ def collect_ns
59
+ ns = param_types.compact.map(&:collect_ns).reduce([], :+)
60
+ ns += return_type.collect_ns if return_type
61
+ ns
62
+ end
56
63
  end
57
64
  end
@@ -38,5 +38,11 @@ module Furnace::AVM2::ABC
38
38
  def to_s
39
39
  data.to_s
40
40
  end
41
+
42
+ def to_astlet(*args)
43
+ node = data.to_astlet(*args)
44
+ node.metadata[:origin] = self
45
+ node
46
+ end
41
47
  end
42
48
  end
@@ -1,16 +1,19 @@
1
1
  module Furnace::AVM2::ABC
2
2
  # Undocumented
3
3
  class MultinameKindGenericName < Record
4
- vuint30 :name_type
5
-
6
- abc_array_of :parameter, :vuint30
4
+ const_ref :name, :multiname
5
+ const_array_of :parameter, :multiname
7
6
 
8
7
  def to_s
9
- "(genericname)"
8
+ "#{name.to_s}<#{parameters.map(&:to_s).join(",")}>"
10
9
  end
11
10
 
12
11
  def to_astlet
13
- AST::Node.new(:generic, [ name_type, parameters ])
12
+ AST::Node.new(:generic, [ name.to_astlet, parameters.map(&:to_astlet) ])
13
+ end
14
+
15
+ def collect_ns
16
+ [ *name.collect_ns, *parameters.map(&:collect_ns).reduce([], :+) ]
14
17
  end
15
18
  end
16
19
  end
@@ -11,6 +11,10 @@ module Furnace::AVM2::ABC
11
11
  AST::Node.new(:m, [ ns_set.to_astlet, name ])
12
12
  end
13
13
 
14
+ def collect_ns
15
+ ns_set.ns
16
+ end
17
+
14
18
  def context_size
15
19
  0
16
20
  end
@@ -12,7 +12,7 @@ module Furnace::AVM2::ABC
12
12
  end
13
13
 
14
14
  def to_astlet
15
- node = AST::Node.new(:q)
15
+ node = AST::Node.new(:q, [])
16
16
 
17
17
  if ns && ns.name == ""
18
18
  elsif ns
@@ -37,6 +37,10 @@ module Furnace::AVM2::ABC
37
37
  end
38
38
  end
39
39
 
40
+ def collect_ns
41
+ [ ns ]
42
+ end
43
+
40
44
  def context_size
41
45
  0
42
46
  end
@@ -0,0 +1,90 @@
1
+ module Furnace::AVM2::ABC
2
+ module RecordWithValue
3
+ XlatTable = {
4
+ :Int => 0x03,
5
+ :UInt => 0x04,
6
+ :Double => 0x06,
7
+ :Utf8 => 0x01,
8
+ :True => 0x0B,
9
+ :False => 0x0A,
10
+ :Null => 0x0C,
11
+ :Undefined => 0x00,
12
+ :Namespace => 0x08,
13
+ :PackageNamespace => 0x16,
14
+ :PackageInternalNs => 0x17,
15
+ :ProtectedNamespace => 0x18,
16
+ :ExplicitNamespace => 0x19,
17
+ :StaticProtectedNs => 0x1A,
18
+ :PrivateNs => 0x05,
19
+ }
20
+
21
+ def value
22
+ if value_idx > 0
23
+ case value_kind
24
+ when :Int
25
+ AST::Node.new(:integer, [ root.constant_pool.ints[value_idx - 1] ])
26
+ when :UInt
27
+ AST::Node.new(:integer, [ root.constant_pool.uints[value_idx - 1] ])
28
+ when :Double
29
+ AST::Node.new(:double, [ root.constant_pool.doubles[value_idx - 1] ])
30
+ when :Utf8
31
+ AST::Node.new(:string, [ root.constant_pool.strings[value_idx - 1] ])
32
+ when :True
33
+ AST::Node.new(:true)
34
+ when :False
35
+ AST::Node.new(:false)
36
+ when :Null
37
+ AST::Node.new(:null)
38
+ when :Undefined
39
+ AST::Node.new(:undefined)
40
+ else
41
+ raise "unknown value kind #{value_kind}"
42
+ end
43
+ else
44
+ nil
45
+ end
46
+ end
47
+
48
+ def ruby_value
49
+ if value_idx > 0
50
+ case value_kind
51
+ when :Int
52
+ root.constant_pool.ints[value_idx - 1]
53
+ when :UInt
54
+ root.constant_pool.uints[value_idx - 1]
55
+ when :Double
56
+ root.constant_pool.doubles[value_idx - 1]
57
+ when :Utf8
58
+ root.constant_pool.strings[value_idx - 1]
59
+ when :True
60
+ true
61
+ when :False
62
+ false
63
+ when :Null
64
+ nil
65
+ when :Namespace
66
+ :"%%Namespace"
67
+ else
68
+ raise "unknown value kind #{value_kind}"
69
+ end
70
+ else
71
+ nil
72
+ end
73
+ end
74
+
75
+ def printable_value
76
+ if value_idx > 0
77
+ case value_kind
78
+ when :Null
79
+ "null"
80
+ when :Undefined
81
+ "undefined"
82
+ when :Int, :UInt, :Double, :Utf8, :True, :False
83
+ ruby_value.inspect
84
+ end
85
+ else
86
+ nil
87
+ end
88
+ end
89
+ end
90
+ end
@@ -1,7 +1,31 @@
1
1
  module Furnace::AVM2::ABC
2
2
  class ScriptInfo < Record
3
- vuint30 :init
3
+ include InitializerBody
4
+
5
+ root_ref :initializer, :method
4
6
 
5
7
  abc_array_of :trait, :nested, :class => TraitInfo
8
+
9
+ def collect_ns
10
+ ns = []
11
+ ns += initializer.collect_ns if initializer
12
+ traits.each { |trait| ns += trait.collect_ns }
13
+ ns
14
+ end
15
+
16
+ def decompile(options={})
17
+ Furnace::AVM2::Tokens::PackageToken.new(self,
18
+ options.merge(ns: collect_ns,
19
+ package_type: :script,
20
+ package_name: non_init_traits[0].name))
21
+ end
22
+
23
+ def any_code?
24
+ non_init_traits.any?
25
+ end
26
+
27
+ def non_init_traits
28
+ traits.reject { |trait| trait.kind == :Class }
29
+ end
6
30
  end
7
31
  end
@@ -1,10 +1,14 @@
1
1
  module Furnace::AVM2::ABC
2
2
  class TraitClass < Record
3
- vuint30 :slot_id
4
- vuint30 :classi
3
+ vuint30 :slot_id
4
+ root_ref :klass, :klass, :plural => :klasses
5
5
 
6
6
  def to_astlet(trait)
7
- :class
7
+ AST::Node.new(:class, [trait.name.to_astlet, klass.instance.name.to_astlet])
8
+ end
9
+
10
+ def collect_ns
11
+ []
8
12
  end
9
13
  end
10
14
  end
@@ -10,9 +10,9 @@ module Furnace::AVM2::ABC
10
10
  :Const => 6
11
11
  }
12
12
 
13
- FINAL = 0x01
14
- OVERRIDE = 0x02
15
- METADATA = 0x04
13
+ TRAIT_FINAL = 0x01
14
+ TRAIT_OVERRIDE = 0x02
15
+ TRAIT_METADATA = 0x04
16
16
 
17
17
  attr_accessor :kind_raw
18
18
 
@@ -34,6 +34,10 @@ module Furnace::AVM2::ABC
34
34
  const_ref :name, :multiname
35
35
 
36
36
  attributes :attributes
37
+ flag :final, :attributes, TRAIT_FINAL
38
+ flag :override, :attributes, TRAIT_OVERRIDE
39
+ flag :metadata, :attributes, TRAIT_METADATA
40
+
37
41
  xlat_field :kind
38
42
 
39
43
  choice :data, :selection => :kind do
@@ -46,7 +50,7 @@ module Furnace::AVM2::ABC
46
50
  variant :Const, :nested, :class => TraitSlot
47
51
  end
48
52
 
49
- abc_array_of :metadata, :vuint30, :plural => :metadata, :if => lambda { attributes & METADATA != 0 }
53
+ abc_array_of :metadata, :vuint30, :plural => :metadata, :if => :metadata?
50
54
 
51
55
  def method_missing(method, *args, &block)
52
56
  data.send(method, *args, &block)
@@ -10,5 +10,9 @@ module Furnace::AVM2::ABC
10
10
  def to_astlet(trait)
11
11
  method.to_astlet(method_idx, trait.name.to_astlet)
12
12
  end
13
+
14
+ def collect_ns
15
+ method.collect_ns
16
+ end
13
17
  end
14
18
  end
@@ -1,22 +1,6 @@
1
1
  module Furnace::AVM2::ABC
2
2
  class TraitSlot < Record
3
- XlatTable = {
4
- :Int => 0x03,
5
- :UInt => 0x04,
6
- :Double => 0x06,
7
- :Utf8 => 0x01,
8
- :True => 0x0B,
9
- :False => 0x0A,
10
- :Null => 0x0C,
11
- :Undefined => 0x00,
12
- :Namespace => 0x08,
13
- :PackageNamespace => 0x16,
14
- :PackageInternalNs => 0x17,
15
- :ProtectedNamespace => 0x18,
16
- :ExplicitNamespace => 0x19,
17
- :StaticProtectedNs => 0x1A,
18
- :PrivateNs => 0x05,
19
- }
3
+ include RecordWithValue
20
4
 
21
5
  vuint30 :idx
22
6
  const_ref :type, :multiname
@@ -30,41 +14,11 @@ module Furnace::AVM2::ABC
30
14
  AST::Node.new(:slot, [ (trait.name ? trait.name.to_astlet : nil), (type ? type.to_astlet : nil), value, idx ])
31
15
  end
32
16
 
33
- def value
34
- if value_idx > 0
35
- case value_kind
36
- when :Int
37
- AST::Node.new(:integer, [ root.constant_pool.ints[value_idx - 1] ])
38
- when :UInt
39
- AST::Node.new(:integer, [ root.constant_pool.uints[value_idx - 1] ])
40
- when :Double
41
- AST::Node.new(:double, [ root.constant_pool.doubles[value_idx - 1] ])
42
- when :Utf8
43
- AST::Node.new(:string, [ root.constant_pool.strings[value_idx - 1] ])
44
- when :True
45
- AST::Node.new(:true)
46
- when :False
47
- AST::Node.new(:false)
48
- when :Null
49
- AST::Node.new(:null)
50
- when :Undefined
51
- AST::Node.new(:undefined)
52
- else
53
- raise "unknown value kind #{value_kind}"
54
- end
17
+ def collect_ns
18
+ if type
19
+ type.collect_ns
55
20
  else
56
- nil
57
- end
58
- end
59
-
60
- def ruby_value
61
- astlet_value = self.value
62
- if astlet_value
63
- if astlet_value.children.count > 0
64
- astlet_value.children.first
65
- else
66
- astlet_value.name
67
- end
21
+ []
68
22
  end
69
23
  end
70
24
  end
@@ -1,5 +1,5 @@
1
1
  module Furnace::AVM2::ABC
2
- class AS3LShift < BitwiseOpcode
2
+ class AS3Lshift < BitwiseOpcode
3
3
  instruction 0xa5
4
4
 
5
5
  consume 2
@@ -1,5 +1,5 @@
1
1
  module Furnace::AVM2::ABC
2
- class AS3RShift < BitwiseOpcode
2
+ class AS3Rshift < BitwiseOpcode
3
3
  instruction 0xa6
4
4
 
5
5
  consume 2
@@ -1,5 +1,5 @@
1
1
  module Furnace::AVM2::ABC
2
- class AS3URShift < BitwiseOpcode
2
+ class AS3Urshift < BitwiseOpcode
3
3
  instruction 0xa7
4
4
 
5
5
  consume 2
@@ -0,0 +1,15 @@
1
+ module Furnace::AVM2::ABC
2
+ class AS3Debug < Opcode
3
+ instruction 0xef
4
+
5
+ body do
6
+ uint8 :debug_type
7
+ vuint30 :index
8
+ uint8 :reg
9
+ vuint30 :extra
10
+ end
11
+
12
+ consume 0
13
+ produce 0
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ module Furnace::AVM2::ABC
2
+ class AS3DebugFile < Opcode
3
+ instruction 0xf1
4
+
5
+ body do
6
+ vuint30 :index
7
+ end
8
+
9
+ consume 0
10
+ produce 0
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module Furnace::AVM2::ABC
2
+ class AS3DebugLine < Opcode
3
+ instruction 0xf0
4
+
5
+ body do
6
+ vuint30 :linenum
7
+ end
8
+
9
+ consume 0
10
+ produce 0
11
+ end
12
+ end
@@ -0,0 +1,21 @@
1
+ module Furnace::AVM2::ABC
2
+ class AS3CallPropertyLex < Opcode
3
+ include ContextualOpcode
4
+
5
+ instruction 0x4c
6
+
7
+ implicit_operand false
8
+
9
+ body do
10
+ const_ref :property, :multiname
11
+ vuint30 :arg_count
12
+ end
13
+
14
+ consume { body.arg_count }
15
+ produce 1
16
+
17
+ def disassemble_parameters
18
+ "#{body.property.to_s}(#{body.arg_count})"
19
+ end
20
+ end
21
+ end