3 ms·
> copied the raw compiled machine code (as hex) into AutoHotkey and directly called it with DllCall Holy potatoes, you can do that?! Or, I suppose, you could d
by TeMPOraL 7y ago
> copied the raw compiled machine code (as hex) into AutoHotkey and directly called it with DllCall
Holy potatoes, you can do that?! Or, I suppose, you could do that, because I half-expect you can't anymore with all the various security features that were added to Windows over the last two decades. But cool stuff nonetheless.
It reminds me of my own foray into the space of running assembly output; back in my teenage years, I compiled a small bit of assembly into an object file, read it into a C++ program, casted the string into a function pointer and executed. Surprisingly, it worked. I got the idea from StarCraft modding scene; in those days, if you wanted to add a new button for your unit that did something, you had to write the action in assembly, compile it with MASM, and then let StarGraft tool patch the game executable with it (I don't remember if it did it at runtime or modified the actual executable).
- infogulch 7y agoYep! Actually I'd bet it still works today. I was able to find it in my Dropbox (2005 me's solution to version control). This is the function that does the dirty work [1]. That gist also has the C source as well. Date modified on these files are ~2008-9. [1]: https://gist.github.com/infogulch/d88b956ddd86bd00b35164951142d533#file-regiongetcolor-ahk-L64 https://gist.github.com/infogulch/d88b956ddd86bd00b351649511...