ronin-code-asm 1.0.0.beta1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +1 -0
  3. data/.yardopts +1 -1
  4. data/README.md +2 -1
  5. data/gemspec.yml +2 -2
  6. data/lib/ronin/code/asm/archs/amd64.rb +2 -2
  7. data/lib/ronin/code/asm/archs/x86.rb +2 -2
  8. data/lib/ronin/code/asm/archs.rb +1 -1
  9. data/lib/ronin/code/asm/config.rb +1 -1
  10. data/lib/ronin/code/asm/immediate_operand.rb +1 -1
  11. data/lib/ronin/code/asm/instruction.rb +1 -1
  12. data/lib/ronin/code/asm/memory_operand.rb +1 -1
  13. data/lib/ronin/code/asm/os/freebsd.rb +1 -1
  14. data/lib/ronin/code/asm/os/linux.rb +1 -1
  15. data/lib/ronin/code/asm/os/os.rb +1 -1
  16. data/lib/ronin/code/asm/os.rb +1 -1
  17. data/lib/ronin/code/asm/program.rb +6 -6
  18. data/lib/ronin/code/asm/register.rb +2 -2
  19. data/lib/ronin/code/asm/shellcode.rb +1 -1
  20. data/lib/ronin/code/asm/syntax/att.rb +1 -1
  21. data/lib/ronin/code/asm/syntax/common.rb +1 -1
  22. data/lib/ronin/code/asm/syntax/intel.rb +1 -1
  23. data/lib/ronin/code/asm/syntax.rb +1 -1
  24. data/lib/ronin/code/asm/version.rb +2 -2
  25. data/lib/ronin/code/asm.rb +1 -1
  26. data/ronin-code-asm.gemspec +2 -1
  27. metadata +5 -30
  28. data/spec/asm_spec.rb +0 -14
  29. data/spec/config_spec.rb +0 -10
  30. data/spec/immediate_operand_spec.rb +0 -79
  31. data/spec/instruction_spec.rb +0 -62
  32. data/spec/memory_operand_spec.rb +0 -80
  33. data/spec/os_spec.rb +0 -68
  34. data/spec/program_spec.rb +0 -439
  35. data/spec/register_spec.rb +0 -112
  36. data/spec/shellcode_spec.rb +0 -58
  37. data/spec/spec_helper.rb +0 -7
  38. data/spec/syntax/att_spec.rb +0 -181
  39. data/spec/syntax/common_spec.rb +0 -42
  40. data/spec/syntax/intel_spec.rb +0 -174
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afdbeb043e51ce8513e7d833b7c8a730ee0488e579bc71c17044137c6b60dbe9
4
- data.tar.gz: 0fb69ebc839c8e1079122e5b962967b094d97fe48955e21ab09896b8f4c65fd3
3
+ metadata.gz: 7ad5a87365920a6f38b31e9ea268d2c2b4e735a2e4386a3aa0579cd00c0fdf16
4
+ data.tar.gz: 7d56cd03b8001a61ef64d9feb30378e6c315ebf191d066b8565321257a288289
5
5
  SHA512:
6
- metadata.gz: f1dca72988f3754272eb3e43d63292ef8209b94cd472f357c703f5cc695a4361d79d0da51fcd589078177c2a42412fd00a838ed47542a5865c199e05dc086345
7
- data.tar.gz: b4d1e207dd1bf4d47b88cab47423cd35610b66fb1f1580897acad9d961a2dfa9218e29e8a9564f89fe5e31cf8a18ee7d012c4f303e203aca1dc40c174253d14a
6
+ metadata.gz: 39999f88ef21563cb802fe25caf26cd31f32e78610c46f343ade50d081a399247f9a37d0d53466db58fcc99ea65f5e2a67b6c1cc5c6ae31f18c7416d64f55ef4
7
+ data.tar.gz: e744939e56cdc3f63129cf09bcdd3680cdb8dab885e368db8b71bda3a4e2fff56d21dd613d0d8bc1c1466793347733db08b4c9fa2f13d783ee6eceb40ed7f39d
@@ -21,6 +21,7 @@ jobs:
21
21
  uses: ruby/setup-ruby@v1
22
22
  with:
23
23
  ruby-version: ${{ matrix.ruby }}
24
+ bundler-cache: true
24
25
  - name: Install dependencies
25
26
  run: |
26
27
  sudo apt update -y && \
