asmrepl 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asmrepl/repl.rb +29 -25
- data/lib/asmrepl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fea751dab8edd03b3cecfb3ea60417c34a9464f19c6e2bc2c2b67b4dcc209cd
|
4
|
+
data.tar.gz: db10a7a8e9a385bcafa3d517dc851774f52a657184334c493627e7cd09d7f870
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf9202d1ec0d1700f404f6b8e3c353b56b1985b9a36b4e7520857ac228815439d424c63936b840b56c4a0d073a5814ac699e4afa146ffa73e360b39ec526f05f
|
7
|
+
data.tar.gz: 7c999f1a3b51ea5156e4224296b2df27ca509ae5a4becec8f9d2c57ef1a6af4338993137efe98e98f75ffed1fff791a25c530e5bdd75d36b18f025a8e8aa4a50
|
data/lib/asmrepl/repl.rb
CHANGED
@@ -55,36 +55,40 @@ module ASMREPL
|
|
55
55
|
pos = (state.rip - @buffer.memory.to_i)
|
56
56
|
@buffer.seek pos
|
57
57
|
use_history = true
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
58
|
+
begin
|
59
|
+
loop do
|
60
|
+
cmd = nil
|
61
|
+
text = Reline.readmultiline(">> ", use_history) do |multiline_input|
|
62
|
+
if multiline_input =~ /\A\s*(\w+)\s*\Z/
|
63
|
+
register = $1
|
64
|
+
cmd = [:read, register]
|
65
|
+
else
|
66
|
+
cmd = :run
|
67
|
+
end
|
68
|
+
true
|
66
69
|
end
|
67
|
-
true
|
68
|
-
end
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
71
|
+
case cmd
|
72
|
+
in :run
|
73
|
+
break if text.chomp.empty?
|
74
|
+
binary = @assembler.assemble @parser.parse text.chomp
|
75
|
+
binary.bytes.each { |byte| @buffer.putc byte }
|
76
|
+
break
|
77
|
+
in [:read, "cpu"]
|
78
|
+
display_state state
|
79
|
+
in [:read, reg]
|
80
|
+
val = state[reg]
|
81
|
+
if val
|
82
|
+
puts sprintf("%#018x", state[reg])
|
83
|
+
else
|
84
|
+
puts "Unknown command: "
|
85
|
+
puts " " + text
|
86
|
+
end
|
82
87
|
else
|
83
|
-
puts "Unknown command: "
|
84
|
-
puts " " + text
|
85
88
|
end
|
86
|
-
else
|
87
89
|
end
|
90
|
+
rescue Interrupt
|
91
|
+
exit 0
|
88
92
|
end
|
89
93
|
tracer.continue
|
90
94
|
end
|
data/lib/asmrepl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asmrepl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|