Results 1 to 1 of 1

Threaded View

  1. #1
    Kahenraz's Avatar
    Join Date
    Apr 2013
    Gender
    female
    Posts
    1
    Reputation
    10
    Thanks
    0

    Patching real-time clock issues in old games?

    I've been working to diagnose an issue with an old game (mid 90s) that does not run properly on modern hardware. The issue arises when using a CPU clocked above 4.2Ghz which causes unsigned integers to roll over. The function they use in their code to call the system's real-time clock DOES return a 64-bit integer but then elsewhere in the code they do brilliant things like this:

    Code:
    int64 clock();
    
    int old = clock();
    ..
    (unsigned int)clock() - old <= something
    There are hundreds of calls to the clock function which use the wrong type so I don't see it being possible to patch these data types. But would it be possible instead to patch the code to divide the clock by some number so that it will fit into a signed 32-bit integer?

    I've dealt with modifying code by altering or NOPing instructions but this here looks as though I'll need to add new instructions; something I've not done before. Is this possible?

    This is what I have to work with:

    Code:
    push   ebp
    mov   ebp,esp
    push   ecx
    push   ecx
    and   dword ptr [ebp-08h],00000000h
    and   dword ptr [ebp-04h],00000000h
    push   esi
    rdtsc
    mov   [ebp-08h],eax
    mov   [ebp-04h],edx
    mov   ecx,[ebp-08h]
    mov   edx,[ebp-04h]
    xor   eax,eax
    xor   esi,esi
    or   eax,ecx
    or   edx,esi
    sub   eax,[L00988C60]
    pop   esi
    sbb   edx,[L00988C64]
    leave
    retn
    Thanks.
    Last edited by Kahenraz; 07-29-2015 at 05:29 AM.

Similar Threads

  1. Replies: 1
    Last Post: 05-05-2012, 08:56 AM
  2. Replies: 2
    Last Post: 02-21-2012, 10:49 PM
  3. Old game.
    By Tyraell101 in forum Wolfenstein Hacks
    Replies: 6
    Last Post: 03-15-2010, 09:22 AM
  4. [Info] How to make the "patched" unnamed aimbot to work 1 more game.
    By neononxxx in forum Combat Arms Discussions
    Replies: 19
    Last Post: 09-11-2009, 06:06 PM
  5. [Request] Simple Radar for Rune(old game)
    By happydeath in forum Hack Requests
    Replies: 0
    Last Post: 06-19-2009, 08:35 PM