--- name: reversing-xamarin-maui description: Reverse engineer Xamarin and .NET MAUI mobile apps by extracting assemblies.blob and XALZ-compressed DLLs with pyxamstore, then decompiling with dnSpy or ILSpy. Use when an APK contains libmonodroid.so, libmonosgen, assemblies.blob, assemblies/*.dll, or libxamarin-app.so, when an IPA contains Mono assemblies, or when jadx shows only Xamarin bootstrap classes. verified: 2026-07-27 --- # Reversing Xamarin and .NET MAUI Apps Xamarin apps hide a complete .NET application inside an Android package. Once you extract and decompress the assemblies you get near-source-quality C#, which makes this one of the highest-return reversing jobs — but only if you get past the container format, which changed twice and defeats naive unzipping. ## When to Use - The APK contains `lib/*/libmonodroid.so`, `libmonosgen-2.0.so`, or `libxamarin-app.so` - The APK contains `assemblies/assemblies.blob` or `assemblies/*.dll` - `jadx` shows only `mono.MonoPackageManager` and Xamarin bootstrap classes - An IPA contains `.dll` files or a `Frameworks/Mono*` layout - The target is described as Xamarin, Xamarin.Forms, or .NET MAUI ## When NOT to Use - **Unity** (`global-metadata.dat`, `libil2cpp.so`) — use `reversing-unity-il2cpp`; Unity is also .NET but uses a completely different packaging - **Flutter or React Native** — use `reversing-flutter-apps` or `reversing-react-native-apps` - **TLS interception problems** — use `bypassing-mobile-pinning` - **The wider assessment** — use `testing-mobile-applications` ## Identify the Packaging Generation Three formats shipped over the product's life, and the extraction differs. ```bash unzip -l target.apk | rg 'assemblies|libmonodroid|libxamarin|libmonosgen' ``` | What you see | Generation | Extraction | | --- | --- | --- | | `assemblies/*.dll`, readable PE headers (`MZ`) | Classic, uncompressed | Unzip and decompile directly | | `assemblies/*.dll` starting with `XALZ` | Classic, LZ4-compressed | Decompress the XALZ wrapper first | | `assemblies/assemblies.blob` + `.manifest` | AssemblyStore | `pyxamstore` to unpack | | `lib/*/libxamarin-app.so` with no `assemblies/` | .NET 6+ / MAUI, assemblies in the ELF | Extract from the shared library | | No managed assemblies anywhere | NativeAOT | Not .NET reversing — use `analyzing-binaries` | ```bash # Which one is it? Check the first four bytes of an assembly unzip -p target.apk 'assemblies/Mono.Android.dll' 2>/dev/null | xxd | head -1 # 4d5a... → MZ, a plain .NET PE, decompile now # 58414c5a → "XALZ", LZ4-compressed, decompress first ``` ## Extraction ```bash # AssemblyStore (assemblies.blob) pyxamstore unpack -d ./out target.apk # produces the individual .dll files under ./out # XALZ-compressed individual DLLs # The header is: magic "XALZ" | descriptor index | uncompressed size | LZ4 block python3 -c " import lz4.block, struct, sys d = open(sys.argv[1],'rb').read() assert d[:4] == b'XALZ' size = struct.unpack('