Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Apples's own ASLR implementation work?

According to ASLR(Address Space Layout Randomization), It provides random stack and heap allocations and page load every time a process starts, and randomize the address where objects are placed in virtual space of a given process.

But in my application running on ios, i create an object named ObjectA, after several reload the process ,i found that the address of ObjectA is all the same ,no randomize.

How does Apples's own ASLR implementation work? Why ObjectA's address is all the same?

like image 805
timestee Avatar asked Apr 14 '12 09:04

timestee


People also ask

How does Apple sandbox work?

Sandboxing. All third-party apps are “sandboxed,” so they are restricted from accessing files stored by other apps or from making changes to the device. Sandboxing is designed to prevent apps from gathering or modifying information stored by other apps.

How is iOS developed?

They are written using iOS Software Development Kit (SDK) and, often, combined with Xcode, using officially supported programming languages, including Swift and Objective-C. Other companies have also created tools that allow for the development of native iOS apps using their respective programming languages.

What is swift sandbox?

Android sandboxThe Android platform isolates apps from each other and protects them -- and the overall system -- from malicious apps and intruders. Android assigns a unique user ID (UID) to each application to create a kernel-level sandbox. This kernel ensures security between apps and the system at the process level.


1 Answers

What you mean for "several reload"? You should explicitly quit the application, because of the multitasking you might reopen the same process.

eg. This is one of my applications printing out the address of a UIViewController instance, as you can see the address of the object is different in every execution.

First run: <DCViewController: 0x13d4a0>
Second run: <DCViewController: 0x2880f0>
Third run: <DCViewController: 0x2a2050>

(I do not think this is the case but in XCode there's an option to enable PIE (Position Independent Executable) under "Build Settings" and it's called "Don't Create Position Indipendent Executables", you can find it easily but typing "pie" in the search box. This option should be set to No).

EDIT:

Moreover Xcode will only make PIE binaries if deployment target is >= 4.3

Hope this helps =)

like image 199
GreyHands Avatar answered Sep 27 '22 18:09

GreyHands