• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python ptypes.setsource函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中ptypes.setsource函数的典型用法代码示例。如果您正苦于以下问题:Python setsource函数的具体用法?Python setsource怎么用?Python setsource使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setsource函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_abc

    def test_abc():
        data = '\xbf\x14\xe5\x03\x00\x00\x01\x00\x00\x00\x00\x10\x00.\x00\x00\x00\x00"\x00\x04void\x07mx.core\nIFlexAsset\x0eByteArrayAsset\x0bflash.utils\tByteArray\x16mx.core:ByteArrayAsset\x08test_fla\x1aMainTimeline_Testinputsets#test_fla:MainTimeline_Testinputsets\x0cMainTimeline\rflash.display\tMovieClip\x15test_fla:MainTimeline\rTestinputsets\x05Class\x07loadres\x06frame1*http://www.adobe.com/2006/flex/mx/internal\x07VERSION\x06String\x073.0.0.0\x0bmx_internal\x06Object\tshareable\x0eaddFrameScript\x0cflash.events\x0fEventDispatcher\rDisplayObject\x11InteractiveObject\x16DisplayObjectContainer\x06Sprite\x0c\x16\x01\x16\x03\x16\x06\x18\x08\x16\t\x18\x0b\x16\r\x18\x0f\x17\t\x08\x14\x16\x1c\x03\x01\x02\x01\x05\x1a\x07\x01\x02\x07\x02\x04\x07\x02\x05\x07\x03\x07\t\x04\x01\x07\x05\n\x07\x05\x0c\x07\x07\x0e\x07\x01\x10\x07\x01\x11\x07\x01\x12\x07\t\x13\x07\n\x15\x07\x01\x16\x07\x02\x18\t\x05\x01\x07\x01\x19\t\n\x02\x07\x01\x1a\x07\x01\x1b\x07\x0b\x1d\x07\x07\x1e\x07\x07\x1f\x07\x07 \x07\x07!\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x02\x00\x05\x00\x02\x00\x03\x04\t\x04\x01\x05\x05\x00\x06\x03\t\x06\x00\x08\x00\x07\x08\x08\x08\x00\r\x03\t\x00\x00\n\x00\x0b\x01\x00\x0b\x0c\x01\x00\x0c\x01\x00\x04\x01\r\x06\x01\x0e\x17\x01\x07\x00\n\x00\x05\x00\x01\x0f\x06\x00\x00\n\x08\x03\x01\x02\x04\x00\x00\x06\x01\x03\x04\x00\x01\t\x01\x06\x04\x00\x02\x0e\x01\x07\x04\x01\x03\x0e\x00\x01\x01\x01\x02\x03\xd00G\x00\x00\x01\x00\x01\x03\x03\x01G\x00\x00\x03\x02\x01\x01\x02\n\xd00]\x05 X\x00h\x02G\x00\x00\x04\x02\x01\x04\x05\t\xd00^\r,\x17h\rG\x00\x00\x05\x01\x01\x05\x06\x06\xd00\xd0I\x00G\x00\x00\x06\x02\x01\x01\x04\x13\xd00]\x10`\x110`\x040`\x04X\x01\x1d\x1dh\x03G\x00\x00\x07\x01\x01\x05\x06\x03\xd00G\x00\x00\x08\x01\x01\x06\x07\x06\xd00\xd0I\x00G\x00\x00\t\x02\x01\x01\x05\x17\xd00]\x12`\x110`\x040`\x030`\x03X\x02\x1d\x1d\x1dh\x06G\x00\x00\n\x01\x01\t\n\x03\xd00G\x00\x00\x0b\x02\x02\n\x0b\x0e\xd00\xd0J\t\x00\x80\x04\xd5\xd1&a\x13G\x00\x00\x0c\x01\x01\n\x0b\x07\xd00\xd0O\x0b\x00G\x00\x00\r\x03\x01\n\x0b\x15\xd00\xd0`\x06h\t\xd0I\x00]\x14$\x00\xd0f\x0cO\x14\x02G\x00\x00\x0e\x02\x01\x01\t\'\xd00e\x00`\x110`\x150`\x160`\x170`\x180`\x190`\x080`\x08X\x03\x1d\x1d\x1d\x1d\x1d\x1d\x1dh\x07G\x00\x00'
        ptypes.setsource( prov.string(data) )

        a = tags.Tag()
        a = a.l
        print a['data']['ABCData']
