coding help

Posts 19 of 9 · Page 1 of 1
coding help
can u plz tell me what is wrong with this code ?
Code:
  #include <process.h>
    #include "stdafx.h"
    #include <windows.h>
    #include <shellapi.h>
    #include <fstream>

    #pragma comment(lib,"shell32.lib")

    void __cdecl PushToConsole( const char* szCommand )
    {
    DWORD *Ltcliient = ( DWORD* )( 0x3778BFB0 );
    void* CONoff = ( void* )*( DWORD* )( *Ltcliient + 0x208 );

    __asm
    {
    push szCommand;
    call CONoff;
    add esp, 4;
    }
    }

    bool IsGameReadyForHook()
    {
    if( GetModuleHandleA( "d3d9.dll" ) != NULL
    && GetModuleHandleA( "ClientFX.fxd" ) != NULL
    && GetModuleHandleA( "CShell.dll" ) != NULL )
    return true;

    return false;
    }
    void MemCopy(void* Dest, const void* Src, int Len)
    {
    DWORD OldProtect;
    DWORD OldProtect2;
    VirtualProtect(Dest, Len, PAGE_EXECUTE_READWRITE, &OldProtect);
    memcpy(Dest, Src, Len);
    VirtualProtect(Dest, Len, OldProtect, &OldProtect2);
    FlushInstructionCache(GetCurrentProcess(), Dest, Len);
    }
    void main()
    {




    while (!IsGameReadyForHook()){
    Sleep(20);
    }
    bool boxes = false;//nx chams with boxes
    bool fog = false;//no fog
    bool speed = false;//speed hack
    bool spread = false;// no spread
    bool tracers = false;// tracers useless but why not
    bool showfps = false;// also useless but why not
    bool drawgun = false;// takes away your gun
    bool sjump = false;// super jump ( i toned it down so it does not hurt you when you fall its just enough to jump onto higher ledges and stuff
    bool windows = false;//windowed kinda buggy on single core computers
    bool nosway = false;// no sway. Very usefull in my opinion helps with fireing
    bool wframe = false;// wire frame iritating ....
    bool fb = false;//full bright useful on some maps
    bool glow = false;// glow usefull on some maps
    bool ps = false;//useless just harder to aim
    bool removers = false;// helps speed up game
    bool vjump = false;//heard it can help


    //right here is stuff that will be on when it starts up
    PushToConsole("FallDamageMax 0.000001");
    PushToConsole("ShowFps 1");
    showfps = true;

    while(true){
    if(GetAsyncKeyState(VK_HOME)<0){
    if(boxes){
    PushToConsole("ModelDebug_DrawBoxes 0");
    PushToConsole("SkelModelStencil 0");
    boxes = false;
    } else {
    PushToConsole("ModelDebug_DrawBoxes 1");
    PushToConsole("SkelModelStencil 1");
    boxes = true;
    }
    }
    if(GetAsyncKeyState(VK_F11)<0){
    if(fog){
    PushToConsole("FogEnable 1");
    fog = false;
    } else {
    PushToConsole("FogEnable 0");
    fog = true;
    }
    }
    if(GetAsyncKeyState(VK_F12)<0){
    if(speed){
    PushToConsole("BaseMoveAccel 3000.000000");
    PushToConsole("StartAccel 500.000000");
    PushToConsole("MaxAccel 3000.000000");
    PushToConsole("AccelInc 6000.000000");
    PushToConsole("WalkVel 70.000000");
    PushToConsole("FRunVel 285.000000");
    PushToConsole("BRunVel 285.000000");
    PushToConsole("SRunVel 285.000000");
    PushToConsole("DuckVel 50.000000");
    speed = false;
    } else {
    PushToConsole("BaseMoveAccel 999.000000");
    PushToConsole("StartAccel 999.000000");
    PushToConsole("MaxAccel 999.000000");
    PushToConsole("AccelInc 666.000000");
    PushToConsole("WalkVel 500.000000");
    PushToConsole("FRunVel 500.000000");
    PushToConsole("BRunVel 500.000000");
    PushToConsole("SRunVel 500.000000");
    PushToConsole("DuckVel 300.000000");
    speed = true;
    }
    }
    if(GetAsyncKeyState(VK_F6)<0){
    if(spread){
    PushToConsole("PerturbRotationEffect 3.000000");
    PushToConsole("PerturbIncreaseSpeed 3.000000");
    PushToConsole("PerturbDecreaseSpeed 9.000000");
    PushToConsole("PerturbWalkPercent 0.500000");
    PushToConsole("PerturbRecoil 9.000000");
    PushToConsole("FireMovePerturb 9.000000");
    PushToConsole("ZoomedFireMoveDuckPerturb 9.000000");
    PushToConsole("ZoomedFireMovePerturb 9.000000");
    PushToConsole("ZoomedFireDuckPerturb 9.000000");
    spread = false;
    } else {
    PushToConsole("PerturbRotationEffect 0.000000");
    PushToConsole("PerturbIncreaseSpeed 0.000000");
    PushToConsole("PerturbWalkPercent 0.000000");
    PushToConsole("PerturbFiringIncreaseSpeed 0.000000");
    PushToConsole("PerturbRecoil 0.000000");
    PushToConsole("FireMovePerturb 0.000000");
    PushToConsole("ZoomedFireMoveDuckPerturb 0.000000");
    PushToConsole("ZoomedFireMovePerturb 0.000000");
    PushToConsole("ZoomedFireDuckPerturb 0.000000");
    spread = true;
    }
    }
    if(GetAsyncKeyState(VK_F7)<0){
    if(tracers){
    PushToConsole("ShowFirePath 0");
    tracers = false;
    } else {
    PushToConsole("ShowFirePath 1");
    tracers = true;
    }
    }
    if(GetAsyncKeyState(VK_MENU)<0){
    if(sjump){
    PushToConsole("JumpVel 330.000000");
    sjump = false;
    } else {
    PushToConsole("JumpVel 660.000000");
    sjump = true;
    }
    }
    if(GetAsyncKeyState(VK_INSERT)<0){
    if(showfps){
    PushToConsole("ShowFps 0");
    showfps = false;
    } else {
    PushToConsole("ShowFps 1");
    showfps = true;
    }
    }


    if(GetAsyncKeyState(VK_F9)<0){
    if(nosway){
    PushToConsole("WeaponSway 1.000000");
    nosway = false;
    } else {
    PushToConsole("WeaponSway 0.000000");
    nosway = true;
    }
    }


    if(GetAsyncKeyState(VK_UP)<0){
    PushToConsole("PlayerGravity +200");
    }
    if(GetAsyncKeyState(VK_DOWN)<0){
    PushToConsole("PlayerGravity -200");
    }
    //
    if(GetAsyncKeyState(VK_RIGHT)<0){
    PushToConsole("PlayerGravity +800");
    }
    if(GetAsyncKeyState(VK_LEFT)<0){
    PushToConsole("PlayerGravity -800");
    }
    if(GetAsyncKeyState(VK_PAUSE)<0){
    PushToConsole("FragSelf 1");
    }
    if(GetAsyncKeyState(VK_F10)<0){
    PushToConsole("CrossHair_DefaultLength 50");
    PushToConsole("CrossHair_DefaultGapLength 1");
    PushToConsole("CrosshairGapMin 0");
    PushToConsole("CrosshairGapMax 2");
    PushToConsole("CrosshairBarMin 100");
    PushToConsole("CrosshairBarMax 100");
    PushToConsole("HitCrossHairMAXPerturb 0");
    PushToConsole("HitCrossHairMINPerturb 0");
    PushToConsole("HitCrossHairSize 0");
    PushToConsole("CrossHair_FiringDuration 0");
    PushToConsole("ScopeUDRadius 0");
    PushToConsole("ScopeLRRadius 0");
    PushToConsole("ScopeUPGap 0");
    PushToConsole("ScopeLRGap 0");
    PushToConsole("ShowBreath 0");
    }
    if(GetAsyncKeyState(VK_END)<0){
    if(windows){
    PushToConsole("Windowed 0");
    windows = false;
    } else {
    PushToConsole("Windowed 1");
    windows = true;
    }
    }
    if(GetAsyncKeyState(VK_PRIOR)<0){
    if(fb){
    PushToConsole("FullBright 1");
    fb = false;
    } else {
    PushToConsole("FullBright 0");
    fb = true;
    }
    }
    if(GetAsyncKeyState(VK_NEXT)<0){
    if(wframe){
    PushToConsole("WireFrame 1");
    wframe = false;
    } else {
    PushToConsole("WireFrame 0");
    wframe = true;
    }
    }
    if(GetAsyncKeyState(VK_RSHIFT)<0){
    if(glow){
    PushToConsole("ScreenGlowEnable 1");
    glow = false;
    } else {
    PushToConsole("ScreenGlowEnable 0");
    glow = true;
    }
    }
    if(GetAsyncKeyState(VK_DELETE)<0){
    if(ps){
    PushToConsole("ModelDebug_DrawSkeleton 1");
    ps = false;
    } else {
    PushToConsole("ModelDebug_DrawSkeleton 0");
    ps = true;
    }
    }

    if(GetAsyncKeyState(VK_F5)<0){
    if(removers){
    PushToConsole("ShowPerformanceStatistics 1");
    removers = false;
    } else {
    PushToConsole("ShowPerformanceStatistics 0");
    removers = true;
    }
    }
    if(GetAsyncKeyState(VK_CAPITAL)<0){
    if(vjump){
    PushToConsole("CamMaxPosYOffset 200.000000");
    PushToConsole("DuckDownCamOffSet 1000.000000");
    vjump = false;
    } else {
    PushToConsole("CamMaxPosYOffset -200.000000");
    PushToConsole("DuckDownCamOffSet -1000.000000");
    vjump = true;
    }
    }


    Sleep(160);
    }
    }
    BOOL APIENTRY DllMain( HMODULE hModule,
    DWORD ul_reason_for_call,
    LPVOID lpReserved
    )
    {
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    ShellExecute;
    CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&main, NULL, 0,NULL);
    break;
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
    break;
    }
    return TRUE;
    }
