View Full Version : Hook add-on (change dll name etc...)
mlitn
19th October 2004, 09:48
THIS GOES TOGETHER WITH 1.6.3.4 HOOK
This will give you the ability to rename the dll to whatever you want and then set the name in the config and run it.
Evilconfig part:
open your IDC_LOADER:
Add a Sample edit box (just copy the one for path to AA) with ID: IDC_EDIT2
Add a new button to select folder (copy AA one) with ID: IDC_BUTTON3
make a Sample edit box (just copy the one for path to AA) with ID: IDC_EDIT3
Loaderdlg.cpp:
Search for:
Code:
, m_PathToGame(_T(""))
add:
Code:
, m_PathToEvilhack(_T(""))
, m_Evildll(_T(""))
Search for:
Code:
DDX_Text(pDX, IDC_EDIT2, m_PathToGame);
add:
Code:
DDX_Text(pDX, IDC_EDIT2, m_PathToEvilhack);
DDX_Text(pDX, IDC_EDIT3, m_Evildll);
Search for:
Code:
ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton1)
or
Code:
ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
(depending if you have other buttons yet like in morgan his source (just edit the number if you have 3 buttons already)
add:
Code:
ON_BN_CLICKED(IDC_BUTTON3, OnBnClickedButton3)
Search for:
Code:
m_PathToGame = theApp.m_Settings.m_PathToGame;
add:
Code:
m_PathToEvilhack = theApp.m_Settings.m_PathToEvilhack;
m_Evildll = theApp.m_Settings.m_Evildll;
Search for:
Code:
strcat(EvilhackDll, "DLLNAME.dll");
replace by:
Code:
strcat(EvilhackDll, theApp.m_Settings.m_Evildll);
search for:
Code:
void CLoaderDlg::OnTimer(UINT nIDEvent)
before, add:
Code:
void CLoaderDlg::OnBnClickedButton3()
{
CFileDialog *myDialog = new CFileDialog(TRUE, NULL, NULL, OFN_PATHMUSTEXIST | OFN_ENABLESIZING | OFN_EXPLORER, "All Files (*.*)|*.*||", this);
if (myDialog->DoModal() == IDOK)
{
m_PathToEvilhack = myDialog->GetPathName();
m_Evildll = myDialog->GetFileName();
unsigned int i = m_PathToEvilhack.GetLength();
unsigned int u = m_Evildll.GetLength();
while (m_PathToEvilhack.GetAt(i) != '\\')
{
m_PathToEvilhack.Delete(i, 1);
i--;
}
strcpy(theApp.m_Settings.m_PathToEvilhack, m_PathToEvilhack.GetBuffer());
strcpy(theApp.m_Settings.m_Evildll, m_Evildll.GetBuffer());
UpdateData(FALSE);
}
}
Loaderdlg.h:
Search for:
Code:
afx_msg void OnBnClickedButton1();
or
Code:
afx_msg void OnBnClickedButton2();
or whatever button you have already;
add:
Code:
afx_msg void OnBnClickedButton3();
Search for:
Code:
CString m_PathToGame;
add:
Code:
CString m_PathToEvilhack;
CString m_Evildll;
Evilsettings.h:
Search for:
Code:
char m_PathToGame[MAX_PATH];
char m_PathToEvilhack[MAX_PATH];
add:
Code:
char m_Evildll[MAX_PATH];
Evilsettings.cpp:
Search for:
Code:
GetPrivateProfileString("Evilhack", "m_PathToGame", "", m_PathToGame, sizeof(m_PathToGame), Path);
add:
Code:
GetPrivateProfileString("Evilhack", "m_PathToEvilhack", "", m_PathToEvilhack, sizeof(m_PathToEvilhack), Path);
GetPrivateProfileString("Evilhack", "m_Evildll", "", m_Evildll, sizeof(m_Evildll), Path);
Search for:
Code:
WritePrivateProfileString("Evilhack", "m_PathToGame", m_PathToGame, Path);
add:
Code:
WritePrivateProfileString("Evilhack", "m_PathToEvilhack", m_PathToEvilhack, Path);
WritePrivateProfileString("Evilhack", "m_Evildll", m_Evildll, Path);
itwasfunny
19th October 2004, 12:17
Add a Sample edit box (just copy the one for path to AA) with ID: IDC_EDIT2
Add a new button to select folder (copy AA one) with ID: IDC_BUTTON3
make a Sample edit box (just copy the one for path to AA) with ID: IDC_EDIT3
Its a nice tutorial but i dont understand this
Hum?!
mlitn
19th October 2004, 12:59
go to resource view, open your loader, add a new sample edit box, a new button and another new sample edit box and give them the names: IDC_EDIT2, IDC_BUTTON3 and IDC_EDIT3
gil
19th October 2004, 13:03
Added to the EvilHack Modification thread.
itwasfunny
19th October 2004, 14:36
1)resource view (this is in VB?)
2)open your loader (this is loaderDlg.cpp?)
3)add a new sample edit box-»IDC_EDIT2
add again -»IDC_BUTTON3
add again -»IDC_EDIT3
What is a sample?
sharknaww
19th October 2004, 16:27
1)resource view (this is in VB?)
2)open your loader (this is loaderDlg.cpp?)
3)add a new sample edit box-»IDC_EDIT2
add again -»IDC_BUTTON3
add again -»IDC_EDIT3
What is a sample?
You open rescource.rc in notepad....etc
Loader can bo found in the project.
mlitn
19th October 2004, 19:37
1)resource view (this is in VB?)
2)open your loader (this is loaderDlg.cpp?)
3)add a new sample edit box-»IDC_EDIT2
add again -»IDC_BUTTON3
add again -»IDC_EDIT3
What is a sample?
http://gamextreme00.free.fr/voila.JPG
same with button and 2nd edit box (but other names)
itwasfunny
19th October 2004, 21:51
Thx alot man!!! :D
Question:
I can make this
open your IDC_LOADER:
Add a Sample edit box (just copy the one for path to AA) with ID: IDC_EDIT2
Add a new button to select folder (copy AA one) with ID: IDC_BUTTON3
make a Sample edit box (just copy the one for path to AA) with ID: IDC_EDIT3
after put the next codes in my source right?
I don´t have this in LoaderDlg.cpp in PK Source:
Search for:
Code:
DDX_Text(pDX, IDC_EDIT2, m_PathToGame);
i only have DDX_Text(pDX, IDC_EDIT1, m_PathToGame);
mlitn
19th October 2004, 22:23
make new one and call it IDC_EDIT2 (or copy other one and rename the copy to IDC_EDIT2 (should have that name already if you copied it btw))
EDIT: 200 post
itwasfunny
19th October 2004, 22:28
strcat(EvilhackDll, "DLLNAME.dll"); -» I cant found this!!!
mlitn
19th October 2004, 22:41
you need to have added 1.6.3.4 hook first... (see other post)
EDIT: http://www.mpcforum.com/showthread.php?t=60735
^^ this one
itwasfunny
19th October 2004, 22:48
You say:
Search for:
Quote:
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
ZeroMemory(&pi, sizeof(pi));
si.cb = sizeof(si);
if (CreateProcess(NULL, StartGameCommand, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{
NULL;
#ifndef _DEBUG //keep evilconfig loaded for debug purposes
PostMessage(WM_QUIT, 0, 0);
#endif
}
else
MessageBox("Error creating process", "error", MB_OK);
Replace with:
Quote:
strcpy(EvilhackDll, theApp.m_Settings.m_PathToEvilhack);
strcat(EvilhackDll, "DLLNAME.dll");
if (SpawnProcess(StartGameCommand, EvilhackDll))
PostMessage(WM_QUIT, 0, 0);
else
MessageBox("Error creating process", "error", MB_OK);
Search for:
Quote:
#ifdef _DEBUG
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, CurrentEntry.th32ProcessID);
SuspendThread(hProcess);
if (hProcess == NULL)
MessageBox("Couldnt open process", "error", MB_OK);
//Need full path here, just "evilhack.dll" won't do
if (!DetourContinueProcessWithDllA(hProcess, theApp.GetFullDllName()))
MessageBox("Couldnt inject dll", "error", MB_OK);
ResumeThread(hProcess);
CloseHandle(hProcess);
#else
dllinject(CurrentEntry.th32ProcessID, theApp.GetFullDllName());
#endif
CloseHandle(hSnapshot); //Move this here from inside the old CDC 1.5.1 multipass counter
PassCount += 1;
if (PassCount > 1)
{
KillTimer(0);
PostMessage(WM_QUIT, 0, 0);
}
return;
}
}
if (hSnapshot != NULL)
CloseHandle(hSnapshot);
}
CPropertyPage::OnTimer(nIDEvent);
}
Replace with:
Quote:
finish:
#ifdef _DEBUG
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, CurrentEntry.th32ProcessID);
SuspendThread(hProcess);
if (hProcess == NULL)
MessageBox("Couldnt open process", "error", MB_OK);
//Need full path here, just "evilhack.dll" won't do
if (!DetourContinueProcessWithDllA(hProcess, theApp.GetFullDllName()))
MessageBox("Couldnt inject dll", "error", MB_OK);
ResumeThread(hProcess);
CloseHandle(hProcess);
#else
dllinject(CurrentEntry.th32ProcessID, theApp.GetFullDllName());
#endif
CloseHandle(hSnapshot); //Move this here from inside the old CDC 1.5.1 multipass counter
PassCount += 1;
if (PassCount > 1)
{
KillTimer(0);
PostMessage(WM_QUIT, 0, 0);
}
return;
}
}
if (hSnapshot != NULL)
CloseHandle(hSnapshot);
}
CPropertyPage::OnTimer(nIDEvent);
}
If you make this you delete that CODE!
mlitn
19th October 2004, 22:57
yup, i first made hook tut, than i made thgis tut, so that's why some parts replace each other...
don't worry bout it, just copy and paste wha it sayd and it'll work
itwasfunny
19th October 2004, 23:03
can you edit the tutorial plz?
mlitn
19th October 2004, 23:04
no, too much work
just do 1.6.3.4 hook first, then hook add-on
itwasfunny
19th October 2004, 23:10
ok
How to fix that error?
what i need to change?
mlitn
19th October 2004, 23:12
eh what error?
first do 1.6.3.4 hook, then this, and everything should be ok
itwasfunny
20th October 2004, 12:57
but the DLLNAME....
mlitn
20th October 2004, 12:59
is in 1.6.3.4 hook, if you've done that you'll find it
itwasfunny
20th October 2004, 21:15
Dude You replace that code!!!
mlitn
20th October 2004, 22:37
yeah so? just do what the tuts say, do i care if it gets replaced, if i say replace it, then do so
itwasfunny
20th October 2004, 23:52
Changing the hook....
Search for:
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
ZeroMemory(&pi, sizeof(pi));
si.cb = sizeof(si);
if (CreateProcess(NULL, StartGameCommand, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{
NULL;
#ifndef _DEBUG //keep evilconfig loaded for debug purposes
PostMessage(WM_QUIT, 0, 0);
#endif
}
else
MessageBox("Error creating process", "error", MB_OK);
Replace with:
Quote:
strcpy(EvilhackDll, theApp.m_Settings.m_PathToEvilhack);
strcat(EvilhackDll, "DLLNAME.dll");
if (SpawnProcess(StartGameCommand, EvilhackDll))
PostMessage(WM_QUIT, 0, 0);
else
MessageBox("Error creating process", "error", MB_OK);
Search for:
Quote:
#ifdef _DEBUG
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, CurrentEntry.th32ProcessID);
SuspendThread(hProcess);
if (hProcess == NULL)
MessageBox("Couldnt open process", "error", MB_OK);
//Need full path here, just "evilhack.dll" won't do
if (!DetourContinueProcessWithDllA(hProcess, theApp.GetFullDllName()))
MessageBox("Couldnt inject dll", "error", MB_OK);
ResumeThread(hProcess);
CloseHandle(hProcess);
#else
dllinject(CurrentEntry.th32ProcessID, theApp.GetFullDllName());
#endif
CloseHandle(hSnapshot); //Move this here from inside the old CDC 1.5.1 multipass counter
PassCount += 1;
if (PassCount > 1)
{
KillTimer(0);
PostMessage(WM_QUIT, 0, 0);
}
return;
}
}
if (hSnapshot != NULL)
CloseHandle(hSnapshot);
}
CPropertyPage::OnTimer(nIDEvent);
Then:
Replace with:
#ifdef _DEBUG
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, CurrentEntry.th32ProcessID);
SuspendThread(hProcess);
if (hProcess == NULL)
MessageBox("Couldnt open process", "error", MB_OK);
//Need full path here, just "evilhack.dll" won't do
if (!DetourContinueProcessWithDllA(hProcess, theApp.GetFullDllName()))
MessageBox("Couldnt inject dll", "error", MB_OK);
ResumeThread(hProcess);
CloseHandle(hProcess);
#else
dllinject(CurrentEntry.th32ProcessID, theApp.GetFullDllName());
#endif
CloseHandle(hSnapshot); //Move this here from inside the old CDC 1.5.1 multipass counter
PassCount += 1;
if (PassCount > 1)
{
KillTimer(0);
PostMessage(WM_QUIT, 0, 0);
}
return;
}
}
if (hSnapshot != NULL)
CloseHandle(hSnapshot);
}
CPropertyPage::OnTimer(nIDEvent);
}
You don´t add this:strcat(EvilhackDll, "DLLNAME.dll");
Now you say in Hook add-on (change dll name etc...)
Search for:
Code:
strcat(EvilhackDll, "DLLNAME.dll");
Oh my GOD DUDE!!!
Please Please fix IT
mlitn
21st October 2004, 09:50
you gotta read...
it's search for:
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
ZeroMemory(&pi, sizeof(pi));
si.cb = sizeof(si);
if (CreateProcess(NULL, StartGameCommand, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{
NULL;
#ifndef _DEBUG //keep evilconfig loaded for debug purposes
PostMessage(WM_QUIT, 0, 0);
#endif
}
else
MessageBox("Error creating process", "error", MB_OK);
then replace by:
strcpy(EvilhackDll, theApp.m_Settings.m_PathToEvilhack);
strcat(EvilhackDll, "DLLNAME.dll");
if (SpawnProcess(StartGameCommand, EvilhackDll))
PostMessage(WM_QUIT, 0, 0);
else
MessageBox("Error creating process", "error", MB_OK);
then again search for:
#ifdef _DEBUG
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, CurrentEntry.th32ProcessID);
SuspendThread(hProcess);
if (hProcess == NULL)
MessageBox("Couldnt open process", "error", MB_OK);
//Need full path here, just "evilhack.dll" won't do
if (!DetourContinueProcessWithDllA(hProcess, theApp.GetFullDllName()))
MessageBox("Couldnt inject dll", "error", MB_OK);
ResumeThread(hProcess);
CloseHandle(hProcess);
#else
dllinject(CurrentEntry.th32ProcessID, theApp.GetFullDllName());
#endif
CloseHandle(hSnapshot); //Move this here from inside the old CDC 1.5.1 multipass counter
PassCount += 1;
if (PassCount > 1)
{
KillTimer(0);
PostMessage(WM_QUIT, 0, 0);
}
return;
}
}
if (hSnapshot != NULL)
CloseHandle(hSnapshot);
}
CPropertyPage::OnTimer(nIDEvent);
and then replace by
#ifdef _DEBUG
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, CurrentEntry.th32ProcessID);
SuspendThread(hProcess);
if (hProcess == NULL)
MessageBox("Couldnt open process", "error", MB_OK);
//Need full path here, just "evilhack.dll" won't do
if (!DetourContinueProcessWithDllA(hProcess, theApp.GetFullDllName()))
MessageBox("Couldnt inject dll", "error", MB_OK);
ResumeThread(hProcess);
CloseHandle(hProcess);
#else
dllinject(CurrentEntry.th32ProcessID, theApp.GetFullDllName());
#endif
CloseHandle(hSnapshot); //Move this here from inside the old CDC 1.5.1 multipass counter
PassCount += 1;
if (PassCount > 1)
{
KillTimer(0);
PostMessage(WM_QUIT, 0, 0);
}
return;
}
}
if (hSnapshot != NULL)
CloseHandle(hSnapshot);
}
CPropertyPage::OnTimer(nIDEvent);
}
CODING TUTORIALS ARE NOT MEANT FOR COPYPASTING! THEY'RE MEANT TO MAKE YOU LEARN! SO DON'T JUST COPY THE CODE WITHOUT READING (don't even see the replace with etc...) BUT READ IT, TRY TO UNDERSTAND IT!
itwasfunny
21st October 2004, 12:24
WoWWWWWWW Dude gigante words lol
mlitn
21st October 2004, 14:44
they were a bit too huge :p
itwasfunny
21st October 2004, 15:37
Nice tutorial men :)
What´s your mail? PM ME!
mlitn
21st October 2004, 18:07
sry i don't give out my email, but if you got questions you can reply here or pm me
itwasfunny
21st October 2004, 20:07
ok np dude, its not for questions, is for a friend.
But no problem :)
gil
21st October 2004, 20:38
Ghost, you spam too much.
All this can be done with PMs.
itwasfunny
23rd October 2004, 18:13
Dude i make that, But.....
I need a OK bottom for change the name of dll
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.