开发者ID:arizvisa,项目名称:syringe,代码行数:7,代码来源:tags.py


示例2: test_DefineShape_load

 def test_DefineShape_load():
     s = '\xbf\x00$\x00\x00\x00\x01\x00`\x002\x00\x00\r\xc0\x01\x00\xff\xff\xff\x01\x01\x00\x00\x00\x00\x115\x8c\x807\x1fD\xe0p\xc9\x1d\x0c\x81\xc2\xdc\x00'
     ptypes.setsource( prov.string(s) )
     a = tags.Tag()
     a = a.l
     b = a['data']
     print b
     print b['shapeid']
     print b['shapebounds']
     print b['shapes']
开发者ID:arizvisa,项目名称:syringe,代码行数:10,代码来源:tags.py


示例3: test_SHAPEWITHSTYLE_load

 def test_SHAPEWITHSTYLE_load():
     global a
     s = '\x01\x00\xff\xff\xff\x01\x01\x00\x00\x00\x00\x115\x8c\x807\x1fD\xe0p\xc9\x1d\x0c\x81\xc2\xdc\x00'
     print repr(s[0xc:])
     ptypes.setsource( prov.string(s) )
     a = stypes.SHAPEWITHSTYLE()
     a = a.l
     print a.v
     #print a['fillstyles']['fillstyles'][0]
     #print a['linestyles']['linestyles'][0]
     #print a['numbits']
     print a['ShapeRecords'][0]
     print a['shaperecords']
     print a['shaperecords'][0]
     print a['shaperecords'][0]['Shape']
开发者ID:arizvisa,项目名称:syringe,代码行数:15,代码来源:tags.py


示例4:

if __name__ == '__main__':
    import ptypes,pecoff
    from ptypes import *
    ptypes.setsource(ptypes.file('./chewbacca.exe.infected'))
    a = pecoff.Executable.File()
    a=a.l
    b = a['next']['header']
    #print b['header']
    c = b['FileHeader']['pointertosymboltable'].d
    c = c.l
    print c['Symbols'][1]
    print c['Symbols'][1].details()
    print c['Symbols']

    print c.names()
    print c.walk().next()

    print c.getSymbol('_main')
    print c.getAuxiliary('_main')
    print c.fetch('_main')
开发者ID:arizvisa,项目名称:syringe,代码行数:20,代码来源:test.py


示例5: DpxMainHeader

        (float, 'white_level'),
        (float, 'integration_times'),
        (dyn.block(76), 'reserved'),
    ]

class DpxMainHeader(pstruct.type):
    _fields_ = [
        (DpxFileHeader, 'fileHeader'),
        (DpxImageHeader, 'imageHeader'),
        (DpxOrientationHeader, 'orientationHeader'),
        (DpxFilmHeader, 'filmHeader'),
        (DpxTelevisionHeader, 'televisionHeader'),
    ]

class File(pstruct.type):
    _fields_ = [
        (DpxMainHeader, 'header'),
    ]

if __name__ == '__main__':
    import sys
    import ptypes, image.dpx

    if len(sys.argv) != 2:
        print "Usage: {:s} file".format(sys.argv[0] if len(sys.argv) else __file__)
        sys.exit(0)

    ptypes.setsource(ptypes.prov.file(sys.argv[1]))
    a = image.dpx.File()
    a = a.l
开发者ID:arizvisa,项目名称:syringe,代码行数:30,代码来源:dpx.py


示例6: section_entry_extension

class section_entry_extension(pstruct.type):
    class __field(pbinary.struct):
        _fields_ = [(4,'unused'),(1,'record_follows'),(2,'unused2'),(1,'wtf')]

    _fields_ = [
        (uchar, 'indicator'),
        (uchar, 'field'),
        (dyn.block(30), 'vendor_criteria'),
    ]

if __name__ == '__main__':
    import ptypes,iso9660
    reload(iso9660)
    reload(ptypes.provider)
    ptypes.setsource(ptypes.provider.WindowsFile('~/downloads/6euj41uc.iso', 'r'))

    z = iso9660.File()
    z = z.l
    boot_sector = z['desc'][1]['data']['boot_catalog']
    if False:
        a = iso9660.sector(offset=boot_sector*2048).l
        print a.cast(iso9660.section_validation_entry)
        #    print z['iso']
        #    print [x for x in z['unused'] if not x.is_empty()]
        #    date = z['primary']['root_directory_record']['date']
        #    print date
        #    print date['year'].summary()

        a = z['desc'][1]['data']['boot_catalog']
        print a.cast(iso9660.sectorpointer)
