Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[VB2008&C++] Packet Sending Program
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
majidemo
Cheater
Reputation: 0

Joined: 17 Apr 2009
Posts: 28

PostPosted: Fri Jun 05, 2009 11:29 pm    Post subject: Reply with quote

is this right?

but my main question now? how do i change this code to make it connect to the process i want to connect to?
please? help..

i also was looking into this
h**p://msdn.microsoft.com/en-us/library/ms740149(VS.85).aspx

how do i connect / hook this to KhanClient.exe on process..

Code:

//winsock send hook

#include "windows.h"
#include "winsock.h"

#pragma comment ( lib, "Ws2_32.lib" )
#define JMP(frm, to) (int)(((int)to - (int)frm) - 5);

DWORD SendOriginalAddress = 0;
DWORD SendReturnAddress = 0;
DWORD* SendNewAddress = 0;
DWORD OldProtection = 0;

char* send_buffer;
int send_sizeofdata = 0;
SOCKET send_s;
int send_flags = 0;

void __declspec(naked) __stdcall  SendHookFunc()    
{
   __asm
   {
            mov  edi,edi
            push ebp
            mov ebp, esp
            mov eax, [ebp+0x08] /* Param 1 : Socket */
            mov send_s, eax
            mov eax, [ebp+0x0C] /* Param 2 : buffer */
            mov [send_buffer], eax
            mov eax, [ebp+0x10] /*Param 3 : Size*/
            mov send_sizeofdata, eax
            mov eax, [ebp+0x14] /*Param 4 : flags*/
            mov send_flags, eax
            jmp SendReturnAddress
   }
}

void UnHookSend()
{
   /* To unhook on a WinXP post SP2 box you need to restore the 5 byte preamble */
   *(WORD *)SendOriginalAddress = 0xFF8B;      // mov  edi,edi
   *(BYTE *)(SendOriginalAddress+2) = 0x55;   // push epb
   *(WORD *)(SendOriginalAddress+3) = 0xEC8B;   // mov epb, esp
   VirtualProtect( (void*)SendOriginalAddress, 0x05, OldProtection, &OldProtection );
}

void HookSend()
{
   SendNewAddress = (DWORD*)SendHookFunc;
   HINSTANCE hDll = LoadLibrary((LPCTSTR) "Ws2_32.dll");
   SendOriginalAddress = (DWORD)GetProcAddress(hDll, "send");
   SendReturnAddress = SendOriginalAddress + 5;
   VirtualProtect( (void*)SendOriginalAddress, 0x05, PAGE_READWRITE , &OldProtection );
   *(BYTE *)(SendOriginalAddress) = 0xe9;
   *(int *)(SendOriginalAddress+1) = JMP(SendOriginalAddress, SendNewAddress);
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                )
{
   if (ul_reason_for_call == DLL_PROCESS_ATTACH)
      HookSend();
   if (ul_reason_for_call == DLL_THREAD_DETACH)
      UnHookSend();
    return TRUE;
}

Back to top
View user's profile Send private message
Valex37
How do I cheat?
Reputation: 0

Joined: 22 May 2009
Posts: 9
Location: United States of America

PostPosted: Sat Jun 06, 2009 10:58 am    Post subject: Reply with quote

Since it's a DLL, you would inject it into the target process. The DLL should take care of the rest. Just make sure the settings on whatever you are trying to do is correct for that process, or you could crash it. A great program to inject DLLs is winject, which I have uploaded to filebeam if you want to download it.

filebeam.c o m/d6b25a7a74e41ee4b5f1ccac90541190

remove spaces

_________________
Valex
Back to top
View user's profile Send private message MSN Messenger
Rockhard
How do I cheat?
Reputation: 0

Joined: 29 Apr 2010
Posts: 1

PostPosted: Thu Apr 29, 2010 4:30 pm    Post subject: Reply with quote

I was wondering if any have created a successful item creator or duper via Turf Battles, i have been trying myself with VC++ but it's very difficult to understand and i am just in the beginning of learning. Thanks.

(and yes i realize this is an old post but im trying to find people that have Turf Battles Experience and maybe they are subscribed to this thread still? Wink)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites