Navigation
Browse the developer docs

FH2 Modding Guide · Chapter 1

Getting started

Always first: the one game build, Azimuth, folders, the three ways to make a mod, tools and a safe test routine.

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

This chapter is the map: which game build mods target, how Azimuth runs it, where the files live, the three ways to make a mod, the tools to build and reverse-engineer with, and a test routine that keeps players' saves safe. Read it first, then jump to the chapter for your route.

1.1 One game build

Every address in this guide, and in every FH2 mod, is for one file only:

Fileforza_durango_release_final.exe (the Xbox One build of Forza Horizon 2)
Build date24 Nov 2015
PE TimeDateStamp0x565501ED
SizeOfImage0x3A18000
Preferred image base0x140000000
Built withVisual C++ 2012 family, compiler and linker build 65501 (15.6)

Addresses are written as an RVA, game+0x12CC730, or as the absolute address at the preferred base, 0x1412CC730. They are the same place. Always work from the base the loader hands you, never from the constant 0x140000000: under Wine and Proton the exe has been seen mapped at 0x14690000, 0x18940000 and 0x19D40000, with its absolute pointers relocated.

Azimuth 1.0.1 and later can also run Forza Motorsport 5 and 6 from the same launcher. Their exes share the file name and preferred base, so check the header before you touch anything:

GameTitle IDTimeDateStampSizeOfImage
Forza Horizon 21A96545B0x565501ED0x3A18000
Forza Motorsport 57B35D9170x53D8D1F20x279D000
Forza Motorsport 664F9397E0x58AFB1CD0x1FC8000

The FH2 Mod Platform does this check for you and refuses hooks into any other game. An Extra Options plugin gets game_image_size in its context and should compare it with 0x3A18000.

1.2 How the game runs on PC

  • Azimuth is the loader. It is not an emulator in the usual sense: it maps the Xbox One exe into its own process (azimuth.exe) when the player presses Play and translates the Xbox APIs to Windows ones. So Azimuth, the game and every mod share one process. GetModuleHandle(NULL) returns azimuth.exe, not the game, and the game is not in the module list.
  • The game's own drives: game:\ is the Mount folder; T:\ (temporary storage) is <Azimuth folder>\data\titles\1A96545B\tmp. A game:\ path containing .. stops the game with "Invalid runtime path component". Host paths such as C:\... are not found by the game's file system.
  • Azimuth ends the game with TerminateProcess. No DLL_PROCESS_DETACH, no atexit handlers, no destructors run. Write anything you need to keep as you go.
  • Mods get into the process by being loaded by a DLL that Azimuth already loads:
DLL next to azimuth.exeWhoLoaded by
d3dcompiler_47.dllFH2 Mod PlatformAzimuth up to 1.0.1
DWrite.dllFH2 Mod Platform (same file)Azimuth 1.0.1 and later; the only one 1.0.3+ loads
winmm.dllExtra OptionsAzimuth (the supported versions are in chapter 3)

Don't add another proxy DLL of your own: these names are taken, and two proxies of one name cannot both load.

1.3 Where things live

Paths below are relative. <Azimuth> is the folder holding azimuth.exe; <Mount> is the game folder Azimuth points at ([title-1a96545b] folder= in <Azimuth>\data\azimuth.ini, a UTF-16 file).

PathWhat
<Mount>\forza_durango_release_final.exethe game
<Mount>\media\the game's data: zips, the database Stripped\gamedbRC.slt, string tables, UI, cars, tracks, audio (chapter 4)
<Mount>\mediaoverride\files here replace files in media (see 1.5)
<Mount>\mediapc\a second override folder, read after mediaoverride
<Mount>\DLC\StormIsland_...\the Storm Island expansion, a separate package that Azimuth's content= setting points at
<Azimuth>\data\azimuth.iniAzimuth's settings (UTF-16)
<Azimuth>\data\titles\1A96545B\saves\saves, as numbered revisions. Mods never write here.
<Azimuth>\data\titles\1A96545B\tmp\the game's T:\. Platform 2.9.0+ keeps its own layer in tmp\fh2-platform\media\
<Azimuth>\fh2-mods\platform mods (*.dll), platform.log, crash reports, the platform's records
<Azimuth>\FH2_ExtraOptions.ini / .logExtra Options' settings and log
<Azimuth>\mods\Forza Horizon 2\<mod>\Extra Options mod packages and their plugins (EO 0.4.5+)

Several Azimuth folders can point at the same Mount. They then share mediaoverride, so a file one install writes there shows up in the other. Prefer the platform's per-folder layer or Extra Options' own mod folders when you can.

1.4 Three ways to make a mod

RouteYou writeGood forRead
FH2 Mod Platform moda DLL in fh2-mods\ exporting fh2mod_initanything: hooks, settings on the in-game MODS page, pages, title-screen entries, hotkeys, HUD text, database and string changes, car packschapter 2
Extra Options plugina DLL in an EO mod's plugins\ folder exporting FH2PluginInitializemods for players who run EO; a per-frame player-car callback and a database callback come with it, hooks are your own (MinHook)chapter 3
Data-only modfiles: replacement media, an EO package (database.json, strings.json, carbin.json), or a platform car packnew liveries, cars, text, tuning of database rows, UI tweakschapter 4

