Re: C++: C++ to machine code via TDM-GCC
Posted: 26 May 2018, 11:44
You should look for a beginners C++ tutorial before attempting this.
Let's help each other out
Did you fix this yet? Can you explain what you meant. Thanks.nnnik wrote:Well I guess I never mentioned that you need to use VarSetCapacity to initialize data in them then.
I expected a different reaction .- I'm yet to have any problems with C/C++
I've got enough knowledge now to do some good codes.
I wouldn't convert an address to a string only to convert it back to number. In this example, the 32 bit code needs an address, so it cannot be hard coded. The 64 bit needs a relative address so it can be hard coded. You also need to make sure the memory (of the constant 16 byte data in the example) is 16-byte aligned, varsetcapacity doesn't guarantee that. I use arrays for my binary code, often I can only insert stuff in the array when needed. If I used hex strings, I'd use numput on the allocated memory directly.isn't it equally correct to say that we should edit the hex string for the machine code.
As I said in that thread, it is great for learning, but when you want to produce actual usable code, writing it in c / c++ is generally preferred.it looks like we need to know a bit about ASM
Indeed we need pop corn emoticons on this forum.nnnik wrote:This is just the beginning of issues.