コード例 #1
0
ファイル: api.py プロジェクト: SecurityResearchStaff/pyrebox
def r_ioport(address, size):
    """Read I/O port

        :param address: The port address to read, from 0 to 65536
        :type address: int

        :param size: The size to read (1, 2, or 4)
        :type size: int

        :return: The value read
        :rtype: int
    """
    import c_api
    if size not in [1, 2, 4]:
        raise ValueError("Incorrect size to read: it must be 1, 2 or 4")
    if address < 0 or address > 65536:
        raise ValueError("Incorrect port address: it must be between 0-65536")
    return c_api.r_ioport(address, size)
コード例 #2
0
ファイル: api.py プロジェクト: CRYP706URU/pyrebox
def r_ioport(address, size):
    """Read I/O port

        :param address: The port address to read, from 0 to 65536
        :type address: int

        :param size: The size to read (1, 2, or 4)
        :type size: int

        :return: The value read
        :rtype: int
    """
    import c_api
    if size not in [1, 2, 4]:
        raise ValueError("Incorrect size to read: it must be 1, 2 or 4")
    if address < 0 or address > 65536:
        raise ValueError("Incorrect port address: it must be between 0-65536")
    return c_api.r_ioport(address, size)