␊ |
#if CONFIG_MODULE_DEBUG␊ |
#define DBG(x...)␉printf(x);␊ |
#define DBGPAUSE()␉getc()␊ |
#define DBGPAUSE()␉getchar()␊ |
#else␊ |
#define DBG(x...)␊ |
#define DBGPAUSE()␊ |
|
else␊ |
{␊ |
// The module does not have a valid start function␊ |
printf("Unable to start %s\n", SYMBOLS_MODULE); getc();␊ |
printf("Unable to start %s\n", SYMBOLS_MODULE); getchar();␊ |
}␉␉␊ |
␉␉}␉␉␊ |
␉}␊ |
|
␉␉else // The module does not have a valid start function. This may be a library.␊ |
␉␉{␊ |
␉␉␉printf("WARNING: Unable to start %s\n", module);␊ |
␉␉␉getc();␊ |
␉␉␉getchar();␊ |
␉␉}␊ |
#else␊ |
␉␉else msglog("WARNING: Unable to start %s\n", module);␊ |
|
␉␊ |
#if CONFIG_MODULE_DEBUG␊ |
␉verbose("Unable to locate symbol %s\n", name);␊ |
␉getc();␊ |
␉getchar();␊ |
#endif␊ |
␉␊ |
␉if(strcmp(name, VOID_SYMBOL) == 0) return 0xFFFFFFFF;␊ |
|
␉else␊ |
␉{␊ |
␉␉verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic);␊ |
␉␉//getc();␊ |
␉␉//getchar();␊ |
␉␉return NULL;␊ |
␉}␊ |
␉␊ |
|
␉/*if(((struct mach_header*)binary)->filetype != MH_DYLIB)␊ |
␉ {␊ |
␉ printf("Module is not a dylib. Unable to load.\n");␊ |
␉ getc();␊ |
␉ getchar();␊ |
␉ return NULL; // Module is in the incorrect format␊ |
␉ }*/␊ |
␉␊ |
|
␉␉␉␉else␊ |
␉␉␉␉{␊ |
␉␉␉␉␉printf("Unable to bind symbol %s\n", symbolName);␊ |
␉␉␉␉␉getc();␊ |
␉␉␉␉␉getchar();␊ |
␉␉␉␉}␊ |
␉␉␉␉␊ |
␉␉␉␉segmentAddress += sizeof(void*);␊ |
|
␉␉␉␉else␊ |
␉␉␉␉{␊ |
␉␉␉␉␉printf("Unable to bind symbol %s\n", symbolName);␊ |
␉␉␉␉␉getc();␊ |
␉␉␉␉␉getchar();␊ |
␉␉␉␉}␊ |
␊ |
␉␉␉␉segmentAddress += tmp + sizeof(void*);␊ |
|
␉␉␉␉else␊ |
␉␉␉␉{␊ |
␉␉␉␉␉printf("Unable to bind symbol %s\n", symbolName);␊ |
␉␉␉␉␉getc();␊ |
␉␉␉␉␉getchar();␊ |
␉␉␉␉}␊ |
␉␉␉␉segmentAddress += (immediate * sizeof(void*)) + sizeof(void*);␊ |
␉␉␉␉␊ |
|
␉␉␉␉else␊ |
␉␉␉␉{␊ |
␉␉␉␉␉printf("Unable to bind symbol %s\n", symbolName);␊ |
␉␉␉␉␉getc();␊ |
␉␉␉␉␉getchar();␊ |
␉␉␉␉}␊ |
␉␉␉␉break;␊ |
␉␉}␊ |
|
␉␊ |
#if CONFIG_MODULE_DEBUG␊ |
␉//print_hook_list();␊ |
␉//getc();␊ |
␉//getchar();␊ |
#endif␊ |
␉␊ |
}␊ |
|
void dyld_stub_binder()␊ |
{␊ |
␉printf("ERROR: dyld_stub_binder was called, should have been take care of by the linker.\n");␊ |
␉getc();␊ |
␉getchar();␊ |
}␊ |
␊ |
#else /* CONFIG_MODULES */␊ |