Also, for those using software written in the PowerPC era, Snow Leopard gives us the last chance to run those apps.If you're a programmer, there are many reasons why you might want to go exploring the inner workings of Mac OS X. After this, Apple introduced OS X 10.7 Lion, which moved the Mac in the same direction as iOS a whole new direction for desktop Macs. If this isn't your thing, don't worry our usual non-technical stuff will be back soon.)Mac OS X 10.6 Snow Leopard marked an endpoint in the evolution of traditional OS X. Before you download, you can check if Chrome supports your operating system and you have all the other system requirements.(Note: this is one of our occasional extra-geeky technical posts. It is the primary operating system for Apples Mac computers.Within the market of desktop, laptop and home computers, and by web usage, it is the second most widely used desktop OS, after Windows NT.Google Chrome is a fast, free web browser. MacOS (/ m &230 k o s / previously Mac OS X and later OS X) is a proprietary graphical operating system developed and marketed by Apple Inc.By using Best MAC Emulator for Windows OS, there is no need to change the O.S. Since its launch in 2008, Chrome has expanded to Android, iOS, and is the. Available for Windows, Mac, and Linux, Google Chrome is the most widely used desktop browser in the world. (We're all adults here, so I won't lecture you about the dangers of using private or undocumented interfaces in your apps.)Google Chrome. Or perhaps you're just curious about how things work.But reading x86 assembly really isn't that hard. Most of it is Windows- or DOS-centric, usually with syntax that doesn't apply (Intel syntax vs the AT&T syntax that GCC uses), and with the aim of teaching how to write it. Despite the present and future of the Mac being x86, it seems like people have lots of anxiety about having to work with it.I think the problem is not a lack of documentation on x86 assembly, but a surfeit of it. While there are good resources available to learn about reading PowerPC assembly for exploration, there are fewer about x86. It is also the last Mac OS X version that supports PowerPC-based applications, as Mac OS X v10.In any case, though, you need to know how to read assembly, either PowerPC (if you have an older Mac) or x86 (if you have anything recent). This is the place where comes in handy, allowing us to use the MAC only applications for the Windows PC seamlessly.Using the open source Chromium infrastructure of Google.If you have the latest developer tools, launch Shark (in /Developer/Applications/Performance Tools) and in the Help menu you can access various ISA references. Let's touch on two functions, in both PowerPC and x86 flavors.Before we begin, I'm going to assume that you're comfortable with assembly in general (though not necessarily with any particular one). While exploring, I took notes of my discoveries.
Chrome For Powerpc Mac OS X 10Instead, the PowerPC has a link register and a command bl to branch and put the old PC value into the link register. The PowerPC doesn't have a dedicated stack pointer (convention is to use r1 for that), so the common way of implementing branches by pushing the PC onto the stack doesn't work. I went with Carbon because sometimes the dynamic nature of Objective-C with Cocoa makes tracing code harder.This is the prologue of the function. In this case, I chose SetWindowTitleWithCFString because it has to somehow set the title of a window even if it's minimized. And finally, this is only for the 32-bit version of each platform things change even more with 64 bits.The trail always begins with a public call that uses the SPI that you want to figure out. I'm going to go over each function twice (once for PowerPC and once for x86) feel free to skim the PowerPC version if you're accustomed to it. Return values are returned in r3. Integer-sized parameters (the only kind we'll be dealing with today) are passed into a function starting with r3 and going up through the registers. Then in we drop the old PC onto the stack and allocate 80 bytes on the stack.A note on parameter passing. The stmw (store multiple words) instruction is useful for ditching many high registers on the stack. Every function needs scratch registers to hold local variables, and usually the high-numbered registers are used. Then in we save off some registers that we're going to smash. That's fine, as the WindowRef was just an index into a table and won't be needed further.At this point we run some checks. In addition, note that the function return value, being in r3, will overwrite the WindowRef value which wasn't saved in a high register. We see that we use the WindowRef as a parameter to a C++ function GetWindowData(OpaqueWindowPtr), as the WindowRef was passed in as r3 and r3 wasn't altered before the call. Fortunately, we have the symbols so it's not too hard. : bl 0x92881384 : cmpwi cr7,r3,0 // if no window data, bail: cmpwi cr7,r30,0 // if no string to set, bailThis is where we must start making inferences as to what the code is doing. City car driving 12 5 free download demoX86 has fewer registers and they've historically had different roles (accumulator, base, source index, destination index, and so on). We restore the stack pointer, put the return value into r3, restore the registers, move the old PC back into the link register, and branch to the link register ( blr), returning us to our caller.The PowerPC register file is really easy: r0, r1, r2. We call a member function WindowData::SetTitleCommon(CFString*), and then do common tear down. : bl 0x928d2af8 : addi r1,r1,80 // tear down stack frame and returnThe rest is pretty simple. Why are we using cr7 here? Probably because cr7 is volatile and we can get away with not saving/restoring it. (The end of the function will move r0 into r3 for return.)The PowerPC condition register has eight condition sets. That's it.PowerPC assembly reads right-to-left (except for stores). Eax, ebx, ecx, edx, esi, and edi are all general-purpose registers. There are eight registers you care about. To execute the function, the call instruction was used. Parameters to a function are put at the top of the stack, and the rightmost parameters have the highest addresses. : push %ebp // make stack frameX86 is stack-based. The stack pointer doesn't move once we make it past the prologue. One interesting note is that rarely are parameters pushed onto the stack for a call. And below that is a bunch of stack space used for either register spillage or calling subsequent functions. Immediately below ebp are the values saved from the registers, which will be restored before the return. On x86 the parameters go on the stack and values are kept in registers when possible. There, lower registers like r3 are reused for parameter passing so important values are kept in the high registers. It's actually pretty analogous to how things go in PowerPC. Since fiddling in memory is slow, we pull the values into registers. : mov 0x8(%ebp),%eax // get WindowRef in %eax: mov 0xc(%ebp),%esi // get new title in %esiThe parameters are passed on the stack. But on the constant 0xffce is loaded in ax. In the constant 0xffffea20 is loaded into eax. The only thing of interest to note is the clever use of the peculiar register structure. : mov %eax,%edx // stick WindowData into %edx: mov $0xffffea20,%eax // errInvalidWindowRef: test %edx,%edx // if no window data, bail: test %esi,%esi // if no string to set, bailReturn values come back from functions in eax, but otherwise this is pretty much the same. Here, we just look at the register indirect addressing with esp.
0 Comments
Leave a Reply. |
AuthorRob ArchivesCategories |