IOS build code

I would like to try some ARM build code with apple iOS just for educational purpose. I would like to start with some lines of code inside Xcode. I understand that I need to compile an iOS device, for example, for my iPhone, which means that I need to pay $ 99 per year for membership. I don’t think I can use the ASM build code with the iOS phone simulator. I find it difficult to find examples, books or documentation on the ARM build code in Xcode env from iPhone. Am I doing it wrong? Perhaps iOS is not the most convenient environment for exploring ARM builds.

+6
source share
4 answers

Backup...

What are you learning? Manual assembly or iOS programming? Choose one ...

Do you have any build experience?

What do you think you want to learn about hand assembly? Come in and write some full-sized gui applications? You need to learn how to add additions and / or xor to the registers and save answers in the registers. then read and write down some memory locations. Learn to use the stack, make calls, etc. Then write your applications in C or whatever and use asm for manual tuning or use your asm skills to debug the compiler and / or code. Writing applications or operating systems, etc. In asm for people who want to make an expression or have a specific reason, and not for educational purposes.

Give it a few minutes, or maybe half an hour, it won’t take long to pass, maybe evening, if you are serious about it.

http://github.com/dwelch67/lsasim see file learnasm.txt.

It is free, open source, should work in most places (linux, unix, windows, etc. with the C compiler), if you are not a programmer yet and do not have basic compilation tools or programming skills, and then learn some languages ​​( check python hard way http://learnpythonthehardway.org/ ), C, of ​​course, and get back to working in assembler. Isashim above is not an ARM, but has many familiar features. Let me know how good or bad the work I have done.

Now this is IS ARM, but the thumb command set:

https://github.com/dwelch67/thumbulator

Not a tutorial, but a simple, simple instruction set simulator. It should be obvious what happens in the simulator, which you can add / modify / print what you want to help in debugging. You can get your feet wet with built-in, large, cortex-m, ARM registers using gcc, gnu assembler and / or llvm clang as cross-compilers. Take one of the as-then examples, then start modifying it.

Some are prone to the unified assembly language ARM, which runs on both ARM-based cores and thumb-supported cores. Not for all assembly languages, but for places where you might want to write a code module, and should not have a lot if thumbs clogging up the code. You can, of course, get your feet wet with this here and take some of this code directly to full 32-bit ARM instructions on some other platform. thumbulator - only the thumb, a common set of commands between ARM-based cores and thumb-based cores, basically it is a set of portable ARM commands, it writes code once, it works with almost all of their cores.

You will see on github. I have a number of other sample projects that start with assembler and then load into the asm boot code leading to C. Many, but not all ARMs are based. Equipment costs between $ 10 and $ 50 or so. You can, for example, look at the yagbat game and get a free visual boyish simulator and simulate 32-bit hand commands or a 16-bit finger or something else, and have a simulated display, etc. Or if you have gaming equipment or nds or nds lite and the correct cartridges, you can run programs on real equipment.

All the material that I post there is for people to learn from. Overcoming the fears of trying the built-in for the first time, not knowing how to compile the compilation, etc. I have learned from many other similar examples and am simply returning the favor.

If your goal is to learn programming on iOS, get a kit or something else and learn to use any language you want to learn, master it, learn apis, etc. Then, if you do some of the assembler things above, you can start thinking about calling asm functions or inline assembler, etc. from your iOS programs. How many assembler is your choice. I would not expect to see applications written in assembly language for this platform, instead I would look for how I can call this assembly code from an ios application or how to make an inline assembly. (do not learn the built-in assembly until you achieve a real build).

There is no reason to pay for access to the simulator, there are many many hand simulators, one in my mother, a weapon arms in gdb and other places, a number of games for playing games and nintendo ds, etc. etc. etc. Of course there is qemu-arm. there are more simulators than you are likely to spend time trying, I am about 10 years old or so, and I have not tried them all.

the training assembly is not like C or python or java, I will write a minesweeper game to learn this language. You learn the mechanics of moving bits around, small steps, without writing down usable applications. For example, adding two 128-bit numbers using a 16-bit processor is a worthy assembly language project. Multiplication of two numbers of any size with a processor without a multiplication instruction, that is, another educational project such as assembler. yes, I agree, you CAN learn these things by calling asm from an iOS application, but if you don’t already have a set of iOS developers and you know how to write iOS applications, you need to learn a lot before you start thinking about assembler.

If I do not agree with what you asked, there are no problems, I will gladly delete this answer ...

+11
source

Even without a code signing certificate, I think you should be able to go to the scheme popup menu (on the right side) and select "iOS Device"

Once you do this, you can select any .c or .m file (or .cpp or .mm) in your project, open the assistant editor and select Build from the editor’s assistant panel. Then you can see the source code and build code side by side.

Or you can simply go to the Product menu and Generate Output → assembly

It may be easier for you to start with C code, where function calls will be much easier to perform initially than calls to Objective-C methods.

+2
source

What you need is an ARM developer kit with a set of Linux programming tools. You can then install VirtualBox on your Mac, create a Linux virtual machine, and install the ARM development tools on a Linux virtual machine. Make sure that when you purchase the ARM dev kit, it comes with an ARM processor, a full dev / test board, USB cables for transferring / debugging software, and the entire Linux instrumentation line. You can find such kits for less than $ 99.

+1
source

Another brief introduction to ARM assembly and reverse engineering: http://yurichev.com/writings/RE_for_beginners-en.pdf

+1
source

Source: https://habr.com/ru/post/903338/


All Articles