Chameleon

Chameleon Commit Details

Date:2010-08-12 08:34:52 (13 years 8 months ago)
Author:Evan Lojewski
Commit:356
Parents: 355
Message:Fixed date, changed one or two things
Changes:
M/branches/meklort/i386/boot2/modules.c

File differences

branches/meklort/i386/boot2/modules.c
11
2
2
33
44
55
......
8888
8989
9090
91
91
9292
9393
9494
......
132132
133133
134134
135
135
136136
137137
138138
......
190190
191191
192192
193
193
194194
195195
196196
......
266266
267267
268268
269
270
269
271270
272271
273272
......
856855
857856
858857
859
858
860859
861860
862861
/*
* Copyright 2009 Evan Lojewski. All rights reserved.
* Copyright 2010 Evan Lojewski. All rights reserved.
*
*/
char* nonlazy = NULL;
//char* nonlazy_variables = NULL;
// TODO convert all of the structs a union
// TODO convert all of the structs to a union
struct load_command *loadCommand = NULL;
struct dylib_command* dylibCommand = NULL;
struct dyld_info_command* dyldInfoCommand = NULL;
section = binary + binaryIndex + sizeof(struct segment_command);
while(sections)
{
// Look for the __symbol_stub section
// Look for some sections and save the addresses
if(strcmp(section->sectname, SECT_NON_LAZY_SYMBOL_PTR) == 0)
{
/*printf("\tSection non lazy pointers at 0x%X, %d symbols\n",
case LC_LOAD_DYLIB:
case LC_LOAD_WEAK_DYLIB ^ LC_REQ_DYLD:
dylibCommand = binary + binaryIndex;
dylibCommand = binary + binaryIndex;
char* module = binary + binaryIndex + ((UInt32)*((UInt32*)&dylibCommand->dylib.name));
// =dylibCommand->dylib.current_version;
// =dylibCommand->dylib.compatibility_version;
// To satisfy cicular deps, the module_loaded command shoudl be run before the module init();
// Notify the system that it was laoded
module_loaded(moduleName, moduleVersion, moduleCompat);
return module_start;
unsigned int lookup_all_symbols(const char* name)
{
unsigned int addr = 0xFFFFFFFF;
if(lookup_symbol)
if(lookup_symbol && lookup_symbol != 0xFFFFFFFF)
{
addr = lookup_symbol(name);
if(addr != 0xFFFFFFFF)

Archive Download the corresponding diff file

Revision: 356