Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
OS X Operating Systems Software Windows

Native Windows PE File Loading on OS X? 397

ozmanjusri writes "Coders working on Wine for Mac have found that the Mac loader has gained its own undocumented ability to load and understand Windows Portable Executable (PE) files. They found PE loading capabilities in Leopard that weren't there in Tiger. Further dissection showed that Apple is masking references to 'Win' and 'PE' in the dll, which means it's not an accidental inclusion. Is Apple planning native PE execution within OS X?"
This discussion has been archived. No new comments can be posted.

Native Windows PE File Loading on OSX?

Comments Filter:
  • noooo FP (Score:5, Insightful)

    by Anonymous Coward on Saturday December 01, 2007 @05:31PM (#21546949)
    please not - i don't need every windows malware able to run on my mac...
  • by cnettel ( 836611 ) on Saturday December 01, 2007 @05:38PM (#21547025)
    UI includes showing the actual images. Sending them over IPC is certainly not wise from a performance standpoint.
  • by Anonymous Coward on Saturday December 01, 2007 @05:42PM (#21547065)
    Umm...one of Apple's biggest selling points for the Mac if you go into any store that sells one is that it can "still run all of your Windows stuff." They've changed architectures over to Intel-based PC's.

    You have any special insight that would suggest why they _wouldn't_ want to be as compatible with Windows as possible, being that they're trying hard to convince people to switch? Why they wouldn't want a PC that can already run all of the Windows software on the shelves, without the painful experience of having to use Vista (which they reference more and more often in their commercials)? I think not.
  • by SigILL ( 6475 ) on Saturday December 01, 2007 @05:49PM (#21547147) Homepage

    You have any special insight that would suggest why they _wouldn't_ want to be as compatible with Windows as possible, being that they're trying hard to convince people to switch?

    Because if they did, customers could choose between machines that sorta run Windows applications (Macs) or machines that run Windows applications properly (PCs). As Wine proves, any reimplementation of the Win32 API is inevitably not going to be as good as the real thing.

    Providing compatibility with Windows through VMWare or Parallels is a lot better in that respect. And if a virtual machine should fail, so what? It would only make Microsoft or the virtual machine maker look bad, not Apple.

    Besides, as I said in my original post: I think the moment Apple starts offering integrated Win32 binary-level compatibility is the moment software vendors stop offering Mac-native applications. And that's the point where Apple might as well start bundling the current version of Windows with their systems.
  • by apankrat ( 314147 ) on Saturday December 01, 2007 @05:53PM (#21547179) Homepage
    The actual problem is resolving all external dependencies of Windows-bound binaries. If the Win32 API is somehow emulated (see Wine project for some "minor" details), this leaves (an ungodly mess of) COM interfaces. Then even if this is taken care of, Apple is going to be quite exposed to a legal beating from MS.

    Lastly, "Is Apple planning native PE execution within OSX?" - if they were _planning_ that, they wouldn't include this into a production release of the OS. This means that it's already used for something. The big question is what exactly.
  • Comment removed (Score:5, Insightful)

    by account_deleted ( 4530225 ) on Saturday December 01, 2007 @05:59PM (#21547239)
    Comment removed based on user account deletion
  • by Anonymous Coward on Saturday December 01, 2007 @06:16PM (#21547385)
    That is not true. Anyone remember when IBM did this with OS/2? It killed the market for OS/2 software, because every developer just wrote for the lowest common denominator (Windows) instead of making "native" OS/2 software. Adding Windows application support in Mac OS X would kill the platform slowly.
  • by abigor ( 540274 ) on Saturday December 01, 2007 @06:17PM (#21547401)

    I'd personally love it if Apple replaced its aging Cocoa/Objective-C/XCode infrastructure with something more modern like .NET or Java, but I don't think it's going to happen anytime soon.
    Well, Apple has cut loose the Java bindings to Cocoa, so I guess you're right.

    I've only dabbled with Cocoa in order to learn Objective-C, but the whole thing seems super elegant, and Objective-C itself is SO much nicer to work with than Java - it's like C combined with Python (very dynamic). The class hierarchy is clean and not particularly deep. I don't know, I personally think moving to, say, Java for infrastructure would be a step backwards (and I say this as someone whose current contracts are all big Java projects). But that's just my opinion.
  • by sjf ( 3790 ) on Saturday December 01, 2007 @06:20PM (#21547415)
    If I had mod points, you'd get them. This is a good point. There are a lot of .NET programmers out there, and anything to encourage coding for a platform has to be a good thing.

    On the otherhand, I doubt this is the full story. I'd bet on "you can run your windows apps without running windows" before I'd bet on, ".NET programmers wanted, no Mac experience necessary."
  • Comment removed (Score:5, Insightful)

    by account_deleted ( 4530225 ) on Saturday December 01, 2007 @06:22PM (#21547423)
    Comment removed based on user account deletion
  • by Myria ( 562655 ) on Saturday December 01, 2007 @06:33PM (#21547499)
    The Mac equivalent of Win32's WriteProcessMemory requires your program to be setgid procmod, so essentially you'd need Administrator access. This probably makes Mac malware considerably more difficult to make than on other platforms. Even Linux lets programs ptrace each other on all by the strictest of SELinux modes. Also, on Linux, a lot more machines have GDB installed, so malware could pipe to it when SELinux does interfere. Few Mac users have GDB installed.
  • by SigILL ( 6475 ) on Saturday December 01, 2007 @07:41PM (#21547921) Homepage

    Nope. Do you even know what "quantification" means?

    Not right now, no. But it's half past twelve here. In the morning. And I'm writing posts in a language that's not my mother tongue. I'm actually amazed my posts are halfway coherent and readable.

    But to get back on the subject, you probably want to see hard numbers regarding this. Well, there aren't any. Developing a platform has always and will always depend on guesses. That's because we're dealing with people here, who have those nasty undefinable things called "preferences". We can only guess what's going to work out, and what isn't.

    And right now, .NET looks like a pretty good bet.
  • by Durandal64 ( 658649 ) on Saturday December 01, 2007 @07:49PM (#21547955)

    Right now, the world's colleges and universities are churning out Java & C# programmers. Those are the popular languages, the ones for which you can almost literally open up a can of programmers for.
    Having the "dime a dozen" crowd develop for your platform isn't without its drawbacks. I hear a lot of comments from Windows converts saying that the Mac indy developer scene is smaller than Windows, but the software is almost always of much higher quality and polish. When you make it easy to develop for your platform, you attract lots of developers (good), but the signal-to-noise ratio drops significantly (bad).

    Microsoft's seen the proverbial storm coming, and has been working on an alternative for their aging and clunky Win32 API. Remember a few years back, when the Redmontians announced that Vista (then called Longhorn) would only support .NET programs natively? Back then the world evidently wasn't ready for it. But it's slowly becoming ready, because it's getting harder and harder to find competent C++ programmers.
    Based on what I've heard from Windows developers, Microsoft needed a good Win32 replacement because Win32 sucked. I've seen some Win32 code; it's not pretty, and the way the UI code connects to what's happening on the screen is a complete mystery to me. When I learned Cocoa and Objective-C, the connections were intuitive and obvious.

    Meanwhile, Apple is tied to Objective C. A language few people are willing to learn (remember "Objectionable C"?).
    I'm sure that'll change in February of 2008. Then lots of people will probably be interested in learning Objective-C.

    So, enter .NET. It's reasonably fast (getting faster), it has plenty of mindshare, and most importantly: there isn't much in the way of a legacy code base for it. Supporting .NET doesn't mean hurting your own APIs, its simply an additional one.
    Apple tried that kind of thing before with the Java/Cocoa bridge. It's now been deprecated because it was a pain in the ass to maintain, and no one was using it. A .Net bridge would require that Apple map all the .Net standard classes to their own. They might be able to do toll-free bridging to underlying CoreFoundation types (like dictionaries, strings, etc ...), but I don't know if C# supports the kind of dynamic typing that makes it possible through the C/Objective-C combination. I suspect it does. But it'd still be a lot of work.

    Instead, Apple is offering Python and Ruby Objective-C bridges, and that makes a lot more sense. They've got bridging support for arbitrary scripting languages into the Objective-C runtime, enabling web developers to write native Mac OS X applications using native APIs. Whatever Apple does with respect to additional language support in the future, you can bet Objective-C will be a part of it. The language allows for a lot of dynamism and flexibility, and on top of that, it's a strict C superset, which means that there are no special wrappers required to call down to the POSIX layer. So it's just easy to bridge other languages with it.

    At the end of the day, Objective-C just doesn't get the credit it deserves. It's a very well thought-out language with lots of power. Most people just don't see it because they think Objective-C is Apple's "proprietary" language or some such nonsense.
  • by coolGuyZak ( 844482 ) on Saturday December 01, 2007 @08:04PM (#21548069)

    Really, though, how hard is it to make the mental leap to [myObject insertObject:xxx atPosition:yyy] from myObject->insertObjectAtPosition(xxx,yyy) ? And which is the more readable ?

    As far as a layman is concerned, the former is more readable, but less understandable. I expect most formally educated programmers (meaning college) to prefer the latter. Why? A few reasons:

    • Most institutions teach java, C#, or C++ in their core curriculum. Programmers simply know the syntax better.
    • The programming paradigms of the language are different. In C, you access a method of an object. In Objective-C you send a message to a foreign object. The latter is confusing, given the background of a majority of programmers.
    • The syntax for a function is derived from math (e.g. f(x)), which (AFAIK) most 'programming' curricula have a solid backing in.
    • It's easier to follow the C-style *syntax*. '->' appears like an arrow; it implies direction, unlike the Objective-C messaging syntax.*

    It's not perfect, though. I'd appreciate a few idioms from Objective-C to be "ported" to C#, particularly aspects of RTTI and message passing (functions, delegates, and events in C# are irritating). IMHO, it's far more elegant the Obj-C way.

    I agree with your sentiment that Cocoa development is superior to .Net. My theory of why .Net sucks a nut, comparatively, is as follows:

    • Apple considers the POV of third parties more heavily than MS. It also appears that Apple drinks from its own trough more than MS.
    • It is clear in Apple's documentation and design how they developed something--Apple discusses design patterns, object relationships, and, on occasion, history, in their docs. Meanwhile, MS reinvents the wheel using proprietary, confusing terminology while offering contrived examples that don't express the power of their tech.
    • The more I look at .Net, the more I think that Microsoft sicked their Win32 dev team on the problem. (Consider, for example, events versus callback functions. Compare with Objective C messaging.)

    I still prefer C# and .Net, as sick as that may sound. My background is heavily Java and C# based, which makes the Objective C environment is too clunky for me to like (The @'s, #'s, and XCode-IB code integration are painful). Apple tries to alleviate this by providing (admittedly, great) tools to manage that business, but it always comes off as applying gauze to a gaping chest wound.

    btw, thanks for the link :)

    --
    * Quite frankly, I think both suck. I'd like a strange frankenstein syntax. "myObject <- [message_name arg1: xxx arg2: yyy];" It's more clear than either of the other two, IMHO. Until then, I'll take C-style. As a further aside, I dislike 'dot syntax' wholesale.

  • by duffbeer703 ( 177751 ) * on Saturday December 01, 2007 @08:36PM (#21548235)
    Q: Where do I go to buy OS X for my commodity PC?
    A: I don't.

    Mac OS, iTunes, the iTunes Music store, etc exist for one purpose: to sell Macs, iPhones, iPods, etc. The software simply isn't where the company makes the money. The old regime almost bankrupted Apple by switching to a Microsoft-like software licensing model... so I doubt that Apple would go back to that.
  • by The One and Only ( 691315 ) * <[ten.hclewlihp] [ta] [lihp]> on Saturday December 01, 2007 @10:30PM (#21548901) Homepage
    Apple isn't a hardware company or a software company. They're a systems company. They sell a complete system that they put together. The hardware might have an Intel CPU, an nVidia graphics card or a Marvell WiFi controller, and the software might have a Mach kernel, a KDE-derived web browser, or a GNU compiler, but you don't have to invent your own kitchen sink or air conditioner to build a great house, either.
  • by PhotoGuy ( 189467 ) on Saturday December 01, 2007 @10:45PM (#21548935) Homepage
    Adopting Wine would have its limitations.

    Being a hook for Parallels (as some have suggested) isn't super efficient (a whole virtual PC just to run Windows apps is a lot of overhead; Parallels is awesome, but I doubt Apple is catering specifically to them).

    Emulating or copying in some form or other the hundreds of COM objects isn't practical either.

    But what if they allowed you to pop in your XP (or Vista, ugh) CD, and do an install of XP right inside OS X (a bit Xen-like) and cross-launch apps seamlessly, sharing the file system (in a Crossover Office-like way). That would really rock. (Keeping the Windows apps appropriately sandboxed of course.) Crossover Office (and coLinux, to a degree) achieve inter-OS compatibility by leveraging actual OS code, with native hooks into the host operating system. When it works, it's far more efficient that emulating an entire machine.

    The more I think about it, the more I'm hoping that will be their approach.

    If they can have XP (or Vista, once again, ugh) run, properly licensed, inside/alongside OS X seamlessly, it would bring people to Apple in droves. The switch to X86, allowing people to bail to Windows if their "switch" didn't work, and the efficiency of Parallels on an X86 platform (no emulation of every instruction), truly won over a lot of people to the Mac camp, myself included. This final step would be a major coup, and a natural final step in helping people get away from dependency upon Windows as their sole operating system...

    Keeping my fingers crossed...
  • by Ashmo6ai ( 1190651 ) on Sunday December 02, 2007 @07:02AM (#21550831)
    Or when a 3rd paty developer has been cruising on old frameworks for years, never committing themselves to an upgrade because the so-called "proprietary technology corporation" might be out of business soon. Honestly, Adobe should have seen this coming years ago, but instead they just decidd not to do any real development work on the Mac.
  • by Bert64 ( 520050 ) <bert AT slashdot DOT firenzee DOT com> on Sunday December 02, 2007 @08:48AM (#21551171) Homepage
    Apple sell complete systems...
    A bundle of hardware and software designed to work properly together. That's a big selling point, no hassle with drivers, no hardware conflicts etc.
    Windows could never provide the same level of integration unless microsoft start producing hardware against (remember the jazz platform?) and linux could but would really need the hardware maker to roll their own distro.

    The only other place you get good integration between hardware and software, is at the high end.. Think z/OS, Solaris/Sparc, AIX etc
  • by Anonymous Coward on Sunday December 02, 2007 @10:11AM (#21551425)
    A barrier to sale is "why not", a selling point is "why".
  • It's not quite NIH (Score:3, Insightful)

    by SanityInAnarchy ( 655584 ) <ninja@slaphack.com> on Sunday December 02, 2007 @11:38AM (#21551765) Journal
    Disclaimer: I didn't even read grandparent, and your post seems reasonable enough.

    What I find frustrating about Apple is their need to so tightly control every bit of code they borrow. Look how long it's taken for Webkit to go back into Konqueror... and don't even get me started on BSD/Darwin, whose policy seems to be "Open whenever we feel like it."

    Thus, I suspect that, were Apple to include Wine, they'd fork it, improve it quite a lot (though largely in ways that can't easily be integrated back into Wine), assuming they didn't just fork Crossover, Cedega, or the newest version of Wine that's not LGPL'd. I don't know who to blame for this situation, actually -- it seems like Apple is not playing nice with others, yet with all the code there (well, most of the time), it seems like the projects which got forked could be re-integrating a lot of Apple improvements a lot faster.
  • Comment removed (Score:3, Insightful)

    by account_deleted ( 4530225 ) on Sunday December 02, 2007 @12:14PM (#21551975)
    Comment removed based on user account deletion
  • by 99BottlesOfBeerInMyF ( 813746 ) on Sunday December 02, 2007 @04:16PM (#21553873)

    What I find frustrating about Apple is their need to so tightly control every bit of code they borrow.

    Partly I think this is because Apple relies upon secrecy in order to be competitive against MS's offerings so they don't like people looking at their codebase for future releases, unlike most OSS projects. They tend to wait until they have a project completely and ready to go before they let anyone outside Apple know it exists, which often means they've reworked code for a year and the original projects has a massive load of work dumped upon them at once.

    Look how long it's taken for Webkit to go back into Konqueror...

    That is actually a good example, although a bit clouded by all the nonsense people posted about it, when they had no idea what they're talking about. For some fairly obvious for business reasons Apple could not have let slip to MS they were working on their own browser, lest MS retaliate by canceling IE before it is ready, or introducing a lock-in into IE in some way. When Apple did release the code, they did not well document the evolution of their version. Someone commented on this in a forum and suddenly all sorts of people were claiming Apple was screwing over the Konquerer team, or intentionally obfuscating things, or violating the spirit of the license. Of course at that point, no one had asked anyone at Apple for a better breakdown and when someone did, the guys working at Apple went out of their way to help make things easier for them to re-integrate into KHTML. Mind you, because the Konquerer team was not happy with some of the design decisions Apple had made, they delayed implementing most of them. They had been used to being the only ones contributing and were not used to dealing with major contributions from other coders. Lately, they've come around with Apple and several other making regular contributions (something the Konquerer guys consider the best thing to come out of Apple's adoption) and they're moving to merging the WebKit and KHTML branches back together since Apple's contributions are more useful than the inconvenience caused by Apple's architectural decisions. The delay in getting Apple's changes incorporated, however, can't really be blamed on Apple, more than a few days, for the most part it was a conscious decision by the Konquerer developers.

    ...and don't even get me started on BSD/Darwin, whose policy seems to be "Open whenever we feel like it."

    Credit where credit is due, the BSD license does not require Apple to release their changes at all, so doing so on a delayed timetable is still a lot better than most vendors.

    Thus, I suspect that, were Apple to include Wine, they'd fork it, improve it quite a lot (though largely in ways that can't easily be integrated back into Wine), assuming they didn't just fork Crossover, Cedega, or the newest version of Wine that's not LGPL'd.

    I doubt it. Why do you suppose Apple publishes the Darwin source or any of the other low-level technologies they code (ZeroConf, LaunchD, etc.). They publish them because they actually see the business case for sharing the work with other companies and gaining wider adoption of said technologies. Windows API re-implementations fit in that same category. If possible, Apple would try to share the load with other players. Realistically, I think they would be prevented from using WINE because of their license to MS's code nor do I think they have a lot interest in such a project.

  • by jim3e8 ( 458859 ) on Sunday December 02, 2007 @04:23PM (#21553917) Homepage
    Lastly, "Is Apple planning native PE execution within OSX?" - if they were _planning_ that, they wouldn't include this into a production release of the OS. This means that it's already used for something.

    It's common to include "unused" code and undocumented interfaces in an OS, especially if they are benign.

    For example, Quartz 2D Extreme (QuartzGL) has been available since 10.4 was released, and it's still disabled, and enabling it is not officially supported as it may cause stability issues. Yet they did not simply compile it out, but left it in as an undocumented option.

  • by GPS Pilot ( 3683 ) on Monday December 03, 2007 @03:02PM (#21562743)
    The old regime almost bankrupted Apple by switching to a Microsoft-like software licensing model

    No, the experiment with Mac clones was not at all Microsoft-like. Microsoft makes money every time Dell ships a PC with Windows installed, and Apple lost money every time Power Computing shipped a clone with Mac OS 8 installed.

    The reason is pretty simple. Apple should have priced OS licenses such that it wouldn't matter to its bottom line whether the hardware had been made by Apple or a cloner. The price of an OS license was initially set too low, perhaps out of optimism about the extent to which Apple's hardware sales would be cannibalized. When sales turned out to be cannibalized quite a bit, instead of adjusting to the circumstances, Apple simply killed the cloning program :(

No man is an island if he's on at least one mailing list.

Working...