2
Okay, the lawyers seemed to have weighed in, and admin says we're not to change anything about what we're doing until it all settles down. Suits me.
<p>I forgot about callee cleanup. fucking stdcall is callee cleanup. I can&#39;t have a generic int blah(){return 0x1234;} function because it needs to know how many words of arguments were pushed.</p>
<p>ideally I should be able to patch arbitrary python in there and do some kind of interop to return values to python</p><p>but that&#39;s hard. and way easier unflexible thing this is 80% of what I need that for</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@film_girl" class="u-url mention">@<span>film_girl</span></a></span> 😭 that&#39;s a tragedy...</p>
<p>I need this because the decompression routine I&#39;m emulating isn&#39;t entirely standalone: it calls malloc() at the beginning and free() at the end</p><p>so I&#39;m replacing malloc() with a static value and free() with a return value no one will check</p>
<p>my latest bad idea: DUMBPATCH.</p><p>to avoid the complexity of generating functions and mapping them into the address space of the emulated PC, I instead designed a simple syntax:</p><p>a 16bit segmented address plus a number. that function is emulated as if it returned that number in AX. There are no other options. I suspect I&#39;ll be able to emulate up to 80% of complex subfunctions with this one bit of functionality</p>
<p>it&#39;s too bad python&#39;s ctypes doesn&#39;t support 16-bit x86. it&#39;d be handy right now</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@VeroniqueB99" class="u-url mention">@<span>VeroniqueB99</span></a></span> she’d had a liver transplant recently so maybe it was related to that. Like organ rejection idk. So awful.</p>
<p>I&#39;m implementing unicorn as an x86 emulator to do the decompression, but I&#39;m single-stepping the processor and I&#39;m aiding debugging by showing what instruction I&#39;m on.</p><p>but instead of having to set up an x86 disassembly engine, I&#39;m just parsing a plain text ghidra dump of the disassembly. I&#39;m parsing it with regexes</p>