ff14wed / deucalion

Injected Windows library for capturing decoded FFXIV packets
GNU General Public License v3.0
61 stars 5 forks source link

Improve logging in main and around sig scanning #11

Closed ff14wed closed 1 year ago

ff14wed commented 1 year ago

This PR also adds some refactors to clean up the unused code and to avoid code duplication.

It adds logging for the signature used, the time spent scanning signatures, and emits logs at various parts of the lifecycle to aid in debugging.

Fixes #10

Here are what the new logs look like:

03:00:46 [INFO] Attempting to auto-initialize the hooks
03:00:46 [INFO] Scanning for RecvPacket sig: `E8 $ { ' } 4C 8B 43 10 41 8B 40 18`
03:00:46 [INFO] Found RecvPacket addr(s): [153fcf0, 1546f60, 1580fe0]
03:00:46 [INFO] Sig scan took 67.2561ms
03:00:46 [INFO] Scanning for SendPacket sig: `E8 $ { ' } 8B 53 2C 48 8D 8B`
03:00:46 [INFO] Found SendPacket addr(s): [1541120, 157f7f0]
03:00:46 [INFO] Sig scan took 66.1381ms
03:00:46 [INFO] Hooks initialized.
03:00:46 [INFO] Starting server on \\.\pipe\deucalion-101404
03:00:47 [INFO] New client connected: 0
03:00:59 [INFO] New client connected: 1
03:01:11 [INFO] client disconnected: 0
03:01:14 [INFO] client disconnected: 1
03:01:14 [INFO] Shutdown signal received
03:01:14 [INFO] Hook shutdown initiated...
03:01:14 [INFO] Shut down!