{"id":15043200,"url":"https://github.com/atrexus/ws-watcher","last_synced_at":"2025-04-14T21:12:59.587Z","repository":{"id":256518985,"uuid":"855280310","full_name":"atrexus/ws-watcher","owner":"atrexus","description":"A PoC application that detects unauthorized external access to select memory regions.","archived":false,"fork":false,"pushed_at":"2024-09-11T03:48:47.000Z","size":15,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T21:12:53.211Z","etag":null,"topics":["cpp","memory-management","security","windows","x64"],"latest_commit_sha":null,"homepage":"https://atrexus.github.io/posts/abusing-the-process-working-set","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/atrexus.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,"publiccode":null,"codemeta":null}},"created_at":"2024-09-10T16:03:29.000Z","updated_at":"2025-03-10T23:23:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"32a465f2-2c43-4820-9294-654435a736d9","html_url":"https://github.com/atrexus/ws-watcher","commit_stats":null,"previous_names":["atrexus/ws-watcher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atrexus%2Fws-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atrexus%2Fws-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atrexus%2Fws-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atrexus%2Fws-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atrexus","download_url":"https://codeload.github.com/atrexus/ws-watcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961237,"owners_count":21189993,"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":["cpp","memory-management","security","windows","x64"],"created_at":"2024-09-24T20:48:41.554Z","updated_at":"2025-04-14T21:12:59.557Z","avatar_url":"https://github.com/atrexus.png","language":"C++","readme":"# ws-watcher\nThis application protects its heap-allocated memory from being accessed externally and internally. The working set watcher introduces a custom smart pointer, `ws::paged_ptr`, which pages the memory associated with the pointer out of the working set. The watcher then launches a separate thread that queries the working set and catches any page faults that occur. If a page fault was caused externally, information about the handle used is logged.\n\nTo safely access the memory in a paged pointer, use the `lock` method to retrieve a shared pointer instance to that data. Refer to the example below:\n```cpp\n// Allocate a 10 byte array of paged memory\nconst auto\u0026 paged = ws::make_paged\u003c std::uint8_t \u003e( 10 );\n\n// Lock the page in memory so that we can safely access it's data\nif ( const auto\u0026 data = paged.lock( ) )\n{\n    // Get the raw pointer to the data.\n    const auto\u0026 ptr = data.get( );\n\n    // Edit the memory\n    ptr[ 0 ] = 0xFF;\n    ptr[ 1 ] = 0xFF;\n}\n```\n\nThe video below demonstrates what happens if an external process attempts to read from a buffer protected by the `ws::paged_ptr` class. \n\nhttps://github.com/user-attachments/assets/e84d6526-4c43-42de-84d7-035e6690b041\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatrexus%2Fws-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatrexus%2Fws-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatrexus%2Fws-watcher/lists"}