开发者ID:arizvisa,项目名称:syringe,代码行数:30,代码来源:iso9660.py


示例7:

        (_row(method_info, 'method_count'), 'method'),
        (u30, 'metadata_count'),
        (_row(metadata_info, 'metadata_count'), 'metadata'),
        (u30, 'class_count'),
        (_row(instance_info, 'class_count'), 'instance'),
        (_row(class_info, 'class_count'), 'class'),
        (u30, 'script_count'),
        (_row(script_info, 'script_count'), 'script'),
        (u30, 'method_body_count'),
        (_row(method_body_info, 'method_body_count'), 'method_body'),
    ]

if __name__ == '__main__':
    import ptypes,as3,stypes
    from ptypes import *
    ptypes.setsource(prov.file('./tag-abcfile.bin','r'))

    #0000000: 0100 0000 0010 002e 00
    #0000000                        00 0000 2200 0476  ............"..v

    b = as3.abcFile(offset=5)
    b=b.l
#    print b['minor_version'].l
#    print b['major_version'].l

#    c = b['constant_pool'].l
#    print c.keys()
#    for k,v in c.items():
#        print k
#        print v
#    print c
开发者ID:arizvisa,项目名称:syringe,代码行数:31,代码来源:as3.py


示例8: File

        (UINT32, 'packet_count_for_this_packet'),
    ]

###
class File(parray.terminated):
    _object_ = RealMedia_Header

    def isTerminator(self, value):
        l = len(self.value)
        if l > 0:
            return l > self.value[0]['object']['num_headers'].int() + 1
        return False

if __name__ == '__main__':
    import sys
    import ptypes,rmff
    ptypes.setsource( ptypes.file(sys.argv[1], mode='rb') )

    self = rmff.File()
    z = self.l
    print len(self.value)

#    offset = 0x16f
#    print self.at(offset)

#    typespecific = self[3]['object']['type_specific_data']

    mdpr = [x for x in self.traverse(filter=lambda x: type(x) == rmff.RealMedia_Header) if x['object_id'].serialize() == 'MDPR']
    for x in mdpr:
        print x.__name__, x['object']['mime_type']
开发者ID:arizvisa,项目名称:syringe,代码行数:30,代码来源:rmff.py


示例9: pieces

import sys, user
import ptypes,pecoff

ptypes.setsource(ptypes.prov.file(sys.argv[1], mode='r'))
z=pecoff.Executable.File()
print >>sys.stdout, 'Filename: {:s}\n'.format(z.source.file.name)

z=z.l
p = z['next']['header']

#lc = p['datadirectory']['loadconfig']['address'].d.li
dn = p['datadirectory']['clr']['address'].d.li
#dnv = dn['vtablefixups']['address'].d.li
dnm = dn['metadata']['address'].d.li

root = dnm['StreamHeaders'].Get('#~')['Offset'].d
root = root.l
print >>sys.stderr, 'Loading strings...'
names = dnm['StreamHeaders'].Get('#Strings')['Offset'].d.l
print >>sys.stderr, 'Loading blobs...'
blobs = dnm['StreamHeaders'].Get('#Blob')['Offset'].d.l

class pieces(ptypes.pbinary.struct):
    _fields_ = [
        (8, 'table'),
        (24, 'index'),
    ]

e = dn['EntryPoint'].cast(pieces)
if e['table'] != pecoff.portable.clr.TMethodDef.type:
    print >>sys.stderr, 'No CLR entrypoint found!'
开发者ID:arizvisa,项目名称:syringe,代码行数:31,代码来源:pe-clr.entrypoint.py


示例10: ImageData_Chunk

class ImageData_Chunk(pstruct.type):
    _fields_ = [
        (pint.uint8_t, 'Block Size'),
        (lambda s: dyn.block(int(s['Block Size'].li)), 'Data Values')
    ]

class ImageData( parray.type ):
    length = 1
    _object_ = ImageData_Chunk
    def isTerminator(self, v):
        if int(v['Block Size']) == 0:
            return True
        return False

