Navigation
Browse the developer docs

FH2 Modding Guide · Chapter 3

Extra Options

You are writing an Extra Options plugin or package, or your mod has to live alongside it.

By Trinculo54 · from the FH2 Modding Guide · CC BY 4.0 · copied 4 Dec 2026 · read the original, which may be newer

On this page

Extra Options (EO) is the quality-of-life mod most FH2 PC players run. It patches the game in memory, mounts the mediaoverride and mediapc folders, loads data-only mods and plugin DLLs, and rewrites some UI pages as the game reads them. This chapter is for anyone who writes an EO plugin or EO mod, and for platform mod authors whose mods run beside EO: what it changes, where, how to work with it, and how not to switch it off by accident.

Extra Options is written by Arthur (RokkuDayo) and released under the GNU GPL v3: https://github.com/RokkuDayo/ForzaHorizon2_ExtraOptions (the wiki is on the same repo). Everything here describes EO 0.6.0 unless a version is named. EO changes quickly; when this chapter and EO's own docs\ folder disagree, trust EO's docs for the version you have.

All addresses are for forza_durango_release_final.exe of 24 Nov 2015 (TimeDateStamp 0x565501ED, SizeOfImage 0x3A18000), image base 0x140000000. game+0xRVA is the offset from the image base; the full address is 0x140000000 + RVA.

Related chapters: Getting started (installs and the three routes), The FH2 Mod Platform, Game data (files, database, strings, XAML), Hooking safely and Troubleshooting.


What Extra Options is

A proxy DLL beside azimuth.exe

  • On Azimuth, EO is winmm.dll next to azimuth.exe. Azimuth imports WINMM statically (for timeBeginPeriod), and WINMM isn't a KnownDLL, so the copy in the application folder wins. EO forwards every winmm export to System32's winmm.dll.
  • EO also supports a second translation layer, where it is loaded as xg.dll in the game's Mount folder. Plugins can tell the two apart with context->adapter (section The plugin API).
  • EO 0.6.0 also runs Forza Motorsport 5 and Forza Horizon 3, each with its own ini (FM5_ExtraOptions.ini, FH3_ExtraOptions.ini). It recognises the title from Azimuth's TitleId; FH2 is 1A96545B.
  • It exports Fh2TweaksStatus(), which returns the same status text as line 2 of its log. Other code (the FH2 Mod Platform included) uses this export to detect EO.
File (beside azimuth.exe)What it is
winmm.dllEO itself
FH2_ExtraOptions.iniSettings read at start-up (strict, see below)
FH2_ExtraOptions.datChoices made on EO's in-game settings rows
FH2_ExtraOptions.logRewritten every start. Line 1 is the version, line 2 the status
mods\EO mods and their plugins

EO is built with Zig and Python (python build.py <zig.exe> --azimuth); you only need that to build EO itself, not to write plugins for it.

Licence

EO is GPLv3. A plugin talks to EO through a plain C header and a context struct passed at run time; it links nothing from EO. If you copy EO's code into your own project, that code brings the GPL with it.

A warning worth repeating to players

EO's README warns that there is no "All-In-One" PowerShell installer. Anything that asks players to paste PowerShell commands to "install Extra Options" is a scam (one was a keylogger). Link players to EO's GitHub releases.


Which EO fits which Azimuth

EO checks the Azimuth executable it runs inside, by size, PE timestamp, SizeOfImage and a full SHA-256. Every new Azimuth release needs a new EO release. There is no bypass; on an unknown Azimuth EO patches nothing and says so.

EOReleasedAzimuthWhere it goes
0.2.34Oct 20260.9.6replaced data\bin\azimuth-tls.dll
0.2.68 / 0.2.74Oct 20260.9.9same
0.2.88 / 0.2.98Oct 20260.9.10winmm.dll proxy
0.3.0Oct 20261.0.1 onlywinmm.dll beside azimuth.exe
0.3.2Oct 20261.0.2same
0.4.4Oct 20261.0.1, 1.0.2, 1.0.3, 1.0.4same; mods in mods\<mod>
0.4.5Nov 2026samemods move to mods\Forza Horizon 2\<mod> (migrated automatically)
0.6.0 / 0.6.1Nov 20261.0.1 to 1.0.4, and 1.0.4 with the FH3 DLC patchsame
  • GitHub tag names such as Azimuth_v1.0.4 name the Azimuth version, not EO's. Read the release title for EO's.
  • On an unsupported Azimuth the log says: "REFUSED: unsupported Azimuth build. Extra Options x.y.z supports the inspected Azimuth 1.0.1, 1.0.2, 1.0.3 and 1.0.4 executables only".
  • Azimuth 1.0.4 does not load winmm.dll from mods\. It must sit beside azimuth.exe, or EO silently isn't there.
  • When a new Azimuth ships before EO supports it, players run without EO for a while. Nothing reads mediaoverride then unless something else mounts it; this is why the FH2 Mod Platform 2.7.3 and later mount it themselves when EO is absent (see Living alongside the platform).

How EO starts (Azimuth, 0.4.4 and later)

  1. azimuth.exe loads winmm.dll at process start. EO's DllMain only records its module handle.
  2. When Azimuth first resolves timeBeginPeriod, EO arms a redirect of Azimuth's game-mapping call (12 bytes written into int3 padding in azimuth.exe, byte-guarded, restored before the original runs). The log status meanwhile is "Waiting for Azimuth to prepare the loaded game."
  3. When Azimuth's mapper returns, the game is mapped at 0x140000000, relocated and its imports bound, but no game code has run. EO reads the TitleId; for other titles it logs "INACTIVE: the loaded title is outside this build's supported profiles." and only forwards winmm.
  4. EO then, in one go on that thread: reads the ini and .dat, hashes the exe on disk, prepares mods\, configures plugins, applies every patch in one transaction, optionally repairs Azimuth save markers, and writes the log.
  5. Plugins load later, on a worker thread started from EO's file resolver on the game's first file lookup.

Installing EO and its strict ini

Players install EO by copying winmm.dll and FH2_ExtraOptions.ini beside azimuth.exe. A missing ini means all code defaults (which differ from the shipped ini in places, see the table below).

One unknown key stops all of EO

FH2_ExtraOptions.ini is parsed strictly:

  • At most 8,192 bytes, UTF-8 or ASCII (a UTF-8 BOM is fine). UTF-16 is refused: "REFUSED: INI must use UTF-8 or ASCII, not UTF-16."
  • Comments start with ; or #.
  • Any unknown section, unknown key or invalid value refuses the whole of EO: "REFUSED: invalid INI section, option, or value. See the supplied FH2_ExtraOptions.ini."
  • Known sections: Global (alias General), Content, Frontend, Autodrive, PhotoMode, Bindings, Mods, Files, Compatibility, Experiments, plus the legacy Gameplay, Camera, Graphics, Livery, HUD, Language, Profile. A few retired keys are silently ignored.

Never add your own keys to EO's ini, and never tell players to. One typo or one extra key disables every EO feature, its mod loader and every plugin. Keep your mod's settings in your own file.

Status lines

