diff --git a/demo.xls b/demo.xls deleted file mode 100644 index dd5e863d6dfe237a20e7f408953744a1349ea704..0000000000000000000000000000000000000000 Binary files a/demo.xls and /dev/null differ diff --git a/init.py b/init.py deleted file mode 100644 index 1491ec94411c5bb5a5f66461afbd1b7e932a25e5..0000000000000000000000000000000000000000 --- a/init.py +++ /dev/null @@ -1,45 +0,0 @@ -# setup_helper.py -import urllib.request -from pathlib import Path - -VIRTUAL_DESKTOP_URL = "https://github.com/MScholtes/VirtualDesktop/releases/download/V1.21/VirtualDesktop11-24H2.exe" -BIN_DIR = Path(__file__).parent / "bin" # 项目根目录/bin - -def download_virtual_desktop(): - """下载 VirtualDesktop11-24H2.exe 到项目根目录的 bin/ 文件夹""" - print("=" * 70) - print("开始下载 VirtualDesktop 工具...") - print(f"目标路径: {BIN_DIR}") - print("=" * 70) - - # 确保 bin 目录存在 - BIN_DIR.mkdir(parents=True, exist_ok=True) - - # 从 URL 中提取原始文件名(不更改文件名!) - from urllib.parse import urlparse - original_filename = urlparse(VIRTUAL_DESKTOP_URL).path.split('/')[-1] - - # 完整文件路径(保持原文件名) - exe_path = BIN_DIR / original_filename - - # 检查是否已存在 - if exe_path.exists(): - print(f"⚠️ {exe_path} 已存在,跳过下载") - return exe_path - - try: - # 下载文件(文件名保持为 VirtualDesktop11-24H2.exe) - print(f"📥 正在下载 {original_filename}...") - urllib.request.urlretrieve(VIRTUAL_DESKTOP_URL, exe_path) - - print(f"✅ 下载成功: {exe_path}") - print(f"文件大小: {exe_path.stat().st_size:,} bytes") - return exe_path - - except Exception as e: - print(f"❌ 下载失败: {e}") - raise - -if __name__ == "__main__": - download_virtual_desktop() - print("\n下载完成!") \ No newline at end of file diff --git a/main1.py b/main1.py deleted file mode 100644 index b22f1581be126948bdc0eeb3781b56bc713ab5d9..0000000000000000000000000000000000000000 --- a/main1.py +++ /dev/null @@ -1,42 +0,0 @@ -import ctypes -import psutil - -kernel32 = ctypes.windll.kernel32 - -class MEMORY_BASIC_INFORMATION(ctypes.Structure): - _fields_ = [ - ("BaseAddress", ctypes.c_void_p), - ("AllocationBase", ctypes.c_void_p), - ("AllocationProtect", ctypes.c_ulong), - ("RegionSize", ctypes.c_size_t), - ("State", ctypes.c_ulong), - ("Protect", ctypes.c_ulong), - ("Type", ctypes.c_ulong), - ] - - -def check_memory(pid, address): - h_process = kernel32.OpenProcess(0x10, False, pid) - mbi = MEMORY_BASIC_INFORMATION() - - res = kernel32.VirtualQueryEx( - h_process, - ctypes.c_void_p(address), - ctypes.byref(mbi), - ctypes.sizeof(mbi) - ) - - if res: - print("内存基址:", hex(mbi.BaseAddress)) - print("保护属性 Protect:", hex(mbi.Protect)) - print("类型 Type:", hex(mbi.Type)) - else: - print("查询失败") - - kernel32.CloseHandle(h_process) - - -# 调用 -pid = 13500 -addr = 0x15F75FC3244 -check_memory(pid, addr) \ No newline at end of file diff --git "a/\345\267\246\344\270\212\350\247\222/\345\267\246\344\270\212\350\247\222.py" "b/\345\267\246\344\270\212\350\247\222/main.py" similarity index 100% rename from "\345\267\246\344\270\212\350\247\222/\345\267\246\344\270\212\350\247\222.py" rename to "\345\267\246\344\270\212\350\247\222/main.py" diff --git "a/\351\274\240\346\240\207\346\211\213\345\212\277/cursor_direction.py" "b/\351\274\240\346\240\207\346\211\213\345\212\277/cursor_direction.py" index b53439c313214aec6d54d17247a405e7dd1c268e..9311b762ad98172f3721d0d4e08bbcd5deb19d76 100644 --- "a/\351\274\240\346\240\207\346\211\213\345\212\277/cursor_direction.py" +++ "b/\351\274\240\346\240\207\346\211\213\345\212\277/cursor_direction.py" @@ -46,7 +46,7 @@ def calculate_cumulative_movement(sample_interval=0.01, duration=0.2): return main_direction, total_distance -def wait_for_large_movement(up_th=350, down_th=400, left_th=500, right_th=550, +def wait_for_large_movement(up_th=400, down_th=400, left_th=500, right_th=550, sample_interval=0.002, duration=0.03): """ 循环检测鼠标累计移动,超过阈值时返回方向