it is not mine in anyway so dont flame me plz
tell us what is the problem
cant compile, doesn't work in game or something like that
Quote Originally Posted by GodHack2 View Post
tell us what is the problem
cant compile, doesn't work in game or something like that
1>------ Build started: Project: s, Configuration: Release Win32 ------
1>Compiling...
1>base.cpp
1>.\base.cpp(2) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
1>Build log was saved at "file://c:\Users\OWNER\Documents\Visual Studio 2008\Projects\s\s\Release\BuildLog.htm"
1>s - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Quote Originally Posted by pushdis15 View Post


1>.\base.cpp(2) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
change
Code:
 #include "stdafx.h"
to
Code:
#include <stdafx.h>
i get this erorr still
Code:
1>c:\users\jamal\documents\visual studio 2010\projects\jamal\jamal\hack.cpp(2): fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
stdafx.h
Code:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include "targetver.h"

#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>



// TODO: reference additional headers your program requires here
stdafx.cpp
Code:
// stdafx.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"
targetver.h
Code:
#pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

#include <SDKDDKVer.h>
add the source GodHack posted as header files.

but even that won't help you because your method of using the Console is outdated and your not hooking Present or Endscene so you can't use the current version of accessing the console
Dont Create Empyt Project ...



Delete Dllmain..



