GTA San Andreas .rwtex file loader .ASI plugin example using plugin-sdk. RWTEX files are native RenderWare texture files created using the Magic.TXD editor.
This logic is what powers the global texture replacement ASI.
Full documentation is provided here.