-
Notifications
You must be signed in to change notification settings - Fork 0
/
pynbfs.py
38 lines (33 loc) · 925 Bytes
/
pynbfs.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
from lib.decoder import parse
class NBFS:
def __init__(self):
pass
def bin2xml(self, data):
'''
.NET Binary to XML
:param bytes:
:return:
'''
assert isinstance(data, bytes), 'Input data should be byte type.'
return parse.parse(data)
def xml2bin(self, content):
'''
Same as xml2mcnbfs
:param content:
:return:
'''
return self.xml2mcnbfs(content)
def xml2mcnbfs(self, content):
'''
XML to .NET Binary in format [MC-NBFS] (standard)
:param content:
:return:
'''
return parse.xml_to_mcnbfs(content)
def xml2mcnbfse(self, content,nosizeprefix=True):
'''
XML to .NET Binary in format [MC-NBFSE] with in-band dictionary
:param content:
:return:
'''
return parse.xml_to_mcnbfse(content,nosizeprefix)