C++ source change -> Delphi source please

Posts 1–11 of 11 · Page 1 of 1
C++ source change -> Delphi source please
#include <windows.h>
#include <iostream>

using namespace std;

void __cdecl PushToConsole(char* command )
{
DWORD dwCShell = (DWORD)GetModuleHandleA("cshell.dll");
if( dwCShell != NULL )
{
DWORD *LTClient = ( DWORD* )( (dwCShell + 0x46F940) );
void* Total = ( void* )*( DWORD* )( *LTClient + 0x1F8 );
_asm
{
push command;
call Total;
add esp, 4;
}
}
}

BOOL WINAPI Main (LPVOID)
{
bool boxes = false;
bool nosky = false;

while(1)
{
__asm pushad;
if(GetAsyncKeyState(VK_NUMPAD1)&1)
{
boxes = !boxes;
}
if(GetAsyncKeyState(VK_NUMPAD2)&1)
{
nosky = !nosky;
}
if (boxes)
PushToConsole("ModelDebug_DrawBoxes 1");
else
PushToConsole("ModelDebug_DrawBoxes 0");

if (nosky)
PushToConsole("DrawSky 1");
else
PushToConsole("DrawSky 0");
__asm popad;

Sleep(100);
}
}

bool Ready(void)
{
if( GetModuleHandleA("cshell.dll")!= NULL)
return true;
return false;
}

DWORD WINAPI dwMainThread(LPVOID)
{
while (!Ready())
Sleep(200);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Main, NULL, NULL, NULL);
return 0;
}

BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
MessageBoxA(0, "By", "CrossFire", 0);
CreateThread(NULL, NULL, dwMainThread, NULL, NULL, NULL);
}
return TRUE;
}
this code is working in PH ??
Updated?
this only put in c++ or wath ???
I think he wants someone to rewrite the code from C++ to Delphi
Quote Originally Posted by enjoto View Post
I think he wants someone to rewrite the code from C++ to Delphi
I agree
Source Wh (cf Rus) - Cheater Forumⓘ
Code:
library CF_RUS;

uses
  Windows;
  
var
TI1: LongWord;
TI2: LongWord;

{$R *.res}

function PushToConsole(command:string):boolean;cdecl;
var
dwCShell, LTClient, Total: cardinal;
null: variant;
begin
  dwCShell := GetModuleHandleA('CShell.dll');
  if dwCShell <> null then begin
   LTClient := dwCShell + $0027DFF8;
   Total := LTClient + $000001F8;
   asm
    push command;
    call Total;
    add esp, $00000004;
   end;
   result := true;
  end else begin
   result := false;
  end;
end;

function Main(const LPVOID:variant):boolean;
var
boxes, nosky: boolean;
begin
boxes := false;
nosky := false;

while(true)do begin
  asm
   pushad;
  end;

  //down key
  if(GetAsyncKeyState(VK_NUMPAD1)<>0)then begin
   boxes := not boxes;
  end;
  if(GetAsyncKeyState(VK_NUMPAD2)<>0)then begin
   nosky := not nosky;
  end;

  //on or off cmd cheat
  if boxes then begin
   PushToConsole('ModelDebug_DrawBoxes 1');
  end else begin
   PushToConsole('ModelDebug_DrawBoxes 0');
  end;
  if nosky then begin
   PushToConsole('DrawSky 1');
  end else begin
   PushToConsole('DrawSky 0');
  end;


  asm
   popad;
  end;
  Sleep(100);
end;
end;

function Ready():boolean;
var
  null: variant;
begin
if GetModuleHandleA('cshell.dll')<> NULL then begin
  result := true;
end else begin
  result := false;
end;
end;

function dwMainThread(const LPVOID:variant):LongWord;
begin
while not Ready() do begin
  Sleep(200);
  CreateThread(nil, 0, @Main, nil, 0, TI2);
  result := 0;
end;
end;

//DllMain
begin
DisableThreadLibraryCalls(HInstance);
MessageBoxA(0, 'Coded by: HackerVasya'+#13#10+'For **************.com', 'CrossFire Cheats', 0);
CreateThread(nil, 0, @dwMainThread, nil, 0, TI1);
end.
Where'd you got your library from?
Code:
library CF_RUS;
Nuff bumping,
/Closed.
Posts 1–11 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us