Exemplo n.º 1
0
    0x0A: ("kCRC", "CRC"),
    0x0B: ("kFolder", "Folder"),
    0x0C: ("kCodersUnPackSize", "CodersUnPackSize"),
    0x0D: ("kNumUnPackStream", "NumUnPackStream"),
    0x0E: ("kEmptyStream", "EmptyStream"),
    0x0F: ("kEmptyFile", "EmptyFile"),
    0x10: ("kAnti", "Anti"),
    0x11: ("kName", "Name"),
    0x12: ("kCreationTime", "CreationTime"),
    0x13: ("kLastAccessTime", "LastAccessTime"),
    0x14: ("kLastWriteTime", "LastWriteTime"),
    0x15: ("kWinAttributes", "WinAttributes"),
    0x16: ("kComment", "Comment"),
    0x17: ("kEncodedHeader", "Encoded archive header"),
}
PROP_IDS = createDict(PROP_INFO, 0)
PROP_DESC = createDict(PROP_INFO, 1)
# create k* constants
for k in PROP_IDS:
    globals()[PROP_IDS[k]] = k


def ReadNextByte(self):
    return self.stream.readBits(self.absolute_address + self.current_size, 8, self.endian)


def PropID(self, name):
    return Enum(UInt8(self, name), PROP_IDS)


class SevenZipBitVector(FieldSet):
Exemplo n.º 2
0
    0x0538: ("POLYPOLYGON", u"Draw multiple polygons", None),
    0x0548: ("EXTFLOODFILL", u"Extend flood fill", None),
    0x061C: ("ROUNDRECT", u"Draw a rounded rectangle", None),
    0x061D: ("PATBLT", u"Pattern blitting", None),
    0x0626: ("ESCAPE", u"Escape", None),
    0x06FF: ("CREATEREGION", u"Create region", None),
    0x0817: ("ARC", u"Draw an arc", None),
    0x081A: ("PIE", u"Draw a pie", None),
    0x0830: ("CHORD", u"Draw a chord", None),
    0x0940: ("DIBBITBLT", u"DIB bit blitting", None),
    0x0a32: ("EXTTEXTOUT", u"Draw text (extra)", None),
    0x0b41: ("DIBSTRETCHBLT", u"DIB stretch blitting", None),
    0x0d33: ("SETDIBTODEV", u"Set DIB to device", None),
    0x0f43: ("STRETCHDIB", u"Stretch DIB", None),
}
META_NAME = createDict(META, 0)
META_DESC = createDict(META, 1)

#----------------------------------------------------------------------------
# EMF constants

# EMF mapping modes
EMF_MAPPING_MODE = {
    1: "TEXT",
    2: "LOMETRIC",
    3: "HIMETRIC",
    4: "LOENGLISH",
    5: "HIENGLISH",
    6: "TWIPS",
    7: "ISOTROPIC",
    8: "ANISOTROPIC",
Exemplo n.º 3
0
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
    UInt8, UInt24, UInt32, NullBits, NullBytes,
    Bit, Bits, String, RawBytes, Enum)
from hachoir_core.endian import BIG_ENDIAN
from hachoir_parser.audio.mpeg_audio import Frame
from hachoir_parser.video.amf import AMFObject
from hachoir_core.tools import createDict

SAMPLING_RATE = {
    0: ( 5512, "5.5 kHz"),
    1: (11025, "11 kHz"),
    2: (22050, "22.1 kHz"),
    3: (44100, "44.1 kHz"),
}
SAMPLING_RATE_VALUE = createDict(SAMPLING_RATE, 0)
SAMPLING_RATE_TEXT = createDict(SAMPLING_RATE, 1)

AUDIO_CODEC_MP3 = 2
AUDIO_CODEC_NAME = {
    0: u"Uncompressed",
    1: u"ADPCM",
    2: u"MP3",
    5: u"Nellymoser 8kHz mono",
    6: u"Nellymoser",
}

VIDEO_CODEC_NAME = {
    2: u"Sorensen H.263",
    3: u"Screen video",
    4: u"On2 VP6",