Giter Site home page Giter Site logo

uptimefaker's Introduction

Uptime Faker

Generic Windows library designed to help detecting issues related to high PC uptime.

Reason for creating this plugin

The most accurate timers in Windows all count time from the time Windows has started. Historically, these values often were relatively small, as people usually shut down their PC at night, and therefore uptime stayed low. However, with the introduction of Fast Startup in Windows 8, uptime stopped resetting after shutting down the PC (since it's now effectively a partial hibernation). This led to uptimes inflating noticeably for most people, as with Fast Startup enabled it resets only on a full PC reboot.

Turns out, older software often cannot handle high uptimes. Much to my surprise, Application Verifier did not have any options to help detecting such issues by faking high uptime, I decided to create this plugin.

To allow using Uptime Faker as a general purpose fix for games and/or applications not handling high uptime gracefully, v1.1 added a ProcessTime INI option, making timers count time from the process creation instead of the last reboot.

Usage

This plugin is a Detours plugin. Therefore, it can be injected into the process with DetourCreateProcessWithDlls or by any other means. It is also possible to inject UptimeFaker by using Ultimate ASI Loader, but file extension needs to be renamed to ASI first.

Hooked WinAPI functions, the amount of uptime added and a process time mode can be configured with a provided UptimeFaker.ini file.

Supported functions

  • From kernel32.dll:
    • QueryPerformanceCounter
    • GetTickCount
    • GetTickCount64
  • From winmm.dll:
    • timeGetTime
    • timeGetSystemTime

Third party dependencies

This project uses Detours to hook into WinAPI time functions.

uptimefaker's People

Contributors

cookieplmonster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

uptimefaker's Issues

GetTickCount(64) and timeGetTime(system) seemingly don't get hooked without QueryPerfomanceCounter hook

Demo to reproduce:

#include <iostream>
#include <Windows.h>
#include <time.h>

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

int main()
{
    HMODULE hMod = LoadLibrary(L"UptimeFaker32.dll");
    if (!hMod)
        return 1;

    DWORD tickCount = GetTickCount();
    DWORD time = timeGetTime();

    std::cout << "GetTickCount: " << tickCount << std::endl;
    std::cout << "timeGetTime: " << time << std::endl;
    return 0;
}

Console results:

QueryPerformanceCounter=0

GetTickCount: 26363796
timeGetTime: 26363796

QueryPerformanceCounter=1 (and 49 days)

GetTickCount: 4259980812
timeGetTime: 4259980812

ProcessTime option

Option that makes the process count from its inception rather than system uptime.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.