|
You last visited: Today at 20:40
Advertisement
Changes on login sequence? 5018 - Now (5212)
Discussion on Changes on login sequence? 5018 - Now (5212) within the CO2 Programming forum part of the Conquer Online 2 category.
02/09/2010, 20:02
|
#16
|
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
|
Code:
[DllImport("kernel32.dll")]
public static extern IntPtr CreateRemoteThread(int hProcess, IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
[DllImport("kernel32.dll", CharSet=CharSet.Ansi)]
public static extern IntPtr GetModuleHandle(string Module);
[DllImport("kernel32.dll")]
public static extern int CloseHandle(IntPtr hHandle);
[DllImport("kernel32.dll", CharSet=CharSet.Ansi)]
public static extern IntPtr GetProcAddress(IntPtr hModule, string Procedure);
[DllImport("kernel32.dll")]
public static extern int OpenProcess(uint dwAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId);
// so on with others, WriteProcessMemory, VirtualAllocEx and VirtualFreeEx
int ProcId;
string DllName;
IntPtr LoadLibAddr = GetProcAddress(GetModuleHandle("Kernel32.dll"), "LoadLibraryA");
int HandleProc = OpenProcess(0x1fffff, false, ProcId);
int DllSize = DllName.Length + 1;
IntPtr Remotedll = VirtualAllocEx(HandleProc, IntPtr.Zero, DllSize, 0x1000, 4);
// WriteDllString to the allocated memory..
// Call CreateRemoteThread;
IntPtr Hndl = CreateRemoteThread(ProcId, IntPtr.Zero, 0, LoadLibAddr, Remotedll, 0, IntPtr.Zero);
VirtualFreeEx(ProcId, Hndl, DllSize, 0x8000);
CloseHandle(Hndl);
.
EDIT:
Wait, you can't use gabrola's code in C#, unless managed dll's can be injected nowadays..
You have to do it C# style.. Marshal.GetFunctionPointerForDelegate(Delegate d), WriteProcessMemory, VirtualAllocEx, VirtualFreeEx, CloseHandle, OpenProcess.. etc
|
|
|
02/09/2010, 20:24
|
#17
|
elite*gold: 0
Join Date: Dec 2006
Posts: 1,039
Received Thanks: 1,335
|
As Nullable said you can't create the DLL in C# since it's managed, it has to be in C++.
|
|
|
02/09/2010, 20:57
|
#18
|
elite*gold: 0
Join Date: Jan 2007
Posts: 656
Received Thanks: 541
|
Quote:
Originally Posted by gabrola
As Nullable said you can't create the DLL in C# since it's managed, it has to be in C++.
|
Nono I never said I was creating the DLL in C#, I am going to create the DLL in C++ as a ATL COM Component and then use Interop COM to use the methods in C#  .
|
|
|
02/09/2010, 21:05
|
#19
|
elite*gold: 0
Join Date: Jan 2007
Posts: 656
Received Thanks: 541
|
Quote:
Originally Posted by Nullable
Code:
[DllImport("kernel32.dll")]
public static extern IntPtr CreateRemoteThread(int hProcess, IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
[DllImport("kernel32.dll", CharSet=CharSet.Ansi)]
public static extern IntPtr GetModuleHandle(string Module);
[DllImport("kernel32.dll")]
public static extern int CloseHandle(IntPtr hHandle);
[DllImport("kernel32.dll", CharSet=CharSet.Ansi)]
public static extern IntPtr GetProcAddress(IntPtr hModule, string Procedure);
[DllImport("kernel32.dll")]
public static extern int OpenProcess(uint dwAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId);
// so on with others, WriteProcessMemory, VirtualAllocEx and VirtualFreeEx
int ProcId;
string DllName;
IntPtr LoadLibAddr = GetProcAddress(GetModuleHandle("Kernel32.dll"), "LoadLibraryA");
int HandleProc = OpenProcess(0x1fffff, false, ProcId);
int DllSize = DllName.Length + 1;
IntPtr Remotedll = VirtualAllocEx(HandleProc, IntPtr.Zero, DllSize, 0x1000, 4);
// WriteDllString to the allocated memory..
// Call CreateRemoteThread;
IntPtr Hndl = CreateRemoteThread(ProcId, IntPtr.Zero, 0, LoadLibAddr, Remotedll, 0, IntPtr.Zero);
VirtualFreeEx(ProcId, Hndl, DllSize, 0x8000);
CloseHandle(Hndl);
.
EDIT:
Wait, you can't use gabrola's code in C#, unless managed dll's can be injected nowadays..
You have to do it C# style.. Marshal.GetFunctionPointerForDelegate(Delegate d), WriteProcessMemory, VirtualAllocEx, VirtualFreeEx, CloseHandle, OpenProcess.. etc
|
Ahhh, looks like music to my eyes, compared to C++ atleast haha.
|
|
|
02/09/2010, 21:11
|
#20
|
elite*gold: 0
Join Date: Dec 2006
Posts: 1,039
Received Thanks: 1,335
|
Quote:
Originally Posted by Trigorio
Nono I never said I was creating the DLL in C#, I am going to create the DLL in C++ as a ATL COM Component and then use Interop COM to use the methods in C#  .
|
What's the point behind this? I mean all what needs to happen is once the c++ dll gets injected using winject or whatever this code runs
Code:
*(PDWORD)&OrigConnect = APIHook((DWORD)GetProcAddress(GetModuleHandle("Ws2_32.dll"), "connect"), (DWORD)MyConnect, (DWORD)OrigConnect);
Quote:
Originally Posted by Trigorio
Ahhh, looks like music to my eyes, compared to C++ atleast haha.
|
That code only injects the unmanaged DLL into the process
|
|
|
02/10/2010, 09:27
|
#21
|
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
|
Quote:
Originally Posted by Trigorio
Nono I never said I was creating the DLL in C#, I am going to create the DLL in C++ as a ATL COM Component and then use Interop COM to use the methods in C#  .
|
Quote:
Originally Posted by gabrola
That code only injects the unmanaged DLL into the process
|
And i think that is what he needed :P
|
|
|
 |
|
Similar Threads
|
D2NT 3.0 Barb Sequence
04/12/2010 - Diablo 2 - 1 Replies
Kann man den so einstellen, dass er mit dem einen Slot teleportiert und Bo'd und mit dem anderen nur angreift?
Wäre ganz hilfreich
|
Base sequence patch 5226
04/08/2010 - CO2 Programming - 2 Replies
Hello,
I thought I'd give it a try, but before I continue on pointess searching through executables, has anything changed? As in cryptography?
Thanks,
ImmuneOne.
|
Conquer 4267 Login Sequence
01/25/2010 - CO2 Private Server - 28 Replies
Anyone remember it? Ive got to the game server and im receiving a 1010:137 Packet which is empty except for my Character ID, Ive tried the following:
Respond with identical packet - Displays interface, servername, cords 0,0, with the message "Logging into server.....please wait", opening interface panels scars the background.
Respond with 1010:74 packet - Nothing changes, remains with the black login screen, so im assuming that the client doesnt understand it at this version.
Respond...
|
Remove Death sequence
06/14/2009 - Conquer Online 2 - 2 Replies
How do i remove the monsters right after they die. I would much rather them die and diapear rather that fall down and just lay there for a few seconds.
Thx
|
nid help with the sequence
03/09/2008 - Dekaron - 0 Replies
i have this as a sequence for my 2mbot but it doesnt do anything?
SL(1000)
CN
MT(200,200)
MT(200,100)
CR
AT
MT(100,50)
|
All times are GMT +1. The time now is 20:42.
|
|