Esempio n. 1
0
 def __call__(self, raw_bytes, avoid, pcreg=''):
     key, xordata = xor_key(raw_bytes, avoid, size=1)
     key          = u8(key)
     maximum      = 256
     length       = len(raw_bytes)
     cacheflush   = shellcraft.arm.linux.cacheflush()
     decoder      = asm(self.decoder % locals())
     return decoder + xordata
Esempio n. 2
0
 def __call__(self, raw_bytes, avoid, pcreg=''):
     key, xordata = xor_key(raw_bytes, avoid, size=1)
     key = u8(key)
     maximum = 256
     length = len(raw_bytes)
     cacheflush = shellcraft.arm.linux.cacheflush()
     decoder = asm(self.decoder % locals())
     return decoder + xordata
Esempio n. 3
0
    def __call__(self, raw_bytes, avoid, pcreg=''):

        assert 0 == len(raw_bytes) % context.bytes, "Payload is not aligned"

        size = (len(raw_bytes) // 4) + 1
        assert size < 0x10000, "Payload is too long"

        size = size ^ 0xffff
        sizelo = size & 0xff
        sizehi = size >> 8

        decoder = str(decoders[context.endian])
        decoder = decoder.replace('SIZ1', chr(sizehi))
        decoder = decoder.replace('SIZ2', chr(sizelo))

        key, data = xor_key(raw_bytes, avoid=avoid)

        return decoder + key + data
Esempio n. 4
0
    def __call__(self, raw_bytes, avoid, pcreg=''):

        assert 0 == len(raw_bytes) % context.bytes, "Payload is not aligned"

        size = (len(raw_bytes)/4) + 1
        assert size < 0x10000, "Payload is too long"

        size   = size ^ 0xffff
        sizelo = size & 0xff
        sizehi = size >> 8

        decoder = str(decoders[context.endian])
        decoder = decoder.replace('SIZ1', chr(sizehi))
        decoder = decoder.replace('SIZ2', chr(sizelo))

        key, data = xor_key(raw_bytes, avoid=avoid)

        return decoder + key + data