04 November 2007

library randomization

so it seems like to me, and perhaps im just not thinking right because i havent worked it out on paper, but it seems like because of the fact that apple say's that:


Mach-O position-independent code design is based on the observation that the __DATA segment is always located at a constant offset from the __TEXT segment. That is, the dynamic loader, when loading any Mach-O file, never moves a file’s __TEXT segment relative to its __DATA segment. Therefore, a function can use its own current address plus a fixed offset to determine the location of the data it wishes to access. All segments of a Mach-O file, not only the __TEXT and __DATA segments, are at fixed offsets relative to the other segments.

Note: If you are familiar with the Executable and Linking Format (ELF), you may note that Mach-O position-independent code is similar to the GOT (global offset table) scheme. The primary difference is that Mach-O code references data using a direct offset, while ELF indirects all data access through the global offset table.


Now, I haven't actual spent any time digging through leopard, aside from a simple test of compiling a test program with the gcc on their (v4.0.1) to see if it had SSP (it had never heard of the flags -fstack-protector or -fstack-protector-all ?)- but it seems like if Apple PIC binaries contain this trait you end up with a couple complications.

The first and most obvious would be that you can't randomize per section, although in theory i believe you should be able to randomize the stack and heap, although that may cause problems in one of those funko languages like obj-c. The second problem is that because the text is not randomized, and because all i need to know is the base address of the image, which is pretty likely considering all of the segments that are not randomized and then look for variable references that take observation of the fact that section offsets are constant, and it would seem like I could reverse the address space layout that way.

I mean examining the .text or anything dealing with libraries, such as dyld, should reveal a lot of those references, it seems pretty much like overkill at this point in the game because all you really need is a jmp/call addr/reg, but honestly this seems like a deep flaw in the ASLR logic; maybe i just need more sleep?

5 comments:

Unknown said...

2010 your best choice for christmas gift. First, Power Balance silicone Bracelets. They are are sweeping the whole world.
power balance bracelets were first released in January of 2007 and now they become the most popular health bracelets among people of all ages and all walks of life, including some of the super athletes.

Second, Silly bandz. A very famous brand of silicon rubber bands. bakugan toys
silly bandz come in different shapes like objects, animals and letters and this is why these are loved by kids of all ages. The bands are very popular because they come in many colors, shapes and themes. There is no doubt that you will fall in love with them the minute you see them. These bands can wither be used as bracelets or as regular rubber bands. The choice is entirely of the user.

Third, Far away on the mysterious Isle of Zoobles reside hundreds of adorable, little creatures with a magnificent ability, they can magically transform into tiny balls hiding from the unknown, rolling to colorful destinations, sleeping after a long day But beware, you never know when these mischievous Zoobles are going to pop open and surprise you.

Fourth, EFX’s holographic technology contains algorithms and frequencies that interact positively with this energy field in both humans and animals at the cellular level. When placed near the body, especially at key energy centers such as the hands and feet, EFX bracelet’s products will harmonize with the body’s naturally occurring bioelectric frequencies.

Seduco said...

I am grateful to you for this great content.aöf thanks kullanıcı yorumları cool kadınlar portalı very nice ssk only cinsellik very nice pembe maske yorumları turhoq home free otomobil yorumları last go korku jomax med olsaoy kullanıcı yorumları lesto go mp3 indir free only film izle

Unknown said...

I really like your writing style. Nice Post keep it up.

Asus - K53E-DS31 15.6" LED Notebook - Intel Core i3 i3-2350M 2.30 GHz - Mocha

Asus - 14" Notebook 4 GB Memory - 500 GB Hard Drive - Black (P43E-XH31)

Selfless said...

When playing online games, watch yourself. Some of these games will require you to pay a monthly fee. Check out a site in depth before your kids join it. You need to find out if there is money involved and make a decision about the game justifying the cost of buy Maple Story 2 Mesos.

Playing MapleStory 2 can be an excellent method of bonding with your kids. This can give you a glimpse into how your child has fun. Talking about your gaming lives provides common ground that is great for starting a conversation. You can also take part in their developmental skills through gaming.

Lots of online gaming options provide players the option to earn rewards or content or to buy such features with money. Look over all the benefits that are being offered before you make a purchase of Maplestory M Mesos. They may do nothing for your gaming. Or, they might improve it a lot and save you tons of time.

smrtsmith said...

You can search for the keyword FFXIV Gil through the Internet, and then select a website with higher comprehensive evaluation for consultation and purchase. Generally, the top ranked website has higher comprehensive credit. You can also search for MMOAH directly. The website you want for gold coins is sold at reasonable prices. The most important thing is that the transaction speed is fast, the transaction is safe, and the comprehensive evaluation is also very high. Very trustworthy