{"id":18864913,"url":"https://github.com/joedf/mcode4gcc","last_synced_at":"2025-10-04T23:59:46.592Z","repository":{"id":20820731,"uuid":"24106504","full_name":"joedf/MCode4GCC","owner":"joedf","description":"MCode4GCC is an MCode generator using the GCC Compiler.","archived":false,"fork":false,"pushed_at":"2020-03-10T16:05:22.000Z","size":150,"stargazers_count":21,"open_issues_count":1,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-30T14:46:35.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"AutoHotkey","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/joedf.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}},"created_at":"2014-09-16T15:56:28.000Z","updated_at":"2025-02-23T00:15:26.000Z","dependencies_parsed_at":"2022-07-25T08:02:05.867Z","dependency_job_id":null,"html_url":"https://github.com/joedf/MCode4GCC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joedf/MCode4GCC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joedf%2FMCode4GCC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joedf%2FMCode4GCC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joedf%2FMCode4GCC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joedf%2FMCode4GCC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joedf","download_url":"https://codeload.github.com/joedf/MCode4GCC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joedf%2FMCode4GCC/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278391180,"owners_count":25978945,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"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":[],"created_at":"2024-11-08T04:44:26.760Z","updated_at":"2025-10-04T23:59:46.563Z","avatar_url":"https://github.com/joedf.png","language":"AutoHotkey","funding_links":[],"categories":[],"sub_categories":[],"readme":"MCode4GCC\n==================\n  \nMCode4GCC is an MCode generator using the GCC Compiler.  \nMore about MCode here : http://ahkscript.org/boards/viewtopic.php?f=7\u0026t=32\n  \n## Screenshots\n![screenshot](screenshot2.png \"screenshot\")\n  \n## Help\n- [What is MCode?](#what-is-mcode)\n- [Getting started](#getting-started)\n- [Setting up GCC](#setting-up-gcc)\n- [Questions?](#questions)\n\t\n#### What is MCode?\n**MCode** is short for [machine code](http://en.wikipedia.org/wiki/Machine_code). Basically, it is compiled code : instructions in binary form for the CPU to execute. The main advantages of MCode is speed and the possibility to execute low-level code, such as Assembly.  \n\n#### Getting started\nCurrently, there are two MCode functions available for AutoHotkey. Bentschi's version is recommended.  \n  \n**Laszlo**'s version :  \nHow to use it : http://www.autohotkey.com/board/topic/19483-machine-code-functions-bit-wizardry\n```\nMCode(ByRef code, hex) { ; allocate memory and write Machine Code there\n\tVarSetCapacity(code,StrLen(hex)//2)\n\tLoop % StrLen(hex)//2\n\t\tNumPut(\"0x\" . SubStr(hex,2*A_Index-1,2), code, A_Index-1, \"Char\")\n}\n```\n  \n**Bentschi**'s version :  \nHow to use it : http://ahkscript.org/boards/viewtopic.php?f=7\u0026t=32\n```\nMCode(mcode) {\n\tstatic e := {1:4, 2:1}, c := (A_PtrSize=8) ? \"x64\" : \"x86\"\n\tif (!regexmatch(mcode, \"^([0-9]+),(\" c \":|.*?,\" c \":)([^,]+)\", m))\n\t\treturn\n\tif (!DllCall(\"crypt32\\CryptStringToBinary\", \"str\", m3, \"uint\", 0, \"uint\", e[m1], \"ptr\", 0, \"uint*\", s, \"ptr\", 0, \"ptr\", 0))\n\t\treturn\n\tp := DllCall(\"GlobalAlloc\", \"uint\", 0, \"ptr\", s, \"ptr\")\n\tif (c=\"x64\")\n\t\tDllCall(\"VirtualProtect\", \"ptr\", p, \"ptr\", s, \"uint\", 0x40, \"uint*\", op)\n\tif (DllCall(\"crypt32\\CryptStringToBinary\", \"str\", m3, \"uint\", 0, \"uint\", e[m1], \"ptr\", p, \"uint*\", s, \"ptr\", 0, \"ptr\", 0))\n\t\treturn p\n\tDllCall(\"GlobalFree\", \"ptr\", p)\n}\n```\n  \n#### Setting up GCC\nThere are many GCC distributions for the Microsoft Windows Operating System.  \nHere are some recommended ones :  \n\t- MinGW : http://www.mingw.org/wiki/Getting_Started  \n\t- TDM-GCC : https://jmeubank.github.io/tdm-gcc/  \n\t- Cygwin : https://cygwin.com/install.html  \n  \n#### Questions?\nDon't be shy to post in the forums. Just ask away!  \nPost your questions here : http://ahkscript.org/boards/viewtopic.php?f=6\u0026t=4642  \n  \n## Credits\nSpecial thanks to IsNull, fincs, Laszlo, SKAN, Bentschi and kon  \nWritten by joedf (joedf@ahkscript.org)  \nReleased under the [MIT License](http://opensource.org/licenses/MIT)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoedf%2Fmcode4gcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoedf%2Fmcode4gcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoedf%2Fmcode4gcc/lists"}