{"id":21543810,"url":"https://github.com/amaranthinecodices/cursed-aslr-rng","last_synced_at":"2025-03-17T23:55:51.411Z","repository":{"id":208359906,"uuid":"721441338","full_name":"AmaranthineCodices/cursed-aslr-rng","owner":"AmaranthineCodices","description":"this is not a place of honor","archived":false,"fork":false,"pushed_at":"2023-11-21T07:12:25.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T08:44:01.275Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmaranthineCodices.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-11-21T04:11:58.000Z","updated_at":"2023-11-21T08:18:26.000Z","dependencies_parsed_at":"2023-11-21T05:28:32.680Z","dependency_job_id":"bb3f6baa-6d79-4e63-8c75-dda57f37d897","html_url":"https://github.com/AmaranthineCodices/cursed-aslr-rng","commit_stats":null,"previous_names":["amaranthinecodices/cursed-aslr-rng"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmaranthineCodices%2Fcursed-aslr-rng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmaranthineCodices%2Fcursed-aslr-rng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmaranthineCodices%2Fcursed-aslr-rng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmaranthineCodices%2Fcursed-aslr-rng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmaranthineCodices","download_url":"https://codeload.github.com/AmaranthineCodices/cursed-aslr-rng/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130278,"owners_count":20402753,"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":[],"created_at":"2024-11-24T05:15:45.322Z","updated_at":"2025-03-17T23:55:51.389Z","avatar_url":"https://github.com/AmaranthineCodices.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cursed-aslr-rng\n\nsome time ago I had a ~~terrible~~ brilliant idea: what if you used ASLR as a PRNG?\n\nthis is the result\n\nplease do not use this or anything like it for anything ever\n\n## how\n\naslr randomizes the starting point of, among other things, your heap space. the premise is simple: get a new heap space, get a new random number. it's not a very good random number, but it's a number.\n\nto do this, the executable must be linked as a position-independent executable (because otherwise you don't get aslr). from there you have to export a function (like a shared library) (yes, it's an executable). you then load the executable as a shared library, pull the function out, and have it give you a `uint64_t` pointer from that randomized address space.\n\nhowever, there is a problem: `dlclose` is not guaranteed to actually release the address space, so you can end up with the same number if you try this multiple times in a row. to bust the cache, we copy the executable to a new file and load the copy. once we're done, we delete the copy. this is not a good idea, but then again, nothing here is.\n\n## usage\n\n- step 1: don't\n- step 2: ???\n- step 3: revel in your blissful existence\n\n## building, in case you too are a fool\n```\nmkdir build\ncd build\ncmake ..\ncmake --build .\n./cursed-aslr\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famaranthinecodices%2Fcursed-aslr-rng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famaranthinecodices%2Fcursed-aslr-rng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famaranthinecodices%2Fcursed-aslr-rng/lists"}