void RSManager::showStatus() {
	console.add(format("%s %s", INTERCEPTOR_NAME, GeDoSaToVersion()));
	if(scaler) scaler->showStatus();
	else console.add("Not downsampling");
	console.add(format("Plugin loaded: %s", plugin->getName().c_str()));
	plugin->reportStatus();
}
Beispiel #2
0
extern "C" __declspec(dllexport) void GeDoSaToInit() {
	// read install location from registry
	getInstallDirectory();
	OutputDebugString("GeDoSaTo: Got install dir");

	// loaded in GeDoSaToTool, stay in memory
	if(getExeFileName() == "GeDoSaToTool") {
		OutputDebugString("GeDoSaTo: Tool mode");
		g_tool = true;
		return;
	}

	g_active = true;
	OutputDebugString(format("GeDoSaTo: Active on %s", getExeFileName()).c_str());

	// initialize log
	string logFn = format("logs\\%s_%s.log", getExeFileName().c_str(), getTimeString().c_str());
	std::replace(logFn.begin(), logFn.end(), ':', '-');
	std::replace(logFn.begin(), logFn.end(), ' ', '_');
	logFn = getInstalledFileName(logFn);
	fopen_s(&g_oFile, logFn.c_str(), "w");
	if(!g_oFile) OutputDebugString(format("GeDoSaTo: Error opening log fn %s", logFn.c_str()).c_str());
	else OutputDebugString(format("GeDoSaTo: Opening log fn %s, handle: %p", logFn.c_str(), g_oFile).c_str());
	OutputDebugString("GeDoSaTo: Log file initialized, let that take over");

	// startup
	SDLOG(-1, "===== %s =====\n", getTimeString().c_str());
	SDLOG(-1, "===== start "INTERCEPTOR_NAME" %s = fn: %s\n", GeDoSaToVersion(), getExeFileName().c_str());
	SDLOG(-1, "===== installation directory: %s\n", getInstallDirectory().c_str());

	// load settings
	Settings::get().load();
	Settings::get().report();

	KeyActions::get().load();
	KeyActions::get().report();

	// early steam dll loading
	if(!Settings::get().getPreventSteamOverlay() && Settings::get().getLoadSteamOverlayEarly()) {
		SDLOG(2, "Attempting to pre-load Steam overlay dll.\n");
		LoadLibrary("gameoverlayrenderer.dll");
	}

	// early d3d loading
	if(Settings::get().getLoadD3DEarly()) {
		SDLOG(2, "Early d3d loading.\n");
		auto dllname = getSystemDllName("d3d9.dll");
		LoadLibrary(dllname.c_str());
	}

	// detour
	startDetour();
}
Beispiel #3
0
BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, PVOID pvReserved) {	
	if(dwReason == DLL_PROCESS_ATTACH) {
		OutputDebugString("GeDoSaTo: startup");

		// read install location from registry
		getInstallDirectory();
		OutputDebugString("GeDoSaTo: Got install dir");

		// don't attach to processes on the blacklist / not on the whitelist
		if(getUseBlacklist() ? onList(getExeFileName(), "blacklist.txt") : !onList(getExeFileName(), "whitelist.txt")) {
			OutputDebugString("GeDoSaTo: blacklisted / not whitelisted");
			if(getExeFileName() == "GeDoSaToTool") return true;
			return true;
		}
		g_active = true;
		OutputDebugString("GeDoSaTo: Active");
		
		// initialize log
		string logFn = format("logs\\%s_%s.log", getExeFileName().c_str(), getTimeString().c_str());
		std::replace(logFn.begin(), logFn.end(), ':', '-');
		std::replace(logFn.begin(), logFn.end(), ' ', '_');
		logFn = getInstalledFileName(logFn);
		fopen_s(&g_oFile, logFn.c_str(), "w");
		if(!g_oFile) OutputDebugString(format("GeDoSaTo: Error opening log fn %s", logFn.c_str()).c_str());
		else OutputDebugString(format("GeDoSaTo: Opening log fn %s, handle: %p", logFn.c_str(), g_oFile).c_str());
		OutputDebugString("GeDoSaTo: Log file initialized, let that take over");

		// startup
		sdlogtime(-1);
		SDLOG(-1, "===== start "INTERCEPTOR_NAME" %s = fn: %s\n", GeDoSaToVersion(), getExeFileName().c_str());
		SDLOG(-1, "===== installation directory: %s\n", getInstallDirectory().c_str());

		// load settings
		Settings::get().load();
		Settings::get().report();
		 
		KeyActions::get().load();
		KeyActions::get().report();

		if(!Settings::get().getPreventSteamOverlay() && Settings::get().getLoadSteamOverlayEarly()) {
			SDLOG(2, "Attempting to pre-load Steam overlay dll.\n");
			LoadLibrary("gameoverlayrenderer.dll");
		}

		if(Settings::get().getLoadD3DEarly()) {
			SDLOG(2, "Early d3d loading.\n");
			auto dllname = getSystemDllName("d3d9.dll");
			LoadLibrary(dllname.c_str());
		}

		// detour
		startDetour();
		return true;
	}
	if(dwReason == DLL_PROCESS_DETACH && g_active) {
		Settings::get().shutdown();
		endDetour();
		SDLOG(-1, "===== end =\n");
		fclose(g_oFile);
	}
    return false;
}