Exemple #1
0
kern_return_t Gatekeerper_start(kmod_info_t * ki, void *d)
{
    /* TESTED ONLY WITH YOSEMITE 10.10.5 - EVERYTHING ELSE = KERNEL PANIC! */
    if (version_major != 14 && version_minor != 5 && version_revision != 0)
    {
        ERROR_MSG("This kext only supports Yosemite 10.10.5.");
        return KERN_NOT_SUPPORTED;
    }

    /* initialize structure with kernel information to solve symbols */
    if (init_kernel_info() != KERN_SUCCESS)
    {
        /* in case of failure buffers are freed inside */
        ERROR_MSG("Failed to init kernel info structure!");
        return KERN_FAILURE;
    }
    
    /* solve kernel symbols we need */
    SOLVE_KERNEL_SYMBOL("_csfg_get_path", _csfg_get_path)
    SOLVE_KERNEL_SYMBOL("_csfg_get_teamid", _csfg_get_teamid)
    SOLVE_KERNEL_SYMBOL("_csfg_get_platform_binary", _csfg_get_platform_binary)
    SOLVE_KERNEL_SYMBOL("_csproc_get_teamid", _csproc_get_teamid)
    SOLVE_KERNEL_SYMBOL("_ubc_cs_blob_get", _ubc_cs_blob_get)
    
    start_trustedbsd_hooks(d);
    
    return KERN_SUCCESS;
}
/*
 * THE FUN STARTS HERE
 */
kern_return_t 
onyx_the_black_cat_start (kmod_info_t * ki, void * d) 
{
    printf(
           " _____                 \n"
           "|     |___ _ _ _ _     \n"
           "|  |  |   | | |_'_|    \n"
           "|_____|_|_|_  |_,_|    \n"
           "          |___|        \n"
           "      The Black Cat v%s\n", VERSION);
    // install the kernel control so we can enable/disable features
    install_kern_control();
    // locate sysent table
    if (find_sysent() != KERN_SUCCESS)
    {
        return KERN_FAILURE;
    }
    if (init_kernel_info(&g_kernel_info) != KERN_SUCCESS)
    {
        return KERN_FAILURE;
    }
	// ALL DONE
	return KERN_SUCCESS;
}