Professional Web Applications Themes

How to link to a dynamic PEF library from xCode? - Mac Programming

Hi, I've been stumped for three days, I've searched all around here and the internet in general, but cannot find a simple how-to on linking to a dynamic PEF library from my mach-o application I'm building in xcode. I have a library that must be in PEF format for copy protection purposes, but I'm building my app in xcode as a mach-o executable. I've heard rumors about some way to put it inside a framework or a bundle, but haven't been able to find out how. Is there any way to do it so that I don't have to use ...

  1. #1

    Default How to link to a dynamic PEF library from xCode?

    Hi, I've been stumped for three days,
    I've searched all around here and the internet in general, but
    cannot find a simple how-to on linking to a dynamic PEF library from
    my mach-o application I'm building in xcode. I have a library that
    must be in PEF format for copy protection purposes, but I'm building
    my app in xcode as a mach-o executable.

    I've heard rumors about some way to put it inside a framework or a
    bundle, but haven't been able to find out how. Is there any way to do
    it so that I don't have to use the bundle api calls to access the
    functions? I.e. I want to just be abe to include the headers, call
    teh functions like normal in the code, and then have the linker hook
    up to the PEF dynamically at runtime.

    Tom
    Jamchild Guest

  2. #2

    Default Re: How to link to a dynamic PEF library from xCode?

    In article <google.com>,
    net (Jamchild) wrote:
     

    You can't link a PEF library into a Mach-O application. (Regardless of what tool
    you use.)

    What you have to do is write glue code to call PEF from Mach-O. Follow the
    sample at
    <http://developer.apple.com/samplecode/CFM_MachO_CFM/CFM_MachO_CFM.html>, which
    shows how to call Mach-O from CFM and vice-versa.

    hth

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  3. #3

    Default Re: How to link to a dynamic PEF library from xCode?

    In article <google.com>,
    net (Jamchild) wrote:
     

    Meeroh already answered your question, but I have one of my own. :) Why
    would a library have to be in PEF format for copy protection purposes?
    You can disassemble a PEF library just as easily as a Mach-O one....

    Just wondering,
    Eric

    --
    Eric Albert stanford.edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  4. #4

    Default Re: How to link to a dynamic PEF library from xCode?

    In article <stanford.edu>,
    Eric Albert <stanford.edu> wrote:
     
    >
    > Meeroh already answered your question, but I have one of my own. :) Why
    > would a library have to be in PEF format for copy protection purposes?
    > You can disassemble a PEF library just as easily as a Mach-O one....[/ref]

    IMO, it works better (PEFViewer), as long as the Mach-O one is not Cocoa
    (Cocoa-classdump)..

    Regards,
    Tom_E

    --
    This address is valid in its unmodified form but expires soon.

    Thomas Guest

  5. #5

    Default Re: How to link to a dynamic PEF library from xCode?

    OK, this seems good, but I can't even get a pointer to the function in
    the PEF library to modify in this way. Anyone know how to do that
    (get a pointer to a function in a PEF library from Mach-o code)?

    I'm trying to use an out-of-the-box copy protection system that works
    on Mac and PC, but the Mac part only works on PEF files - Mach-o
    support isn't coming for another year. So this is why I need to be
    able to build a PEF component and link to it from my Mach-o code.

    Thanks for your help so far - it's great.
    Tom


    Eric Albert <stanford.edu> wrote in message news:<stanford.edu>... 
    >
    > Meeroh already answered your question, but I have one of my own. :) Why
    > would a library have to be in PEF format for copy protection purposes?
    > You can disassemble a PEF library just as easily as a Mach-O one....
    >
    > Just wondering,
    > Eric[/ref]
    Jamchild Guest

  6. #6

    Default Re: How to link to a dynamic PEF library from xCode?

    In article <de>,
    Thomas Engelmeier <com> wrote:
     
    > >
    > > Meeroh already answered your question, but I have one of my own. :) Why
    > > would a library have to be in PEF format for copy protection purposes?
    > > You can disassemble a PEF library just as easily as a Mach-O one....[/ref]
    >
    > IMO, it works better (PEFViewer), as long as the Mach-O one is not Cocoa
    > (Cocoa-classdump)..[/ref]

    otool can do everything PEFViewer can, albeit without a GUI. (I was
    going to say "without a pretty UI", but you can hardly call the
    PEFViewer UI "pretty". :)

    -Eric

    --
    Eric Albert stanford.edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  7. #7

    Default Re: How to link to a dynamic PEF library from xCode?

    In article <stanford.edu>,
    Eric Albert <stanford.edu> wrote:
     

    Except for dumping PEF? :-)

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  8. #8

    Default Re: How to link to a dynamic PEF library from xCode?

    In article <mit.edu>,
    Miro Jurisic <org> wrote:
     
    >
    > You can't link a PEF library into a Mach-O application. (Regardless of what
    > tool
    > you use.)
    >
    > What you have to do is write glue code to call PEF from Mach-O. Follow the
    > sample at
    > <http://developer.apple.com/samplecode/CFM_MachO_CFM/CFM_MachO_CFM.html>,
    > which
    > shows how to call Mach-O from CFM and vice-versa.
    >
    > hth
    >
    > meeroh[/ref]


    Note that, if this PEF file is for the purpose of copy protection, that
    means that all the symbol names will be visible (since the app has to
    find the routines by name in the file), and it would be much easier for
    somebody determined to write their own PEF library with the same entry
    points to replace this file, NO-OPping out your copy protection.
    Glenn Guest

Similar Threads

  1. Link in XCode to an external .o file
    By Wolfgang in forum Mac Programming
    Replies: 3
    Last Post: May 24th, 05:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139