Quote:
Originally Posted by dimkacool
Why you need autoit when you have edx loader?
|
Quote:
Originally Posted by lesderid
Because he wants to code his own loader and he doesn't know C++?
|
Both, stop posting if you dont know how to help him.
@topic
Sorry, i think the easiest way would be detouring the connect function. And in c++ its so much easier than in AutoIt. Here is a tutorial how to create a easy dll in c++ to detour it:
Quote:
Download MS Detours 1.5:[Only registered and activated users can see links. Click Here To Register...]
Copy the header file into Visual Studio 2xxx\VC\Include\ and the library file into Visual Studio 2xxxx\VC\lib .
Create a new empty Win32 project(dynamic link library | dll and multibyte). Add a cpp file and insert this code:
Code:
#include <winsock2.h>
#include <stdio.h>
#include <windows.h>
#include "Detours.h"
#pragma comment(lib, "Detours.lib")
#pragma comment(lib, "ws2_32.lib")
typedef int (WINAPI * trampoline_connect)(SOCKET s, const sockaddr *name, int namelen);
trampoline_connect orginal_connect;
int WINAPI my_connect(SOCKET s, const sockaddr *name, int namelen)
{
sockaddr_in si;
memcpy(&si, name, sizeof(sockaddr_in));
si.sin_addr.S_un.S_addr = inet_addr[COLOR="Red"]("127.0.0.1"[/COLOR]);
return orginal_connect(s, (sockaddr*)&si, sizeof(sockaddr_in));
}
BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
{
orginal_connect = (trampoline_connect)DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("ws2_32.dll"),"connect"), (PBYTE)my_connect);
}
}
return TRUE;
}
Compile the project in Release Mode. The last thing to do is injecting the dll into the sro_client process.Im using WinInject(google), but every other injector is fine,too.
Regards
|
The red marked code is the ip you wanna redirect silkroad to.
If you created the dll succesfully you have to inject it via your autoit application when silkroad is starting.
Regards