{"id":19691913,"url":"https://github.com/yviscool/xnu_memory_hack_example","last_synced_at":"2026-05-13T11:34:25.042Z","repository":{"id":143935334,"uuid":"456153731","full_name":"yviscool/xnu_memory_hack_example","owner":"yviscool","description":"just for test","archived":false,"fork":false,"pushed_at":"2022-02-06T13:10:46.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T11:41:23.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yviscool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2022-02-06T13:08:03.000Z","updated_at":"2022-02-06T13:10:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a1a7d92-b700-4586-b038-54951773a58c","html_url":"https://github.com/yviscool/xnu_memory_hack_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yviscool/xnu_memory_hack_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yviscool%2Fxnu_memory_hack_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yviscool%2Fxnu_memory_hack_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yviscool%2Fxnu_memory_hack_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yviscool%2Fxnu_memory_hack_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yviscool","download_url":"https://codeload.github.com/yviscool/xnu_memory_hack_example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yviscool%2Fxnu_memory_hack_example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32980812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T11:31:52.688Z","status":"ssl_error","status_checked_at":"2026-05-13T11:31:52.072Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-11T19:11:46.716Z","updated_at":"2026-05-13T11:34:25.017Z","avatar_url":"https://github.com/yviscool.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OS X Memory hack\n xnu memory manipulation library\n\n## Features\n* Read memory\n* Write memory\n* get image base address\n* get pid\n\nyou must to open process with `Open(\u003cprocess name\u003e)`. \nif you do not, then causes throw exception.\n\n\n## Example\n```c++\nProcess *process = new Process();\nprocess-\u003eOpen(\"Safari\");\nuint64_t base = process-\u003eget_base_address();\npid_t pid = process-\u003eget_pid();\ncout \u003c\u003c \"pid : \" \u003c\u003c pid \u003c\u003c endl;\ncout \u003c\u003c \"base address : 0x\" \u003c\u003c hex \u003c\u003c base \u003c\u003c endl;\ncout \u003c\u003c \"magic : 0x\" \u003c\u003c hex \u003c\u003c process-\u003eRead\u003cuint32_t\u003e(base) \u003c\u003c endl;\nprocess-\u003eWrite\u003cuint32_t\u003e(base, 0xdeadbeef);\ncout \u003c\u003c \"written magic : 0x\" \u003c\u003c hex \u003c\u003c process-\u003eRead\u003cuint32_t\u003e(base) \u003c\u003c endl;\n```\n\n#### mem.cpp\n```\n# ./mem Safari\nprocess : Safari\npid : 86488\nopened process.\nbase address : 0x102717000\nread/write to 0x102717000\nmagic 0xfeedfacf\nwrite 0xdeadbeef\nmagic 0xdeadbeef\nread/write to 0x102717028\nread __PAGEZERO\nwrite \"__PUSH0EBP\"\nread __PUSH0EBP\n```\n\n## Functions\n### Open Process\n#### type\n```c++ \nkern_return_t Open(char *process_name)`\n```\n#### example\n```c++\nprocess-\u003eOpen(\"Safari”);\n````\nif pid is valid and open fail, you are not root.\nif pid is not valid (-1) and open fail, process was not found.\n  \n### Read Memory\n#### type\n```c++\nvm_size_t Read(uint64_t addr, void *data, vm_size_t size)\n```\nfor bytes. return read bytes size\n\n```c++\ntemplate \u003ctypename T\u003e T Read(uint64_t addr)\n``` \nfor value\n\n#### example\n```c++\nprocess-\u003eRead\u003cuint32_t\u003e(base); //0xfeedfacf\nprocess-\u003eRead(base + 0x28, buffer, sizeof(buffer)); //__PAGEZERO\n```\n\n### Write Memory\n#### type \n```c++\nkern_return_t Write(uint64_t addr, void *data, vm_size_t size)\n```\nfor bytes.\n\n```c++\ntemplate \u003ctypename T\u003e T Read(uint64_t addr)\n```\nfor value.\n\n#### example\n```c++\nprocess-\u003eWrite\u003cuint32_t\u003e(base, magic_value); \nprocess-\u003eWrite(addr, value, sizeof(value));\n```\n\n#### Get Base Address\n```c++\nprocess-\u003eget_base_address()\n```\n\n#### Get Process id\n```c++\nprocess-\u003eget_pid()\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyviscool%2Fxnu_memory_hack_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyviscool%2Fxnu_memory_hack_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyviscool%2Fxnu_memory_hack_example/lists"}