Questions tagged [mach-o]

Executable file format utilized by Darwin.

Mach-O is the file format used for executables, shared libraries and object files on OS X and iOS. It supports both single-architecture and multiple-architecture ("fat") binaries.

371 questions
0
votes
1 answer

Calling the C-function _printf from NASM causes a Segmentation Fault

I've been trying to learn 64-bit assembly on both Mac-OS and Windows using NASM. My code is extern _printf section .data msg db "Hello World!", 10, 0 section .text global _main _main: mov rax, 0 mov rdi, msg call _printf …
0
votes
0 answers

Swift Can't play audio on simulator using avaudioplayer

I have been trying to play audio on an iOS simulator using Swift in Xcode but all I get is the error below. What is causing this problem? 2018-11-08 21:30:14.752040-0800 [9055:150546] Error loading…
BigBoy
  • 11
  • 1
0
votes
1 answer

How does one compile a 64 bit macOS application with NASM application using CMake?

Looking at the source setting CMAKE_ASM_NASM_OBJECT_FORMAT should be sufficient, however this does not seem to be the case. I expected the following to create a valid build configuration for a macOS application using the macho64 file…
sheeldotme
  • 2,237
  • 14
  • 27
0
votes
1 answer

iPhone 3.1.3 GDB dyld: Symbol not found

I'm trying to just get gdb to break at 0x2000 in a iphone application. The problem is that it requirers a shared library that's for iOS 4. I have tried to set sysroot and set solib-absolute-path in GDB but it won't work. Is there any way to change…
thaDudeda
  • 1
  • 1
0
votes
0 answers

Error about 32 bit address in 64 bit mode for global data

I'm trying to write a simple x64 assembly program on mac using nasm. Here is my program: global start section .text start: mov r10, 3; Store 3 to r10 mov r9, 4; Store 4 to r9 mov rax, r10; Move 3 to rax because multiply needs an arg in…
Drew
  • 12,578
  • 11
  • 58
  • 98
0
votes
1 answer

In `/usr/include/mach-o/loader.h`, what's the mach filetype `mh_dylib_stub` for?

I'm reading mach-o/loader.h and noticed this file type and it's description: #define MH_DYLIB_STUB 0x9 /* shared library stub for static */ /* linking only, no section contents */ This sounds almost like an…
lanza
  • 1,512
  • 2
  • 13
  • 26
0
votes
0 answers

How to load least significant digit of a register into variable? Getting "64 bit does not support 32-bit absolute addresses" on macho64

I want to display the least significant digit with an assembly program on nasm/macho-64: %define SYSCALL_WRITE 0x2000004 %define SYSCALL_EXIT 0x2000001 SECTION .data digit db 0,10 SECTION .text global _start _start: add rax, 48 mov…
srsrso
  • 111
  • 8
0
votes
1 answer

Why does the nm tool output for the extern-only and defined-only options overlap?

I'll start by giving my understanding of the options: extern-only: Show me only those symbols which are referenced by the binary but whose definitions (the code or variable) will be provided by another binary defined-only: Show me only those…
Verticon
  • 2,419
  • 16
  • 34
0
votes
2 answers

what is this assembly code in C?

I have some assembly code below that I don't really understand. My thoughts are that it is meaningless. Unfortunately I can't provide any more instruction information. What would the output in C be? 0x1000: iretd 0x1001: cli 0x1002: in eax,…
user7183233
0
votes
0 answers

Tweak make package failed: libfakeroot.dylib: mach-o, but wrong architecture

I was trying to make my first tweak for ios using Theos. And I just used a default tweak template(nic.pl), didnt change anything, I got this error when I tried to run make package: dyld: could not load inserted library…
404
  • 53
  • 1
  • 6
0
votes
1 answer

Fat Mach-O Executable Multi-purpose?

I am currently working with Mach-O Executables on my Mac and A question just came across me, Can a single Fat Mach-O Executable file have multiple purposes? Eg. Could I Have a single Mach-O Executable File with a Fat Header specifying 2…
YeaTheMans
  • 1,005
  • 8
  • 19
0
votes
0 answers

Mach-O How To Determine Procedure Names

I am currently learning about Mach-O Binary files and I am stuck trying to figure out how to determine which method names link to which procedure. I am using Hopper to understand mach-o binaries and It knows how to link the method names with their…
YeaTheMans
  • 1,005
  • 8
  • 19
0
votes
0 answers

Error when try move element of array to eax NASM

I write assembly code section .data mas dd 1, 2, 3, 4, 5 section .text global start start: xor eax, eax xor si, si xor ecx, 20 sum: push mas[si] add ax, mas[si] add esi, 4 cmp ecx, esi jne…
Claus Stolz
  • 358
  • 4
  • 18
0
votes
1 answer

Apple Mach-O Linker (ld) Error Group clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried this in Xcode Version 8.3.2 (8E2002). Trying in IBM mobile first(7.1) to integrate Cordova FCM Plugin.(https://github.com/arnesson/cordova-plugin-firebase/). Its success in android. When I included FCM sdk (.framework) file using…
Roney Francis
  • 356
  • 2
  • 15
0
votes
1 answer

Reversed Mach-O 64-bit x86 Assembly analysis

This question is for Intel x86 assembly experts to answer. Thanks for your effort in advance! Problem Specification I am analysing a binary file, which match Mach-O 64-bit x86 assembly. I am currently using MacOS 64 OS. The assembly comes from…
Wang Yi
  • 31
  • 1
  • 7