It takes less than a minute to convert that into winapiĪnd a pure c does not have the PE format structures defined I hate putting this here after that comment BY OP
Result and confirmation :\>python getbytatent.py c:\Windows\System32\calc.exe Try to ask more precise - its easy to help you when its clear what your exact target isĮntry = pe.OPTIONAL_HEADER.AddressOfEntryPointįor i in (Cs(CS_ARCH_X86,CS_MODE_64).disasm(bytes,OEP)): Normaly this is the way: C/C++/Assembler/whatever-Source -> Compiler -> Objectfiles -> OS-related-Executable-Format What format is "a file" in your example - some sort of source-code or object file format?
#I HATE YOU.EXE HOW TO#
How would I go about programming a c program to convert a file to machine code?Īnd now you revert you question completely - before - you ask how to load a file with machine-code and now you ask how to convert "a file" to machine-code Read the spec of your operating system file format and write a small loader/parser, there are serveral C,C++,go,python. So you've already got some sort of disassembler? We have not yet set down this day of Triumph : To morrow, in my judgment.
#I HATE YOU.EXE CODE#
I have written a C program to convert machine code to assembly. Withdraw yourself a while, I'll with you.