25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: file_macho.c,v 1.1 2007/04/10 16:33:44 debug Exp $ |
* $Id: file_macho.c,v 1.2 2007/06/15 17:02:39 debug Exp $ |
29 |
* |
* |
30 |
* Mach-O file support. |
* Mach-O file support. |
31 |
*/ |
*/ |
218 |
debug("symtable: %i symbols @ 0x%x (strings at " |
debug("symtable: %i symbols @ 0x%x (strings at " |
219 |
"0x%x)\n", nsyms, symoff, stroff); |
"0x%x)\n", nsyms, symoff, stroff); |
220 |
|
|
221 |
symbols = malloc(12 * nsyms); |
CHECK_ALLOCATION(symbols = malloc(12 * nsyms)); |
|
if (symbols == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
222 |
fseek(f, symoff, SEEK_SET); |
fseek(f, symoff, SEEK_SET); |
223 |
fread(symbols, 1, 12 * nsyms, f); |
fread(symbols, 1, 12 * nsyms, f); |
224 |
|
|
225 |
strings = malloc(strsize); |
CHECK_ALLOCATION(strings = malloc(strsize)); |
|
if (strings == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
226 |
fseek(f, stroff, SEEK_SET); |
fseek(f, stroff, SEEK_SET); |
227 |
fread(strings, 1, strsize, f); |
fread(strings, 1, strsize, f); |
228 |
|
|