Improvements:

- Added a new way of dll injection. The game is started through OTM, thus OTM inject the dll directly.
This commit is contained in:
code@koerner-de.net
2011-11-18 10:28:13 +00:00
parent fab93611c1
commit 199383dacb
38 changed files with 1851 additions and 225 deletions
+20 -36
View File
@@ -35,42 +35,6 @@ OTM_Language::OTM_Language(const wxString &name)
LastError.Empty();
}
//#define LAST_USED_LANGUAGE_FILE "OTM_LastUsedLanguage.txt"
/*
int OTM_Language::LoadCurrentLanguage(void)
{
wxFile file;
if (!file.Access( LAST_USED_LANGUAGE_FILE, wxFile::read)) return -1;
file.Open( LAST_USED_LANGUAGE_FILE, wxFile::read);
if (!file.IsOpened()) return -1;
unsigned len = file.Length();
char* buffer;
try {buffer = new char [len+1];}
catch (...) {return -1;}
unsigned int result = file.Read( buffer, len);
file.Close();
if (result != len) return -1;
buffer[len]=0;
wxString lang = buffer;
delete [] buffer;
return LoadLanguage( lang, false);
}
int OTM_Language::SaveCurrentLanguage(void)
{
wxFile file;
//if (!file.Access( LAST_USED_LANGUAGE_FILE, wxFile::write)) return -1;
file.Open( LAST_USED_LANGUAGE_FILE, wxFile::write);
if (!file.IsOpened()) return -1;
file.Write( CurrentLanguage.char_str(), CurrentLanguage.Len());
return 0;
}
*/
int OTM_Language::GetLanguages(wxArrayString &lang)
{
@@ -222,6 +186,9 @@ int OTM_Language::LoadLanguage(const wxString &name)
CheckEntry( command, msg, MenuHelp)
CheckEntry( command, msg, MenuAbout)
CheckEntry( command, msg, MenuAcknowledgement)
CheckEntry( command, msg, MenuStartGame)
CheckEntry( command, msg, MenuStartGameCMD)
CheckEntry( command, msg, MenuUseHook)
CheckEntry( command, msg, MenuAddGame)
CheckEntry( command, msg, MenuDeleteGame)
CheckEntry( command, msg, MenuLoadTemplate)
@@ -242,12 +209,17 @@ int OTM_Language::LoadLanguage(const wxString &name)
CheckEntry( command, msg, CheckBoxSaveAllTextures)
CheckEntry( command, msg, TextCtrlSavePath)
CheckEntry( command, msg, SelectLanguage)
CheckEntry( command, msg, StartGame)
CheckEntry( command, msg, CommandLine)
CheckEntry( command, msg, ChooseGame)
CheckEntry( command, msg, DeleteGame)
CheckEntry( command, msg, GameAlreadyAdded)
CheckEntry( command, msg, ExitGameAnyway)
CheckEntry( command, msg, NoComment)
CheckEntry( command, msg, Author)
CheckEntry( command, msg, Error_GameIsHooked)
CheckEntry( command, msg, Error_ProcessNotStarted)
CheckEntry( command, msg, Error_RemoveHook)
CheckEntry( command, msg, Error_FileNotSupported)
CheckEntry( command, msg, Error_FktNotFound)
CheckEntry( command, msg, Error_DLLNotFound)
@@ -288,6 +260,11 @@ int OTM_Language::LoadDefault(void)
MenuHelp = "Help";
MenuAbout = "About";
MenuAcknowledgement = "Acknowledgement";
MenuStartGame = "Start game through OTM";
MenuStartGameCMD = "Start game through OTM (with command line)";
MenuUseHook = "Use global hook";
MenuAddGame = "Add game";
MenuDeleteGame = "Delete game";
MenuLoadTemplate = "Load template";
@@ -314,6 +291,9 @@ int OTM_Language::LoadDefault(void)
SelectLanguage = "Select a language.";
StartGame = "Select the game to start.";
CommandLine = "Set command line arguments.";
ChooseGame = "Select a game binary.";
DeleteGame = "Select the games to be deleted.";
GameAlreadyAdded = "Game has been already added.";
@@ -321,6 +301,10 @@ int OTM_Language::LoadDefault(void)
NoComment = "No comment.";
Author = "Author: ";
Error_GameIsHooked = "The global hook is active and this game will be injected! Please delete the game from the list or disable the hook.";
Error_ProcessNotStarted = "The game could not be started.";
Error_RemoveHook = "Removing the Hook while a game is running might lead to crash.";
Error_FileNotSupported = "This file type is not supported:\n";
Error_DLLNotFound = "Could not load the dll.\nThe dll injection won't work.\nThis might happen if D3DX9_43.dll (32bit) is not installed on your system.\nPlease install the newest DirectX End-User Runtime Web Installer.";
Error_FktNotFound = "Could not load function out of dll.\nThe dll injection won't work.";