mach-o

fork Cocoa process and re-init Cocoa. how?

巧了我就是萌 提交于 2019-12-01 10:38:21
问题 I tried to fork() a Cocoa process and setup a new Cocoa/ObjC environment but I get the error: The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug. Is there a way to re-initialize Cocoa/ObjC in the forked process? I know that the documentation about fork() does say it is limited, however I wonder if there is still a way to do it,

Position Independent Code pointing to wrong address

喜你入骨 提交于 2019-12-01 07:26:40
问题 I have a small example program written in NASM(2.11.08) targeting the macho64 architecture. I'm running OSX 10.10.3: bits 64 section .data msg1 db 'Message One', 10, 0 msg1len equ $-msg1 msg2 db 'Message Two', 10, 0 msg2len equ $-msg2 section .text global _main extern _printf _main: sub rsp, 8 ; align lea rdi, [rel msg1] xor rax, rax call _printf lea rdi, [rel msg2] xor rax, rax call _printf add rsp, 8 ret I'm compiling and linking using the following command line: /usr/local/bin/nasm -f

Assembler Error: Mach-O 64 bit does not support absolute 32 bit addresses

瘦欲@ 提交于 2019-12-01 05:50:35
So I'm learning x86_64 nasm assembly on my mac for fun. After hello world and some basic arithmetic, I tried copying a slightly more advanced hello world program from this site and modifying it for 64 bit intel, but I can't get rid of this one error message: hello.s:53: error: Mach-O 64-bit format does not support 32-bit absolute addresses . Here is the command I use to assemble and link: nasm -f macho64 hello.s && ld -macosx_version_min 10.6 hello.o . And here is the relevant line: cmp rsi, name+8 rsi is the register I am using for my index in the loop, and name is a quad word reserved for

What is required for a Mach-O executable to load?

前提是你 提交于 2019-11-30 20:19:34
I am attempting to hand-write a Mach-O executable. There are three load commands: LC_SEGMENT_64 loading __PAGEZERO LC_SEGMENT_64 loading __TEXT , with a single __text section LC_UNIXTHREAD with an appropriately-set rip Every command matches the structs in mach/loader.h and related headers. otool -l lists the information as expected and doesn't report any errors. By all accounts it is a well-formed object file — yet OS X 10.10.5 terminates the task (SIGKILL). What features of a Mach-O executable are checked before OS X will load it? Where is this information located? Do these features change

codesign an old Director projector on OS X 10.13 - perhaps manipulate __LINKEDIT segment value

耗尽温柔 提交于 2019-11-30 09:49:42
问题 (See Updates at end of this post) For $reasons, I need to codesign an old Director projector that we can no longer re-publish (no access to original source code or to Director). I'm doing this because when run without being signed, the app now opens a Finder window with a prompt saying "Where is..." asking for a file that's one of the embedded projector resources. But... If I cd into the Projector.app contents (it's not really called that, but you get the idea) and find the projector binary

Basic OS X Assembly and the Mach-O format

左心房为你撑大大i 提交于 2019-11-30 07:01:20
问题 I am interested in programming in x86-64 assembly on the Mac OS X platform. I came across this page about creating a 248B Mach-O program, which led me to Apple's own Mach-O format reference. After that I thought I'd make that same simple C program in Xcode and check out the generated assembly. This was the code: int main(int argc, const char * argv[]) { return 42; } But the assembly generated was 334 lines, containing (based on the 248B model) a lot of excess content. Firstly, why is so much

Apple Mach-O Linker errors and I don't know what to do

有些话、适合烂在心里 提交于 2019-11-30 05:56:50
I cannot compile my project for the device or simulator anymore. I get 13 Apple Mach-O-Linker errors. It all started after I failed attempt to use sharekit. Here is the log from the error: ld: warning: directory not found for option '-F/Users/bbrandy95/Documents/Broken Brandsonic Web Projects/Brandsonic Web mobile/../../Downloads/0.2.1gm1/iphoneos4.0/System/Library/Frameworks' Undefined symbols for architecture armv7: "_OBJC_CLASS_$_NSURLRequest", referenced from: objc-class-ref in Brandsonic_Web_mobileAppDelegate.o objc-class-ref in Brandsonic_Web_mobileViewController.o "_OBJC_CLASS_$

What is required for a Mach-O executable to load?

爷,独闯天下 提交于 2019-11-30 04:28:36
问题 I am attempting to hand-write a Mach-O executable. There are three load commands: LC_SEGMENT_64 loading __PAGEZERO LC_SEGMENT_64 loading __TEXT , with a single __text section LC_UNIXTHREAD with an appropriately-set rip Every command matches the structs in mach/loader.h and related headers. otool -l lists the information as expected and doesn't report any errors. By all accounts it is a well-formed object file — yet OS X 10.10.5 terminates the task (SIGKILL). What features of a Mach-O

Linker command error: 'ld: symbol(s) not found for architecture i386'

眉间皱痕 提交于 2019-11-30 01:37:08
I have an error at compile time. Seems to be weird. it worked as detail view application, but using single view doesn't seem to work. this is the error details: Undefined symbols for architecture i386: "_OBJC_CLASS_$_RssArticle", referenced from: objc-class-ref in RssXmlParser.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) iOS Test Try these steps: Open your project in XCode. In left side window/panel of XCode click on your project name on top. Now select Target from right side panel of XCode. Select Build Phases

How libgmalloc work with two level namespaces?

时光毁灭记忆、已成空白 提交于 2019-11-29 14:20:47
问题 I want to write my own malloc/free functions with debug purposes, documentation says I have to use DYLD_FORCE_FLAT_NAMESPACE together with DYLD_INSERT_LIBRARIES. But at the same time libgmalloc article clearly states: libgmalloc is available in /usr/lib/libgmalloc.dylib. To use it, set this environment variable: set DYLD_INSERT_LIBRARIES to /usr/lib/libgmalloc.dylib Note: it is no longer necessary to set DYLD_FORCE_FLAT_NAMESPACE. The question is: how to remove the necessity in DYLD_FORCE