They mix: the platform and Extra Options run together, and the platform waits for EO to finish patching before it lets mods hook. Many players run both. A platform mod reaches the most players and gets the MODS page, update checks and crash reports for free; an EO plugin suits a mod that is part of an EO package anyway.

A rule of thumb: change data before code. If a database row, a string table or a replaced XAML page does the job, it is safer than a hook, survives other mods better and is easy to switch off.

1.5 How the game finds files

The game asks its file system for game:\media\.... Override folders are mounted above media:

  1. mediaoverride (and, on Azimuth 1.0+ without EO, the platform's layer in T:\fh2-platform\media above it)
  2. mediapc
  3. media

A file inside a zip is replaced by a loose file at the same path with the zip's name as a folder: media\UI.zip\Scenes\Anthem\A_Hud.xaml is replaced by mediaoverride\UI\Scenes\Anthem\A_Hud.xaml. The list of files in each zip comes from media\zipmanifest.xml, which the game trusts; never edit the game's zips.

Who mounts the override folders:

  • With Extra Options: EO, when its EnableMediaOverrides=1.
  • Without it: platform 2.7.3 and later mount them itself.

Most files are read once at start-up (the database, string tables, most UI). Changes made after the game has read them show from the next launch.

1.6 Toolchain

  • Compiler: clang targeting MinGW (llvm-mingw) with CMake and Ninja. The released mods and the platform's CI use it.
    • You need clang's MSVC-style SEH (__try/__except, -fms-extensions) to read game memory safely. GCC MinGW doesn't support it. Some mods refuse MSVC in their CMakeLists because they also use GNU extensions.
    • Link with -static so you ship no libc++ or libunwind DLLs.
    • Release builds from llvm-mingw are stripped. For readable crash reports, also build with -gcodeview -Wl,--pdb= and keep the PDB.
  • Hooking library: the platform has MinHook built in and chains hooks between mods. Without the platform, use MinHook yourself (BSD-2 licence: ship LICENSE-MinHook.txt).
  • SQLite: compile it in if you read the database yourself. winsqlite3.dll doesn't exist under Wine.

A platform mod's build, in PowerShell (keep it in one command, so PATH only changes for it):

$env:PATH = '<llvm-mingw>\bin;' + $env:PATH
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=cmake/mingw-w64-x86_64.cmake
cmake --build build

1.7 Reverse-engineering the game

This is the overview; chapter 15 walks through it with commands and a worked example.

The exe is a gift to modders: it isn't packed, and much of the C++ type information survives.

  • RTTI is intact. For any object, vtable[-1] points to an MSVC CompleteObjectLocator, which leads to a type descriptor with the class name (.?AVForzaCar@@). That's how most of the names in this guide were found.
  • .pdata gives every function's bounds, so you can tell where a function starts and whether an address is the start of an instruction.
  • Strings and log formats in the exe name many systems; search them first.
  • Disassemblers: any will do (Ghidra, IDA, Binary Ninja). For quick checks, llvm-mingw ships llvm-objdump:
    llvm-objdump -d --no-show-raw-insn --start-address=0x1412CC730 --stop-address=0x1412CC800 forza_durango_release_final.exe
    
  • The STL is MSVC 2012's. Layouts and sizes for std::string, vector, shared_ptr, list, map, deque, unordered_map and more are in chapter 11.
  • Know how it was built. The compiler build, the flags the code shows and what follows from them are in 15.6.
  • Probe in game before you build a feature. A small mod that logs what a hook sees (with a hotkey to dump state) answers in one run what hours of static reading may not. Log plain sentences you can search later.
  • Test offline where you can. A harness that maps the real exe from disk and calls your code against a fake platform API catches wrong offsets and byte checks without starting the game.

1.8 Test routine

  1. Back up the saves before every in-game test (copy data\titles\1A96545B\saves somewhere else). Mods must never edit saves, but a crash mid-save can still hurt one.
  2. Install the mod alone first, then alongside the popular mods (Extra Options, Achievements, WreckingBall, FH2MP's client if you claim online support).
  3. Read the logs right after each run. They're rewritten on every launch, and Azimuth can start the game twice in one launch:
    • fh2-mods\platform.log: line 1 names the platform version that ran; your mod's lines carry [YourMod].
    • fh2-mods\crashes\crash-*.txt: call stack as game+0x... and YourMod.dll+0x..., the mod a crash came from, and every hook in place.
    • FH2_ExtraOptions.log: whether EO applied its patches (OK:), refused them (REFUSED:) or is off.
  4. Tell builds apart by hash, not version string. Test builds often keep the old version.
  5. Ship as players install: see the packaging notes at the end of chapter 2 and the EO package format in chapter 3.

1.9 Where to go next

“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 01-getting-started.md at commit bb10508; corrections belong in the original repository.