{"id":15558520,"url":"https://github.com/arusekk/utfpyc","last_synced_at":"2026-04-06T02:02:28.176Z","repository":{"id":179862251,"uuid":"337022790","full_name":"Arusekk/utfpyc","owner":"Arusekk","description":"Make .pyc files that are valid UTF-8","archived":false,"fork":false,"pushed_at":"2021-02-09T13:20:33.000Z","size":37,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T04:44:39.227Z","etag":null,"topics":["bytecode-manipulation","cpython","utf-8"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arusekk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2021-02-08T09:28:49.000Z","updated_at":"2024-08-12T20:10:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"0bcdb39b-c57b-45db-894a-eff7b4a44740","html_url":"https://github.com/Arusekk/utfpyc","commit_stats":null,"previous_names":["arusekk/utfpyc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Arusekk/utfpyc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arusekk%2Futfpyc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arusekk%2Futfpyc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arusekk%2Futfpyc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arusekk%2Futfpyc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arusekk","download_url":"https://codeload.github.com/Arusekk/utfpyc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arusekk%2Futfpyc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31456664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"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":["bytecode-manipulation","cpython","utf-8"],"created_at":"2024-10-02T15:37:08.365Z","updated_at":"2026-04-06T02:02:28.170Z","avatar_url":"https://github.com/Arusekk.png","language":"Python","readme":"# UTFPYC\n\nWhy not make .pyc files that are valid UTF-8 by the way?\n\nNote: this only works best-effort and assumes you don't use\nconstants and literals that are not possible to encode this way.\nIt just makes sure that the code for code objects is a little better,\nwhile longer and hopefully not changing its semantics.\n\nThe code here is intended for use with CPython 3.9,\nbut should work with CPython 3.8-3.11 with no changes,\nand with older wordcode CPythons just by tweaking the marshaller.\n\nIf necessary, it may be rewritten using the excellent [xdis] library.\n\n[xdis]: https://github.com/rocky/python-xdis\n\nNote that in most cases you should not need to transform very complex\ncode patterns using this project,\nand whenever it fails to do its job on your actual payload\nyou can just compile a stager with it,\nand embed your actual payload inside in some way.\n\nExample stager for the simple case [`test/stager.py`](test/stager.py):\n```py\nimport binascii\nimport marshal\n\nactual_payload = '''\n610d0d0a0000000001e20d60eb030000e30000000000000000000000000000000007000000400000\n00735c00000064005a0069005a01640144005d325a0265036402830144005d245a04650565046403\n1700640216006502170083016501650565046502170083013c007118710c65066404a00764056406\n8400650044008301a101830101006407530029086158030000477572204d726120627320436c6775\n62612c206f6c2047767a204372677265660a0a4f726e686776736879207666206f72676772652067\n756e61206874796c2e0a526b637976707667207666206f72676772652067756e6120767a63797670\n76672e0a46767a637972207666206f72676772652067756e612070627a6379726b2e0a50627a6379\n726b207666206f72676772652067756e612070627a637976706e6772712e0a53796e67207666206f\n72676772652067756e61206172666772712e0a46636e656672207666206f72676772652067756e61\n2071726166722e0a45726e716e6f767976676c207062686167662e0a46637270766e7920706e6672\n66206e65726127672066637270766e7920726162687475206762206f65726e782067757220656879\n72662e0a4e796775626874752063656e706776706e7976676c206f726e67662063686576676c2e0a\n5265656265662066756268797120617269726520636e666620667679726167796c2e0a4861797266\n6620726b637976707667796c2066767972617072712e0a56612067757220736e7072206273206e7a\n6f76746876676c2c20657273686672206775722067727a63676e677662612067622074687266662e\n0a477572657220667562687971206f72206261722d2d206e6171206365727372656e6f796c206261\n796c20626172202d2d626f6976626866206a6e6c2067622071622076672e0a4e7967756268747520\n67756e67206a6e6c207a6e6c20616267206f7220626f6976626866206e6720737665666720686179\n726666206c62682765722051686770752e0a41626a207666206f72676772652067756e6120617269\n72652e0a4e79677562687475206172697265207666206273677261206f72676772652067756e6120\n2a65767475672a2061626a2e0a56732067757220767a6379727a7261676e6776626120766620756e\n657120676220726b63796e76612c2076672766206e206f6e71207671726e2e0a5673206775722076\n7a6379727a7261676e6776626120766620726e666c20676220726b63796e76612c207667207a6e6c\n206f72206e2074626271207671726e2e0a416e7a7266636e707266206e6572206261722075626178\n766174207465726e67207671726e202d2d207972672766207162207a626572206273206775626672\n212902e941000000e961000000e91a000000e90d000000da00630100000000000000000000000200\n00000600000043000000731800000067007c005d107d017400a0017c017c01a102910271045300a9\n002902da0164da036765742902da022e30da016372060000007206000000fa1a2f7573722f6c6962\n2f707974686f6e332e392f746869732e7079da0a3c6c697374636f6d703e1c000000f30000000072\n0c0000004e2908da01737207000000720a000000da0572616e6765da0169da03636872da05707269\n6e74da046a6f696e720600000072060000007206000000720b000000da083c6d6f64756c653e0100\n0000730a0000000416040108010c012402\n535353535353\n'''.replace('\\n', '') # hexlified PYC file, padded to encodable length\neval(marshal.loads(binascii.unhexlify(actual_payload)[16:]))\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farusekk%2Futfpyc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farusekk%2Futfpyc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farusekk%2Futfpyc/lists"}