Exemplo n.º 1
0
int main(int argc, char **argv, char **envp)
{
    /* First check whether we're about to start a VM: */
    bool fStartVM = false;
    /* In separate process: */
    bool fSeparateProcess = false;
    for (int i = 1; i < argc && !(fStartVM && fSeparateProcess); ++i)
    {
        /* NOTE: the check here must match the corresponding check for the
         * options to start a VM in main.cpp and VBoxGlobal.cpp exactly,
         * otherwise there will be weird error messages. */
        if (   !MyStrCmp(argv[i], "--startvm")
            || !MyStrCmp(argv[i], "-startvm"))
        {
            fStartVM = true;
        }
        else if (   !MyStrCmp(argv[i], "--separate")
                 || !MyStrCmp(argv[i], "-separate"))
        {
            fSeparateProcess = true;
        }
    }

    uint32_t fFlags = (fStartVM && !fSeparateProcess) ? 0 : SUPSECMAIN_FLAGS_DONT_OPEN_DEV;

#ifdef VIRTUALBOX_VM
    return SUPR3HardenedMain("VirtualBoxVM",
                             fFlags | SUPSECMAIN_FLAGS_TRUSTED_ERROR | SUPSECMAIN_FLAGS_OSX_VM_APP,
                             argc, argv, envp);
#else
    return SUPR3HardenedMain("VirtualBox", fFlags | SUPSECMAIN_FLAGS_TRUSTED_ERROR, argc, argv, envp);
#endif
}
int main(int argc, char **argv, char **envp)
{
    /*
     * First check whether we're about to start a VM.
     */
    uint32_t fFlags = SUPSECMAIN_FLAGS_DONT_OPEN_DEV;
    for (int i = 1; i < argc; i++)
        /* NOTE: the check here must match the corresponding check for the
         * options to start a VM in main.cpp and VBoxGlobal.cpp exactly,
         * otherwise there will be weird error messages. */
        if (   !::strcmp(argv[i], "--startvm")
            || !::strcmp(argv[i], "-startvm"))
        {
            fFlags &= ~SUPSECMAIN_FLAGS_DONT_OPEN_DEV;
            break;
        }

    return SUPR3HardenedMain("VirtualBox", fFlags, argc, argv, envp);
}
Exemplo n.º 3
0
int main(int argc, char **argv, char **envp)
{
    return SUPR3HardenedMain("VBoxVMMPreload", 0, argc, argv, envp);
}
int main(int argc, char **argv, char **envp)
{
    return SUPR3HardenedMain(PROGRAM_NAME_STR, SUPSECMAIN_FLAGS_LOC_TESTCASE, argc, argv, envp);
}
Exemplo n.º 5
0
int main(int argc, char **argv, char **envp)
{
    return SUPR3HardenedMain(PROGRAM_NAME_STR, 0, argc, argv, envp);
}
int main(int argc, char **argv, char **envp)
{
    return SUPR3HardenedMain("VBoxHeadless", 0, argc, argv, envp);
}