Learn · Mobile forensics

A phone is a pile of databases

Chats, calls, contacts, browser history and locations all end up in small SQLite files. These pages show how to get them off a device, how to read them byte by byte, and where deleted messages hide.

1 Why phones are different

A USB stick hands you every sector, and you image it with dd. A phone does not. Its storage is soldered in, encrypted with keys held inside the device, and protected by the operating system. What you can copy depends on the method, the OS version and whether the phone is unlocked. That is why mobile work starts with the question what level of acquisition do I have?

Once you have the files, the next surprise is how uniform they are. Almost every app keeps its data in SQLite databases, with a few property lists (iOS), XML preferences (Android) and JSON files around them. If you can read SQLite at the byte level, you can read most of a phone.

Acquisitionbackup, file system or physical copy
App foldersone sandbox per app: databases, preferences, caches
SQLite filesmain file + -wal + -shm; live rows, freeblocks, free pages, old WAL frames

The examples on these pages come from invented sample files: a chat app called Chatter (contacts Alex and Sam), an Android backup, an iOS-style backup manifest and a location cache. They were written with Python's sqlite3 module, so the bytes are what a real app would leave behind.

2 The pages

As on the file-system pages, every hex view is interactive: click a field to see its bytes, click a byte to see its field, and follow the → rows.

3 Android and iOS at a glance

AndroidiOS
App data/data/data/<package>/ with databases/, shared_prefs/, files//private/var/mobile/Containers/Data/Application/<UUID>/ with Documents/, Library/
Shared storage/sdcard/ (photos, downloads), readable over adbPhotos and files only through the system apps or a backup
Backup formatadb backup → .ab (header + zlib + tar), deprecatediTunes/Finder backup folder: Manifest.db plus files named by SHA-1
Settings filesXML in shared_prefs/Binary or XML property lists (.plist)
Typical timestampsUnix millisecondsCocoa time: seconds since 2001-01-01
System databasese.g. mmssms.db (SMS), contacts2.dbe.g. sms.db, AddressBook.sqlitedb

Paths and file names change between OS versions and apps. Treat this table as a starting point and verify on the version in front of you.

4 Ground rules

Before you start: the File Systems in Hex pages explain hex, offsets and little-endian numbers. SQLite stores its numbers big-endian, so watch the byte order.

5 Warm-up

Two quick checks before the deep-dive pages.

An app keeps its chats in chat.db, in WAL mode. Which files do you acquire and hash?

See the ground rules in section 4.

All three. The newest rows and older versions of pages may exist only in the -wal file. The -shm file is only an index into the WAL, but it records which frames were in use when you copied the files, so it belongs to the evidence too.

An iOS database stores the time 810369000.5. From which moment does it count seconds?

Check the "Typical timestamps" row of the table in section 3. As Unix seconds, 810 million would be a date in 1995.

iOS and macOS use Cocoa time, seconds since 2001-01-01 00:00 UTC, often with a fraction. 810,369,000.5 s after 2001-01-01 is 2026-09-06 06:30:00.5 UTC. The Location page converts between the formats.