class File(pstruct.type):
    _fields_ = [
        (Header, 'header'),
        (LogicalScreenDescriptor, 'screen'),
        (ImageDescriptor, 'image'),
        (ImageData, 'data')
    ]

if __name__ == '__main__':
    import ptypes,gif
    reload(gif)
    ptypes.setsource( ptypes.provider.file('./poc.gif') )

    z = gif.File()
    print z.l
开发者ID:d0c-s4vage,项目名称:syringe,代码行数:29,代码来源:__init__.py


示例11: min

        sig = header['Signature'].str()

        # if it's compressed then use the 'zlib' structure
        t = EncodedDataType.withdefault(sig, type=sig)
        length = min(header['FileLength'].int(), self.source.size()) - header.size()
        return dyn.clone(t, _value_=dyn.clone(t._value_, length=length))

    _fields_ = [
        (Header, 'header'),
        (__data, 'data')
    ]

if __name__ == '__main__':
    import sys
    import ptypes,__init__ as swf
    ptypes.setsource(ptypes.file('./test.swf', mode='r'))

    z = File
#    z = ptypes.debugrecurse(z)
    z = z()
    z = z.l
    for x in z['data']['tags']:
        print '-'*32
        print x

    a = z['data']['tags'][0]
    print a.hexdump()
    print a.li.hexdump()
    print repr(a.l['Header'].serialize())

    correct='\x44\x11\x08\x00\x00\x00'
开发者ID:arizvisa,项目名称:syringe,代码行数:31,代码来源:__init__.py


示例12: int

    _fields_ = [
        (dyn.block(4), 'SettingSig'),
        (uInt32Number, 'SettingSize'),
        (verify_bitsize(uInt32Number, 8), 'numSettings'),
        (lambda s: dyn.array(uInt32Number, int(s['numSettings'].li)), 'Setting')
    ]

class TextDescStruct(pstruct.type, TagStruct):
    signature = 'desc'

    _fields_ = [
        (pstr.szstring, 'IsoStr'),
        (uInt32Number, 'UniLangCode'),
        (pstr.szwstring, 'UniStr'),
        (uInt16Number, 'MacScriptCode'),
        (uInt8Number, 'MacCount'),
        (dyn.clone(pstr.string, length=67), 'MacStr')
    ]

if __name__ == '__main__':
    import ptypes
    from ptypes import *

    ptypes.setsource( provider.file('./poc.pf') )
    self = ProfileFile()
#    print self.l
    self.l

    z = ptype.debugrecurse(DevStruct)()
    z.setoffset(self['tags'][0]['offset'].__int__())
开发者ID:d0c-s4vage,项目名称:syringe,代码行数:30,代码来源:__init__.py


示例13: USER

class USER(ptype.block): type = 0x0007
@Viewport.define
class CAMERA(ptype.block): type = 0x0008
@Viewport.define
class LIGHT(ptype.block): type = 0x0009
@Viewport.define
class DISABLED(ptype.block): type = 0x0010
@Viewport.define
class BOGUS(ptype.block): type = 0x0011

## File chunk
class File(Chunk): pass

if __name__ == '__main__':
    import ptypes, max
    ptypes.setsource(ptypes.prov.file('./samples/3ds/boletus.3ds', mode='rb'))
    z = max.File()
    z=z.l
    print z['data']

    print z['data'][1]['data'][0]['data']
    print z['data'][1]['data'][1]
    print z['data'][1]['data'][2]['data'][0]['data']
    print z['data'][1]['data'][3]['data']['chunk']['data'][0]['data']   # TRI_VERTEXL
    print z['data'][1]['data'][3]['data']['chunk']['data'][1]['data']   # TRI_LOCAL
    print z['data'][1]['data'][3]['data']['chunk']['data'][2]['data']   # TRI_MAPPINGCOORS
    print z['data'][1]['data'][3]['data']['chunk']['data'][3]
    print z['data'][1]['data'][3]['data']['chunk']['data'][3]['data']
    print z['data'][1]['data'][3]['data']['chunk']['data'][3]['data']['face']
    print z['data'][1]['data'][3]['data']['chunk']['data'][3]['data']['facedata'][0]['data']['face']
    print z['data'][1]['data'][3]['data']['chunk']['data'][3]['data']['facedata'][1]['data']
开发者ID:arizvisa,项目名称:syringe,代码行数:31,代码来源:max.py


