10/29/2023 0 Comments Convert c to arm assemblyThe problem is that some structures and other things may be identical for x86 and x86-64 but different for ARM so you need to find those different parts as well and change them. Here's what I get when I compile with ARM64 GCC 5.4 and optimization level O3 (comments added by me): mov x0, 32 x0 0x20 mov w1, 24 w1 0x18 movk x0, 0x40, lsl 16 x0 31:16 0x40. floattohexmodule.c - the C file that compiles into a Python module setup.py - the Python file used to build the Python module. ![]() The mapping is not necessarily perfect, and not possible. A decompiler attempts to approximate a programs original source code. Note that a decompiler does not 'convert assembly to C'. Only works on 64bit x86 code (and the code in the else statement only on 32bit x86 code). It sounds to me like you compiled the C code with a compiler targetting AArch32, but the assembly code you've shown looks like it was written for AArch64. Well, unless the C code uses embedded assembly. Compilers analyze and convert source code written in languages such as Java, C++, C or Swift. Well yeah but you would need to change alot more things (I’ve only looked at the ftrace).įor example the branch_table would need ARM opcodes instread of x86 opcodes.Īlso like you noticed the user_regs_struct needs adjustments to be ARM compatible (usage of ARM registers instead of x86).You also need to change everything the author marked with #ifdef x86_64 as it simbolizes that the following code Although the two are similar, they differ in important ways.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |