{"id":20814372,"url":"https://github.com/hansalemaos/pdmemedit","last_synced_at":"2026-04-07T08:32:23.451Z","repository":{"id":149314736,"uuid":"621614702","full_name":"hansalemaos/pdmemedit","owner":"hansalemaos","description":"Edit/read/observe memory with pymem and pandas - Why not use the best libraries for organizing Big Data to organize Big Data?","archived":false,"fork":false,"pushed_at":"2023-03-31T02:54:50.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T23:39:20.867Z","etag":null,"topics":["assembler","assembly","cheat","edit","engine","hacking","memory","pandas","pymem","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pdmemedit/","language":"Python","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/hansalemaos.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":"2023-03-31T02:54:48.000Z","updated_at":"2023-03-31T03:01:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec9b4483-7087-4e54-b566-edd131d48dfa","html_url":"https://github.com/hansalemaos/pdmemedit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hansalemaos/pdmemedit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fpdmemedit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fpdmemedit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fpdmemedit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fpdmemedit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansalemaos","download_url":"https://codeload.github.com/hansalemaos/pdmemedit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fpdmemedit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31506562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["assembler","assembly","cheat","edit","engine","hacking","memory","pandas","pymem","python"],"created_at":"2024-11-17T21:15:58.225Z","updated_at":"2026-04-07T08:32:23.424Z","avatar_url":"https://github.com/hansalemaos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Edit/read/observe memory with pymem and pandas DataFrames\n\n## pip install pdmemedit\n\n### Tested against Windows 10 / Python 3.10 / Anaconda \n\n#### Why not use the best libraries for organizing Big Data to organize Big Data?\n\n```python\n# Here is an example\n# start a separate Python process and get the pid\nfrom time import sleep\nimport os\n\ntu = (\n    6666,\n    77777554,\n    \"b1abvababubux\",\n    b\"b1abvababubux\",\n    \"b1abvababubux\".encode(\"utf-16-le\"),\n)\nprint(os.getpid())\nwhile True:\n    print(f\"{tu=}\\t{id(tu)=}\")\n\n    for v in tu:\n        print(f\"{v=}\\t{id(v)=}\")\n        sleep(5)\n\n    # output:\n    # tu=(6666, 77777554, 'b1abvababubux', b'b1abvababubux', b'b\\x001\\x00a\\x00b\\x00v\\x00a\\x00b\\x00a\\x00b\\x00u\\x00b\\x00u\\x00x\\x00')\tid(tu)=1784089644304\n    # v=6666\tid(v)=1784088602128\n    # v=77777554\tid(v)=1784088604816\n    # v='b1abvababubux'\tid(v)=1784089580144\n    # v=b'b1abvababubux'\tid(v)=1784089556480\n    # v=b'b\\x001\\x00a\\x00b\\x00v\\x00a\\x00b\\x00a\\x00b\\x00u\\x00b\\x00u\\x00x\\x00'\tid(v)=1784089244720\n\n```\n\n\n\n\n\n\n\n```python\nimport pymem\nimport numpy as np\nfrom pdmemedit import Pdmemory\n# pass either pid or filename, but not both\npdme = Pdmemory(\n    pid=21956, filename=None  # pid of the Python process we have just created\n)\n\n# memory to DataFrame\npdme.update_region_df(\n    limitfunction=lambda x: True,\n    dtypes=(\n        \"S1\",\n        np.int8,\n        np.uint8,\n        np.int16,\n        np.uint16,\n        np.int32,\n        np.uint32,\n        np.int64,\n        np.uint64,\n        np.float32,\n        np.float64,\n    ),\n    allowed_protections=(\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_EXECUTE_READ,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_EXECUTE_READWRITE,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_EXECUTE_WRITECOPY,\n        # pymem.ressources.structure.MEMORY_PROTECTION.PAGE_NOACCESS,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_READONLY,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_READWRITE,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_WRITECOPY,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_GUARD,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_NOCACHE,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_WRITECOMBINE,\n    ),\n)\nregiondf = pdme.get_regiondf()\nprint(regiondf)\n\n```\n![](https://github.com/hansalemaos/screenshots/blob/main/memedit/regiondf.png?raw=true)\n\n\n\n\n```python\n\n###################################################################\n# Search for a string\n# Don't forget to get a memory dump by calling pdme.update_region_df before you search for a string\npdme.search_string(\"b1abvababubux\")\nstringresultsdf = pdme.get_searchstringdf()\nprint(stringresultsdf)\n```\n![](https://github.com/hansalemaos/screenshots/blob/main/memedit/stringresultsdf.png?raw=true)\n\n\n\n\n```python\n###################################################################\n# Search for a number\n# Don't forget to get a memory dump by calling pdme.update_region_df before you search for a number\npdme.search_number(\n    numexprquery=f\"(a == 77777554)\",  # numexpr.evaluate string, name of 'a' can't be changed\n    dtypes=(\n        np.int8,\n        np.uint8,\n        np.int16,\n        np.uint16,\n        np.int32,\n        np.uint32,\n        np.int64,\n        np.uint64,\n        # np.float32,\n        # np.float64,\n    ),\n)\nnumberresults = pdme.get_searchnumberdf()\nprint(numberresults)\n\n```\n![](https://github.com/hansalemaos/screenshots/blob/main/memedit/numberresults.png?raw=true)\n\n\n\n```python\n\n###################################################################\n# Call pdme.search_number first, edit the DataFrame (self.numbersearchdf) until it serves your needs\n# and call pdme.observe_numbers to see how the value changes\npdme.observe_numbers(  # ctrl+c to break\n    keepcondition=\"(new \u003e= old)\",  # numexpr.evaluate string, names of 'new/old' can't be changed\n    sleep_between_scans=1,\n    savefolder=None,\n    printoutputlimit=100,\n)\nobservedvalues = pdme.get_observerdf()\nprint(observedvalues)\n\n\n```\n![](https://github.com/hansalemaos/screenshots/blob/main/memedit/observedvalues.png?raw=true)\n\n\n\n\n```python\n\n###################################################################\n# How to edit the memory\nnumberresults.ff_write.apply(lambda x: x(99999999)) # Overwrites results with 99999999\nstringresultsdf.ff_write_str.apply(\n    lambda x: x(\"B\")\n)  # binary/utf-8/utf-16-le... conversation should work automatically - overwrites each single letter\n\n# Output after calling numberresults.ff_write/stringresultsdf.ff_write_str\n# tu=(6666, 99999999, 'BBBBBBBBBBBBB', b'BBBBBBBBBBBBB', b'B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00')\tid(tu)=1784089644304\n# v=6666\tid(v)=1784088602128\n# v=99999999\tid(v)=1784088604816\n# v='BBBBBBBBBBBBB'\tid(v)=1784089580144\n# v=b'BBBBBBBBBBBBB'\tid(v)=1784089556480\n# v=b'B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00B\\x00'\tid(v)=1784089244720\n\n\n```\n\n\n```python\n\n\n###################################################################\n\n# Use this with care, and limit the area of interest as much as possible, this method might use a lot of memory and get really slow, since\n# it dumps the memory of the whole process and compares every single byte with the last memory dump.\n# You can stop recording by pressing Ctrl+C\npdme.record_all_changing_values(  # might get very slow and use a lot of memory\n    limitfunc=lambda x: True,\n    dtype=np.uint32,\n    allowed_protections=(\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_EXECUTE_READ,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_EXECUTE_READWRITE,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_READWRITE,\n        pymem.ressources.structure.MEMORY_PROTECTION.PAGE_READONLY,\n    ),\n)\npdme.get_differencesdf()\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalemaos%2Fpdmemedit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansalemaos%2Fpdmemedit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalemaos%2Fpdmemedit/lists"}