rubypwn 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/lib/asm.rb +14 -0
- data/lib/basic.rb +15 -6
- data/lib/rubypwn.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d865abbc807e6fbc199682a1e9566c4f5a70debc
|
4
|
+
data.tar.gz: e472c7e2a94c64990cea313c8d8ee5518317dfbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b0f1e99c8aa6e9a7f1aa724f9a0246593913bca33e5f9ed3b5114b3996c0fe42d0d4fd79e1d38886d617a666ef896e2271c9124544a48ff247d2ef9ca107d91
|
7
|
+
data.tar.gz: bd3eb79562e975d77d2e945be7c02ae144a103fe693adaeb00956a59aac63dd39dcc72e2cd043ca6635befc6c67f9a1dc6fe5774697dd75d5d04927a7ace9a62
|
data/lib/asm.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class Asm
|
5
|
+
def self.compile(code, arch="i386", format="hex")
|
6
|
+
r = RestClient.post 'http://atdog.tw/asm/compile', :code => code, :arch => arch, :format => format
|
7
|
+
r = JSON.parse r
|
8
|
+
if r['result'] == 1
|
9
|
+
return r['code']
|
10
|
+
else
|
11
|
+
raise "asm compile error. [code]: #{code}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/basic.rb
CHANGED
@@ -1,11 +1,20 @@
|
|
1
|
-
def
|
2
|
-
[int].pack("
|
1
|
+
def i16(int)
|
2
|
+
[int].pack("S<")
|
3
3
|
end
|
4
4
|
|
5
5
|
def i32(int)
|
6
6
|
[int].pack("L<")
|
7
7
|
end
|
8
8
|
|
9
|
+
def i64(int)
|
10
|
+
[int].pack("Q<")
|
11
|
+
end
|
12
|
+
|
13
|
+
def s16(int)
|
14
|
+
str = str.ljust(2, "\x00")
|
15
|
+
str.unpack("S<")[0]
|
16
|
+
end
|
17
|
+
|
9
18
|
def s32(str)
|
10
19
|
str = str.ljust(4, "\x00")
|
11
20
|
str.unpack("L<")[0]
|
@@ -16,10 +25,6 @@ def s64(str)
|
|
16
25
|
str.unpack("Q<")[0]
|
17
26
|
end
|
18
27
|
|
19
|
-
def i16(int)
|
20
|
-
[int].pack("S<")
|
21
|
-
end
|
22
|
-
|
23
28
|
def c(int)
|
24
29
|
[int].pack("C")
|
25
30
|
end
|
@@ -27,3 +32,7 @@ end
|
|
27
32
|
def hex(str)
|
28
33
|
str.unpack("H*")[0]
|
29
34
|
end
|
35
|
+
|
36
|
+
def nop()
|
37
|
+
"\x90"
|
38
|
+
end
|
data/lib/rubypwn.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubypwn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- atdog
|
@@ -16,6 +16,7 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- lib/asm.rb
|
19
20
|
- lib/basic.rb
|
20
21
|
- lib/exec.rb
|
21
22
|
- lib/netcat.rb
|