Line 2 of FH2_ExtraOptions.log (and Fh2TweaksStatus()) starts with OK: (patched, or the exe already carries EO's patches), DISABLED: ([Global] Enabled=0), INACTIVE: (not a title EO supports) or REFUSED: (nothing patched, see the table below). After it come the effective Key=value settings, then feature lines (FILES:, MODS:, PLUGINS:, GARAGE: and so on). There are no timestamps; an old file date means EO didn't run at all.


All or none: how EO verifies the game

EO only patches a game it has checked byte for byte, and it applies all its patches or none. This matters to every other mod: if you change one of EO's bytes before EO looks, players lose all of EO without an obvious error.

  1. The exe on disk. forza_durango_release_final.exe must be 58,204,160 bytes with SHA-256 3ec04c6163fb5614e3d351ba0570d39b846041a257715d6340eceb03ccb7f0a3, after EO puts back the original bytes at its own patch ranges. EO also accepts about 24 exes pre-patched by its own older exe patcher (core, VIP, frontend, livery and anti-aliasing variants). Any other change anywhere in the file fails.
  2. The mapped image. AMD64, TimeDateStamp 0x565501ED, SizeOfImage 0x3A18000.
  3. Every site in memory. Before writing anything, EO compares the live bytes at every one of its 352 sites (0.6.0: 91 fixed byte patches, 261 runtime callback sites and one data value) with its list of accepted bytes (the original, or EO's own patched bytes). One unexpected site and nothing is written.
  4. The write. EO pins its own DLL, makes every page writable, writes, flushes the instruction cache and restores protection. A failure at any step rolls back.

EO checks once, before writing, and never again. So:

  • Changing one of EO's sites before EO runs makes EO refuse everything.
  • Changing one after EO has finished doesn't make EO refuse, but you are now fighting EO for that code.

What makes EO refuse, and the fix

Log line 2CauseFix
REFUSED: unsupported Azimuth build...Azimuth newer or older than this EO supportsGet the EO release for that Azimuth
REFUSED: invalid INI section, option, or value...Unknown key, typo, bad valueRestore the shipped ini, then change values only
REFUSED: INI must use UTF-8 or ASCII, not UTF-16.Ini saved as UTF-16Save as UTF-8
REFUSED: unsupported executable size. / ...differs from the supported FH2 build outside the known patch ranges.Exe patched by another tool, or a different buildRestore the original exe
REFUSED: unsupported loaded executable headers. No patches applied.Wrong game build mappedUse the 24 Nov 2015 build
REFUSED: unexpected loaded bytes at <site name>. No patches applied.Another mod changed an EO site before EO ranHook only after EO has finished (platform mods: wait_for_code)
REFUSED: cannot make every patch page writable... / ...instruction-cache flush failed...Rare system failuresReport to EO with the log
Log missing or oldEO didn't loadWrong folder, unsupported Azimuth, or Wine's builtin winmm (see the checklist)

Feature and patch reference

This is what EO 0.6.0 changes, so you know which settings a player may have on, which game code is already taken, and which pad buttons already do something.

The sites other mods meet most often

SiteRVAAddressWhat EO does there
File resolver slot (CFileSys vtable +0x210)game+0x2E6EF280x142E6EF28Swaps the pointer (original game+0x11F49B0) for its own resolver: media overrides, mods, plugin start-up
UIRenderer LoadComponent resource callgame+0x16EBB370x1416EBB37Redirects through a thunk at game+0x13FE354: the XAML rewrite point
Stateflow XML parse slotgame+0x2EC4FE00x142EC4FE0Edits pause.xml, ui_screens.xml and others in memory (original game+0x13DE7E0)
Local car update slotgame+0x2C5CC000x142C5CC00Pad gestures, lights, roof; drives the plugin vehicle callback (original game+0x2A9400)
PauseMenu wire-the-tiles slotgame+0x2E143100x142E14310Points it at EO's callback, which calls the original game+0xDC6E30
HUD options reset slotgame+0x2DF07C80x142DF07C8HUD page reset (original game+0xD33AE0)
Treasure Map extras entrygame+0xDBDD900x140DBDD90Call replaced by mov al,1
Game database opengame+0xF65322, game+0x109312E0x140F65322, 0x14109312ECalls retargeted to thunks: merges EO mods' database.json
String table loadgame+0x12454410x141245441Call retargeted to a thunk: merges strings.json
FMOD bank DiskPath slotgame+0x2E6EEC80x142E6EEC8Bank paths for mod files (original game+0x11F1460)
Bink video open slotgame+0x2EA86500x142EA8650.bk2 overrides (original game+0x11A0710)

Settings in the ini

Default is the value in the shipped ini; the code default (used when the key is absent) is in brackets where it differs.

Section.KeyDefaultWhat it does
Global.Enabled1Everything, including the mod loader and plugins. 0 = DISABLED
Content.UnlockDLC1All DLC entitlements (the Storm Island map still needs its package)
Content.OfflineVIP1VIP perks: double credits and XP, wheelspin bonus
Content.UnlockTreasureMap0Bonus boards and barns revealed; stays in the save once saved
Content.UnlockStormIslandCars1Ranger T6 and #7 SST without the Storm Island events
Frontend.CarsNextToHome1Pause menu tab order (Cars right of Home). Restart
Frontend.ShowPlaygroundEvents0Playground events in "Show All Events"
Frontend.MenuTurboIntervalMs100LB/RB held 0.5 s repeats; 20-1000 ms, 0 off. Restart
Frontend.SkipIntro1Boot straight to "Press Start"
Frontend.GetInCarFromPauseMenu1"Get In Car" from My Cars in free roam
Frontend.AllRimsCategory1 [0]Combined aftermarket and stock rim categories, no database writes
Frontend.EnableMarketplace, EnableSocial, EnableClubs, EnableRivals1Live-only pause tabs offline
Autodrive.Enabled1 [0]GPS autodrive
PhotoMode.FreeCamera1No photo-mode collision or bounds
Mods.DatabaseCache1Cache of the merged database in mods\Cache\fh2-db
Files.EnableMediaOverrides1 [0]Mount mediaoverride and mediapc
Compatibility.DisableParentalLocks1User-content privilege checks allowed locally
Compatibility.GenerateMissingSaveCommits1Rebuild missing Azimuth save commit markers
Experiments.LocalDrivatarLiveries1Drivatars wear saved designs from the player's library
Experiments.MaxDrivatarLiveries5 [6]0-32
Experiments.UnlockAeroTuning0Aero tuning without aero parts (can change PI)
Experiments.AllEngineSwaps, AllTransmissionSwaps0Whole catalogue in swaps; keep on while using cars saved with them

Many settings moved into the game's own Video, HUD, Audio, Assist and Controller pages, saved in the .dat: drift camera, field of view per camera, sun shadows, photo samples, minimap orientation, livery resolution and anti-aliasing, spawn location, units, player character and more. Their old ini keys (for example Livery.Enable4K, HUD.MinimapFollowsCamera, Graphics.SmoothSunShadows) are still accepted.

Pad and keyboard bindings

If your mod takes a pad button, check EO's [Bindings] defaults first, or one press does two things:

  • Pad: autodrive DPadDown; headlights RightStick tap; roof RightStick held 1.5 s while stationary; signals DPadLeft/DPadRight held 0.5 s (a tap still changes the radio); hazards DPadUp; photo mode DPadUp held 1 s; showroom photo View; car meet photo X; return to garage X; jump to manufacturer View (cars) and Y (rims).
  • Keyboard: autodrive F2, headlights F3, roof F4, jump to manufacturer Tab, toggle UI F1.
  • Players can rebind them (A, B, X, Y, LB, RB, LT, RT, View, Menu, the DPad and sticks, + for combinations, None to turn one off), so treat these as likely, not certain.

Patches and hooks by feature

FeatureSettingFixed byte patches (RVA)Runtime hooks
Skip introFrontend.SkipIntro0x21D5A0, 0x21E68D, 0x22009D, 0x221280 (jumps made unconditional)
Offline VIPContent.OfflineVIP7 calls replaced by mov eax,1, 0x29F00C to 0x6F54D7
DLCContent.UnlockDLC0x9BE8BB, 0x9BEC6B, 0x1E03795
Treasure MapContent.UnlockTreasureMap10 sites incl. 0x405E86 (barns), 0xD72DB4/0xD72DBA (map), 0xDBDD90 (Extras)callback pointer in padding 0x4028F8
Storm Island carsContent.UnlockStormIslandCars0xB02F69, 0xCACEC9
Skip car-meet bootin-game spawn choice0x87AC66
Photo free cameraPhotoMode.FreeCamera0x3978E8, 0xAA0081, 0xAA00FB
Lights, hazards, signalsBindings.*0x963703, 0x964C00, 0x964D08, 0x964D38local car update 0x2C5CC00, roof fade 0x2C81388, thunks 0x9630D4, 0x964DB4, 0x965464
Minimap follows camerain game0xBAAFF6, thunk in padding 0xBABB88callback pointer 0xBAAE68
Get In Car from pauseFrontend.GetInCarFromPauseMenu0xCCF660stateflow parse 0x2EC4FE0; pause slots 0x2E14310, 0x2E14350, 0x2E20DD0
Marketplace tabFrontend.EnableMarketplace5 group flags 0xDDACAD-0xDDBB3E; 177-byte SQL string in .rdata at 0x1F538C0
Clubs, Rivals, Social tabsFrontend.Enable*5 + 7 + 3 group flags, 0xDDAE0A-0xDDBE0E
Aero tuningExperiments.UnlockAeroTuning0xE9AB3B, 0xE9ABA7, 0x1057635, 0x10576B0thunks 0x1061064, 0x1061234
RimsFrontend.AllRimsCategory12 sites, 0xEB6A30-0x13A92BFthunks 0xEB0274, 0xECD6A4, 0xECDE31, 0xECFC22, 0x108D414; name slots 0x2D826A0, 0x2E5EF20
Drift camerain game0x10369C9, 0x103C87Dthunks 0x103B261, 0x103B281; camera update slots 0x2E703D0, 0x2E77EC8, 0x2E78140
Field of viewin game6 camera slots 0x2E70420-0x2E788F0
Sun shadowsin game0x1131C02, 0x1153E5A, 0x11556B5
4K liveries, MSAAin game9 sites 0x121D0A1-0x12258F1 (code in int3 padding)
Parental locksCompatibility.DisableParentalLocks0x1249C50, 0x1249E90
Settings pages, page rewritesGlobal.Enabled0x16EBB37thunk 0x13FE354, reset slots 0x2E60900, 0x2DF07C8
AutodriveAutodrive.Enabled13 slots (GPS, tracker, pause, UI draw)
Media overrides, modsFiles.EnableMediaOverrides, Global.Enabledresolver 0x2E6EF28, video 0x2EA8650, bank 0x2E6EEC8, database 0xF65322/0x109312E, strings 0x1245441
Showroom photoBindings.ShowroomPhotoXbox6 slots 0x2D63CF8-0x2DD3750
Photo samplesin gameruntime data value at 0x2E83CE4 (int, original 295)

EO's runtime hooks come in five kinds, all verified before writing:

KindWhat EO writes
relocated vtable pointerSwaps a pointer in a vtable or .rdata, after checking the original pointer
vtable function pointerSame, for a function slot it wraps
callback pointer in unused paddingAn 8-byte pointer written into int3 padding
callback thunk in unused padding12 bytes, mov rax, imm64; jmp rax, over int3 padding
relative call to callback thunkAn E8 rel32 call retargeted to such a thunk

Besides the 64 runtime hooks EO describes in patches.json, about 200 more callback sites live in the PatchDefinition tables of its fh2/<feature>.c files: manufacturer jump (51, mostly car-list vtables), offline events (42), showroom photo (24), autodrive (12), presentation controls (8) and smaller groups. Before you claim any vtable slot in the car lists, pause menu or settings pages, search those tables.

GroupSiteRVAAddressBytes
INTROintro_resources_skipgame+0x21D5A00x14021D5A06
INTROintro_sequence_skipgame+0x21E68D0x14021E68D2
INTROintro_complete_stategame+0x22009D0x14022009D2
INTROintro_resource_name_skipgame+0x2212800x1402212806
VIPmain_values_vipgame+0x29F00C0x14029F00C5
VIPlocal_vip_profilegame+0x2F850E0x1402F850E7
VIPloaded_profile_vipgame+0x3265A00x1403265A05
VIPreward_context_vipgame+0x612EBA0x140612EBA5
VIPwheelspin_display_vipgame+0x6E8A800x1406E8A805
VIPwheelspin_claim_vipgame+0x6E91550x1406E91555
VIPalternate_claim_vipgame+0x6F54D70x1406F54D75
PHOTO_CAMERAphoto_camera_world_restrictionsgame+0x3978E80x1403978E86
PHOTO_CAMERAphoto_camera_ui_collisiongame+0xAA00810x140AA00812
PHOTO_CAMERAphoto_camera_ui_vertical_boundsgame+0xAA00FB0x140AA00FB6
TREASURE_MAPtreasure_map_mainland_propertygame+0x4028F00x1404028F06
TREASURE_MAPtreasure_map_barn_marker_revealgame+0x405E860x140405E862
TREASURE_MAPtreasure_map_board_setup_bindinggame+0x4F57710x1404F57717
TREASURE_MAPtreasure_map_mainland_property_bindinggame+0xA5E9DA0x140A5E9DA7
TREASURE_MAPtreasure_map_island_property_bindinggame+0xA5E9F70x140A5E9F77
TREASURE_MAPtreasure_map_island_map_checkgame+0xD72DB40x140D72DB44
TREASURE_MAPtreasure_map_mainland_map_checkgame+0xD72DBA0x140D72DBA4
TREASURE_MAPtreasure_map_extras_cataloggame+0xD783DA0x140D783DA5
TREASURE_MAPtreasure_map_extras_entrygame+0xDBDD900x140DBDD905
TREASURE_MAPtreasure_map_island_propertygame+0x16570600x1416570606
BOOT_CAR_MEETmainland_boot_skip_car_meetgame+0x87AC660x14087AC662
VEHICLE_CONTROLSblinker_radio_left_querygame+0x964D080x140964D085
VEHICLE_CONTROLSblinker_radio_right_querygame+0x964D380x140964D385
VEHICLE_CONTROLShazards_photo_inputgame+0x964C000x140964C005
VEHICLE_CONTROLShazards_photo_hold_readygame+0x9637030x1409637035
DLCownership_predicategame+0x9BE8BB0x1409BE8BB4
DLCactive_entitlement_predicategame+0x9BEC6B0x1409BEC6B4
DLCcatalog_purchasedgame+0x1E037950x141E037951
ISLAND_CARSstorm_island_car_availabilitygame+0xB02F690x140B02F695
ISLAND_CARSstorm_island_purchase_gategame+0xCACEC90x140CACEC95
MINIMAPminimap_camera_heading_callgame+0xBAAFF60x140BAAFF65
MINIMAPminimap_camera_heading_thunkgame+0xBABB880x140BABB886
PAUSE_GARAGEpause_garage_get_in_cargame+0xCCF6600x140CCF6602
MARKETPLACEmarketplace_group_enabled_1game+0xDDACAD0x140DDACAD6
MARKETPLACEmarketplace_group_enabled_2game+0xDDAE1F0x140DDAE1F6
MARKETPLACEmarketplace_group_enabled_3game+0xDDB2F50x140DDB2F56
MARKETPLACEmarketplace_group_enabled_4game+0xDDB9100x140DDB9106
MARKETPLACEmarketplace_group_enabled_5game+0xDDBB3E0x140DDBB3E6
MARKETPLACEcatalog_include_owned_packsgame+0x1F538C00x141F538C0177
CLUBSclubs_group_enabled_ddae0agame+0xDDAE0A0x140DDAE0A6
CLUBSclubs_group_enabled_ddb2a1game+0xDDB2A10x140DDB2A16
CLUBSclubs_group_enabled_ddbad5game+0xDDBAD50x140DDBAD56
CLUBSclubs_group_enabled_ddbcd8game+0xDDBCD80x140DDBCD86
CLUBSclubs_group_enabled_offline_refresh_ddbe0egame+0xDDBE0E0x140DDBE0E6
RIVALSrivals_group_enabled_ddae34game+0xDDAE340x140DDAE346
RIVALSrivals_group_enabled_ddaef0game+0xDDAEF00x140DDAEF06
RIVALSrivals_group_enabled_ddaf7agame+0xDDAF7A0x140DDAF7A6
RIVALSrivals_group_enabled_ddb123game+0xDDB1230x140DDB1236
RIVALSrivals_group_enabled_ddb2b6game+0xDDB2B60x140DDB2B66
RIVALSrivals_group_enabled_ddb655game+0xDDB6550x140DDB6556
RIVALSrivals_group_enabled_ddbaeagame+0xDDBAEA0x140DDBAEA6
SOCIALsocial_group_enabled_ddae81game+0xDDAE810x140DDAE816
SOCIALsocial_group_enabled_ddb75dgame+0xDDB75D0x140DDB75D6
SOCIALsocial_group_enabled_ddba96game+0xDDBA960x140DDBA966
AERO_TUNINGaero_front_tuning_unlockedgame+0xE9AB3B0x140E9AB3B5
AERO_TUNINGaero_rear_tuning_unlockedgame+0xE9ABA70x140E9ABA75
AERO_TUNINGfront_aero_physics_rangesgame+0x10576350x1410576355
AERO_TUNINGrear_aero_physics_rangesgame+0x10576B00x1410576B05
RIMSstock_rim_localized_name_callgame+0xEBC61E0x140EBC61E5
RIMSall_rims_categories_querygame+0xECE71F0x140ECE71F6
RIMSall_rims_items_querygame+0xECF3070x140ECF3076
RIMSstock_wheel_variant_querygame+0x108FADC0x14108FADC5
RIMSfactory_rim_size_category_lockgame+0xEB6A300x140EB6A305
RIMSfactory_rim_size_category_selectgame+0xEBFB450x140EBFB455
RIMSfactory_rim_size_part_lockgame+0xEBFF380x140EBFF385
RIMSstock_wheel_archive_preloadgame+0xFD054C0x140FD054C5
RIMSstock_wheel_models_startupgame+0x11AF25B0x1411AF25B5
RIMSstock_wheel_models_previewgame+0x11B0F300x1411B0F305
RIMSstock_wheel_archive_startupgame+0x138E6340x14138E6345
RIMSstock_wheel_archive_previewgame+0x13A92BF0x1413A92BF5
DRIFT_CAMERAdrift_camera_heading_callgame+0x10369C90x1410369C95
DRIFT_CAMERAdrift_camera_chase_spring_callgame+0x103C87D0x14103C87D5
SUN_SHADOWSsun_shadow_all_cascades_per_framegame+0x1131C020x141131C027
SUN_SHADOWSsun_shadow_cascade_direction_refreshgame+0x1153E5A0x141153E5A2
SUN_SHADOWSsun_shadow_focus_direction_refreshgame+0x11556B50x1411556B52
LIVERYlivery_5game+0x121D0A10x14121D0A113
LIVERYlivery_6game+0x121D1E10x14121D1E113
LIVERYlivery_7game+0x121D3410x14121D34113
LIVERYlivery_2game+0x121EA6A0x14121EA6A6
LIVERYlivery_1game+0x121F0DA0x14121F0DA5
LIVERYlivery_0game+0x121F1120x14121F1125
LIVERYlivery_3game+0x12258E90x1412258E98
LIVERYlivery_4game+0x12258F10x1412258F18
MSAAlivery_msaagame+0x121E9B70x14121E9B76
PARENTALprofile_multiplayer_privilegegame+0x1249C500x141249C5010
PARENTALprofile_content_privilegegame+0x1249E900x141249E9010
VIDEO_OPTIONSdrift_video_resource_callgame+0x16EBB370x1416EBB375
GroupHookKindRVAAddressOriginal target
FRONTEND_XMLgarage_xml_parse_hookrelocated vtable pointergame+0x2EC4FE00x142EC4FE0game+0x13DE7E0
ROADgarage_nearest_road_store_hookrelocated vtable pointergame+0x2D275D00x142D275D0game+0x93CA40
TREASURE_MAPtreasure_map_board_setup_callbackcallback pointer in unused paddinggame+0x4028F80x1404028F8
AUTODRIVEautodrive_gps_updaterelocated vtable pointergame+0x2CC31980x142CC3198game+0x6B4D30
AUTODRIVEautodrive_gps_deactivationrelocated vtable pointergame+0x2CC31B00x142CC31B0game+0x6C0C70
AUTODRIVEautodrive_tracker_updaterelocated vtable pointergame+0x2CC32880x142CC3288game+0x6B4E40
AUTODRIVEautodrive_tracker_destructionrelocated vtable pointergame+0x2CC32780x142CC3278game+0x6A26E0
AUTODRIVEautodrive_pause_entryrelocated vtable pointergame+0x2D166980x142D16698game+0x8E98E0
AUTODRIVEautodrive_event_context_entryrelocated vtable pointergame+0x2D1EA500x142D1EA50game+0x912860
AUTODRIVEautodrive_ui_wait_renderrelocated vtable pointergame+0x2E7F0400x142E7F040game+0x1140ED0
AUTODRIVEautodrive_notice_textrelocated vtable pointergame+0x2ECF6C80x142ECF6C8game+0x140A800
AUTODRIVEautodrive_ui_drawrelocated vtable pointergame+0x2ECFAA80x142ECFAA8game+0x15B51A0
AUTODRIVEautodrive_ui_presentrelocated vtable pointergame+0x2ECFAA00x142ECFAA0game+0x15B5110
AUTODRIVEautodrive_ui_wait_render_plainrelocated vtable pointergame+0x2E832A80x142E832A8game+0x1140ED0
AUTODRIVEautodrive_ui_draw_baserelocated vtable pointergame+0x2F090880x142F09088game+0x15B51A0
AUTODRIVEautodrive_ui_present_baserelocated vtable pointergame+0x2F090800x142F09080game+0x15B5110
MINIMAPminimap_camera_heading_callbackcallback pointer in unused paddinggame+0xBAAE680x140BAAE68
MEDIA_OVERRIDESmedia_override_native_resolverrelocated vtable pointergame+0x2E6EF280x142E6EF28game+0x11F49B0
RIMSall_rims_query_callbackcallback pointer in unused paddinggame+0xECF5D80x140ECF5D8
DRIFT_CAMERAdrift_camera_heading_thunkcallback thunk in unused paddinggame+0x103B2610x14103B261
DRIFT_CAMERAdrift_camera_chase_spring_thunkcallback thunk in unused paddinggame+0x103B2810x14103B281
DRIFT_CAMERAdrift_camera_driver_updatevtable function pointergame+0x2E781400x142E78140
DRIFT_CAMERAdrift_camera_hood_updatevtable function pointergame+0x2E77EC80x142E77EC8
DRIFT_CAMERAdrift_camera_bumper_updatevtable function pointergame+0x2E703D00x142E703D0
VIDEO_OPTIONSdrift_video_resource_thunkcallback thunk in unused paddinggame+0x13FE3540x1413FE354
VIDEO_OPTIONSdrift_video_reset_optionsvtable function pointergame+0x2E609000x142E60900
CAMERA_FOVfov_followrelocated vtable pointergame+0x2E784100x142E78410game+0x1034120
CAMERA_FOVfov_chaserelocated vtable pointergame+0x2E786800x142E78680game+0x1034120
CAMERA_FOVfov_far_chaserelocated vtable pointergame+0x2E788F00x142E788F0game+0x1034120
CAMERA_FOVfov_driverrelocated vtable pointergame+0x2E781900x142E78190game+0x10340F0
CAMERA_FOVfov_hoodrelocated vtable pointergame+0x2E77F180x142E77F18game+0x10340F0
CAMERA_FOVfov_bumperrelocated vtable pointergame+0x2E704200x142E70420game+0x10340F0
VIDEO_OPTIONShud_reset_optionsrelocated vtable pointergame+0x2DF07C80x142DF07C8game+0xD33AE0
VEHICLE_CONTROLSlocal_car_vehicle_controls_updaterelocated vtable pointergame+0x2C5CC000x142C5CC00game+0x2A9400
VEHICLE_CONTROLSroof_black_fade_colorrelocated vtable pointergame+0x2C813880x142C81388game+0x477C50
RIMSstock_wheel_archive_text_thunkcallback thunk in unused paddinggame+0xECD6A40x140ECD6A4
RIMSstock_wheel_archive_string_thunkcallback thunk in unused paddinggame+0xECDE310x140ECDE31
RIMSstock_wheel_models_thunkcallback thunk in unused paddinggame+0xECFC220x140ECFC22
RIMSstock_rim_localized_name_thunkcallback thunk in unused paddinggame+0xEB02740x140EB0274
VIDEO_OPTIONSpause_garage_footerrelocated vtable pointergame+0x2E143100x142E14310game+0xDC6E30
VIDEO_OPTIONSpause_garage_help_actionrelocated vtable pointergame+0x2E20DD00x142E20DD0game+0xDE7490
VIDEO_OPTIONSpause_garage_updaterelocated vtable pointergame+0x2E143500x142E14350game+0xDCE660
VIDEO_OPTIONSgarage_location_activationrelocated vtable pointergame+0x2C98D100x142C98D10game+0x559260
VEHICLE_CONTROLSblinker_radio_query_thunkcallback thunk in unused paddinggame+0x964DB40x140964DB4
AERO_TUNINGfront_aero_tuning_rangescallback thunk in unused paddinggame+0x10612340x141061234
AERO_TUNINGrear_aero_tuning_rangescallback thunk in unused paddinggame+0x10610640x141061064
RIMSstock_rim_part_name_everymanrelocated vtable pointergame+0x2D826A00x142D826A0game+0xEB70B0
RIMSstock_rim_part_namerelocated vtable pointergame+0x2E5EF200x142E5EF20game+0xEB70B0
RIMSstock_wheel_variant_query_thunkcallback thunk in unused paddinggame+0x108D4140x14108D414
VEHICLE_CONTROLShazards_photo_input_thunkcallback thunk in unused paddinggame+0x9630D40x1409630D4
VEHICLE_CONTROLShazards_photo_ready_thunkcallback thunk in unused paddinggame+0x9654640x140965464
ADDONSaddon_database_open_thunkcallback thunk in unused paddinggame+0x108E9D40x14108E9D4
ADDONSaddon_sqlite_open_thunkcallback thunk in unused paddinggame+0x108D5240x14108D524
ADDONSaddon_database_openrelative call to callback thunkgame+0xF653220x140F65322
ADDONSaddon_sqlite_openrelative call to callback thunkgame+0x109312E0x14109312E
ADDONSaddon_string_table_thunkcallback thunk in unused paddinggame+0x12455140x141245514
ADDONSaddon_string_table_loadrelative call to callback thunkgame+0x12454410x141245441
MEDIA_OVERRIDESmod_video_file_redirectrelocated vtable pointergame+0x2EA86500x142EA8650game+0x11A0710
VIDEO_OPTIONSshowroom_photo_viewrelocated vtable pointergame+0x2DD37100x142DD3710game+0xCCE280
VIDEO_OPTIONSshowroom_photo_pause_viewrelocated vtable pointergame+0x2D63CF80x142D63CF8game+0xCF8D80
VIDEO_OPTIONSshowroom_photo_autoshowrelocated vtable pointergame+0x2DC6C200x142DC6C20game+0xCA99A0
VIDEO_OPTIONSshowroom_photo_view_inputrelocated vtable pointergame+0x2DD37500x142DD3750game+0xCD1690
VIDEO_OPTIONSshowroom_photo_pause_inputrelocated vtable pointergame+0x2D63D380x142D63D38game+0xCD1690
VIDEO_OPTIONSshowroom_photo_autoshow_inputrelocated vtable pointergame+0x2DC6C600x142DC6C60game+0xCADDB0

Not in patches.json but also hooked by 0.6.0: the audio globals open at game+0x13DE5D6 (thunk game+0x13DE661), the FMOD bank DiskPath slot game+0x2E6EEC8, the bank load diagnostics at game+0x10121D4 and game+0x101218D, and the game's CreateFileA import slot game+0x1DD11B0.


The plugin API

An EO plugin is an ordinary 64-bit DLL that EO loads into the game process. The API is small: one header, one context struct, and up to four optional exports. It gives you a place and a time to start, three callbacks and a log. It does not give you hooks, settings rows or anything else; you write those yourself.

Where plugins live and when they load

  • Folder: <Azimuth folder>\mods\Forza Horizon 2\<mod>\plugins\*.dll (EO 0.4.5 and later; 0.3.x-0.4.4 used mods\<mod>\plugins\). There is no global plugins folder: a plugin always belongs to an EO mod.
  • Only top-level DLLs load. Subfolders are for your resources and dependencies. DLLs load with LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS, so a dependency beside your plugin resolves.
  • Order: mods in loadorder.txt order, then DLLs by case-insensitive file name. Prefix numbers if order matters.
  • Only active mods load plugins: the mod must be enabled in loadorder.txt, its database.json (if any) must have merged, and [Global] Enabled=1. Files.EnableMediaOverrides doesn't matter.
  • When: on a worker thread started from EO's file resolver at the game's first file lookup, after EO's patches. Game threads are already running. Nothing waits for your initialiser.
  • Lifetime: no unloading, no reloading. A DLL stays loaded until exit even when its initialiser fails (it may own hooks). Restart the game after replacing a plugin. A plugin crash is a game crash.

The log gets one line per DLL:

PLUGINS: <path> | initialized
PLUGINS: <path> | loaded (no optional initializer)
PLUGINS: <path> | initializer returned FALSE; module retained
PLUGINS: <path> | load failed (<Windows error>)
PLUGINS: <path> | private media directory ready
PLUGINS: <path> | private media directory rejected

The context and the exports

Copy fh2/fh2_plugin.h from EO's repo. The ABI is version 1, unchanged since 0.2.x; the context is 64 bytes.

typedef struct FH2PluginContext {
    uint32_t size;                        // sizeof(FH2PluginContext)
    uint32_t api_version;                 // FH2_PLUGIN_API_VERSION (1)
    uint32_t adapter;                     // 1 = Azimuth, 2 = the other translation layer EO supports
    uint32_t game_image_size;             // 0x3A18000 for FH2
    void *game_image;                     // the mapped, relocated game (0x140000000 under Azimuth)
    HMODULE plugin_module;
    const wchar_t *plugins_directory;     // this mod's plugins folder
    const wchar_t *plugin_path;           // this DLL
    const char *extra_options_version;    // for example "0.6.0"
    void (*log_utf8)(const char *message);// appends raw text to FH2_ExtraOptions.log
} FH2PluginContext;

All four exports are optional and found by name (use extern "C" in C++):

ExportSinceCalled onContract
BOOL WINAPI FH2PluginInitialize(const FH2PluginContext *)0.2.xEO's loader worker, once, after your DllMain returnedContext and strings stay valid until exit. TRUE turns your callbacks on. FALSE is logged, the DLL stays, no callbacks, no retry
void WINAPI FH2PluginVehicleUpdate(const FH2PluginVehicleFrame *)0.2.176the game thread updating the local player's car, before the original update; never AI carscar is borrowed for this call only. Keep it short
BOOL WINAPI FH2PluginDatabaseUpdate(const FH2PluginDatabaseFrame *)0.2.211the game thread that owns the database, once per merged databaseBorrowed connection. Own your transaction; return FALSE after rolling back
const wchar_t *WINAPI FH2PluginMediaDirectory(void)0.2.212the loader worker, once after a successful initA finished, unchanging folder inside plugins_directory; its files add to your mod's media
typedef struct FH2PluginVehicleFrame {
    uint32_t size, input_enabled;  // input_enabled = 0 in menus, loading, no gameplay input, or window unfocused
    void *car;                     // ForzaCar*, borrowed
    uint32_t buttons;              // XInput-style button bits (16 bits used)
    float delta_seconds;
    int (WINAPI *flash)(void);     // the game's white player-view flash; returns 0 if the camera is busy
} FH2PluginVehicleFrame;

typedef struct FH2PluginDatabaseFrame {
    uint32_t size, api_version;
    void *database;                // the merged in-memory sqlite3* (the game's own SQLite)
    int (*prepare)(void *, const char *, int, void **, const char **);  // sqlite3_prepare_v2
    int (*step)(void *);
    int (*finalize)(void *);
    int64_t (*column_int64)(void *, int);
} FH2PluginDatabaseFrame;

Details that catch people out:

  • Under Azimuth, GetModuleHandleW(NULL) is azimuth.exe, not the game. The game isn't a loaded module. Always use context->game_image.
  • log_utf8 adds no line ending, and it isn't atomic across threads (lines from two threads can interleave). End every line with \r\n and write whole lines in one call.
  • Vehicle callback: it still runs when input_enabled is 0, so you can cancel a half-done gesture. Some stopped simulations don't update the car at all. Handle car changes, and require the button to be released before arming again. The bits come from the game's own controller state and match EO's binding table: DPad 0x1/0x2/0x4/0x8, Menu 0x10, View 0x20, LS 0x40, RS 0x80, LB 0x100, RB 0x200, A 0x1000, B 0x2000, X 0x4000, Y 0x8000. The triggers are not in this field.
  • Database callback: EO allows initialisers up to 5 seconds after the database handoff; ready providers run before the game's database factory returns. Later ones run on the next local-car update. The connection is invalid once a new merge begins; never use it from another thread. Only prepare, step, finalize and column_int64 are offered (no bind, no text columns), so write SQL with literal values.
  • Private media folder: EO canonicalises the path; it must be an existing folder strictly inside plugins_directory, or it is "rejected". Your mod's normal media\ wins over it. Don't rewrite files while the game may have them open. It doesn't add names to a base zip's file list. A mod's mod.json can also point "media" into the plugin folder instead.

A minimal plugin

This plugin checks it is in the right game, logs a line, flashes the screen on a fresh LB press, and makes one car cheaper in the Autoshow. It has not been compiled or run for this guide; treat it as a starting point.

// MyPlugin.c -> <Azimuth folder>\mods\Forza Horizon 2\My Mod\plugins\MyPlugin.dll
#include "fh2_plugin.h"   // copy from EO's repo: fh2/fh2_plugin.h

#define PAD_LB 0x0100u    // LB in EO's binding table and in XInput

static const FH2PluginContext *g_ctx;

static void say(const char *line) { g_ctx->log_utf8(line); } // add "\r\n" yourself

// The mapped game keeps its PE header: check the exact build before touching anything.
static int is_fh2_build(const unsigned char *base) {
    const IMAGE_DOS_HEADER *dos = (const IMAGE_DOS_HEADER *)base;
    if (!base || dos->e_magic != IMAGE_DOS_SIGNATURE) return 0;
    const IMAGE_NT_HEADERS64 *nt = (const IMAGE_NT_HEADERS64 *)(base + dos->e_lfanew);
    return nt->Signature == IMAGE_NT_SIGNATURE &&
           nt->FileHeader.TimeDateStamp == 0x565501EDu &&
           nt->OptionalHeader.SizeOfImage == 0x3A18000u;
}

__declspec(dllexport) BOOL WINAPI FH2PluginInitialize(const FH2PluginContext *ctx) {
    if (!ctx || ctx->api_version != FH2_PLUGIN_API_VERSION || ctx->size < sizeof(*ctx)) return FALSE;
    g_ctx = ctx;
    if (ctx->game_image_size != 0x3A18000u || !is_fh2_build(ctx->game_image)) {
        say("MY MOD: this isn't the FH2 build I know, so I'm staying off.\r\n");
        return FALSE;
    }
    // Install your own hooks here, after checking the exact bytes at each site
    // (const unsigned char *)ctx->game_image + RVA. See 05-hooking.md.
    say("MY MOD: ready.\r\n");
    return TRUE;
}

__declspec(dllexport) void WINAPI FH2PluginVehicleUpdate(const FH2PluginVehicleFrame *f) {
    static int armed = 1;
    int held = (f->buttons & PAD_LB) != 0;
    if (!held) { armed = 1; return; }               // released: ready for the next press
    if (!f->input_enabled) { armed = 0; return; }   // pressed in a menu: wait for a release
    if (armed) { armed = 0; if (f->flash) f->flash(); }
}

static int exec_sql(const FH2PluginDatabaseFrame *f, const char *sql) {
    void *stmt = 0; const char *tail = 0;
    if (f->prepare(f->database, sql, -1, &stmt, &tail) != 0 /* SQLITE_OK */) return 0;
    int rc = f->step(stmt);
    f->finalize(stmt);
    return rc == 101; // SQLITE_DONE
}

__declspec(dllexport) BOOL WINAPI FH2PluginDatabaseUpdate(const FH2PluginDatabaseFrame *f) {
    if (!f || f->size < sizeof(*f) || !exec_sql(f, "SAVEPOINT my_mod")) return FALSE;
    // Car 247 is the 1969 Toyota 2000GT, 80,000 CR in the stock database.
    if (exec_sql(f, "UPDATE Data_Car SET BaseCost=50000 WHERE Id=247"))
        return exec_sql(f, "RELEASE my_mod");
    exec_sql(f, "ROLLBACK TO my_mod");
    exec_sql(f, "RELEASE my_mod");
    say("MY MOD: database change failed and was rolled back.\r\n");
    return FALSE;
}

Notes on the example:

  • No DllMain is needed; if you write one, keep it empty. Do your work in FH2PluginInitialize, outside the loader lock.
  • LB is only an illustration. The game reads the same button, so a real plugin should use a combination or a binding the player can change, and must avoid EO's own defaults (table above).
  • The LB bit matches EO's own binding table and XInput's XINPUT_GAMEPAD_LEFT_SHOULDER, but it is unconfirmed in game for this example.

Building it

Any x64 compiler that makes a normal Windows DLL works; the ABI is plain C.

:: MSVC, from an x64 Native Tools prompt (EO's own docs write /Isource; the header lives in fh2\ in the repo)
cl /nologo /LD /O2 /MT /I<folder with fh2_plugin.h> MyPlugin.c /link /OUT:MyPlugin.dll

:: llvm-mingw or mingw-w64
x86_64-w64-mingw32-clang -shared -O2 -I<folder with fh2_plugin.h> -o MyPlugin.dll MyPlugin.c

:: Zig (what EO's own plugins use)
zig cc -target x86_64-windows-gnu -shared -O2 -I<folder with fh2_plugin.h> -o MyPlugin.dll MyPlugin.c

Check that the exports kept their plain names (llvm-objdump -p MyPlugin.dll or dumpbin /exports): you should see FH2PluginInitialize, FH2PluginVehicleUpdate and FH2PluginDatabaseUpdate, with no decoration. EO's repo has a smaller example in examples/plugins/hello_plugin.c and two full plugins under fh2/plugins/ (an engine-rev plugin and a weather plugin that adds a settings page).

Hooks in a plugin are your job

EO has no hook framework, no byte checks for you, and no chaining between plugins or with the FH2 Mod Platform. If you hook:

  • Byte-check every site against the 24 Nov 2015 exe and stay off, with a log line, on any mismatch.
  • Don't touch EO's own sites (the tables above, and the PatchDefinition tables in EO's source).
  • Game threads are already running when your initialiser runs. EO's weather plugin writes an 8-byte jmp rel32 to a stub near the image, keeps a trampoline for the displaced prologue, checks the expected prologue bytes, and suspends every other thread (checking none is inside the prologue) while it writes. MinHook does the same job.
  • If the FH2 Mod Platform is also installed, a platform mod may already have hooked the function you want, or will be refused later because you changed its bytes. Check for a jump before writing yours. See Living alongside the platform and Hooking safely.

Media overrides

The game opens every file by path through one resolver. EO mounts extra folders in front of the game's own files, so a mod can replace a file without touching the game's zips. Game data covers the file formats; this section covers where to put files and in what order they win.

How the game finds a file

  • game:\ is the game's Mount folder. T:\ is FH2's temporary drive, which Azimuth 1.0 keeps in <Azimuth folder>\data\titles\1A96545B\tmp and doesn't empty between starts. A game:\ path containing .. stops the game.
  • Every lookup goes through the file system's resolver at vtable slot game+0x2E6EF28 (CFileSys vtable game+0x2E6ED18, +0x210), original game+0x11F49B0. The file system holds a list of volumes, each mounted at a path with a 32-bit priority, highest first.
  • Zips mount only if media\zipmanifest.xml has a line for them, read once at start-up. Zip members appear under a virtual folder named after the zip: media\Camera.zip becomes game:\media\Camera\.
  • The exe has no mediaoverride or mediapc folder of its own. Loose overrides are entirely a mod feature.

What EO mounts, and in what order

On the first file lookup after the game's primary volume exists, EO mounts folder volumes, all at game:\media\:

VolumePriorityWhere it is on disk
mediaoverride0x7FFFFFFE<game>\Mount\mediaoverride\
mediapc0x7FFFFFFD<game>\Mount\mediapc\
EO's carbin cache0x7FFFFFFCunder mods\Cache
Each active EO mod's media0x70000001 + 2 × position (later in load order = higher)<Azimuth folder>\mods\Forza Horizon 2\<mod>\media\
EO mods' zipsregistered with the game's own zip readerinside the mod's media\
The game's own files and zipslower<game>\Mount\media\

The log line is "FILES: mediaoverride > mediapc > mods (last first) > original assets; native folder mounts ready."

Things to know:

  • mediaoverride and mediapc are in the game's Mount folder, beside forza_durango_release_final.exe, not beside azimuth.exe. mods\ is beside azimuth.exe. Mixing these up is the most common "nothing happens".
  • Every Azimuth install that shares one Mount folder sees the same mediaoverride.
  • Mapping: a loose file media\path\file goes to mediaoverride\path\file. A zip member media\X.zip → path\file goes to mediaoverride\X\path\file. Example: media\Camera.zip → CameraGroups.xml becomes mediaoverride\Camera\CameraGroups.xml. Unchanged members still come from the zip. Matching ignores case.
  • The switch: Files.EnableMediaOverrides defaults to 0 when absent but is 1 in the shipped ini. When any EO mod is active, EO mounts mediaoverride and mediapc anyway, even with the switch at 0. With 0 and no EO mods, nothing is mounted.
  • Restart after changing files. Mounts and EO mods' file indexes are built once; files added while the game runs aren't seen.
  • Not covered: direct volume access, zip file lists (a loose file doesn't add a name to a zip's listing) and new DLC packages.

What can be overridden

KindWhere it goesStatus
UI pages (XAML)mediaoverride\UI\... (members of media\UI.zip); new files there are found tooProven
Camera and stateflow XMLmediaoverride\Camera\..., mediaoverride\stateflow\...Proven
String tablesmediaoverride\Stripped\StringTables\<LANG>\<Table>.str (whole table)Proven
Game databasemediaoverride\Stripped\gamedbRC.slt (whole file)Proven; clashes with every other mod that does it, prefer database.json or the platform's add_sql
Car thumbnailsStripped\RC<n>\Thumbnail_<Id>_Big.swatchbin / _Small.swatchbin, even names the RC zip lacksProven
Car zipsEO mod media\cars\ (no manifest), or a whole override zipmanifest.xmlProven
Bink videosmedia\ui\videos\*.bk2; EO opens these itself (mediaoverride, mediapc, then mods)EO 0.6.0
audio\audioglobals.xmlNormal paths; the game opens it past the resolver, EO 0.6.0 special-cases itEO 0.6.0 only
FMOD banks (.bank)for example media\audio\fmodanthem\durango\PG_<engine>.bankUnconfirmed in game for EO mods and packs
Carbinswhole .carbin, or <car>.carbin.json patches (EO mods only)Proven
Drivatar cachemedia\DrivatarGlobalCache\DefaultCache.binProven
Textures inside track archives (PGZP)Not overridable: they bypass the resolver

EO converts nothing and runs nothing from media: files must already be in the game's formats.

Loose files or zips

WhereLoose filesNew zips
Mount\mediaoverride, Mount\mediapcYesOnly with a zipmanifest.xml line, which means overriding the whole manifest
EO mod media\Yes; within one mod, loose beats zip membersYes, found recursively, no manifest. Standard single-volume zips, stored or deflated; no ZIP64, no split archives. Registered only after the mod's database merge succeeds
EO mod media\zipmanifest.xml, media\stripped\gamedbRC.sltIgnored on purpose

EO logs each zip it found and whether it mounted (entry count or the Windows error), and which volume answered the first carbin lookup per archive. Mounting doesn't prove the car's model data works in the game.

Azimuth's T:\ layer (FH2 Mod Platform without EO)

This isn't EO, but it explains why files "move" depending on whether EO is installed:

  • Without EO on Azimuth 1.0 or later, platform 2.9.0+ writes its files (string tables, set_files, Mods pages, database, merged zipmanifest.xml) to T:\fh2-platform\media\, which is <Azimuth folder>\data\titles\1A96545B\tmp\fh2-platform\media, mounted at 0x7FFFFFFE. Car packs mount from 0x7FFFFFF0 down, and mediaoverride/mediapc move to 0x7FFFFF00/0x7FFFFEFF. Each Azimuth folder then has its own mods even when installs share one Mount.
  • With EO, the platform writes to Mount\mediaoverride as before (EO mounts it), and car packs use T:\fh2-platform\eo-media (see car packs with EO).
  • With EO loaded, EnableMediaOverrides=0 and no active EO mod, the platform's files are written but never read.

Platform mods should always use set_file and override_root() and never hard-code mediaoverride (The FH2 Mod Platform).


EO mods: data without code

An EO mod is a folder. It can carry loose files, zips, database changes, string changes, carbin patches and plugins, and EO merges them all in memory at start-up. The game's files are never written.

Layout (EO 0.4.5 and later)

<Azimuth folder>\
  winmm.dll  FH2_ExtraOptions.ini  FH2_ExtraOptions.dat  FH2_ExtraOptions.log
  mods\
    Cache\                    EO's caches (fh2-db and others); delete only with the game closed
    Forza Horizon 2\
      loadorder.txt
      My Mod\
        mod.json              optional manifest
        database.json         optional database changes
        strings.json          optional localised strings
        media\                loose files, carbin JSON patches, ordinary zips
        plugins\              optional DLLs

Folders from the older mods\<mod>\ layout are moved automatically (conflicts or locked files are logged and retried next start; linked folders must be moved by hand).

loadorder.txt

  • UTF-8, one folder name per line, # comments. Disable a mod with # My Mod; EO won't turn it back on.
  • New folders are appended (alphabetically when the file is empty); missing ones are removed; your comments and order are kept.
  • Later lines win.
  • A duplicate or invalid line disables every EO mod.
  • Folders starting with a dot and folder links aren't found.
  • Limits: 128 mods, 64 KiB load order, 16 MiB per JSON file, 64 MiB of JSON in all.
  • EO scans once per launch, on the first database open, file lookup or string load. Folders added later are seen next start.

mod.json

{
  "format_version": 1,
  "id": "my-mod",
  "name": "My Mod",
  "author": "Your name",
  "version": "1.0.0",
  "description": "What it does, in one line.",
  "database": "database.json",
  "media": "media",
  "strings": "strings.json",
  "dependencies": ["other-mod"]
}
  • id: lowercase ASCII letters, digits and single hyphens. Without a mod.json the folder name is the identity. addon.json is the old name.
  • Use null for parts you don't have. Dependencies must be earlier in the load order and load successfully; a duplicate id rejects the later mod.

database.json

Never write this by hand. Make it with EO's diff tools (export_database_diff.py / mod_diff.py, or drag two files onto "Mod Diff.cmd") from the stock gamedbRC.slt and your edited copy.

  • Format 2 describes, per table, a key, insert rows (all columns, never replacing), update rows (where the full key, set new values, expect the original values) and guarded deletes. BLOBs are written {"blob_hex":"00ff"}.
  • No schema changes and no arbitrary SQL. Use a plugin's database callback for anything else.
  • id_conflicts:
    • error (default): a clash skips your whole mod.
    • nearest: your new row takes the closest free positive id (up to 32,768 away) and EO rewrites references to it, including foreign keys and the known car, engine, body, make, manufacturer and wheel references. Use this for new rows.
    • last_wins (0.3.11+): rows share an identity; the later mod supplies every column and can override stock rows. Use only when you mean to.
  • update_conflicts: error or last_wins. id_references declares extra relationships. target.base_sha256 only warns.
  • Each mod is one transaction on a private in-memory copy of whatever database the game opened. A failure rolls back that mod and turns off its media and every mod that depends on it.
  • With nearest, ids depend on the load order. Keep the order stable once players have saves using those ids.

The cache: with [Mods] DatabaseCache=1 EO keys the merged result on the incoming database, EO's version, the enabled mods in order and their JSON. Anything that rewrites the database the game opens on every launch (for example another tool replacing mediaoverride\Stripped\gamedbRC.slt) forces a cold merge every time, which takes several seconds.

strings.json

{
  "format_version": 1,
  "fallback_language": "EN",
  "languages": {
    "EN": { "Data_Car": { "27932": "911 GT3 RS (992)" } }
  }
}
  • Keys are string ids (decimal, 0-65534) inside the named table, not car ids. Table names have no .str and must exist.
  • Languages: EN, GB, BR, CHT, CZ, DE, ES, FR, HU, IT, JP, KO, MX, NL, PL, RU, DEV, LOC.
  • Later mods win; keys you leave out keep the game's text; strings can't be deleted.
  • Database text columns hold references such as _&1568980374. As a 32-bit number, the high 16 bits are the table id and the low 16 bits the string id: 0x5D84BD96 is table 23940 (List_PartManufacturer.str), string 48534. So a new car's DisplayName points at a string id you then define in strings.json.

Carbin JSON patches

Since DLL 0.2.140 an EO mod can patch a car's carbin instead of replacing it: put <car>.carbin.json next to the carbin's virtual path, for example media\cars\SUB_BRZ_13\SUB_BRZ_13.carbin.json. The format is fh2-carbin-patch version 1, made with carbin_json.py diff. With nearest, EO also remaps the carbin's upgrade, body and model ids in memory. It never rewrites model GUIDs or asset paths, so give a new car distinct ones.

Add-on cars: with and without EO

A car is a Data_Car row plus media\cars\<MediaName>.zip (the carbin, modelbins, swatchbins and materials). Game data covers the tables.

Without EOWith an EO mod
Mounting the zipNeeds a zipmanifest.xml line, so the mod ships a whole manifest (the game's 608 lines plus its own). A second car mod doing the same overwrites the firstNo manifest. EO reads the zip's central directory itself and mounts it with the game's zip object
Database rowsWhole gamedbRC.slt or SQL; shared ids between mods roll back the later moddatabase.json with nearest renumbers new ids
NameWhole Data_Car.strstrings.json
Stock rimsResolve through the donor's carbin (StockWheelID)
ExampleEO's repo: examples/mods/porsche-911-gt3-rs-2023
  • There is no safe way to append one line to zipmanifest.xml: a line for a missing zip likely crashes, an element that isn't Zip hangs start-up, and a changed zip needs its line's offsets changed. Don't edit the game's zips or manifest in place.
  • The FH2 Mod Platform's car packs (2.9.0+, fh2-cars\) are a separate system that also avoids the manifest clash, and they do work with EO 0.6.0 (see below). Install a car as a pack or as an EO mod, never both.

Choosing the lightest form

You want toUse
Swap an assetLoose files in an EO mod's media\ (or Mount\mediaoverride for a quick personal test)
Change datadatabase.json / strings.json from EO's diff tools
Add a carEO mod: zip + database.json (nearest) + strings.json + thumbnails, or a platform car pack
Change behaviourA plugin DLL, or a platform mod

UI page rewriting by x:Class

EO adds its settings rows and changes a few menus by editing XAML text as the game reads it. If your mod ships its own page built from a stock one, EO may edit yours too.

Where and how EO matches

EO redirects the UIRenderer LoadComponent resource call at game+0x16EBB37 (through the thunk at game+0x13FE354) and looks at every page the game loads, wherever it came from: UI.zip, mediaoverride, an EO mod or another mod's file. It matches with an exact, case-sensitive substring search for x:Class="<class>": no spaces, double quotes.

Class matchedWhat EO does
ForzaUI.Scenes.Anthem.A_MessageBoxManufacturer jump: replaces the whole tilt, MainContent and Menu tags with its own 550-wide list; unnamed parts and resources stay
ForzaUI.A_HudOptions, ForzaUI.A_VideoOptions, ForzaUI.A_AudioOptions, ForzaUI.Scenes.Anthem.A_AssistOptions, ForzaUI.A_ControllerOptionsAdds EO's setting rows
ForzaUI.A_PhotoModeDriver options
ForzaUI.A_PauseMenuTab order (CarsNextToHome)
ForzaUI.A_PostRaceEventResultsOffline events
ForzaUI.Scenes.Anthem.A_CarMeetCarDetails, ForzaUI.A_ViewCar, ForzaUI.A_ColorSelectPhoto and footer buttons; also needs a unique x:Name="DefaultHelpPanel"
Any page with exactly one <local:FZMaterial ImageSource="{Binding SelectedItem.LogoPath, ElementName=UpgradePartList}"Upgrade logos (not class-based)

Size limits in 0.6.0: pages over 262,144 bytes are never touched; pages over 65,536 bytes only for the pause menu and post-race results; EO's output buffer is 131,072 bytes.

The x:Class = workaround

A track-import mod built its track picker on the message-box page. With EO loaded, EO replaced the page's layout with its manufacturer list and the picker came out wrong. The fix is one space:

<!-- EO edits this page: -->
<UserControl x:Class="ForzaUI.Scenes.Anthem.A_MessageBox" ...>

<!-- EO leaves this one alone; XML allows the space, and the game reads it the same: -->
<UserControl x:Class ="ForzaUI.Scenes.Anthem.A_MessageBox" ...>

This is proven in game with EO 0.4.4, and the FH2 Mod Platform writes its own pages the same way. Use it on any page that copies one of the classes above, unless you want EO's edits. If a page still won't keep its layout, search winmm.dll for the class and part names before blaming the game: a newer EO may match differently.

Stateflow XML

EO's parse hook (slot game+0x2EC4FE0) edits ui_screens.xml, pause.xml, race_trigger_activation.xml, free_roam_start.xml, garage.xml, race_flow.xml and post_race_flow.xml in memory. It matches the file's base name (ignoring case) and edits by text anchors, so a replaced pause.xml still gets EO's edits as long as the anchors are there.

  • Success: "GARAGE: pause.xml car reload/resume sequence patched in memory."
  • Anchors missing: "GARAGE: unsupported menu-flow text; car reload unavailable." The feature is off for that session.
  • Keep replaced stateflow files close to stock. The platform's own pause.xml keeps EO's anchors.

The game's XAML reader

These are the game's rules, not EO's, but you meet them as soon as you edit a page:

  • It decodes only &amp; &apos; &quot; &gt; &lt; and hex references with a lowercase x, &#xF3;. Every other reference, including decimal &#243;, becomes a space.
  • No BOM means one byte per character (Latin-1; 0x80-0x9F are control codes, not Windows-1252). A UTF-8 BOM switches on a lax UTF-8 decoder that can swallow a closing quote after a stray byte.
  • Don't turn &#123;/&#125; into real braces: an unknown markup extension crashes the page when it opens.
  • A page that names a missing resource or style crashes the game when it opens. Use only resources that exist in UI.zip.
  • The Anthem fonts have every Polish, Czech and Hungarian letter but not Romanian ă ș ț, and Cyrillic only Ё/ё.

Game data has more on pages, fonts and the state machine.


Living alongside the FH2 Mod Platform

Most players who run platform mods also run EO. They coexist well once you know the order things happen in and which code each one owns.

Load order and timing

  1. azimuth.exe starts and loads both as static imports from its folder: the platform as DWrite.dll (and d3dcompiler_47.dll on older Azimuth), EO as winmm.dll.
  2. The platform calls every mod's fh2mod_init from its loader thread straight away. The game isn't mapped yet.
  3. The player presses Play; Azimuth maps the game. EO verifies and patches here, before any game code runs.
  4. On the game's first file lookup, EO mounts its folders and starts its plugin worker.
  5. From then on, platform mod threads and EO plugin workers run side by side.

How the platform deals with EO:

  • Detection: the platform looks for a loaded module exporting Fh2TweaksStatus. GetModuleHandle("winmm.dll") isn't reliable (it can return System32's copy).
  • wait_for_code (API 3) waits for the game, then, if EO is installed, until EO's log for this launch has its final status (OK:, REFUSED:, DISABLED:) or its winmm proxy line. After 20 s it goes ahead and logs that. With EO it is typically ready well under a second after mapping.

Hooking before EO switches it off

Any byte change at one of EO's 352 sites before EO checks them makes EO refuse everything, for the player, with no in-game sign: "REFUSED: unexpected loaded bytes at ". So:

  • Platform mods: hook only after api->wait_for_code(), from your own thread. See The FH2 Mod Platform.
  • Anything else (your own proxy, a plugin for another loader): wait for EO's status line before writing.
  • EO plugins are safe here by design: they load after EO has patched.

After EO has patched, the platform compares the bytes each hook would change with the exe on disk. A site that EO (or anything else) changed is refused with "game code doesn't match" rather than layered on top. If you need a function EO patches, talk to EO's author rather than fighting over it.

EO plugins have no such check. A plugin can hook a function a platform mod wants; the platform mod is then refused. A plugin that hooks after a platform mod finds the platform's jump and must notice it and back off itself. There is no shared hook chain between the two systems.

Neighbouring sites

None of EO's sites is a site the platform or its mods hook, but some sit right next to each other. These all chain correctly today:

AreaPlatformEOWhy it works
Marketplace Extras tileDetours the handlers game+0xDBD720, game+0xDBDD00, game+0xDBDD60 (0x140DBDD60), game+0xDBFE40Patches a call at game+0xDBDD90 (0x140DBDD90) for Treasure MapDifferent bytes
HUD options pageSwaps the pointer at game+0x2DF07B0 (0x142DF07B0, buttons)Swaps game+0x2DF07C8 (0x142DF07C8, reset)Different slots
Pause menu tilesDetours game+0xDC6E30 (0x140DC6E30) inlineSwaps the vtable slot game+0x2E14310 (0x142E14310) that points to itEO's callback calls game+0xDC6E30, so both run
File resolverSwaps slot game+0x2E6EF28 itself only without EO (2.7.3+), byte-checked against diskOwns the slot when loadedNever both; with EO, EnableMediaOverrides decides

The platform's AVUI property hook game+0x157FF60 and title-screen slot game+0x2E53940 aren't EO sites. Hooking safely lists every site not to touch.

Conflicts seen, and their fixes

What happenedCauseFix
EO's features all gone with a platform mod installedMod hooked before EO checked its byteswait_for_code (platform 2.2.0, API 3)
Platform mods' text, files and database changes vanished on Azimuth 1.0.1Azimuth shipped before EO supported it, so nothing mounted mediaoverridePlatform 2.7.3 mounts it itself when EO isn't loaded
Another mod's database overwrittenMods pinning platform 2.7.1 or older rewrote mediaoverride\Stripped\gamedbRC.sltPlatform 2.7.2; change the database only with add_sql or database.json, never ship a whole gamedbRC.slt
A mod page lost its layoutEO's message-box rewrite matched its x:Classx:Class = with a space
EO silently absent on LinuxWine uses its builtin winmmWINEDLLOVERRIDES="winmm=n,b" (and dwrite/d3dcompiler_47 for the platform). Platform 2.7.1+ logs "Extra Options isn't running: its winmm.dll is next to azimuth.exe, but Wine is using its own winmm.dll instead"
Car packs not read under EOEarly 2.9.0 builds didn't chain behind EO's resolverShipped 2.9.0 chains behind EO (next section)
EO never gets a warm database loadSomething rewrites the database it opens every launchOnly write when inputs change; the platform reuses a byte-identical copy
EO missing after "tidying up"winmm.dll moved into mods\; Azimuth 1.0.4 doesn't load it thereKeep it beside azimuth.exe

Car packs with EO

The platform's own docs may suggest otherwise, but car packs do work with EO 0.6.0. The platform chains behind EO's resolver:

  1. It waits until slot game+0x2E6EF28 holds a pointer into EO's module, then swaps it atomically for its own resolver, keeping EO's as the next one.
  2. It mounts the pack folders from 0x7FFFFFF0 down and its own T:\fh2-platform\eo-media at 0x7FFFFFFF, above all of EO's volumes, then forwards to EO.
  3. It checks this every start: EO took the lookup, packs mounted before EO's volumes, the order is right, and zipmanifest.xml and gamedbRC.slt came from eo-media. Any failure turns packs off for that session, and fh2-mods\platform-eo-packs.txt says in or lost.

Requirements and limits:

  • [Global] Enabled not 0, and either EnableMediaOverrides=1 or at least one active EO mod (otherwise EO mounts nothing).
  • A pack file also present in mediaoverride, mediapc or an EO mod leaves that pack out. An EO mod with its own zipmanifest.xml leaves every pack out.
  • Pack cars never take a Data_Car id that an active EO mod's database.json inserts. An EO mod using last_wins on a pack car's id leaves that pack out.
  • Started from the FH2MP launcher (online), packs are off.
  • EO 0.6.0's FMOD bank hook (slot game+0x2E6EEC8) calls the original resolver directly and can mount EO's folders before the platform's chained resolver sees a lookup. The platform then finds EO's volumes already mounted and may report packs as lost. If platform-eo-packs.txt says lost with EO 0.6.0, this is the first thing to suspect.

Platform mod or EO plugin: which to use

EO mod / pluginFH2 Mod Platform mod
Loaderwinmm.dll; mods\Forza Horizon 2\<mod>, ordered by loadorder.txtDWrite.dll / d3dcompiler_47.dll; DLLs in fh2-mods\, alphabetical
Data without codeYes: media, database.json, strings.json, carbin.json, zips without a manifestNo; from a DLL with set_file, add_sql, string tables, car packs
HooksYour own; no byte checks or chaining providedhook_function, hook_call, hook_pointer, hook_instruction, with disk checks and chaining
CallbacksInit, local-car update, merged database, private media folderSettings rows and pages, title-screen entries, hotkeys, commands, interfaces between mods, crash reports
StartsAfter EO's patches, on the first file lookupfh2mod_init before the game is mapped; hooks after wait_for_code
Azimuth support1.0.1 to 1.0.4, a new EO for each Azimuth0.9.7 to 1.0.1 unchanged; 1.0.3+ needs 2.7.4+ (DWrite.dll)
Works without the otherYesYes (mounts the override folders itself)

Rules of thumb:

  • Asset or data change only: an EO mod. No code, no hooks, merges cleanly with other mods.
  • Behaviour change that other mods might also touch, or that needs settings, hotkeys or pages: a platform mod, so hooks chain and players get a settings row.
  • A small behaviour change for EO players, tied to the player's car: an EO plugin is fine, but do the byte checks yourself.
  • Never ship your own winmm.dll, DWrite.dll or d3dcompiler_47.dll as a proxy. Load through one of the existing loaders.

Pitfalls and debugging checklist

Pitfalls

  • Ini: never add keys; keep it UTF-8 and under 8 KB. One bad line disables all of EO.
  • Folders: mediaoverride/mediapc in the game's Mount; mods\ and winmm.dll beside azimuth.exe.
  • Paths: mirror the game's path under media\; a zip member goes under a folder named like the zip without .zip.
  • Restart after every change: mounts, indexes and plugins load once.
  • Never edit the game's zips or zipmanifest.xml in place, and never ship a whole gamedbRC.slt or manifest when another route exists. Never tell players to delete mediaoverride\Stripped\gamedbRC.slt.
  • Database: diff tools only; error skips your mod on a clash; nearest for new rows; keep the load order stable.
  • Plugins: empty DllMain; check api_version, size and game_image_size; use game_image, not GetModuleHandle(NULL); end log lines with \r\n; keep the vehicle callback short; require a button release; mind EO's default bindings.
  • Hooks: byte-check against the 24 Nov 2015 exe; leave EO's sites alone; nothing may change EO's bytes before EO has run.
  • Pages: x:Class = with a space if you copy a class EO matches; hex references with a lowercase x only.
  • Exe: the exe on disk must be the original (or one of EO's own patched variants), or EO refuses.
  • Saves: mods shouldn't write saves. EO's GenerateMissingSaveCommits only rebuilds missing Azimuth markers.

Debugging checklist

  1. FH2_ExtraOptions.log, line 2: OK, REFUSED (and why), DISABLED or INACTIVE. If the file is old, EO didn't start: wrong folder, unsupported Azimuth, or Wine's builtin winmm.
  2. MODS: lines: your mod's id is ready, or the reason it was skipped (id conflict, dependency, JSON error).
  3. FILES: line: mounts ready, and the priority order.
  4. PLUGINS: lines: one per DLL; initialized is what you want.
  5. Zip lines: mounted with an entry count, and which volume answered the first carbin lookup.
  6. GARAGE: lines: whether your replaced stateflow file still has EO's anchors.
  7. With the platform too: <Azimuth folder>\fh2-mods\platform.log ("game code doesn't match", "car packs with Extra Options:", media override lines) and fh2-mods\platform-eo-packs.txt.
  8. Still stuck: take EO out ([Global] Enabled=0) and test again. If the problem goes, it's an interaction; the conflicts table above lists the known ones.

Unconfirmed and open

  • FMOD banks from EO mods or platform car packs reaching the game's audio: EO 0.6.0 has the hooks, but it is not confirmed in game.
  • The example plugin in this chapter has not been compiled or run. The LB bit (0x100) matches EO's own binding table and XInput, but it is not confirmed in game for a plugin.
  • EO 0.6.0 on Azimuth 1.0.2 wasn't checked for this chapter.
  • EO 0.6.1 ("v0.6.1-latest" on GitHub) wasn't compared with the 0.6.0 source this chapter is based on.
  • The car-pack "lost" case caused by EO's bank hook comes from a code review, not from a reproduced run.

“The FH2 Modding Guide” by Trinculo54 is licensed under CC BY 4.0; its code samples are under the MIT licence. This page is an unchanged copy (links point to this site) of 03-extra-options.md at commit bb10508; corrections belong in the original repository.