Python binascii.rlecode_hqx() Examples

The following are 30 code examples of binascii.rlecode_hqx(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module binascii , or try the search function .
Example #1
Source File: binhex.py    From PokemonGo-DesktopMap with MIT License 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #2
Source File: binhex.py    From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = b'' 
Example #3
Source File: binhex.py    From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #4
Source File: test_binascii.py    From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 5 votes vote down vote up
def test_hqx(self):
        # Perform binhex4 style RLE-compression
        # Then calculate the hexbin4 binary-to-ASCII translation
        rle = binascii.rlecode_hqx(self.data)
        a = binascii.b2a_hqx(self.type2test(rle))
        b, _ = binascii.a2b_hqx(self.type2test(a))
        res = binascii.rledecode_hqx(b)

        self.assertEqual(res, self.rawdata) 
Example #5
Source File: binhex.py    From medicare-demo with Apache License 2.0 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #6
Source File: binhex.py    From medicare-demo with Apache License 2.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #7
Source File: binhex.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #8
Source File: binhex.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #9
Source File: binhex.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #10
Source File: binhex.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #11
Source File: test_binascii.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_hqx(self):
        # Perform binhex4 style RLE-compression
        # Then calculate the hexbin4 binary-to-ASCII translation
        rle = binascii.rlecode_hqx(self.data)
        a = binascii.b2a_hqx(self.type2test(rle))
        b, _ = binascii.a2b_hqx(self.type2test(a))
        res = binascii.rledecode_hqx(b)

        self.assertEqual(res, self.rawdata) 
Example #12
Source File: binhex.py    From RevitBatchProcessor with GNU General Public License v3.0 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #13
Source File: binhex.py    From RevitBatchProcessor with GNU General Public License v3.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #14
Source File: binhex.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #15
Source File: binhex.py    From PokemonGo-DesktopMap with MIT License 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #16
Source File: binhex.py    From unity-python with MIT License 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #17
Source File: binhex.py    From unity-python with MIT License 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #18
Source File: binhex.py    From android_universal with MIT License 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = b'' 
Example #19
Source File: binhex.py    From android_universal with MIT License 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #20
Source File: binhex.py    From canape with GNU General Public License v3.0 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #21
Source File: binhex.py    From canape with GNU General Public License v3.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #22
Source File: binhex.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #23
Source File: binhex.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #24
Source File: binhex.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #25
Source File: binhex.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #26
Source File: test_binascii.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_hqx(self):
        # Perform binhex4 style RLE-compression
        # Then calculate the hexbin4 binary-to-ASCII translation
        rle = binascii.rlecode_hqx(self.data)
        a = binascii.b2a_hqx(self.type2test(rle))
        b, _ = binascii.a2b_hqx(self.type2test(a))
        res = binascii.rledecode_hqx(b)

        self.assertEqual(res, self.rawdata) 
Example #27
Source File: test_binascii.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_hqx(self):
        # Perform binhex4 style RLE-compression
        # Then calculate the hexbin4 binary-to-ASCII translation
        rle = binascii.rlecode_hqx(self.data)
        a = binascii.b2a_hqx(self.type2test(rle))
        b, _ = binascii.a2b_hqx(self.type2test(a))
        res = binascii.rledecode_hqx(b)

        self.assertEqual(res, self.rawdata) 
Example #28
Source File: binhex.py    From meddle with MIT License 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp 
Example #29
Source File: binhex.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = '' 
Example #30
Source File: binhex.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp