To extract or "rip" a livery (texture) from an older version of Forza Horizon 5 (FH5) — assuming you have the game installed and you've created or applied a custom livery in-game — you can theoretically capture the texture using a DXGI proxy hook. This method involves creating a custom DirectX 12 wrapper DLL that intercepts graphics API calls and allows you to dump textures (or other resources) to disk.
Below is a detailed step-by-step guide on how to do it using the DXGI proxy method:
⚠️ Disclaimer:
This guide is for educational purposes only. Extracting game assets may violate the terms of service for some games. You should only extract assets you created (like your own livery) and use them for personal use. Do not share extracted textures without explicit permission from the IP holder.
🛠️ Requirements:
- Visual Studio 2022 or later.
- C++ knowledge (for modifying and compiling the proxy DLL).
- Your own livery installed in FH5.
- Basic understanding of DLL injection and proxying.
📦 Step 1: Create a DXGI Proxy DLL
1.1 Create a new Visual Studio C++ DLL Project
- Open Visual Studio.
- Create a new Win32 Project (Dynamic Link Library).
- Name it something like
dxgi_wrapper.
1.2 Replace the DLL entry point with a DXGI hook
You'll be creating a proxy for dxgi.dll by forwarding DXGI functions and hooking into key ones.
- Add a file called
main.cpp.
#include <Windows.h>
#include <d3d12.h>
#include <dxgi1_6.h>
#include <fstream>
typedef HRESULT(WINAPI* PFN_CREATE_SWAP_CHAIN)(
IUnknown* pDevice,
DXGI_SWAP_CHAIN_DESC* pDesc,
IDXGISwapChain** ppSwapChain);
HMODULE real_dxgi = NULL;
PFN_CREATE_SWAP_CHAIN Real_CreateSwapChain = nullptr;
void Log(const char* msg)
{
std::ofstream log("dxgi_log.txt", std::ios::app);
log << msg << std::endl;
log.close();
}
// Hooked function
HRESULT WINAPI Hooked_CreateSwapChain(
IUnknown* pDevice,
DXGI_SWAP_CHAIN_DESC* pDesc,
IDXGISwapChain** ppSwapChain)
{
Log("Hooked CreateSwapChain called.");
return Real_CreateSwapChain(pDevice, pDesc, ppSwapChain);
}
// Proxy DXGI Load
void LoadOriginalDXGI()
{
if (!real_dxgi)
{
char sysPath[MAX_PATH];
GetSystemDirectoryA(sysPath, MAX_PATH);
std::string realDXGIPath = std::string(sysPath) + "\\dxgi.dll";
real_dxgi = LoadLibraryA(realDXGIPath.c_str());
Real_CreateSwapChain = (PFN_CREATE_SWAP_CHAIN)GetProcAddress(real_dxgi, "CreateSwapChain");
if (Real_CreateSwapChain)
Log("Real DXGI loaded correctly.");
else
Log("Failed to load real DXGI.");
}
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
LoadOriginalDXGI();
DisableThreadLibraryCalls(hinstDLL);
}
return TRUE;
}
1.3 Set up the proxy exports
You must also proxy other DXGI exports. One way is use DLL Export Viewer to get all exports from the real dxgi.dll, or generate headers using [ProxyDll Generator tools**, or a tool like CFF Explorer.
You’ll need a .def file as well to export functions properly:
dxgi.def
LIBRARY dxgi
EXPORTS
CreateDXGIFactory=CreateDXGIFactory
CreateDXGIFactory1=CreateDXGIFactory1
// Add others as needed
📁 Step 2: Build the DLL
- Set the build profile to Release x64 (FH5 is 64-bit).
- Build the project – this will generate a
dxgi.dll in your output folder.
📂 Step 3: Install the DXGI Proxy DLL into FH5
- Go to your FH5 installation directory.
- Copy your built
dxgi.dll into the same directory as the game .exe (ForzaHorizon5.exe).
- Create a log directory or set logging appropriately to dump captured info.
🧠 Step 4: Modify for Screenshot/Texture Capture
You’ll need to hook more deeply into the ID3D12CommandQueue, ID3D12Device, or Present() function to dump textures.
Below is a rough idea of how you could hook IDXGISwapChain::Present() (This is where final render happens):
typedef HRESULT(__stdcall* PresentFunc)(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
PresentFunc oPresent = nullptr;
HRESULT __stdcall hkPresent(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags)
{
Log("Present called");
// Here you could capture or dump the backbuffer
// 1. Get back buffer
// 2. Copy texture to CPU-readable heap
// 3. Save as image (e.g., using DirectXTex or stb_image_write)
return oPresent(pSwapChain, SyncInterval, Flags);
}
// You need to install the hook after swapchain is created
To grab the livery texture, you’ll likely need to inspect the descriptors used in shaders or hook resource creation functions, such as:
ID3D12Device::CreateCommittedResource
You can log texture creation descriptions and check which one matches your livery resolution and format.
📝 Step 5: Dump Textures
To dump the texture (simplified pseudocode):
// Assuming you have ID3D12Resource* texture:
D3D12_RESOURCE_DESC desc = texture->GetDesc();
if (desc.Width == LIVERY_WIDTH && desc.Height == LIVERY_HEIGHT)
{
// Transition resource to COPY_SOURCE
// Create a readback buffer
// Use CopyResource or CopyTextureRegion to copy it
// Map the readback buffer and save bytes to .dds or .png
}
You can use helper libraries like:
- DirectXTex - for saving
ID3D12Resource to .DDS or PNG.
✅ Optional Tools:
If writing your own DLL is too much, consider using tools like:
- RenderDoc – capture a frame and extract all textures at that point.
- PresentMon/fxhx overlay – monitor frame presentations.
- Texmod/UModel etc. – may not work with FH5 or DirectX12.
✅ Summary:
| Step | Action |
|---|
| 1. | Build a proxy dxgi.dll |
| 2. | Forward to real dxgi.dll and log API calls |
| 3. | Hook IDXGISwapChain::Present() |
| 4. | Identify and dump backbuffers or resources during call |
| 5. | Save texture to disk (use DirectXTex) |
If you want, I can provide a pre-made base DXGI proxy with logging and Present hook, ready to go. Let me know!
Would you prefer to use RenderDoc to find the texture instead? It's often easier than coding the entire chain from scratch.