{"id":15650271,"url":"https://github.com/idouble/simple-memory-reading-writing","last_synced_at":"2025-04-30T17:21:25.232Z","repository":{"id":130708795,"uuid":"201586308","full_name":"IDouble/Simple-Memory-Reading-Writing","owner":"IDouble","description":"🔍 Very Simple Template to read / write Process Memory with C++ 🔧","archived":false,"fork":false,"pushed_at":"2024-02-29T17:00:31.000Z","size":863,"stargazers_count":62,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-26T07:15:56.039Z","etag":null,"topics":["cplusplus","cpp","dword","findwindow","handle","hwnd","memory","process","read","readprocessmemory","simple","snippets","template","thread","windows","write","writeprocessmemory"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IDouble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-08-10T05:49:07.000Z","updated_at":"2025-03-30T00:45:56.000Z","dependencies_parsed_at":"2024-04-08T23:02:36.764Z","dependency_job_id":"ec865932-ff19-4f36-9ff6-ba4048ca08bc","html_url":"https://github.com/IDouble/Simple-Memory-Reading-Writing","commit_stats":null,"previous_names":["idouble/simple-memory-reading-writing"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-Memory-Reading-Writing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-Memory-Reading-Writing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-Memory-Reading-Writing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-Memory-Reading-Writing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IDouble","download_url":"https://codeload.github.com/IDouble/Simple-Memory-Reading-Writing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251749114,"owners_count":21637456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","cpp","dword","findwindow","handle","hwnd","memory","process","read","readprocessmemory","simple","snippets","template","thread","windows","write","writeprocessmemory"],"created_at":"2024-10-03T12:34:10.051Z","updated_at":"2025-04-30T17:21:25.176Z","avatar_url":"https://github.com/IDouble.png","language":"C++","readme":"# 🔍 Simple Memory Reading Writing 🔧\n🔍 Very Simple Template to read / write Process Memory with C++ 🔧\n\n## 🔍 Read Process Memory (ReadProcessMemory) 🔍\n\n```\n#include \u003ciostream\u003e\n#include \u003cWindows.h\u003e\n\nusing namespace std;\n\nint main(){\n\n\tint readTest = 0; // We store the Value we read from the Process here\n\n\tHWND hwnd = FindWindowA(NULL, \"Tutorial-x86_64\"); // HWND (Windows window) by Window Name\n\n\t// Check if HWND found the Window\n\tif (hwnd == NULL) {\n\t\tcout \u003c\u003c \"Can't find Process.\" \u003c\u003c endl;\n\t\tSleep(2000); // Sleep 2 seconds\n\t\texit(-1); // Exit the program if it did not find the Window\n\t} else {\n\t\tDWORD procID; // A 32-bit unsigned integer, DWORDS are mostly used to store Hexadecimal Addresses\n\t\tGetWindowThreadProcessId(hwnd, \u0026procID); // Getting our Process ID, as an ex. like 000027AC\n\t\tHANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID); // Opening the Process with All Access\n\n\t\tif (procID == NULL) {\n\t\t\tcout \u003c\u003c \"Can't find Process.\" \u003c\u003c endl;\n\t\t\tSleep(2000); // Sleep 2 seconds\n\t\t\texit(-1); // Exit the program if it did not find the Window\n\t\t} else {\n\t\t\t// Read the Process Memory, 03007640 is the Address, we read the Value from and save it in readTest\n\t\t\tReadProcessMemory(handle, (PBYTE*)0x03007640, \u0026readTest, sizeof(readTest), 0);\n\t\t\tcout \u003c\u003c readTest \u003c\u003c endl;\n\t\t\tSleep(5000); // Sleep 5 seconds\n\t\t}\n\t}\n}\n```\n\n![Read Process Memory Very Simple Template with C++](Images/ReadProcessMemory.png)\n\n## 🔧 Write into Process Memory (WriteProcessMemory) 🔧\n\n```\n#include \u003ciostream\u003e\n#include \u003cWindows.h\u003e\n\nusing namespace std;\n\nint main() {\n\n\tint newValue = 5000; // The new Value we set on the address\n\n\tHWND hwnd = FindWindowA(NULL, \"Tutorial-x86_64\"); // HWND (Windows window) by Window Name\n\n\t// Check if HWND found the Window\n\tif (hwnd == NULL) {\n\t\tcout \u003c\u003c \"Can't find Process.\" \u003c\u003c endl;\n\t\tSleep(2000); // Sleep 2 seconds\n\t\texit(-1); // Exit the program if it did not find the Window\n\t}\n\telse {\n\t\tDWORD procID; // A 32-bit unsigned integer, DWORDS are mostly used to store Hexadecimal Addresses\n\t\tGetWindowThreadProcessId(hwnd, \u0026procID); // Getting our Process ID, as an ex. like 000027AC\n\t\tHANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID); // Opening the Process with All Access\n\n\t\tif (procID == NULL) {\n\t\t\tcout \u003c\u003c \"Can't find Process.\" \u003c\u003c endl;\n\t\t\tSleep(2000); // Sleep 2 seconds\n\t\t\texit(-1); // Exit the program if it did not find the Window\n\t\t}\n\t\telse {\n\t\t\t// Write the newValue into the Process Memory, 03007640 is the Address\n\t\t\tWriteProcessMemory(handle, (PBYTE*)0x03007640, \u0026newValue, sizeof(newValue), 0);\n\t\t\tSleep(5000); // Sleep 5 seconds\n\t\t}\n\t}\n}\n```\n\n![Write Process Memory Very Simple Template with C++](Images/WriteProcessMemory.png)\n\n![Binance Ready to give crypto a try ? buy bitcoin and other cryptocurrencies on binance](Images/binance.jpg)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidouble%2Fsimple-memory-reading-writing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidouble%2Fsimple-memory-reading-writing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidouble%2Fsimple-memory-reading-writing/lists"}