-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdthexlify.py
More file actions
31 lines (25 loc) · 744 Bytes
/
dthexlify.py
File metadata and controls
31 lines (25 loc) · 744 Bytes
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from binascii import hexlify, unhexlify
from dtoperation import DTOperation
class DTHexlify(DTOperation):
'''
Returns Hexlified and UnHexlified data.
Useful for scripts and binaries with hardcoded and hexlified shellcode.
'''
def needs_key(self):
''''''
return False
def needs_second_key(self):
''''''
return False
def needs_IV(self):
''''''
return False
def transform(self, dt_input, dt_key1=None, dt_key2=None, dt_iv=None, dt_mode='dec'):
''''''
if dt_mode == 'enc':
return hexlify(dt_input)
elif dt_mode == 'dec':
return unhexlify(dt_input)
return None