示例14: File

    _fields_ = [
        (Signature, 'signature'),
        (Attributes, 'attributes'),
        (__extended, 'extended'),
        (__padding_header, 'padding'),
    ]

class File(pstruct.type):
    def __data(self):
        res = self['header'].li
        return dyn.block(res['attributes']['compressed-size'].int())

    _fields_ = [
        (Header, 'header'),
        (__data, 'data'),
    ]

if __name__ == '__main__':
    import ptypes, archive.lha
    reload(archive.lha)
    ptypes.setsource(ptypes.prov.file('c:/users/user/Downloads/fcgb2.lzh', mode='r'))
    z = archive.lha.File()
    z = z.l

    print z.source.size()
    print z['header']['signature']
    print z['header']['attributes']
    print z['header']
    print z['header']['filename']
开发者ID:arizvisa,项目名称:syringe,代码行数:29,代码来源:lha.py


示例15: ProcessBasicInformation

                        ('UniqueProcessId', ctypes.c_uint32),
                        ('Reserved3', ctypes.c_uint32)]

        pbi = ProcessBasicInformation()
        res = nt.NtQueryInformationProcess(handle, 0, ctypes.byref(pbi), ctypes.sizeof(pbi), None)
        return pbi

    # grab process handle
    if len(sys.argv) > 1:
        pid = int(sys.argv[1])
        print 'opening process %d'% pid
        handle = openprocess(pid)
    else:
        handle = getcurrentprocess()
        print 'using current process'
    ptypes.setsource(ptypes.provider.WindowsProcessHandle(handle))

    # grab peb
    import ndk
    pebaddress = getPBIObj(handle).PebBaseAddress
    z = ndk.PEB(offset=pebaddress).l

    # grab heap
    if len(sys.argv) > 2:
        heaphandle = eval(sys.argv[2])
        for x in z['ProcessHeaps'].d.l:
            print hex(x.int()),hex(heaphandle)
            if x.int() == heaphandle:
                b = x
                break
            continue
开发者ID:d0c-s4vage,项目名称:syringe,代码行数:31,代码来源:heaptypes.py


示例16: iterate

                yield i,res
            continue
        return
    def iterate(self, version=8):
        for _,n in self.enumerate(version): yield n

    def repr(self):
        return ', '.join('{:s}/{:d}'.format(res.zone_name(), res.version()) for res in self.iterate(None))

entry = dyn.pointer(malloc_zones)

if __name__ == '__main__':
    ab = szone_t()
    ab.alloc()
    print ab
    exit()

    import lldb
    import ptypes,macheap
    ptypes.setsource(lldbprocess(lldb.process))

    modules = lldb.target.get_modules_array()
    sym_malloc_zones, = (m.FindSymbol('malloc_zones') for m in lldb.target.get_modules_array() if m.FindSymbol('malloc_zones').name)
    z = macheap.entry(offset=int(sym_malloc_zones.addr))

if __name__ == '__main__':
    z = macheap.szone_t().a

    mag_get_thread_index = _os_cpu_number() & (TINY_MAX_MAGAZINES-1)
    szone_t.tiny_magazines[mag_thread_index]
开发者ID:KorayAgaya,项目名称:MacHeap,代码行数:30,代码来源:macheap.py


示例17: int

        (lambda s: dyn.array(s.Entry, int(s['count'].li)), 'entry'),
        (dyn.pointer(Directory,type=pint.uint32_t), 'next')
    ]

class Header(pstruct.type):
    def __directory(self):
        signature = self['signature'].li.serialize()
        if signature == '\x4d\x4d\x00\x2a':     # bigendian
            return dyn.pointer(Directory)
        if signature == '\x49\x49\x2a\x00':     # little-endian
            pass
            # XXX: I haven't encountered this yet
        raise NotImplementedError(signature)

    _fields_ = [
#        (pint.uint16_t, 'byteorder'),
#        (pint.uint16_t, 'id'),
        (pint.uint32_t, 'signature'),      # ('\x49\x49\x2a\x00', '\x4d\x4d\x00\x2a')
        (dyn.pointer(Directory,type=pint.uint32_t), 'directory'),
    ]

class File(Header): pass

if __name__ == '__main__':
    import ptypes,tiff
    ptypes.setsource( ptypes.file('./0.tif') )

    a = tiff.File()
    a = a.l
    
