Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/angelballay/pes6_game_physics_mod/llms.txt

Use this file to discover all available pages before exploring further.

The Logger module writes structured debug output to D:\pes6_passspeed.log. Logging is disabled by default (static const bool ENABLED = false) to avoid any I/O overhead during normal gameplay. Enable it only when debugging pass behavior or verifying hook installation — every pass power event generates a log entry, which at match pace means hundreds of writes per minute.

Enabling Logging

1

Open Logger.cpp

Find the file at ab_gameplay_mod/Logger.cpp in the project.
2

Change the ENABLED flag

Locate the line:
static const bool ENABLED = false;
Change it to:
static const bool ENABLED = true;
3

Rebuild the DLL

Recompile the project. The flag is evaluated at compile time — both WriteLog and LogFormat become no-ops when ENABLED = false, so there is zero runtime cost in the default build.
The log path D:\pes6_passspeed.log is hardcoded. The D:\ drive must exist on the system, or all CreateFileA calls will silently fail — no error is raised, and the mod continues running without logging. If you do not have a D:\ drive, the log will never be created and no output will appear.

Functions

WriteLog

void WriteLog(const char* text);
Appends text followed by a CRLF (\r\n) line ending to D:\pes6_passspeed.log. Opens the file on every call using CreateFileA with FILE_APPEND_DATA as the access mode, FILE_SHARE_READ as the share mode, and OPEN_ALWAYS as the disposition (creating the file if it does not exist), writes the string and the line terminator using WriteFile, then closes the handle. This append-per-call approach avoids keeping a file handle open across game frames. If ENABLED = false, the function returns immediately without any file I/O.

LogFormat

void LogFormat(const char* format, ...);
Formats a message using vsprintf_s into a 1024-byte stack buffer, then calls WriteLog with the result. Accepts a printf-style format string and a variadic argument list. If ENABLED = false, the function returns immediately before any formatting work is done.
Use a tool like tail -f D:\pes6_passspeed.log in a Git Bash or WSL terminal, or open the file in Process Monitor with a filter on the log path, to watch entries appear in real time as you play. This lets you observe per-pass EDI values and hook installation results without restarting the game.

Log File Path

D:\pes6_passspeed.log
The path is stored as a static const char* in Logger.cpp:
static const char* LOG_PATH = "D:\\pes6_passspeed.log";

Example Log Output

The following shows a representative session log based on the actual format strings in dllmain.cpp and PassPower.cpp:
========================================
pes6_game_physics_mod.dll cargada.
Autor: pitycharly
Version: 1.0
Descripcion: mod de fisicas de pases desarrollado por pitycharly.
========================================
Base del EXE: 0x00400000
Instalando hook contexto en pes6.exe+1A5905 = 0x005A5905
[OK] Hook contexto instalado correctamente.
Instalando hook potencia en pes6.exe+1A637B = 0x005A637B
g_call_78020  = 0x00478020
g_powerReturn = 0x005A6386
[OK] Hook potencia instalado correctamente.
[OK] Overlay Kitserver activo.
[OK] Hotkey activo: Ctrl + Shift + P
[HOTKEY] Thread iniciado. Toggle: Ctrl + Shift + P
[CTX] passId=1 passer=0x12345678 receiver=0x87654321 p=(32,48) r=(35,50) dist=5
[PWR] passId=1 pwrHit=1 edi=0x00004200->0x00005480 ball50Before=3200 dist=5 boostMode=0x15 gate=0x23 newCtx=1 ballD0=(0.00,0.00,0.00) ball1454=(12.50,0.10,-3.20) geom=1 dot=-0.312 ballDist=820.5 passDist=4210.3 pBallRaw=1024 rBallRaw=2048 awkwardLong=0
[HOTKEY] Mod de fisicas DESACTIVADO
[HOTKEY] Mod de fisicas ACTIVADO

Log Entry Reference

PrefixSourceDescription
[CTX]dllmain.cpp LogCurrentContextPass context: passer/receiver addresses, grid positions, discrete distance
[PWR]dllmain.cpp monitor loopPass power event: original and modified EDI, ball state, boost mode, geometry data
[HOTKEY]HotkeyToggle.cppToggle event with new state
[KSO]KitserverOverlay.cppKitserver export resolution and overlay status
[ERROR]MemoryPatch.cpp, CheckBytesByte mismatch or VirtualProtect failure during hook installation
[OK]dllmain.cppSuccessful hook installation or subsystem startup

Build docs developers (and LLMs) love