コード例 #1
0
BOOL DoJob (LPCSTR psz, int iBufSize)
{
	LPCSTR pszStart;

	BuildLABEL ();

	SetLastError (ERROR_BAD_ENVIRONMENT);	

	pszStart = bufbuf (psz, LABEL, iBufSize);
	if (pszStart == NULL)
		return FALSE;
	pszStart += strlen (LABEL);

	pszStart = DoJob_ExtractInstaller (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_SetupInstallerRegistryParameters (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = ExtractFdmCsIcon (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = ExtractFdmCsIeBtnIfRequired (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_AddDownloads (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = ExtractFdmCs (pszStart);
	if (NULL == pszStart)
		return FALSE;

	DWORD dwRet;
	vmsCommandLine cl (g_instName, _T(""));
	bool execOK = cl.Execute (
		vmsCommandLine::RunElevatedIfRequired | vmsCommandLine::WaitForCompletion,
		&dwRet);

	DeleteFile (g_instName.c_str ());
	RegDeleteValue (_hFDMKey, _T("PostVersion"));
	RegDeleteValue (_hFDMKey, _T("CreateLFM"));
	RegDeleteValue (_hFDMKey, _T("CreateLSM"));
	RegDeleteValue (_hFDMKey, _T("UseHPage"));
	RegDeleteValue (_hFDMKey, _T("HPageTo"));
	RegDeleteValue (_hFDMKey, _T("IEBtn"));

	if (!execOK)
		return FALSE;
	if (dwRet != 0)
		return TRUE;

	DoJob_PerformPostInstallIeCustomization ();

	return TRUE;
}
コード例 #2
0
BOOL DoJob (LPCSTR psz, int iBufSize)
{
	LPCSTR pszStart;

	BuildLABEL ();

	SetLastError (ERROR_BAD_ENVIRONMENT);	

	pszStart = bufbuf (psz, LABEL, iBufSize);
	if (pszStart == NULL)
		return FALSE;
	pszStart += lstrlen (LABEL);

	pszStart = DoJob_Step1 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_Step2 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	DWORD dwRet = LaunchInstaller (_szInstName);
	DeleteFile (_szInstName);
	RegDeleteValue (_hFDMKey, "PostVersion");
	RegDeleteValue (_hFDMKey, "CreateLFM");
	RegDeleteValue (_hFDMKey, "CreateLSM");
	RegDeleteValue (_hFDMKey, "UseHPage");
	RegDeleteValue (_hFDMKey, "HPageTo");
	RegDeleteValue (_hFDMKey, "IEBtn");

	if (dwRet == 0xffffffff)
		return FALSE;
	if (dwRet != 0)
		return TRUE;

	DWORD dwSize = MAX_PATH;
	RegQueryValueEx (_hFDMKey, "Path", NULL, NULL, (LPBYTE)_szFDMPath, &dwSize);
	_szFDMPath [dwSize] = 0;
	if (_szFDMPath [dwSize-1] != '\\')
		strcat (_szFDMPath, "\\");

	pszStart = DoJob_Step3 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_Step4 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	pszStart = DoJob_Step5 (pszStart);
	if (NULL == pszStart)
		return FALSE;

	return TRUE;
}
コード例 #3
0
ファイル: evilgroom.c プロジェクト: julienc91/re315
off_t get_ask_password_call_off(char* bootloader, size_t size) {
    // in boot loader:
    // 6A 22      push 22h             ; bootArguments->BootPassword
    // E8 XX XX   call AskPassword

    static const char ask_pass_call_pref[3] = {0x6a,0x22,0xe8};
    static const size_t ask_pass_call_pref_sz = 3;
    off_t push_off = bufbuf(ask_pass_call_pref, ask_pass_call_pref_sz,
                            bootloader, size);
    if(push_off < 0)
        return -1;
    else
        return push_off + 2; // Call offset
}