data/.yardopts CHANGED
@@ -1 +1 @@
1
- --markup markdown --title 'Ronin ASM Documentation' --protected
1
+ --markup markdown --title 'Ronin::Code::ASM Documentation' --protected
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/ronin-rb/ronin-code-asm/actions/workflows/ruby.yml/badge.svg)](https://github.com/ronin-rb/ronin-asm/actions/workflows/ruby.yml)
4
4
  [![Code Climate](https://codeclimate.com/github/ronin-rb/ronin-code-asm.svg)](https://codeclimate.com/github/ronin-rb/ronin-asm)
5
+ [![Gem Version](https://badge.fury.io/rb/ronin-code-asm.svg)](https://badge.fury.io/rb/ronin-code-asm)
5
6
 
6
7
  * [Source](https://github.com/ronin-rb/ronin-code-asm)
7
8
  * [Issues](https://github.com/ronin-rb/ronin-code-asm/issues)
@@ -146,7 +147,7 @@ $ gem install ronin-code-asm
146
147
 
147
148
  ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
148
149
 
149
- Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
150
+ Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
150
151
 
151
152
  ronin-code-asm is free software: you can redistribute it and/or modify
152
153
  it under the terms of the GNU Lesser General Public License as published
data/gemspec.yml CHANGED
@@ -13,10 +13,10 @@ requirements: yasm >= 0.6.0
13
13
  required_ruby_version: ">= 3.0.0"
14
14
 
15
15
  metadata:
16
- documentation_uri: https://ronin-rb.dev/docs/ronin-code-asm/frames
16
+ documentation_uri: https://ronin-rb.dev/docs/ronin-code-asm
17
17
  source_code_uri: https://github.com/ronin-rb/ronin-code-asm
18
18
  bug_tracker_uri: https://github.com/ronin-rb/ronin-code-asm/issues
19
- changelog_uri: https://github.com/ronin-rb/ronin-code-asm/blob/master/ChangeLog.md
19
+ changelog_uri: https://github.com/ronin-rb/ronin-code-asm/blob/main/ChangeLog.md
20
20
  rubygems_mfa_required: 'true'
21
21
 
22
22
  dependencies:
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -25,7 +25,7 @@ module Ronin
25
25
  module ASM
26
26
  module Archs
27
27
  #
28
- # Contains AMD64 Archtecture information.
28
+ # Contains AMD64 Architecture information.
29
29
  #
30
30
  module AMD64
31
31
  include X86
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -25,7 +25,7 @@ module Ronin
25
25
  module ASM
26
26
  module Archs
27
27
  #
28
- # Contains X86 Archtecture information.
28
+ # Contains X86 Architecture information.
29
29
  #
30
30
  module X86
31
31
  # Default word size
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -322,7 +322,7 @@ module Ronin
322
322
  # Generic method for popping off the stack.
323
323
  #
324
324
  # @param [Symbol] name
325
- # The name of the reigster.
325
+ # The name of the register.
326
326
  #
327
327
  # @abstract
328
328
  #
@@ -333,7 +333,7 @@ module Ronin
333
333
  # Generic method for clearing a register.
334
334
  #
335
335
  # @param [Symbol] name
336
- # The name of the reigster.
336
+ # The name of the register.
337
337
  #
338
338
  # @abstract
339
339
  #
@@ -344,7 +344,7 @@ module Ronin
344
344
  # Generic method for setting a register.
345
345
  #
346
346
  # @param [Symbol] name
347
- # The name of the reigster.
347
+ # The name of the register.
348
348
  #
349
349
  # @param [Register, ImmediateOperand, Integer] value
350
350
  # The new value for the register.
@@ -358,7 +358,7 @@ module Ronin
358
358
  # Generic method for saving a register.
359
359
  #
360
360
  # @param [Symbol] name
361
- # The name of the reigster.
361
+ # The name of the register.
362
362
  #
363
363
  # @abstract
364
364
  #
@@ -369,7 +369,7 @@ module Ronin
369
369
  # Generic method for loading a register.
370
370
  #
371
371
  # @param [Symbol] name
372
- # The name of the reigster.
372
+ # The name of the register.
373
373
  #
374
374
  # @abstract
375
375
  #
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -71,7 +71,7 @@ module Ronin
71
71
  end
72
72
 
73
73
  #
74
- # Substracts from the value within the register and dereferences the
74
+ # Subtracts from the value within the register and dereferences the
75
75
  # address.
76
76
  #
77
77
  # @param [Integer] offset
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -22,7 +22,7 @@ module Ronin
22
22
  module Code
23
23
  module ASM
24
24
  # ronin-code-asm version
25
- VERSION = '1.0.0.beta1'
25
+ VERSION = '1.0.0'
26
26
  end
27
27
  end
28
28
  end
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-code-asm - A Ruby DSL for crafting Assembly programs and shellcode.
4
4
  #
5
- # Copyright (c) 2007-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-code-asm is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -27,6 +27,8 @@ Gem::Specification.new do |gem|
27
27
  gem.files = `git ls-files`.split($/)
28
28
  gem.files = glob[gemspec['files']] if gemspec['files']
29
29
  gem.files += Array(gemspec['generated_files'])
30
+ # exclude test files from the packages gem
31
+ gem.files -= glob[gemspec['test_files'] || 'spec/{**/}*']
30
32
 
31
33
  gem.executables = gemspec.fetch('executables') do
32
34
  glob['bin/*'].map { |path| File.basename(path) }
@@ -34,7 +36,6 @@ Gem::Specification.new do |gem|
34
36
  gem.default_executable = gem.executables.first if Gem::VERSION < '1.7.'
35
37
 
36
38
  gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
37
- gem.test_files = glob[gemspec['test_files'] || 'spec/{**/}*_spec.rb']
38
39
  gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
39
40
 
40
41
  gem.require_paths = Array(gemspec.fetch('require_paths') {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-code-asm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-01 00:00:00.000000000 Z
11
+ date: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-yasm
@@ -86,27 +86,14 @@ files:
86
86
  - lib/ronin/code/asm/syntax/intel.rb
87
87
  - lib/ronin/code/asm/version.rb
88
88
  - ronin-code-asm.gemspec
89
- - spec/asm_spec.rb
90
- - spec/config_spec.rb
91
- - spec/immediate_operand_spec.rb
92
- - spec/instruction_spec.rb
93
- - spec/memory_operand_spec.rb
94
- - spec/os_spec.rb
95
- - spec/program_spec.rb
96
- - spec/register_spec.rb
97
- - spec/shellcode_spec.rb
98
- - spec/spec_helper.rb
99
- - spec/syntax/att_spec.rb
100
- - spec/syntax/common_spec.rb
101
- - spec/syntax/intel_spec.rb
102
89
  homepage: https://github.com/ronin-rb/ronin-code-asm#readme
103
90
  licenses:
104
91
  - LGPL-3.0
105
92
  metadata:
106
- documentation_uri: https://ronin-rb.dev/docs/ronin-code-asm/frames
93
+ documentation_uri: https://ronin-rb.dev/docs/ronin-code-asm
107
94
  source_code_uri: https://github.com/ronin-rb/ronin-code-asm
108
95
  bug_tracker_uri: https://github.com/ronin-rb/ronin-code-asm/issues
109
- changelog_uri: https://github.com/ronin-rb/ronin-code-asm/blob/master/ChangeLog.md
96
+ changelog_uri: https://github.com/ronin-rb/ronin-code-asm/blob/main/ChangeLog.md
110
97
  rubygems_mfa_required: 'true'
111
98
  post_install_message:
112
99
  rdoc_options: []
@@ -128,16 +115,4 @@ rubygems_version: 3.3.26
128
115
  signing_key:
129
116
  specification_version: 4
130
117
  summary: A Ruby DSL for crafting Assembly programs and Shellcode.
131
- test_files:
132
- - spec/asm_spec.rb
133
- - spec/config_spec.rb
134
- - spec/immediate_operand_spec.rb
135
- - spec/instruction_spec.rb
136
- - spec/memory_operand_spec.rb
137
- - spec/os_spec.rb
138
- - spec/program_spec.rb
139
- - spec/register_spec.rb
140
- - spec/shellcode_spec.rb
141
- - spec/syntax/att_spec.rb
142
- - spec/syntax/common_spec.rb
143
- - spec/syntax/intel_spec.rb
118
+ test_files: []
data/spec/asm_spec.rb DELETED
@@ -1,14 +0,0 @@
1
- require 'spec_helper'
2
- require 'ronin/code/asm'
3
-
4
- describe Ronin::Code::ASM do
5
- it "must have a version" do
6
- expect(subject.const_defined?('VERSION')).to eq(true)
7
- end
8
-
9
- describe ".new" do
10
- it "must return a new Ronin::Code::ASM::Program" do
11
- expect(subject.new(arch: :x86)).to be_kind_of(Ronin::Code::ASM::Program)
12
- end
13
- end
14
- end
data/spec/config_spec.rb DELETED
@@ -1,10 +0,0 @@
1
- require 'spec_helper'
2
- require 'ronin/code/asm/config'
3
-
4
- describe Ronin::Code::ASM::Config do
5
- describe "DATA_DIR" do
6
- it "must be a directory" do
7
- expect(File.directory?(subject::DATA_DIR)).to be(true)
8
- end
9
- end
10
- end
@@ -1,79 +0,0 @@
1
- require 'spec_helper'
2
-
3
- require 'ronin/code/asm/immediate_operand'
4
-
5
- describe Ronin::Code::ASM::ImmediateOperand do
6
- let(:value) { 0xff }
7
-
8
- describe "#initialize" do
9
- context "with a width" do
10
- let(:width) { 2 }
11
-
12
- subject { described_class.new(value,width) }
13
-
14
- it "must set the width" do
15
- expect(subject.width).to eq(width)
16
- end
17
- end
18
- end
19
-
20
- describe "#width" do
21
- describe "default width for" do
22
- context "0x100000000 .. 0xffffffffffffffff" do
23
- subject { described_class.new(0xffffffffffffffff).width }
24
-
25
- it { expect(subject).to be == 8 }
26
- end
27
-
28
- context "-0x800000000 .. -0x7fffffffffffffff" do
29
- subject { described_class.new(-0x7fffffffffffffff).width }
30
-
31
- it { expect(subject).to be == 8 }
32
- end
33
-
34
- context "0x10000 .. 0xffffffff" do
35
- subject { described_class.new(0xffffffff).width }
36
-
37
- it { expect(subject).to be == 4 }
38
- end
39
-
40
- context "-0x80000 .. -0x7fffffff" do
41
- subject { described_class.new(-0x7fffffff).width }
42
-
43
- it { expect(subject).to be == 4 }
44
- end
45
-
46
- context "0x100 .. 0xffff" do
47
- subject { described_class.new(0xffff).width }
48
-
49
- it { expect(subject).to be == 2 }
50
- end
51
-
52
- context "-0x80 .. -0x7fff" do
53
- subject { described_class.new(-0x7fff).width }
54
-
55
- it { expect(subject).to be == 2 }
56
- end
57
-
58
- context "0x0 .. 0xff" do
59
- subject { described_class.new(0xff).width }
60
-
61
- it { expect(subject).to be == 1 }
62
- end
63
-
64
- context "0x0 .. -0x7f" do
65
- subject { described_class.new(-0x7f).width }
66
-
67
- it { expect(subject).to be == 1 }
68
- end
69
- end
70
- end
71
-
72
- describe "#to_i" do
73
- subject { described_class.new(value) }
74
-
75
- it "must return the value" do
76
- expect(subject.to_i).to eq(value)
77
- end
78
- end
79
- end
@@ -1,62 +0,0 @@
1
- require 'spec_helper'
2
-
3
- require 'ronin/code/asm/instruction'
4
- require 'ronin/code/asm/register'
5
- require 'ronin/code/asm/immediate_operand'
6
- require 'ronin/code/asm/memory_operand'
7
-
8
- describe Ronin::Code::ASM::Instruction do
9
- let(:register) { Ronin::Code::ASM::Register.new(:eax, 4) }
10
- let(:immediate) { Ronin::Code::ASM::ImmediateOperand.new(0xff, 1) }
11
-
12
- describe "#initialize" do
13
- let(:name) { :mov }
14
- let(:operands) { [immediate, register] }
15
-
16
- subject { described_class.new(name,operands) }
17
-
18
- it "must set the name" do
19
- expect(subject.name).to eq(:mov)
20
- end
21
-
22
- it "must set the operands" do
23
- expect(subject.operands).to eq(operands)
24
- end
25
-
26
- context "when given an Integer operand" do
27
- let(:integer) { 0xff }
28
-
29
- subject { described_class.new(name, [integer, register]) }
30
-
31
- it "must wrap the operand to in a Ronin::Code::ASM::ImmediateOperand" do
32
- expect(subject.operands[0]).to be_kind_of(Ronin::Code::ASM::ImmediateOperand)
33
- expect(subject.operands[0].value).to eq(integer)
34
- end
35
- end
36
-
37
- context "when given a nil operand" do
38
- subject { described_class.new(name, [nil, register]) }
39
-
40
- it "must wrap the operand to in a Ronin::Code::ASM::ImmediateOperand" do
41
- expect(subject.operands[0]).to be_kind_of(Ronin::Code::ASM::ImmediateOperand)
42
- expect(subject.operands[0].value).to eq(0)
43
- end
44
- end
45
- end
46
-
47
- describe "#width" do
48
- subject { described_class.new(:mov, [immediate, register]) }
49
-
50
- it "must return the maximum width of the operands" do
51
- expect(subject.width).to eq(register.width)
52
- end
53
-
54
- context "when one of the operands does not define #width" do
55
- subject { described_class.new(:mov, [:label, register]) }
56
-
57
- it "must ignore them" do
58
- expect(subject.width).to eq(register.width)
59
- end
60
- end
61
- end
62
- end