winamp.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Packages 作者: Keypirinha 项目源码 文件源码
def _read_remote_string(self, address, as_unicode=True):
        """Reads a string from Winamp's memory address space."""
        if not self.wa_hproc:
            #print("Trying to read Winamp's memory without having found any instance!")
            return None

        buflen = 1024
        if as_unicode:
            buffer = ctypes.create_unicode_buffer(buflen)
        else:
            buffer = ctypes.create_string_buffer(buflen)
        bytes_read = ctypes.c_size_t(0)

        if not ctypes.windll.kernel32.ReadProcessMemory(
                self.wa_hproc, address, buffer, buflen, ctypes.byref(bytes_read)):
            winerr = ctypes.GetLastError()
            #print(
            #    "Failed to read memory from Winamp's memory space:",
            #    ctypes.FormatError(winerr))
            return None

        return buffer.value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号