Class: Rex::Encoder::Alpha2::UnicodeMixed
- Inherits:
-
Generic
- Object
- Generic
- Rex::Encoder::Alpha2::UnicodeMixed
show all
- Defined in:
- lib/rex/encoder/alpha2/unicode_mixed.rb
Class Method Summary
collapse
Methods inherited from Generic
add_terminator, default_accepted_chars, encode, encode_byte
Class Method Details
.gen_base_set(max) ⇒ Object
11
12
13
14
15
|
# File 'lib/rex/encoder/alpha2/unicode_mixed.rb', line 11
def self.gen_base_set(max)
Rex::Text.shuffle_a(
[* ( (0..(max-1)).map { |i| i *= 0x10 } ) ]
)
end
|
.gen_decoder(reg, offset) ⇒ Object
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# File 'lib/rex/encoder/alpha2/unicode_mixed.rb', line 50
def self.gen_decoder(reg, offset)
decoder =
gen_decoder_prefix(reg, offset) +
"j" + "XA" + "QA" + "DA" + "ZA" + "BA" + "RA" + "LA" + "YA" + "IA" + "QA" + "IA" + "QA" + "IA" + "hAAA" + "Z" + "1A" + "IA" + "IA" + "J" + "1" + "1A" + "IA" + "IA" + "BA" + "BA" + "B" + "Q" + "I" + "1A" + "I" + "Q" + "IA" + "I" + "Q" + "I" + "1" + "1" + "1A" + "IA" + "J" + "Q" + "YA" + "Z" + "B" + "A" + "B" + "A" + "B" + "A" + "B" + "A" + "B" + "kM" + "A" + "G" + "B" + "9" + "u" + "4JB"
return decoder
end
|
.gen_decoder_prefix(reg, offset) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/rex/encoder/alpha2/unicode_mixed.rb', line 22
def self.gen_decoder_prefix(reg, offset)
if (offset > 28)
raise "Critical: Offset is greater than 28"
end
if (offset <= 14)
nop = 'CP' * offset
mod = 'IA' * (14 - offset) + nop else
mod = 'AA' * (offset - 14) nop = 'CP' * (14 - mod.length)
mod += nop
end
regprefix = { 'EAX' => 'PPYA' + mod, 'ECX' => mod + "4444", 'EDX' => 'RRYA' + mod, 'EBX' => 'SSYA' + mod, 'ESP' => 'TUYA' + mod, 'EBP' => 'UUYA' + mod, 'ESI' => 'VVYA' + mod, 'EDI' => 'WWYA' + mod, }
return regprefix[reg]
end
|
.gen_second(block, base) ⇒ Object
17
18
19
20
|
# File 'lib/rex/encoder/alpha2/unicode_mixed.rb', line 17
def self.gen_second(block, base)
(block - base)
end
|