{"id":20755951,"url":"https://github.com/henryquan/memorysafe","last_synced_at":"2026-05-28T07:31:36.864Z","repository":{"id":87497838,"uuid":"579650043","full_name":"HenryQuan/MemorySafe","owner":"HenryQuan","description":"A naive approach to provide some protections to memory values","archived":false,"fork":false,"pushed_at":"2023-01-25T11:41:55.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T19:36:11.130Z","etag":null,"topics":["cpp","memory","safety"],"latest_commit_sha":null,"homepage":"","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/HenryQuan.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":"2022-12-18T12:18:32.000Z","updated_at":"2022-12-19T10:06:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"798380a4-b09f-4e1e-a154-d8d5810680e1","html_url":"https://github.com/HenryQuan/MemorySafe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HenryQuan/MemorySafe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenryQuan%2FMemorySafe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenryQuan%2FMemorySafe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenryQuan%2FMemorySafe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenryQuan%2FMemorySafe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HenryQuan","download_url":"https://codeload.github.com/HenryQuan/MemorySafe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenryQuan%2FMemorySafe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33599465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cpp","memory","safety"],"created_at":"2024-11-17T09:28:05.666Z","updated_at":"2026-05-28T07:31:36.844Z","avatar_url":"https://github.com/HenryQuan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Memory Safe\n\nA naive approach to provide some protections to memory values.\n\n## Introduction\n\nBack in 2012, the golden age of iOS games, many games appeared on AppStore. Many games are offline and local. It took only 20 minutes to mod one to have unlimited in-game currencies. There was zero protection for critical values, and they were a quick memory search away. The way how it worked was by changing the value to locate the memory address.\n\nA year or so later, games were more protected because memory search wouldn't work anymore. I couldn't understand the reason beyond.\n\n## The Solution\n\nMy guess is that games did a simple trick to swap values between two different addresses, effectively make the memory search useless.\n\n## Demo\n\n![Cheat Engine](https://raw.githubusercontent.com/HenryQuan/MemorySafe/master/img/ce.png)\n\nThe demo showcases how `MemorySafe` could protect critical values. Both `safe_value` and `unsafe_value` are 10 by default. They will update to 20 and 120 after user input. However, `unsafe_value` could be modified by Cheat Engine half way to 2000 in the demo. On the other hand, `safe_value` could not be found easily.\n\n![Demo showcase](https://raw.githubusercontent.com/HenryQuan/MemorySafe/master/img/demo.png)\n\n## Afterword\n\nThis solution is not perfect. `safe_value` can still be found with more advanced techniques. However, it could at least block out many naive attackers like myself. iOS is getting more secure, but storing critical unprotected values in memory is not a good idea. I will cover more in my future blog posts.\n\nAlso check my post on [Linkedin](https://www.linkedin.com/posts/yihengquan_memorysafe-is-my-naive-approach-providing-activity-7023976841812037632-BS9O?utm_source=share).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenryquan%2Fmemorysafe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenryquan%2Fmemorysafe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenryquan%2Fmemorysafe/lists"}