"""probe_rs_base_inert.py Same probe as probe_rsd3d_lost.py but for RenderSurface base (vfptr=0x0079a67c). Check if v5's RS::Destroy actually frees anything, or if RS base instances also have NULL buffers (making v5 inert). Probes: - lost-entry count - entry+0x34 (= primary+0x64, first delete in RS::Destroy) - entry+0xE4 (= primary+0x114 = m_pSurfaceBits, second delete)""" import ctypes, ctypes.wintypes as wt, sys, struct PROCESS_VM_READ = 0x10 PROCESS_QUERY_INFORMATION = 0x400 k = ctypes.windll.kernel32 k.OpenProcess.argtypes = [wt.DWORD, wt.BOOL, wt.DWORD]; k.OpenProcess.restype = wt.HANDLE k.ReadProcessMemory.argtypes = [wt.HANDLE, wt.LPCVOID, wt.LPVOID, ctypes.c_size_t, ctypes.POINTER(ctypes.c_size_t)] k.ReadProcessMemory.restype = wt.BOOL S_RESOURCES_M_DATA = 0x008398C4 S_RESOURCES_M_NUM = 0x008398CC RS_BASE_VTABLE = 0x0079a67c def rd(h, va, n): buf = (ctypes.c_ubyte * n)(); sz = ctypes.c_size_t(0) if not k.ReadProcessMemory(h, va, buf, n, ctypes.byref(sz)): return None return bytes(buf[:sz.value]) def rd_u32(h, va): b = rd(h, va, 4); return struct.unpack('