FreePHG grabs observed hand histories from memory and
stores these to disk. The format used to store the hand histories is exactly the same as the old .hhf format used by the old Party Poker client.To use FreePHG then simply run FreePHG.exe while observing
tables, and you should see the observed hands starting to appear in the "C:\FreePHG_HandHistories\" folder shortly after.The names of the files that are dumped to disk should match the table names you are observing. Also all new hands seen will be appended to the .hhf if they already exist.
The latest test version can be downloaded from here: FreePHG version 2.12
(Old versions of FreePHG can be found here: FreePHG version 0.07c)
General discussion about FreePHG Version 2.0, and how to use it, can be found over at the "2+2 software forum" in this thread.
Old discussions about FreePHG Version 0.x, can be found in this thread.
(Problems relating to importing hands into PokerTracker, PokerOffice or PokerManager can be found in this thread)
The following four options may be set from within "FreePHG.ini":
a) Location of output folder [default: C:\FreePHG_HandHistories].
b) Hand history extension [hhf or txt].
c) Grab observed hands only [0 or 1].
d) Add the 6max tag [0 or 1].
e) Output HH files [0 or 1].
f) Output ".live" files [0 or 1].
NOTE: After you have edited any of these settings you MUST restart FPHG for the settings to become active.
| FreePHG -s | Used to force silent mode (no output) [default = Off]. |
| FreePHG -prof | Used to force profiling (speed test) [default = Off]. |
| FreePHG -d <delay in ms> | Used to control CPU load of FreePHG [default = 1000ms]. |
| FreePHG -e <extension> | Change the extension of the files [default = hhf]. |
| FreePHG -a <align bytes> | This makes assumption hand starts are always aligned to X bytes [default = 2]. |
| FreePHG -p <priority> | -2 =Low, -1=BelowAverage, 0 = Normal, 1=AboveAverage & 2=High [default = Normal] |
| FreePHG -r | This writes the log files in real-time, but unless you need this option don't use it as could be possible problems). Use a smaller delay if you do decide to use it (-d 500 or less). |
| FreePHG -o | Used to make FPHG only write observed hands. If you use this option, then hands you are involved in will not be saved [default = Off]. |
| FreePHG -6max | Used to add the old (6max) tag to hands [default = Off]. |
| FreePHG -debug | Used to help me track down bugs [default = Off]. |
For example to use silent option, with a delay of 200ms and
file extension of .txt, you would use the following command:FreePHG -s -d 200 -e txt
1. You *MUST* allow FreePHG to inject the TestDLL.dll into
the PartyGaming.exe process. If you block it using ProcessGuard, then FreePHG will not work correctly.2. If you use FPHG 0.0x rather than 2.x then it will be MUCH slower.
1. Have made it so we can choose (independantly) if we wish to output the HH files, the ".live" files, or both using new options in the ".ini" file. This can be useful to reduce disk writes for those only datamining HH files or those only using BetPot (or other AHK scripts) which uses the ".live" files.
1. Fixed client-crash on re-open problem. No need to v2.11b code now, as can safely open/close client while running FPHG after the fix.
1. Minor fix to insure that we never start FPHG after the client is allready open, nor attempt to close while the client is open.
1. Have made it so that the first hand will be saved now. This seems to work OK, but need to watch out for corrupted first hands to be sure.
2. Have made it so that the ".ini" file is stored with the main application now, and have updated the format of the ".ini" file (have removed the "legacy" options which are not used by the new code).
3. The path where the hand histories are saved to can now be set from within the ".ini" file.
1. Have attempted again to fix the problem with players who have
strange characters in their name (tested on 2 players, but can't be sure it will work for them all...).1. Fixed a problem where sometimes we have "Trny:" rather than "Trny :"
in the HH file.1. Have made it so that FPHG will use the tournament number in
Speeds SNGs as the table name. This is done for both the filename and also for the table name inside of the ".hhf" file. By doing this it should be possible to import the hands into PT and also should mean that the Party client can be told not to write HHs which causes the vanishing buttons bug (hopefully - untested yet).1. Have implemented a proper UnHook() function which seems to be
working safely so far, so now FPHG may be exited while Party is still running.2. Have removed the explicit check for ASCII chars in the buffer to
avoid problems with players who have strange letters in their name.1. Have optimized the Unicode matching more and re-arranged the code
order to try to reduce overhead in memcpy() hook as much as possible.2. Have gone back to dynamically allocating the Buffer and the table
list to try to fix the problem people reported about "Unable to initialize" error message.3. Have reverted to use MT rather than MT-DLL link option incase
some of the functions we are using are not loaded into Party's memspace.1. Fixed bug which caused fold actions to stall the realtime mode.
1. Optimized the string matching to work with Unicode native strings.
2. Fixed the problem causing the "Out of memory" messages from Party.
1. Have added several more strings to be matched to try to fix the problem of certain hands having the end truncated.
2. Have fixed a bug where "all-in" was being matched rather than "all-In". This could explain some of the hand end problems too.
1. Made it so that FPHG will now save hands from "play money" games.
2. Added a critical section inside of the hook to reduce the chance of any problems from dual processors (ie: is now threadsafe).
3. Have added back the old "live" subfolder to reduce the chance of
problems when using an AHK script which read the hand histories such as the 'betpot' script (all ".live" files are removed each time FPHG is restarted).4. Have added an ".ini" file which lets you set the following options:
a) Hand history extension [hhf/txt]
b) Use Debugging mode [0/1]
c) Grab observed hands only [0/1]
d) Add the 6max tag [0/1]
It is created the first time FPHG is run (with default settings) here: "C:\FreePHG_HandHistories\FPHG.ini" and thereafter it is possible to alter these 4 options which will be used after FPHG is next started.
5. Have fixed a bug that caused the Party client to run slower than it should have (re/de-allocating memory over and over...).
1. Fixed to work with the new Unicode HH format that Party is using.
1. Fixed to work with Empire Poker again now.
1. COMPLETE RE-WRITE USING 2+2er's NEW GRABBING METHOD...
- Used almost no CPU time to do it's work.
- Never misses hands or hand endings like old versions of FPHG.
2. Added a GUI which minimizes to the system tray.
3. Packaged everything properly, using an installer. The hand
histories which are saved will still be saved to "C:\FreePHG_HandHistories\" at the moment (this will be fixed soon).1. Fixed to work with the new Unicode format now (rollback from FPHG 2).
- Just ran a pre-processor loop to remove all even bytes from the buffer we read.
- Set default string alignment to 2 because of the removal of even bytes and because they have started aligning to 4 byte boundaries rather than the old 8.
1. Fixed to work with new Empire update.
0. [0.07b: Fixed to work with new Empire update.]
1. Modified core For loop checking for '#Gam' to run decrementing, checking against zero; doubles the speed of the loop itself. That also required removing the code which would re-align our counting upwards at the end of hand checks, since we now run downwards. Unfortunately, this means that actual hand contents get double-scanned, but it's still a positive trade-off.
2. Unrolled the Stars-Check loop to be a compound If statement. This let the
core loop compile down to a size which fits in processor cache, because it
caused performance to skyrocket, even though the stars check is hit
infrequently. In testing, the stars check was hitting about 500 times per memory
scan, even with very dirty memory (many tables running for a long time), but we
experienced a manyfold increase in throughput.
3. Separated processing wihtin core for realtime mode with preliminary If
statement; avoids multiple "realtime?" checks during both modes. In
realtime branch, removed double-loop checking for "Wins" and then
"\n0" when single "\n0" will suffice. Massive improvement
for realtime.
4. Wrote separate HandleTableDataRealtime function just for realtime mode;
revised original HandleTableData function to omit decisions meant for realtime
mode. HandleTableData is now slightly faster; HandleTableDataRealtime is much,
much faster at realtime than the old HandleTableData was.
5. Separated GetTableNameAndNumber into two functions, one for table name and
one for hand number. This allows writing realtime mode to skip checking for
table name when unnessary; getting table name is more time-intensive than hand
number. (This offers no gain for non-realtime mode, as it will always confirm
that a hand fragment ends with "wins" before processing and pulling
the table name, so table name will usually be necessary. On the other hand, in
realtime, the table name is only necessary the first time a new hand number is
processed).
6. Included code to capture the detection of a new hand number when mid-scan by
flagging PendingHand field and saving PendingHandNumber. Processing of the new
hand does not start until the scan cycle completes; this ensure that we always
get the end of the previous hand from the current scan before abandoning it in
favor of the new hand. This situation is rare, but was possible. Note that this
is not a concern when not in realtime mode. In regular mode, a hand is not
passed to the HandleTableData routine until it has a "wins" line at
the end, which is long after the previous hand is completed. In realtime mode,
the beginning of the next hand can get passed to the HandleTableDataRealtime
routine in the same cycle where it finds the last line of the previous hand.
7. Switched from integer types to unsigned integer types whenever possible. Ok,
not really - just whenever not totally inconvenient.
1. Added the option to only write observed hands (ie: ignore
hands you are involved in and not write them).2. Added in the "-debug" option to try to track down the
reported slowdown.3. Added in the "-6max" option to make the hand histories
have the 6max tag added.1. Now works with Empire Poker also.
1. Can now handle multiple copies of Party in the same user area.
2. Fixed a bug in which was causing the "-r" option to not be
recognized.1. Added another small optimization to the core loop, as noticed
that party seems to always align strings to 8byte boundaries (added -a option just in case). This optimization resulted in about a 40-50% speedup over version 0.03's code.2. Due to the rest of the optimizations, have increased the default
sleep time to 1000ms.3. Have added a "real-time" write option. Due to the way the
monotonically increasing hand numbers are used for each table, then a much lower sleep should be used to be sure that you don't miss the end of hands (ie: too slow and we might see a new hand at a lower address and just forget about finishing off the previous hand...4. Added minor bugfix in that we could in theory mine over 1000 tables
and wasn't checking for an overrun...5. Have made it so that it can have the priorities set from the command
line (uses thread now to start the main loop). Had to change "-p" to "-prof" because of this.6. Prints the options that we are using (because getting too many/confusing).
1. Have added the "-p" option (off by default) to help start with
in profiling for speeding up FreePHG (for my use mainly). Remember to set sleep delay to 0ms if using this...2. Have increased the speed (in memory passes per minute) by about
250% of what it was for version 0.02 (much less CPU used now!). Have found a minimum bound on the size of a page holding a HH to be 65k. By using this got about 50% increase in passes/min. Have speeded up the core string scan loop by about 100%-200%.3. Have fixed the "side pot bug" which used to cause hands with
"side pots" to have the "main pot" line missed at the end.4. Have fixed a bug that made the "side pot bug" and "split pot bug"
much worse by stopping the "More Data" mode from working most of the time (you should now see "New Data [X]" displayed much more).5. Have fixed a (potential) bug where party could lock it's memory
causing ReadProcessMemory() to return invalid values and skip the memory (possible missing hands because of this?).1. There was a bug here where tournament table names were
getting truncated, have fixed this by simply using '\r' as the delimitater and then removing " (Real Money)" from the table name.2. Have now made it so FreePHG displays verbose output by
default, and now we need to use the option "-s" to make it silent.