Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

EEex.db Pattern Database

mrfearless edited this page Feb 21, 2019 · 3 revisions

The pattern database is a windows style ini file used to store information about patterns that are looked for by the EEex.dll once it is loaded by the EEex.exe loader. The patterns defined within the database correspond to the addresses of EE game functions and address locations of EE game global variables.

Pattern Definition

Each pattern for a EE game function or EE game global variable is defined in an ini section name. Details about the section name and the key names found in section are:

  • [Pattern Name] - each section name (Pattern Name) should be unique and named to represent the pattern for the EE game function or the EE game global variable that it stands for. Section names that end with = should be changed to a text representation, such as equ. This is due to a limitation of windows style ini files not able to read key names that end with =. The section name (Pattern Name) is used to read a matching key name in the EEex.ini file, which is used to speed up subsequent loads of the EEex Loader by more quickly verifying patterns vs searching fully for all patterns.

  • PatBytes - is a series of bytes in text hexidecimal format repesenting the pattern to match. PatBytes is required. Note: if PatBytes is not defined or has no content, the pattern is not imported or processed.

  • PatAdj - is an unsigned integer representing the value to adjust +/- the found pattern address by, to return the start of the function or the address to read a game global variable from. PatAdj is optional.

  • VerBytes - is a series of bytes in text hexidecimal format repesenting the sub-pattern to check for and verify if the pattern found is the correct. VerBytes is optional.

  • VerAdj - is an unsigned integer representing the value to adjust +/- the found pattern address by, to obtain an address to use for matching the VerBytes sub-pattern (if VerBytes is defined). VerAdj is optional.

  • Type - is a integer value of 0, 1,2,3 or 4. 0 represents a pattern defined for a function. 1 represents a pattern for a game global variable (or a pattern to read a DWORD from an address). 2 represents a pattern to match multiple occurrences for, and to store in an array of addresses. 3 represents a pattern to read a BYTE from an address. 4 represents a pattern to read a WORD from an address. Type is optional.

Pattern Entries

The first defined pattern should always be PatchLocation. This is the pattern to match that locates the patch location to change the EE game code to the EEex_LuaInit function found within the EEex.dll. EEex_LuaInit in turn initializes and registers the lua functions used by EEex in M__EEex.lua and other EEex lua files found in the EE game override folder.

An example of how the PatchLocation pattern entry might look:

[PatchLocation]
PatBytes=83C43085C075145050506AFF50FF35
PatAdj=-5
VerBytes=83C4186A00
VerAdj=24

An example of an EE game function pattern:

[CDerivedStats::GetLevel]
PatBytes=558BEC518D45FC50FF750CFF7508
PatAdj=0
VerBytes=8A00
VerAdj=22

An example of an EE game global variable pattern:

[g_pBaldurChitin]
PatBytes=6683F8FF0F84B6000000A1
PatAdj=34
Type=1

An example of a type 2 pattern:

[CreStructExpand]
PatBytes=68183B0000
Type=2

Pattern Database Limitations

  • PatBytes or VerBytes if defined must be a minimum of 4 bytes in length.
  • PatBytes or VerBytes if defined must be less than 2048 bytes in length.
  • Pattern Names should not have a = at the end of the name.
  • The maximum text length of all section names (Pattern Names) in all sections of the EEex.db file is defined as 65536 bytes. At an average length of 32 characters (approx) per name, this roughly equates to about 2048 pattern entries that can be defined. Any more and the EEex.dll will need to be recompiled to include a higher max size.

Clone this wiki locally