void switch_to_ctx(struct ctx_s * suivant) { if (current_ctx) { getEBP(current_ctx->ebp_b); getESP(current_ctx->esp_b); } current_ctx = suivant; liste = current_ctx; static short launched =0; static func_t * pf; static void* params; pf = current_ctx->func; params = current_ctx->parameters; if(!current_ctx->launched) { current_ctx->launched=1; launched =1; } setESP(current_ctx->esp_b); setEBP(current_ctx->ebp_b); if(launched) { launched = 0; pf(params); } return 0; }
/* Entrée pour les appels système SYSENTER */ __attribute__ ((noreturn)) void sysenter_handler(regs *dump) { sti(); switch (dump->eax) { /* FOR INSERTING */ default: printf("Appel syscall vers fonction inexistante en %Y:%Y", dump->cs, dump->eip); break; } //dump->eflags &= ~(1 << 6); dump->eflags |= (1 << 6); setESP(dump); restcpu_user(); sysexit(); }