Raychan1 / symbiosis-au-vst

Automatically exported from code.google.com/p/symbiosis-au-vst
0 stars 0 forks source link

Safer code to find my own image? #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is probably safer because it uses APIs. I believe the _dyld* functions are 
considered SPIs.

#include <stdio.h>
#include <mach-o/dyld.h>
#include <assert.h>

int main(void) {
    NSSymbol symbol;
    NSModule module;

    symbol = NSLookupAndBindSymbol("_printf");
    assert(symbol != NULL);
    module = NSModuleForSymbol(symbol);
    assert(module != NULL);
    printf("Module library name: %s\n", NSLibraryNameForModule(module));
    return 0;
}

Original issue reported on code.google.com by malstro...@gmail.com on 1 Jan 2010 at 11:30

GoogleCodeExporter commented 8 years ago
Well, my old solution still works, after all these years.

Original comment by malstro...@gmail.com on 30 Aug 2011 at 10:25