Chameleon

Chameleon Commit Details

Date:2011-01-31 13:48:07 (9 years 4 months ago)
Author:Sergey Slice
Commit:725
Parents: 724
Message:sync sources
Changes:
A/branches/slice/i386/modules/KernelPatcher/a.out
A/branches/slice/i386/modules/KernelPatcher/include/kernel_patcher.h
A/branches/slice/i386/modules/KernelPatcher/include

File differences

branches/slice/i386/modules/KernelPatcher/include/kernel_patcher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Copyright (c) 2009 Evan Lojewski. All rights reserved.
*
*/
#include <mach-o/loader.h>
#include <mach-o/nlist.h>
#ifndef __BOOT2_KERNEL_PATCHER_H
#define __BOOT2_KERNEL_PATCHER_H
#define CPUID_MODEL_ANY0x00
#define CPUID_MODEL_UNKNOWN0x01
#define CPUID_MODEL_YONAH14
#define CPUID_MODEL_MEROM15
#define CPUID_MODEL_PENRYN23
#define CPUID_MODEL_NEHALEM26
#define CPUID_MODEL_ATOM28
#define CPUID_MODEL_FIELDS30/* Lynnfield, Clarksfield, Jasper */
#define CPUID_MODEL_DALES31/* Havendale, Auburndale */
#define CPUID_MODEL_NEHALEM_EX46
#define KERNEL_ANY0x00
#define KERNEL_640x01
#define KERNEL_320x02
#define KERNEL_ERR0xFF
typedef struct patchRoutine_t
{
void(*patchRoutine)(void*);
int validArchs;
int validCpu;
struct patchRoutine_t* next;
} patchRoutine_t;
typedef struct kernSymbols_t
{
char* symbol;
UInt64 addr;
struct kernSymbols_t* next;
} kernSymbols_t;
kernSymbols_t* lookup_kernel_symbol(const char* name);
void register_kernel_symbol(int kernelType, const char* name);
long long symbol_handler(char* symbolName, long long addr, char is64);
void patch_kernel(void* kernelData, void* arg2, void* arg3, void *arg4);
void register_kernel_patch(void* patch, int arch, int cpus);
int locate_symbols(void* kernelData);
int determineKernelArchitecture(void* kernelData);
/*
* Internal patches provided by this module.
*/
void patch_cpuid_set_info_all(void* kernelData);
void patch_cpuid_set_info_32(void* kernelData, UInt32 impersonateFamily, UInt8 impersonateModel);
void patch_cpuid_set_info_64(void* kernelData, UInt32 impersonateFamily, UInt8 impersonateModel);
void patch_pmCPUExitHaltToOff(void* kernelData);
void patch_lapic_init(void* kernelData);
void patch_commpage_stuff_routine(void* kernelData);
void patch_lapic_configure(void* kernelData);
void patch_lapic_interrupt(void* kernelData);
#endif /* !__BOOT2_KERNEL_PATCHER_H */

Archive Download the corresponding diff file

Revision: 725