开发者ID:d0c-s4vage,项目名称:syringe,代码行数:29,代码来源:tiff.py


示例18: FDG

    type = 61471
    _fields_ = [
        (dyn.block(16), 'rgbUid1'),
#        (dyn.block(16), 'rgbUid2'),     # XXX: this is conditional?
        (pint.uint8_t, 'tag'),
        (dyn.block(0), 'BLIPFileData'), # FIXME: this isn't right..
    ]

@Record.define
class FDG(pstruct.type):
    type = 0xf008
    _fields_ = [(pint.uint32_t,'csp'),(MSOSPID, 'spidCur')]

if False:
    import ptypes    
    ptypes.setsource( ptypes.provider.file('poc.xls') )

    x = SpContainer()
#    x.setoffset(66100)
    x.setoffset(66360)
    print x.l

if __name__ == '__main__':
    from ptypes import *
    import art

    if False:
        s = '\x00\x00\x00\x00\x0c\x00\x00\x00' + 'A'*30
        z = art.RecordGeneral()
        z.source = provider.string(s)
开发者ID:d0c-s4vage,项目名称:syringe,代码行数:30,代码来源:art.py


示例19: read_number

#                 hbyte,bread = read_number(tail[tptr:tptr+9])  
#                 print "Hbyte          : 0x%02x (%s)" % (hbyte,hdict[hbyte])
#                 tptr+=bread 

if __name__ == '__main__':
    # 0000000000: 37 7A BC AF 27 1C 00 04   5B 38 BE F9 59 0E 00 00 
    # 0000000010: 00 00 00 00 23 00 00 00   00 00 00 00 7A 63 68 FD 
    # 0000000020: 00 21 16 89 6C 71 3D AB   7D 89 E6 3C 2E BE 60 24 

    res = '''
    37 7A BC AF 27 1C 00 04   5B 38 BE F9 59 0E 00 00 
    00 00 00 00 23 00 00 00   00 00 00 00 7A 63 68 FD 
    00 21 16 89 6C 71 3D AB   7D 89 E6 3C 2E BE 60 24 
    '''.strip().translate(None, ' \n')

    ptypes.setsource(ptypes.prov.string(res.decode('hex')))

    # 002457e0  17 06 e0 20 4f 24 01 09   88 a0 00 07 0b 01 00 02      
    # 002457f0  24 06 f1 07 01 0a 53 07   1f 03 65 f5 9f 71 0b f1     
    # 00245800  23 03 01 01 05 5d 00 40   00 00 01 00 0c 88 98 b3      
    # 00245810  82 0a 01 5d 29 c8 39 00   00                           

    res = '''
    17 06 e0 20 4f 24 01 09   88 a0 00 07 0b 01 00 02      
    24 06 f1 07 01 0a 53 07   1f 03 65 f5 9f 71 0b f1     
    23 03 01 01 05 5d 00 40   00 00 01 00 0c 88 98 b3      
    82 0a 01 5d 29 c8 39 00   00                           
    '''.strip().translate(None, ' \n')

    ptypes.setsource(ptypes.prov.string(res.decode('hex')))
开发者ID:arizvisa,项目名称:syringe,代码行数:30,代码来源:szip.py


示例20: packet

        (1, 'marker_bit'),
        (5, 'video_bound'),
        (8, 'reserved_byte'),
        (__streamarray, 'streamarray'),
    ]

###
class packet(pbinary.struct):
    _fields_ = [
        (32, 'code'),
        (lambda s: layer.lookup(s['code']), 'data'),
    ]

class stream(pbinary.terminatedarray):
    _object_ = packet
    def isTerminator(self, value):
        return type(value) == end_code

class stream(pbinary.array):
    _object_ = packet
    length = 20

if __name__ == '__main__':
    import ptypes,mpeg
#    ptypes.setsource( ptypes.file('./poc-mpeg.stream') )
    ptypes.setsource( ptypes.file('./poc.mov') )
    reload(mpeg)

    a = mpeg.stream(offset=0x3ba, length=20)
    print a.l
开发者ID:d0c-s4vage,项目名称:syringe,代码行数:30,代码来源:mpeg.py



注:本文中的ptypes.setsource函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python public.readFile函数代码示例发布时间:2022-05-25
下一篇:
Python pty_exceptions.translate_exception函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap