-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplugin_base64.py
38 lines (28 loc) · 875 Bytes
/
plugin_base64.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
__description__ = 'Base64 string decoder for oledump.py'
__author__ = 'James Habben'
__version__ = '0.0.1'
__date__ = '2015/01/30'
import re
import base64
def Decode (input) :
return base64.b64decode(input)
class cBase64Decoder(cPluginParent):
macroOnly = True
name = 'Base64 decoder'
def __init__(self, name, stream, options):
self.streamname = name
self.stream = stream
self.options = options
self.ran = False
def Analyze(self):
self.ran = True
result = []
oREString = re.compile(r'"(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?"')
for foundString in oREString.findall(self.stream):
try:
result.append(Decode(foundString))
except:
pass
return result
AddPlugin(cBase64Decoder)