put it in ida pro
how to convert c to assembly language???
#12
Posted 04 May 2019 - 08:28 PM
NB: This method works using Code::Blocks IDE.
I presume you want your Code::Blocks build to generate an annotated assembly listing for each .c source file compiled.
Yes, you can do this as follows (as of Code::Blocks 12.11):
- In the Code::Blocks IDE, navigate Settings -> Compiler
- Ensure that the Selected compiler is GCC.
- In the tab list that begins Compiler settings, Linker settings..., navigate to the last tab, Other settings.
- In the Other settings pane, select Advanced options, at the bottom right.
- In the Advanced compiler options windows, ensure that the drop-down menu entitled Command is set at Compile single file to object file
- See the edit box entitled Command line macro and confirm that it contains the line:
- $compiler $options $includes -c $file -o $object
- To this line append a space followed by exactly this :
-Wa,-alhds=$objects_output_dir$file_name.list
- (Do not allow yourself to be misled at this point by the listing of Command macros at the left of the window. If it lists $objectsoutputdir instead of $objects_output_dir and $filename instead of $file_name, it is wrong.)
- Click OK in the Advanced compiler options window and then in the Compiler settings window.
- Rebuild your project.
The effect of the change you have made to the global compiler settings is that the options:
-alhds=$objects_output_dir$file_name.list
will be passed to the assembly phase when compiling each source file filename.c, with $objects_output_dirreplaced by the object output files directory of your project and $file_name replaced by filename, causing the assembler to generate an annotated listing file filename.list in the same directory where filename.o is placed.
Unfortunately I do not see how to do this just for a selected project; so after the change the compiler will generate the .list files for all projects.
If this is a nuisance, you can work around it by first configuring a "new compiler" in Code::Blocks that is a copy of GCC, with whatever name you like, and then applying the change I have described to this copy. To do this:
- Navigate Settings -> Compiler;
- Ensure the Selected compiler is GCC
- Select Copy and enter the name of your choice when prompted, e.g. "gcc-list"
Seen on : https://stackoverflow.com
Edited by FranckCastle, 04 May 2019 - 08:30 PM.
#20
Posted 10 August 2019 - 07:51 AM
I read this and spit coffee all over the place. I had to read the comments to make sure you wasn't joking!
To answer your question. Windows machine are in ASM at runtime since that's what the processor understands. You could accomplish your
goal with IDA, CheatEngine, VS, almost any memory editor/compiler/decompiler/assembler. I use this all the time to accomplish assembly
task without having to code in ASM. For instance, I was making a psuedoRNGenerator for a shot position on a game a while back. For the life of me I couldn't get it to generate a number in my extreme range and then convert it over to a usuable float. My solution: Code the PRNG'er in Cpp and then view the output in ASM86. A small tweak, return memory here and tada, I have my ASM PRNG'er.
Users browsing this thread: