コード例 #1
0
def flags(flag_str):
    ""
    res = ''
    res = res + '%s\n\n' % utils.str2hex(flag_str)
    flags = utils.bytes2int(flag_str[0:2])
    res = res + '%s                   # flags\n' % (utils.int2hex_str(flags))
    res = res + 'Binary:\nlayout 87654321 87654321\n'
    res = res + '       %s %s\n' % (utils.byte2bin_str(flag_str[1]), utils.byte2bin_str(flag_str[0]))

    flags2 = utils.bytes2int(flag_str[2:4])
    res = res + '%s                   # more flags ???\n' % (utils.int2hex_str(flags2))
    res = res + 'Binary:\nlayout 87654321 87654321\n'
    res = res + '       %s %s\n' % (utils.byte2bin_str(flag_str[3]), utils.byte2bin_str(flag_str[2]))

    #res = res + '%s                   # delimiter ???\n' % m_hex[(cur + 2) * 2: (cur + 4) * 2]

    return res
コード例 #2
0
def item(item_str):
    ""
    item = {}
    res = ''
    item['len1'] = utils.bytes2int(item_str[0:2])
    item['len2'] = utils.bytes2int(item_str[2:4])
    item['offset'] = utils.bytes2int(item_str[4:6])

    res = res + '%s\n\nlength (two times), offset, delimiter\n' % (utils.str2hex(item_str))

    res = res + '%s decimal: %3d    # length 1\n' % (utils.int2hex_str(item['len1']), item['len1'])
    res = res + '%s decimal: %3d    # length 2\n' % (utils.int2hex_str(item['len2']), item['len2'])
    res = res + '%s decimal: %3d    # offset\n' % (utils.int2hex_str(item['offset']), item['offset'])
    res = res + '%s                   # delimiter (two zeros)\n\n' % utils.str2hex(item_str[-2:])
    item['string'] = res

    return item
コード例 #3
0
ファイル: ntlm_messages.py プロジェクト: vpashka/magos-linux
def flags(flag_str):
    ""
    res = ''
    res = res + '%s\n\n' % utils.str2hex(flag_str)
    flags = utils.bytes2int(flag_str[0:2])
    res = res + '%s                   # flags\n' % (utils.int2hex_str(flags))
    res = res + 'Binary:\nlayout 87654321 87654321\n'
    res = res + '       %s %s\n' % (utils.byte2bin_str(
        flag_str[1]), utils.byte2bin_str(flag_str[0]))

    flags2 = utils.bytes2int(flag_str[2:4])
    res = res + '%s                   # more flags ???\n' % (
        utils.int2hex_str(flags2))
    res = res + 'Binary:\nlayout 87654321 87654321\n'
    res = res + '       %s %s\n' % (utils.byte2bin_str(
        flag_str[3]), utils.byte2bin_str(flag_str[2]))

    #res = res + '%s                   # delimiter ???\n' % m_hex[(cur + 2) * 2: (cur + 4) * 2]

    return res
コード例 #4
0
ファイル: ntlm_messages.py プロジェクト: vpashka/magos-linux
def item(item_str):
    ""
    item = {}
    res = ''
    item['len1'] = utils.bytes2int(item_str[0:2])
    item['len2'] = utils.bytes2int(item_str[2:4])
    item['offset'] = utils.bytes2int(item_str[4:6])

    res = res + '%s\n\nlength (two times), offset, delimiter\n' % (
        utils.str2hex(item_str))

    res = res + '%s decimal: %3d    # length 1\n' % (utils.int2hex_str(
        item['len1']), item['len1'])
    res = res + '%s decimal: %3d    # length 2\n' % (utils.int2hex_str(
        item['len2']), item['len2'])
    res = res + '%s decimal: %3d    # offset\n' % (utils.int2hex_str(
        item['offset']), item['offset'])
    res = res + '%s                   # delimiter (two zeros)\n\n' % utils.str2hex(
        item_str[-2:])
    item['string'] = res

    return item