# Xamarin

## General

Las aplicaciones desarrolladas con Xamarin agrupan su código compilado en Dynamically Linked Libraries (.dll), las cuales pueden almacenarse en el directorio `app-decompiled/unknown/assemblies/` de forma independiente, comprimidas mediante LZ4 / XALZ o bien integradas conjuntamente en un archivo denominado `assemblies.blob`.

## Obtención de DLLs

```sh
apktool d application.apk -o app-decompiled
ls -l app-decompiled/unknown/assemblies/

file app-decompiled/unknown/assemblies/<file.dll>
     file.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
```

## Descompresión de DLLs (LZ4 / XALZ)

```sh
apktool d application.apk -o app-decompiled
ls -l app-decompiled/unknown/assemblies/

file app-decompiled/unknown/assemblies/<file.dll>
     file.dll: Sony PlayStation Audio
    
python Xamarin_XALZ_decompress.py app-decompiled/unknown/assemblies/<file.dll> file_decompressed.dll

file file_decompressed.dll
     file_decompressed.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
```

## Obtención de DLLs desde archivo .blob

```sh
apktool d application.apk -o app-decompiled

ls -l app-decompiled/unknown/assemblies/
     assemblies.blob
     assemblies.manifest

file app-decompiled/unknown/assemblies/assemblies.blob
     assemblies.blob: Sony PlayStation Audio

pyxamstore unpack -d app-decompiled/unknown/assemblies/
ls -l out
```

## Herramientas

* [dnSpy](https://github.com/dnSpy/dnSpy)
* [ILSpy](https://github.com/icsharpcode/ILSpy) (Windows) / [AvaloniaILSpy](https://github.com/icsharpcode/AvaloniaILSpy) (Linux/Unix)
* [pyxamstore](https://github.com/jakev/pyxamstore)
* [Xamarin\_XALZ\_decompress.py](https://github.com/x41sec/tools/blob/master/Mobile/Xamarin/Xamarin_XALZ_decompress.py)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mobile.mrw0l05zyn.cl/android/analisis-estatico/reversing/aplicaciones-hibridas/xamarin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
