HOW TO ADD REDIRRECT IP FEATURE ON AUTO it

12/11/2010 16:10 daftones#1
i want to add redirect ip feature on my script but i dont know how to add.. if someone can help me how to add redirect ip... thnx
12/11/2010 17:52 dimkacool#2
Quote:
Originally Posted by daftones View Post
i want to add redirect ip feature on my script but i dont know how to add.. if someone can help me how to add redirect ip... thnx
Why you need autoit when you have edx loader?
12/12/2010 08:19 lesderid#3
Quote:
Originally Posted by dimkacool View Post
Why you need autoit when you have edx loader?
Because he wants to code his own loader and he doesn't know C++?
12/12/2010 11:43 Shadowz75#4
Quote:
Originally Posted by dimkacool View Post
Why you need autoit when you have edx loader?
Quote:
Originally Posted by lesderid View Post
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
12/12/2010 11:49 Haxor#5
@Shadoz75

Also possible in C#?
12/12/2010 12:20 lesderid#6
Quote:
Originally Posted by saif1999 View Post
@Shadoz75

Also possible in C#?
It should be if you can use the Detours library. (which you can)

@Shadow: I was only trying to defend the TS from dimka's comment. I'm sorry if you thought it was meant offensive or the start a discussion. (it wasn't)
12/12/2010 15:52 Shadowz75#7
Quote:
Originally Posted by saif1999 View Post
@Shadoz75

Also possible in C#?
The ms detour library directly is only for native languages like c++(so no c#.net).But you can create a c++ dll and inject it easily via your c# application, too.