Input this Code:

Code:
 #include <process.h>
    #include "stdafx.h"
    #include <windows.h>
    #include <shellapi.h>
    #include <fstream>

    #pragma comment(lib,"shell32.lib")

    void __cdecl PushToConsole( const char* szCommand )
    {
    DWORD *Ltcliient = ( DWORD* )( 0x3778BFB0 );
    void* CONoff = ( void* )*( DWORD* )( *Ltcliient + 0x208 );

    __asm
    {
    push szCommand;
    call CONoff;
    add esp, 4;
    }
    }

    bool IsGameReadyForHook()
    {
    if( GetModuleHandleA( "d3d9.dll" ) != NULL
    && GetModuleHandleA( "ClientFX.fxd" ) != NULL
    && GetModuleHandleA( "CShell.dll" ) != NULL )
    return true;

    return false;
    }
    void MemCopy(void* Dest, const void* Src, int Len)
    {
    DWORD OldProtect;
    DWORD OldProtect2;
    VirtualProtect(Dest, Len, PAGE_EXECUTE_READWRITE, &OldProtect);
    memcpy(Dest, Src, Len);
    VirtualProtect(Dest, Len, OldProtect, &OldProtect2);
    FlushInstructionCache(GetCurrentProcess(), Dest, Len);
    }
    void main()
    {




    while (!IsGameReadyForHook()){
    Sleep(20);
    }
    bool boxes = false;//nx chams with boxes
    bool fog = false;//no fog
    bool speed = false;//speed hack
    bool spread = false;// no spread
    bool tracers = false;// tracers useless but why not
    bool showfps = false;// also useless but why not
    bool drawgun = false;// takes away your gun
    bool sjump = false;// super jump ( i toned it down so it does not hurt you when you fall its just enough to jump onto higher ledges and stuff
    bool windows = false;//windowed kinda buggy on single core computers
    bool nosway = false;// no sway. Very usefull in my opinion helps with fireing
    bool wframe = false;// wire frame iritating ....
    bool fb = false;//full bright useful on some maps
    bool glow = false;// glow usefull on some maps
    bool ps = false;//useless just harder to aim
    bool removers = false;// helps speed up game
    bool vjump = false;//heard it can help


    //right here is stuff that will be on when it starts up
    PushToConsole("FallDamageMax 0.000001");
    PushToConsole("ShowFps 1");
    showfps = true;

    while(true){
    if(GetAsyncKeyState(VK_HOME)<0){
    if(boxes){
    PushToConsole("ModelDebug_DrawBoxes 0");
    PushToConsole("SkelModelStencil 0");
    boxes = false;
    } else {
    PushToConsole("ModelDebug_DrawBoxes 1");
    PushToConsole("SkelModelStencil 1");
    boxes = true;
    }
    }
    if(GetAsyncKeyState(VK_F11)<0){
    if(fog){
    PushToConsole("FogEnable 1");
    fog = false;
    } else {
    PushToConsole("FogEnable 0");
    fog = true;
    }
    }
    if(GetAsyncKeyState(VK_F12)<0){
    if(speed){
    PushToConsole("BaseMoveAccel 3000.000000");
    PushToConsole("StartAccel 500.000000");
    PushToConsole("MaxAccel 3000.000000");
    PushToConsole("AccelInc 6000.000000");
    PushToConsole("WalkVel 70.000000");
    PushToConsole("FRunVel 285.000000");
    PushToConsole("BRunVel 285.000000");
    PushToConsole("SRunVel 285.000000");
    PushToConsole("DuckVel 50.000000");
    speed = false;
    } else {
    PushToConsole("BaseMoveAccel 999.000000");
    PushToConsole("StartAccel 999.000000");
    PushToConsole("MaxAccel 999.000000");
    PushToConsole("AccelInc 666.000000");
    PushToConsole("WalkVel 500.000000");
    PushToConsole("FRunVel 500.000000");
    PushToConsole("BRunVel 500.000000");
    PushToConsole("SRunVel 500.000000");
    PushToConsole("DuckVel 300.000000");
    speed = true;
    }
    }
    if(GetAsyncKeyState(VK_F6)<0){
    if(spread){
    PushToConsole("PerturbRotationEffect 3.000000");
    PushToConsole("PerturbIncreaseSpeed 3.000000");
    PushToConsole("PerturbDecreaseSpeed 9.000000");
    PushToConsole("PerturbWalkPercent 0.500000");
    PushToConsole("PerturbRecoil 9.000000");
    PushToConsole("FireMovePerturb 9.000000");
    PushToConsole("ZoomedFireMoveDuckPerturb 9.000000");
    PushToConsole("ZoomedFireMovePerturb 9.000000");
    PushToConsole("ZoomedFireDuckPerturb 9.000000");
    spread = false;
    } else {
    PushToConsole("PerturbRotationEffect 0.000000");
    PushToConsole("PerturbIncreaseSpeed 0.000000");
    PushToConsole("PerturbWalkPercent 0.000000");
    PushToConsole("PerturbFiringIncreaseSpeed 0.000000");
    PushToConsole("PerturbRecoil 0.000000");
    PushToConsole("FireMovePerturb 0.000000");
    PushToConsole("ZoomedFireMoveDuckPerturb 0.000000");
    PushToConsole("ZoomedFireMovePerturb 0.000000");
    PushToConsole("ZoomedFireDuckPerturb 0.000000");
    spread = true;
    }
    }
    if(GetAsyncKeyState(VK_F7)<0){
    if(tracers){
    PushToConsole("ShowFirePath 0");
    tracers = false;
    } else {
    PushToConsole("ShowFirePath 1");
    tracers = true;
    }
    }
    if(GetAsyncKeyState(VK_MENU)<0){
    if(sjump){
    PushToConsole("JumpVel 330.000000");
    sjump = false;
    } else {
    PushToConsole("JumpVel 660.000000");
    sjump = true;
    }
    }
    if(GetAsyncKeyState(VK_INSERT)<0){
    if(showfps){
    PushToConsole("ShowFps 0");
    showfps = false;
    } else {
    PushToConsole("ShowFps 1");
    showfps = true;
    }
    }


    if(GetAsyncKeyState(VK_F9)<0){
    if(nosway){
    PushToConsole("WeaponSway 1.000000");
    nosway = false;
    } else {
    PushToConsole("WeaponSway 0.000000");
    nosway = true;
    }
    }


    if(GetAsyncKeyState(VK_UP)<0){
    PushToConsole("PlayerGravity +200");
    }
    if(GetAsyncKeyState(VK_DOWN)<0){
    PushToConsole("PlayerGravity -200");
    }
    //
    if(GetAsyncKeyState(VK_RIGHT)<0){
    PushToConsole("PlayerGravity +800");
    }
    if(GetAsyncKeyState(VK_LEFT)<0){
    PushToConsole("PlayerGravity -800");
    }
    if(GetAsyncKeyState(VK_PAUSE)<0){
    PushToConsole("FragSelf 1");
    }
    if(GetAsyncKeyState(VK_F10)<0){
    PushToConsole("CrossHair_DefaultLength 50");
    PushToConsole("CrossHair_DefaultGapLength 1");
    PushToConsole("CrosshairGapMin 0");
    PushToConsole("CrosshairGapMax 2");
    PushToConsole("CrosshairBarMin 100");
    PushToConsole("CrosshairBarMax 100");
    PushToConsole("HitCrossHairMAXPerturb 0");
    PushToConsole("HitCrossHairMINPerturb 0");
    PushToConsole("HitCrossHairSize 0");
    PushToConsole("CrossHair_FiringDuration 0");
    PushToConsole("ScopeUDRadius 0");
    PushToConsole("ScopeLRRadius 0");
    PushToConsole("ScopeUPGap 0");
    PushToConsole("ScopeLRGap 0");
    PushToConsole("ShowBreath 0");
    }
    if(GetAsyncKeyState(VK_END)<0){
    if(windows){
    PushToConsole("Windowed 0");
    windows = false;
    } else {
    PushToConsole("Windowed 1");
    windows = true;
    }
    }
    if(GetAsyncKeyState(VK_PRIOR)<0){
    if(fb){
    PushToConsole("FullBright 1");
    fb = false;
    } else {
    PushToConsole("FullBright 0");
    fb = true;
    }
    }
    if(GetAsyncKeyState(VK_NEXT)<0){
    if(wframe){
    PushToConsole("WireFrame 1");
    wframe = false;
    } else {
    PushToConsole("WireFrame 0");
    wframe = true;
    }
    }
    if(GetAsyncKeyState(VK_RSHIFT)<0){
    if(glow){
    PushToConsole("ScreenGlowEnable 1");
    glow = false;
    } else {
    PushToConsole("ScreenGlowEnable 0");
    glow = true;
    }
    }
    if(GetAsyncKeyState(VK_DELETE)<0){
    if(ps){
    PushToConsole("ModelDebug_DrawSkeleton 1");
    ps = false;
    } else {
    PushToConsole("ModelDebug_DrawSkeleton 0");
    ps = true;
    }
    }

    if(GetAsyncKeyState(VK_F5)<0){
    if(removers){
    PushToConsole("ShowPerformanceStatistics 1");
    removers = false;
    } else {
    PushToConsole("ShowPerformanceStatistics 0");
    removers = true;
    }
    }
    if(GetAsyncKeyState(VK_CAPITAL)<0){
    if(vjump){
    PushToConsole("CamMaxPosYOffset 200.000000");
    PushToConsole("DuckDownCamOffSet 1000.000000");
    vjump = false;
    } else {
    PushToConsole("CamMaxPosYOffset -200.000000");
    PushToConsole("DuckDownCamOffSet -1000.000000");
    vjump = true;
    }
    }


    Sleep(160);
    }
    }
    BOOL APIENTRY DllMain( HMODULE hModule,
    DWORD ul_reason_for_call,
    LPVOID lpReserved
    )
    {
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    ShellExecute;
    CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&main, NULL, 0,NULL);
    break;
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
    break;
    }
    return TRUE;
    }

I Compile this Code


i believe you Ptc method is patched. Try using this forum to find a new one, or simply create one yourself. Or if you fail to do all of thy above you could pm some of the coders here.
Posts 19 of 9 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?