[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.223.210.83: ~ $
######################################################################
#  This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys
from ctypes import *

_array_type = type(Array)

def _other_endian(typ):
    """Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    """
    # check _OTHER_ENDIAN attribute (present if typ is primitive type)
    if hasattr(typ, _OTHER_ENDIAN):
        return getattr(typ, _OTHER_ENDIAN)
    # if typ is array
    if isinstance(typ, _array_type):
        return _other_endian(typ._type_) * typ._length_
    # if typ is structure
    if issubclass(typ, Structure):
        return typ
    raise TypeError("This type does not support other endian: %s" % typ)

class _swapped_meta(type(Structure)):
    def __setattr__(self, attrname, value):
        if attrname == "_fields_":
            fields = []
            for desc in value:
                name = desc[0]
                typ = desc[1]
                rest = desc[2:]
                fields.append((name, _other_endian(typ)) + rest)
            value = fields
        super(_swapped_meta, self).__setattr__(attrname, value)

################################################################

# Note: The Structure metaclass checks for the *presence* (not the
# value!) of a _swapped_bytes_ attribute to determine the bit order in
# structures containing bit fields.

if sys.byteorder == "little":
    _OTHER_ENDIAN = "__ctype_be__"

    LittleEndianStructure = Structure

    class BigEndianStructure(Structure):
        """Structure with big endian byte order"""
        __metaclass__ = _swapped_meta
        _swappedbytes_ = None

elif sys.byteorder == "big":
    _OTHER_ENDIAN = "__ctype_le__"

    BigEndianStructure = Structure
    class LittleEndianStructure(Structure):
        """Structure with little endian byte order"""
        __metaclass__ = _swapped_meta
        _swappedbytes_ = None

else:
    raise RuntimeError("Invalid byteorder")

Filemanager

Name Type Size Permission Actions
macholib Folder 0755
.__init__.pyo.40009 File 19.69 KB 0644
._endian.pyo.40009 File 2.25 KB 0644
.util.pyo.40009 File 7.78 KB 0644
.wintypes.pyo.40009 File 5.82 KB 0644
__init__.py File 16.85 KB 0644
__init__.pyc File 19.69 KB 0644
__init__.pyo File 19.69 KB 0644
_endian.py File 2.16 KB 0644
_endian.pyc File 2.25 KB 0644
_endian.pyo File 2.25 KB 0644
util.py File 8.99 KB 0644
util.py.binutils-no-dep File 8.84 KB 0644
util.pyc File 7.78 KB 0644
util.pyo File 7.78 KB 0644
wintypes.py File 5.22 KB 0644
wintypes.pyc File 5.82 KB 0644
wintypes.pyo File 5.82 KB 0644