one_gadget 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/one_gadget/gadget.rb +10 -3
- data/lib/one_gadget/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: 223aa849cee41952e27731d2ae1e0aeced46e45c9c902d88501a896443934486
|
4
|
+
data.tar.gz: 9f5a11874255fba6cfc3e9a344e2ebc1a15e7388bcff81ffc83e9859d1480fb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 000f6fc6ae7e4e1d714b95fb2d958a40798dc867f991f74050cce746ba3edbc4ab5f41f00de973f4b6237c00f1a714ed6c0f895d5a89de667899da40a4b5d313
|
7
|
+
data.tar.gz: 6c2a1e22e24a3b9cfbdd0f166c4686894686c8805479fc4cfd152e2b5e37841e05178172b4121bdfbe187ec5378ed744955cd0ebeb898ac6d5aebc10889e9e59
|
data/lib/one_gadget/gadget.rb
CHANGED
@@ -78,12 +78,19 @@ module OneGadget
|
|
78
78
|
case expr
|
79
79
|
when / & 0xf/ then 0.95
|
80
80
|
when /GOT address/ then 0.9
|
81
|
-
when /^writable/ then
|
82
|
-
when / == NULL$/ then calculate_null_score(expr.
|
83
|
-
when / <= 0$/ then calculate_null_score(expr.
|
81
|
+
when /^writable/ then calculate_writable_score(expr.sub('writable: ', ''))
|
82
|
+
when / == NULL$/ then calculate_null_score(expr.sub(' == NULL', ''))
|
83
|
+
when / <= 0$/ then calculate_null_score(expr.sub(' <= 0', ''))
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
+
def calculate_writable_score(identity)
|
88
|
+
lmda = OneGadget::Emulators::Lambda.parse(identity)
|
89
|
+
return 0.81 if lmda.deref_count != 0
|
90
|
+
|
91
|
+
OneGadget::ABI.stack_register?(lmda.obj) ? 0.95 : 0.81
|
92
|
+
end
|
93
|
+
|
87
94
|
def calculate_null_score(identity)
|
88
95
|
# remove <CAST>
|
89
96
|
identity.sub!(/^\([s|u]\d+\)/, '')
|
data/lib/one_gadget/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: one_gadget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- david942j
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: elftools
|