BOOL ParseCommandLine()

in PPLGuardDll/dllexploit.cpp [589:621]


BOOL ParseCommandLine()
{
    LPWSTR pwszCommandLine = GetCommandLine();
    LPWSTR* argv = NULL;
    int argc = 0;
    int i = 0;

    argv = CommandLineToArgvW(pwszCommandLine, &argc);
    if (!argv)
        return FALSE;

    if (argc < 2)
        return FALSE;

    g_pwszGuid = argv[1];

    for (size_t i = 2; i < argc; i++)
    {
        if (_wcsicmp(argv[i], L"-v") == 0)
            g_bVerbose = TRUE;
        else if (_wcsicmp(argv[i], L"-d") == 0)
        {
            g_bVerbose = TRUE;
            g_bDebug = TRUE;
        }
        else if (_wcsicmp(argv[i], L"-a") == 0)
        {
            g_bHardenAMPPLOnly = TRUE;
        }
    }

    return TRUE;
}