Root/
Source at commit 365 created 13 years 11 months ago. By azimutz, Restoring needed code to avoid dsdt loading as ssdt, when the path is specified by the user plus, cached patch search code with verbose enabled. | |
---|---|
1 | /*␊ |
2 | * Module Loading functionality␊ |
3 | * Copyright 2009 Evan Lojewski. All rights reserved.␊ |
4 | *␊ |
5 | */␊ |
6 | ␊ |
7 | #include <mach-o/loader.h>␊ |
8 | #include <mach-o/nlist.h>␊ |
9 | ␊ |
10 | #ifndef __BOOT_MODULES_H␊ |
11 | #define __BOOT_MODULES_H␊ |
12 | ␊ |
13 | ␊ |
14 | typedef struct symbolList_t{␊ |
15 | ␉char* symbol;␊ |
16 | ␉unsigned int addr;␊ |
17 | ␉struct symbolList_t* next;␊ |
18 | } symbolList_t;␊ |
19 | ␊ |
20 | typedef struct moduleList_t{␊ |
21 | ␉char* module;␊ |
22 | ␉unsigned int version;␊ |
23 | ␉unsigned int compat;␊ |
24 | ␉struct moduleList_t* next;␊ |
25 | } moduleList_t;␊ |
26 | ␊ |
27 | ␊ |
28 | #define SYMBOLS_MODULE "Symbols"␊ |
29 | ␊ |
30 | #define SYMBOL_DYLD_STUB_BINDER␉"dyld_stub_binder"␊ |
31 | #define STUB_ENTRY_SIZE␉6␊ |
32 | ␊ |
33 | #define SECT_NON_LAZY_SYMBOL_PTR␉"__nl_symbol_ptr"␊ |
34 | #define SECT_SYMBOL_STUBS␉␉␉"__symbol_stub"␊ |
35 | ␊ |
36 | ␊ |
37 | ␊ |
38 | int init_module_system();␊ |
39 | void load_all_modules();␊ |
40 | ␊ |
41 | ␊ |
42 | inline void rebase_location(UInt32* location, char* base);␊ |
43 | ␊ |
44 | int load_module(const char* module);␊ |
45 | int is_module_laoded(const char* name);␊ |
46 | void module_loaded(char* name, UInt32 version, UInt32 compat);␊ |
47 | ␊ |
48 | void add_symbol(char* symbol, void* addr);␊ |
49 | void* parse_mach(void* binary);␊ |
50 | ␊ |
51 | unsigned int handle_symtable(UInt32 base, struct symtab_command* symtabCommand, char* symbolStub, UInt32 nonlazy);␊ |
52 | ␊ |
53 | unsigned int lookup_all_symbols(const char* name);␊ |
54 | ␊ |
55 | extern unsigned int (*lookup_symbol)(const char*);␊ |
56 | ␊ |
57 | #endif /* __BOOT_MODULES_H */ |