Thror
Gebruiker
- Lid geworden
- 29 mei 2009
- Berichten
- 17
Hey!
Ik ben nieuw hier op het forum, en ik denk mischien kan een van jullie mij wel helpen
.
Let op; Ik ben nog redelijk nieuw in C++.
Dit is me source code, het is een programma om voor het spel tibia de client te laten connecten naar een ander IP adres (voor private servers).
Werkt prima, maar ik wil er een Tray Icon bij (rechts onderin bij de klok daar).
Dus ik ging kijken op MSDN en vond dit: http://msdn.microsoft.com/en-us/library/aa922175.aspx
Ik snap eigenlijk nooit zoveel van C++.
Maar heb de code die daar staat toegevoegd, en de header shellapi.h
Maar hij compiled niet, Ik gebruik Dev-C++.
Ik ben nieuw hier op het forum, en ik denk mischien kan een van jullie mij wel helpen

Let op; Ik ben nog redelijk nieuw in C++.
#include <iostream>
#include <windows.h>
#include <shellapi.h>
#define RSA_KEY "109120132967399429278860960508995541528237502902798129123468757937\
266291492576446330739696001110603907230888610072655818825358503429057592827629436\
413108566029093628212635953836686562675849720620786279431090218017681061521755056\
710823876476444260558147179707119674283982419152118103759076030616683978566631413"
void Shell_NotifyIconExample()
{
// Add a Shell_NotifyIcon notificaion
NOTIFYICONDATA nid = {0};
nid.cbSize = sizeof(nid);
nid.uID = 100; // Per Windows Embedded CE docs, values from 0 to 12 are reserved and should not be used.
nid.uFlags = NIF_ICON;
nid.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_SAMPLEICON));
// Add the notification to the tray.
Shell_NotifyIcon(NIM_ADD, &nid);
// Update the notification icon.
nid.uFlags = NIF_ICON;
nid.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_SAMPLEICON2));
Shell_NotifyIcon(NIM_MODIFY, &nid);
// Remove the notification from the tray.
Shell_NotifyIcon(NIM_DELETE, &nid);
return;
}
using namespace std;
char IP[30];
HWND tibia;
DWORD processid;
HANDLE hProcess;
int main()
{
SetConsoleTitle(TEXT("IP Changer 8.42"));
cout <<"\n";
cout << "\t\t\t\tIP: ";
cin >> IP;
tibia=FindWindow("tibiaclient",NULL);
if (!tibia)
{
cout << "Tibia not found..." << endl;
Sleep(10000);
exit(0);
}
else
{
GetWindowThreadProcessId(tibia, &processid);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processid);
if (!hProcess)
{
cout << "Process error...";
Sleep(10000);
exit(0);
}
else
{
IP; // 8.42
WriteProcessMemory(hProcess, (LPVOID)0x785D30, &IP, 25, NULL);
WriteProcessMemory(hProcess, (LPVOID)0x785DA0, &IP, 25, NULL);
WriteProcessMemory(hProcess, (LPVOID)0x785E10, &IP, 25, NULL);
WriteProcessMemory(hProcess, (LPVOID)0x785E80, &IP, 25, NULL);
WriteProcessMemory(hProcess, (LPVOID)0x785EF0, &IP, 25, NULL);
WriteProcessMemory(hProcess, (LPVOID)0x785F60, &IP, 25, NULL);
WriteProcessMemory(hProcess, (LPVOID)0x785FD0, &IP, 25, NULL);
WriteProcessMemory(hProcess, (LPVOID)0x786040, &IP, 25, NULL);
WriteProcessMemory(hProcess, (LPVOID)0x7860B0, &IP, 25, NULL);
WriteProcessMemory(hProcess, (LPVOID)0x786120, &IP, 25, NULL);
//RSA
DWORD oldProt,newProt;
if(VirtualProtectEx(hProcess,(LPVOID)0x005AF610,strlen(RSA_KEY),PAGE_EXECUTE_READWRITE,&oldProt))
{
if(WriteProcessMemory(hProcess,(LPVOID)0x005AF610,RSA_KEY,strlen(RSA_KEY),NULL))
{
if(VirtualProtectEx(hProcess,(LPVOID)0x005AF610,strlen(RSA_KEY),oldProt,&newProt))
{
HWND window;
window=FindWindow("tibiaclient",NULL);
char buffer[40];
sprintf(buffer,"Tibia - Connected to: %s",IP);
SetWindowText(window, buffer);
cout << "\n";
cout << "\t\t\tIP Changed to: " << IP << endl;
Sleep(10000);
}
}
}
CloseHandle(hProcess);
return 0;
}
}
}
Dit is me source code, het is een programma om voor het spel tibia de client te laten connecten naar een ander IP adres (voor private servers).
Werkt prima, maar ik wil er een Tray Icon bij (rechts onderin bij de klok daar).
Dus ik ging kijken op MSDN en vond dit: http://msdn.microsoft.com/en-us/library/aa922175.aspx
Ik snap eigenlijk nooit zoveel van C++.
Maar heb de code die daar staat toegevoegd, en de header shellapi.h
Maar hij compiled niet, Ik gebruik Dev-C++.