Exemplo n.º 1
0
def run(segments, args, addresses, interpreter=None, **kwargs):
    hex_str = binascii.hexlify(six.b(args.hex_str))

    if sys.version[0] == '3':
        hex_str = hex_str.decode()

    if args.null_terminated:
        hex_str += '00'
    setattr(args, 'hex_str', hex_str)
    return find_bytes.run(segments, args, addresses, **kwargs)
Exemplo n.º 2
0
def run(segments, args, addresses, interpreter=None, **kwargs):
    arch = eval(args.arch)
    mode = eval(args.mode)

    if args.bele:
        mode |= KS_MODE_BIG_ENDIAN if \
            interpreter.endianity == '>' else KS_MODE_LITTLE_ENDIAN

    ks = Ks(arch, mode)
    compiled_buf = bytearray(ks.asm(args.code)[0])

    setattr(args, 'hex_str', binascii.hexlify(compiled_buf).decode('utf8'))
    return find_bytes.run(segments, args, addresses, **kwargs)
Exemplo n.º 3
0
def run(segments, args, addresses, interpreter=None, **kwargs):
    hex_str = binascii.hexlify(args.hex_str)
    if args.null_terminated:
        hex_str += '00'
    setattr(args, 'hex_str', hex_str)
    return find_bytes.run(segments, args, addresses, **kwargs)