Results 1 to 10 of 10
  1. #1
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty

    SpeedHack: Not Complete (Please Help if you can)

    This speed hack seems logical to me and has no compile time errors, So Im guessing it loads correctly. However the speedhack simply does not work. As you can tell its kind of messy. There are parts merely commented out, while I set my focus to another part of the program. For this reason I will describe the program in 3 logical parts. This will make it easy to understand:

    1. The Detours. There are three detours set in this program to alter the Windows API functions:
    timeGetTime()
    QueryPerformanceCounter()
    GetTickCount()


    2. The Speed Controls. This part adjusts the speed. Do not pay to much attention to the create window thing. Im working on implementing that inside of the hack. Unless ofcourse you want to offer help which I'll gladly except. Focus more on the factors controlling the speed of the detoured functions.

    3. The DllMain.
    The fault might be here. Maybe it is not loading correctly. To be honest I don't know. All I know is the game does not shut down when I inject it anymore, but perhaps it could be many things.


    However it has to be something wrong with one or more these 3 logical sections. For some reason I have a feeling that its the DllMain, because thats where I had a problem last time. I forgot to return true and the program didn't load of initialize properly. not sure =/

    [PHP]
    #include <windows.h>
    #include <tchar.h>
    #include <stdio.h>
    #include "detours.h"
    /****************NOTES**********************
    Title: SpeedHack v.0.1
    This is a C++ style conversion of Dark_Byte's Speedhack. Completely recoded, from the
    ground up, using a slight aleration of DB's original method, with the Detours Library 2.1
    provided by Microsoft, rather then hooking. This is still in aplha testing.
    Might be some problems with a smooth dialing of speed due to factor conversions
    Also lacks UI, but plan on adding in next compilation.
    Thanks to: Hell_Demon & Matrix_NEO006
    Credits: why06 (why06mail@gmail.com) for MPGH.net
    ********************************************/

    DWORD (__stdcall *Real_timeGetTime)(void) = ( DWORD(WINAPI *)(void))GetProcAddress(GetModuleHandleA("Kernel32 .dll"),"timeGetTime");
    BOOL (__stdcall *Real_QPC)(LARGE_INTEGER *lp) = (BOOL(WINAPI *)(LARGE_INTEGER *))GetProcAddress(GetModuleHandleA("Kernel32.dll") , "QueryPerformanceCounter");
    DWORD (WINAPI *Real_GetTickCount)(void) = (DWORD (WINAPI *)(void))GetProcAddress(GetModuleHandleA("Kernel32 .dll"), "GetTickCount");
    HWND hBox;
    char buf[200] = {0};


    float factorset = 2.0;//initial value: 1.0
    bool speedhack = 1;//initial state: off

    void SpeedLoop()
    {

    HWND hWnd;
    hWnd = (HWND)GetForegroundWindow();
    hBox = CreateWindowA("button", "Change Points", WS_VISIBLE | WS_CHILD, 50, 105, 100, 20, hWnd, (HMENU)1, NULL, NULL);
    while(1)
    {
    GetDlgItemTextA(hBox, 4, buf, 256); //get the text or integer that user has entered and store it in buf
    factorset = atoi(buf); //macro atoi, to convert the string to an integer,

    /*
    if(GetAsyncKeyState(0x5A))//Z key
    {
    factorset -= .25;
    }
    if(GetAsyncKeyState(0x43))//C key
    {
    factorset += .25;
    }
    if(GetAsyncKeyState(0x54))//T key
    {
    if(speedhack)speedhack = 0;//off
    else speedhack = 1;//on
    }
    */
    Sleep(30);
    }
    }

    DWORD My_timeGetTime()
    {
    float factor = 1.0;
    DWORD currentreal = 0;

    if(speedhack)factor = factorset;
    else factor = 1.0;

    static DWORD oldtGT = 0;
    if(oldtGT==0)
    {
    oldtGT = Real_timeGetTime();
    return oldtGT;
    }
    currentreal = Real_timeGetTime();

    DWORD newret;
    newret = currentreal + (DWORD)((currentreal-oldtGT)*(factor-1));

    oldtGT=currentreal;
    return newret;
    }

    BOOL My_QPC(LARGE_INTEGER *lp)
    {
    static __int64 oldfake = 0;
    static __int64 oldreal = 0;
    float factor = 1.0;

    if(speedhack)factor = factorset;//remember this variable
    else factor = 1.0;

    __int64 newvalue;

    if( oldfake == 0 || oldreal == 0 )
    {
    oldfake = lp->QuadPart;
    oldreal = lp->QuadPart;
    }
    newvalue = lp->QuadPart;

    newvalue = oldfake + (__int64)((newvalue - oldreal) * (factor-1));

    oldreal = lp->QuadPart;
    oldfake = newvalue;

    lp->QuadPart = newvalue;
    return Real_QPC(lp);
    }

    DWORD My_GetTickCount()
    {
    float factor = 1.0;
    DWORD new_count = 0;
    DWORD currentreal = 0;

    if(speedhack)factor = factorset;//on
    else factor = 1;//off

    static DWORD old_count = 0;
    if(old_count == 0)
    {
    old_count = Real_GetTickCount();
    return old_count;
    }
    currentreal = Real_GetTickCount();
    new_count = currentreal + (DWORD)(new_count-old_count) * (factor-1);

    old_count = currentreal;
    return new_count;
    }


    BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
    {
    switch( dwReason )
    {
    case DLL_PROCESS_ATTACH:
    DisableThreadLibraryCalls( hModule );
    DetourTransactionBegin();
    DetourUpdateThread( GetCurrentThread() );
    DetourAttach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
    DetourAttach( &(PVOID&)Real_QPC, My_QPC );
    DetourAttach( &(PVOID&)Real_GetTickCount, My_GetTickCount);
    DetourTransactionCommit();
    CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)SpeedLoop, NULL, NULL, NULL);
    break;
    case DLL_PROCESS_DETACH:
    DetourTransactionBegin();
    DetourUpdateThread( GetCurrentThread() );
    DetourDetach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
    DetourDetach( &(PVOID&)Real_QPC, My_QPC );
    DetourDetach(&(PVOID&)Real_GetTickCount, My_GetTickCount);
    DetourTransactionCommit();
    break;
    }
    return TRUE;
    }

    [/PHP]

    Its a lot of code, so it may be easier to look at in a compiler. I've been going over it all day myself, so I figure its about time to ask for some help. Windows is definitely not my specialty... ;l (or anything for that matter, but no need to get picky )

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  2. #2
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Awww... no replies?

    Well good news anyway. Turns out I needed to compile it in release mode. The .obj was not linking with the detours.lib.

    Now that that's out of the way, it means the problem is a code problem and not a configuration problem. Im going to focus on logical sections 1 & 2 now.

    Hmmm... Im beginning to think Combat Arms may hook the time functions to prevent tampering. I will test this on other games to see if that's true. Well... maybe tommorrow... yawn.
    Last edited by why06; 02-04-2010 at 12:02 AM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  3. #3
    ilovecookies's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    In the C++ Section
    Posts
    321
    Reputation
    10
    Thanks
    67
    My Mood
    Shocked
    Quote Originally Posted by why06 View Post
    Awww... no replies?

    Well good news anyway. Turns out I needed to compile it in release mode. The .obj was not linking with the detours.lib.

    Now that that's out of the way, it means the problem is a code problem and not a configuration problem. Im going to focus on logical sections 1 & 2 now.

    Hmmm... Im beginning to think Combat Arms may hook the time functions to prevent tampering. I will test this on other games to see if that's true. Well... maybe tommorrow... yawn.
    VAC and VAC2 don't hook timeGetTime, and HS is way crappier than VAC, so I doubt they hook it. See if I can't google up a bit more for you.

    LOL@ My fail, I went to the HS main website looking to see if they tell what functions they hook. I R Nub. But I turned up this piece of information. HS Pro protects against speed hacks, so they very well may have hooked timeGetTime.
    Last edited by ilovecookies; 02-04-2010 at 11:40 AM.
    Quote Originally Posted by Jules Winnfield View Post
    I am the tyranny of evil men, and you are all the weak. But i'm trying Ringo,i'm trying real hard, to become the shepherd.
    excuse me miss, would you kindly reflect some photons off the epidermis covering your sternum directly into the camera iris or vacate the proximity immediately
    [IMG]https://i882.photobucke*****m/albums/ac23/miki_d420/RealizingYoureALeecher2copy.jpg[/IMG]









  4. #4
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    You do place the hooks from an injected DLL right?
    Try using a static value for the factor(e.g. 5.0f) to test wether it functions at all.
    I think the issue comes from the GetItemDlgTextA part
    Ah we-a blaze the fyah, make it bun dem!

  5. #5
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Hell_Demon View Post
    Try using a static value for the factor(e.g. 5.0f) to test wether it functions at all.
    I think the issue comes from the GetItemDlgTextA part
    Did all that... didn't work.

    You do place the hooks from an injected DLL right?
    Hmmmm? I don't see how else I could do it other then injecting it... =/

    NEW VERSION

    I tested this in Assualt Cube to see if it was just CA.... didnt' work there either . ;l
    [php]
    #include <windows.h>
    #include <tchar.h>
    #include <stdio.h>
    #include "detours.h"
    /****************NOTES**********************
    Title: SpeedHack v.0.1
    This is a C++ style conversion of Dark_Byte's Speedhack. Completely recoded, from the
    ground up, using a slight aleration of DB's original method, with the Detours Library 2.1
    provided by Microsoft, rather then hooking. This is still in aplha testing.
    Might be some problems with a smooth dialing of speed due to factor conversions
    Also lacks UI, but plan on adding in next compilation.
    Thanks to: Hell_Demon & Matrix_NEO006
    Credits: why06 (why06mail@gmail.com) for MPGH.net
    ********************************************/

    DWORD (__stdcall *Real_timeGetTime)(void) = ( DWORD(WINAPI *)(void))GetProcAddress(GetModuleHandleA("Kernel32 .dll"),"timeGetTime");
    BOOL (__stdcall *Real_QPC)(LARGE_INTEGER *lp) = (BOOL(WINAPI *)(LARGE_INTEGER *))GetProcAddress(GetModuleHandleA("Kernel32.dll") , "QueryPerformanceCounter");
    DWORD (WINAPI *Real_GetTickCount)(void) = (DWORD (WINAPI *)(void))GetProcAddress(GetModuleHandleA("Kernel32 .dll"), "GetTickCount");
    //HWND hBox;
    //char buf[200] = {0};


    float factorset = 2.0;//initial value: 1.0
    bool speedhack = 1;//initial state: off

    void SpeedLoop()
    {

    //HWND hWnd;
    //hWnd = (HWND)GetForegroundWindow();
    //hBox = CreateWindowA("button", "Change Points", WS_VISIBLE | WS_CHILD, 50, 105, 100, 20, hWnd, (HMENU)1, NULL, NULL);
    while(1)
    {
    //GetDlgItemTextA(hBox, 4, buf, 256); //get the text or integer that user has entered and store it in buf
    //factorset = atoi(buf); //macro atoi, to convert the string to an integer,


    if(GetAsyncKeyState(VK_NUMPAD0))//Z key
    {
    factorset -= .25;
    }
    if(GetAsyncKeyState(VK_NUMPAD1))//C key
    {
    factorset += .25;
    }
    if(GetAsyncKeyState(VK_INSERT))//T key
    {
    if(speedhack)speedhack = 0;//off
    else speedhack = 1;//on
    }

    Sleep(30);
    }
    }

    DWORD My_timeGetTime()
    {
    float factor = 1.0;
    DWORD currentreal = 0;

    if(speedhack)factor = factorset;
    else factor = 1.0;

    static DWORD oldtGT = 0;
    if(oldtGT==0)
    {
    oldtGT = Real_timeGetTime();
    return oldtGT;
    }
    currentreal = Real_timeGetTime();

    DWORD newret;
    newret = currentreal + (DWORD)((currentreal-oldtGT)*(factor));//-1

    oldtGT=currentreal;
    return newret;
    }

    BOOL My_QPC(LARGE_INTEGER *lp)
    {
    static __int64 oldfake = 0;
    static __int64 oldreal = 0;
    float factor = 1.0;

    if(speedhack)factor = factorset;//remember this variable
    else factor = 1.0;

    __int64 newvalue;

    if( oldfake == 0 || oldreal == 0 )
    {
    oldfake = lp->QuadPart;
    oldreal = lp->QuadPart;
    }
    newvalue = lp->QuadPart;

    newvalue = oldfake + (__int64)((newvalue - oldreal) * (factor));//-1

    oldreal = lp->QuadPart;
    oldfake = newvalue;

    lp->QuadPart = newvalue;
    return Real_QPC(lp);
    }

    DWORD My_GetTickCount()
    {
    float factor = 1.0;
    DWORD new_count = 0;
    DWORD currentreal = 0;

    if(speedhack)factor = factorset;//on
    else factor = 1;//off

    static DWORD old_count = 0;
    if(old_count == 0)
    {
    old_count = Real_GetTickCount();
    return old_count;
    }
    currentreal = Real_GetTickCount();
    new_count = currentreal + (DWORD)(new_count-old_count) * (factor);//-1

    old_count = currentreal;
    return new_count;
    }


    BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
    {
    switch( dwReason )
    {
    case DLL_PROCESS_ATTACH:
    DisableThreadLibraryCalls( hModule );
    DetourTransactionBegin();
    DetourUpdateThread( GetCurrentThread() );
    DetourAttach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
    DetourAttach( &(PVOID&)Real_QPC, My_QPC );
    DetourAttach( &(PVOID&)Real_GetTickCount, My_GetTickCount);
    DetourTransactionCommit();
    CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)SpeedLoop, NULL, NULL, NULL);
    break;
    case DLL_PROCESS_DETACH:
    DetourTransactionBegin();
    DetourUpdateThread( GetCurrentThread() );
    DetourDetach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
    DetourDetach( &(PVOID&)Real_QPC, My_QPC );
    DetourDetach(&(PVOID&)Real_GetTickCount, My_GetTickCount);
    DetourTransactionCommit();
    break;
    }
    return TRUE;
    }
    [/php]

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  6. #6
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    This is probably 100% wrong but you're not getting other replies so. . .

    Did you test the detour function on something you know will work? Like, make your own test program with a function and try to detour it. If that doesn't work, then you might as well start by getting the detour function to work.

  7. #7
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Davidm44 View Post
    This is probably 100% wrong but you're not getting other replies so. . .

    Did you test the detour function on something you know will work? Like, make your own test program with a function and try to detour it. If that doesn't work, then you might as well start by getting the detour function to work.
    No no. That's very helpful!
    It doesn't have to just be a code thing. I should approach the whole situation one step at a time. Narrow it down to one failing point. I will try to get a messagebox working first.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  8. #8
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Code:
    #include <windows.h>
    #include <detours.h> // GET DETOURS 1.5
    int (__cdecl *TestFuncOrig)(bool wtfhax);
    int TestFuncHook(bool wtfhax)
    {
        MessageBoxA(0, "WTF", "WTF", 0);
        return TestFuncOrig(wtfhax);
    }
    BOOL APIENTRY DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
    {
        if(dwReason==DLL_PROCESS_ATTACH)
        {
            TestFuncOrig = (int (__cdecl *)(bool))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("lolwut.dll"), "RAGEMOARPLoX"), (PBYTE)TestFuncHook);
        }
        return TRUE;
    }
    Ah we-a blaze the fyah, make it bun dem!

  9. #9
    AeroMan's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Hell
    Posts
    3,294
    Reputation
    189
    Thanks
    3,049
    My Mood
    Busy
    Quote Originally Posted by why06 View Post
    This speed hack seems logical to me and has no compile time errors, So Im guessing it loads correctly. However the speedhack simply does not work. As you can tell its kind of messy. There are parts merely commented out, while I set my focus to another part of the program. For this reason I will describe the program in 3 logical parts. This will make it easy to understand:

    1. The Detours. There are three detours set in this program to alter the Windows API functions:
    timeGetTime()
    QueryPerformanceCounter()
    GetTickCount()


    2. The Speed Controls. This part adjusts the speed. Do not pay to much attention to the create window thing. Im working on implementing that inside of the hack. Unless ofcourse you want to offer help which I'll gladly except. Focus more on the factors controlling the speed of the detoured functions.

    3. The DllMain.
    The fault might be here. Maybe it is not loading correctly. To be honest I don't know. All I know is the game does not shut down when I inject it anymore, but perhaps it could be many things.


    However it has to be something wrong with one or more these 3 logical sections. For some reason I have a feeling that its the DllMain, because thats where I had a problem last time. I forgot to return true and the program didn't load of initialize properly. not sure =/

    [PHP]
    #include <windows.h>
    #include <tchar.h>
    #include <stdio.h>
    #include "detours.h"
    /****************NOTES**********************
    Title: SpeedHack v.0.1
    This is a C++ style conversion of Dark_Byte's Speedhack. Completely recoded, from the
    ground up, using a slight aleration of DB's original method, with the Detours Library 2.1
    provided by Microsoft, rather then hooking. This is still in aplha testing.
    Might be some problems with a smooth dialing of speed due to factor conversions
    Also lacks UI, but plan on adding in next compilation.
    Thanks to: Hell_Demon & Matrix_NEO006
    Credits: why06 (why06mail@gmail.com) for MPGH.net
    ********************************************/

    DWORD (__stdcall *Real_timeGetTime)(void) = ( DWORD(WINAPI *)(void))GetProcAddress(GetModuleHandleA("Kernel32 .dll"),"timeGetTime");
    BOOL (__stdcall *Real_QPC)(LARGE_INTEGER *lp) = (BOOL(WINAPI *)(LARGE_INTEGER *))GetProcAddress(GetModuleHandleA("Kernel32.dll") , "QueryPerformanceCounter");
    DWORD (WINAPI *Real_GetTickCount)(void) = (DWORD (WINAPI *)(void))GetProcAddress(GetModuleHandleA("Kernel32 .dll"), "GetTickCount");
    HWND hBox;
    char buf[200] = {0};


    float factorset = 2.0;//initial value: 1.0
    bool speedhack = 1;//initial state: off

    void SpeedLoop()
    {

    HWND hWnd;
    hWnd = (HWND)GetForegroundWindow();
    hBox = CreateWindowA("button", "Change Points", WS_VISIBLE | WS_CHILD, 50, 105, 100, 20, hWnd, (HMENU)1, NULL, NULL);
    while(1)
    {
    GetDlgItemTextA(hBox, 4, buf, 256); //get the text or integer that user has entered and store it in buf
    factorset = atoi(buf); //macro atoi, to convert the string to an integer,

    /*
    if(GetAsyncKeyState(0x5A))//Z key
    {
    factorset -= .25;
    }
    if(GetAsyncKeyState(0x43))//C key
    {
    factorset += .25;
    }
    if(GetAsyncKeyState(0x54))//T key
    {
    if(speedhack)speedhack = 0;//off
    else speedhack = 1;//on
    }
    */
    Sleep(30);
    }
    }

    DWORD My_timeGetTime()
    {
    float factor = 1.0;
    DWORD currentreal = 0;

    if(speedhack)factor = factorset;
    else factor = 1.0;

    static DWORD oldtGT = 0;
    if(oldtGT==0)
    {
    oldtGT = Real_timeGetTime();
    return oldtGT;
    }
    currentreal = Real_timeGetTime();

    DWORD newret;
    newret = currentreal + (DWORD)((currentreal-oldtGT)*(factor-1));

    oldtGT=currentreal;
    return newret;
    }

    BOOL My_QPC(LARGE_INTEGER *lp)
    {
    static __int64 oldfake = 0;
    static __int64 oldreal = 0;
    float factor = 1.0;

    if(speedhack)factor = factorset;//remember this variable
    else factor = 1.0;

    __int64 newvalue;

    if( oldfake == 0 || oldreal == 0 )
    {
    oldfake = lp->QuadPart;
    oldreal = lp->QuadPart;
    }
    newvalue = lp->QuadPart;

    newvalue = oldfake + (__int64)((newvalue - oldreal) * (factor-1));

    oldreal = lp->QuadPart;
    oldfake = newvalue;

    lp->QuadPart = newvalue;
    return Real_QPC(lp);
    }

    DWORD My_GetTickCount()
    {
    float factor = 1.0;
    DWORD new_count = 0;
    DWORD currentreal = 0;

    if(speedhack)factor = factorset;//on
    else factor = 1;//off

    static DWORD old_count = 0;
    if(old_count == 0)
    {
    old_count = Real_GetTickCount();
    return old_count;
    }
    currentreal = Real_GetTickCount();
    new_count = currentreal + (DWORD)(new_count-old_count) * (factor-1);

    old_count = currentreal;
    return new_count;
    }


    BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
    {
    switch( dwReason )
    {
    case DLL_PROCESS_ATTACH:
    DisableThreadLibraryCalls( hModule );
    DetourTransactionBegin();
    DetourUpdateThread( GetCurrentThread() );
    DetourAttach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
    DetourAttach( &(PVOID&)Real_QPC, My_QPC );
    DetourAttach( &(PVOID&)Real_GetTickCount, My_GetTickCount);
    DetourTransactionCommit();
    CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)SpeedLoop, NULL, NULL, NULL);
    break;
    case DLL_PROCESS_DETACH:
    DetourTransactionBegin();
    DetourUpdateThread( GetCurrentThread() );
    DetourDetach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
    DetourDetach( &(PVOID&)Real_QPC, My_QPC );
    DetourDetach(&(PVOID&)Real_GetTickCount, My_GetTickCount);
    DetourTransactionCommit();
    break;
    }
    return TRUE;
    }

    [/PHP]

    Its a lot of code, so it may be easier to look at in a compiler. I've been going over it all day myself, so I figure its about time to ask for some help. Windows is definitely not my specialty... ;l (or anything for that matter, but no need to get picky )
    its hard..
    Ask IHelper, his the pro coder of mpgh.net!
    I cant help, i just can't detouring, im learning but whatever;
    Goodluck!

  10. #10
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by ikke0147 View Post
    its hard..
    Ask IHelper, his the pro coder of mpgh.net!
    I cant help, i just can't detouring, im learning but whatever;
    Goodluck!
    You kidding me? Anyone of these guys here know more then that nub. o_O
    And plz don't bump old posts.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

Similar Threads

  1. [Help Request] crossfire hacks not working please help
    By wolfee119 in forum CrossFire Help
    Replies: 7
    Last Post: 07-08-2011, 03:55 PM
  2. Please help if you can :S
    By TheAvenger in forum Combat Arms EU Discussions
    Replies: 1
    Last Post: 01-20-2011, 08:37 AM
  3. Help if you can please with CA eu please
    By walshy155 in forum Combat Arms Help
    Replies: 1
    Last Post: 02-12-2010, 08:25 PM
  4. PLEASE LOOK IF YOU CAN SET UP DOUBLE EXP SnD RIOT SHIELD BOOSTING GAMES!
    By M 3 R K 3 D in forum Call of Duty Modern Warfare 2 Help
    Replies: 1
    Last Post: 12-21-2009, 10:37 PM
  5. Help if you can please..
    By MrEncrypted in forum Hardware & Software Support
    Replies: 4
    Last Post: 11-16-2009, 05:11 AM