iOS artifacts · Lesson 3 of 7
Messages, calls and contacts
11 min read
Communications are at the center of most mobile cases, and on an iPhone the three core sources are Apple's own: the Messages database, the call history store and the contacts database. All three are SQLite databases under /private/var/mobile/Library, all three are in encrypted computer backups (according to Apple, unencrypted backups leave out call history; lesson 2.3), and all three have changed in ways that matter over recent iOS versions. This lesson explains their structure, the columns that carry the evidence, how to read their timestamps, and what recent features such as editing, unsending and Recently Deleted leave behind. Third-party messaging apps follow in Module 5, and SQLite recovery of deleted records is taught in lesson 3.2.
Messages: sms.db
The Messages app keeps iMessage, SMS, MMS and, since iOS 18, RCS conversations in one database: /private/var/mobile/Library/SMS/sms.db, with its -wal and -shm files. In a backup it is HomeDomain-Library/SMS/sms.db, stored as 3d/3d0d7e5fb2ce288813306e4d4636395e047a3d28. Attachments are stored as files under /private/var/mobile/Library/SMS/Attachments. In a backup the attachment files are in MediaDomain, not HomeDomain, with the relative path Library/SMS/Attachments/..., so an attachment's fileID is the SHA-1 of MediaDomain-Library/SMS/Attachments/ followed by the rest of the path in attachment.filename.
If the user has turned on Messages in iCloud, the conversation history is synchronized across the user's devices, older attachments may exist only in iCloud, and a deletion on one device removes the message from all of them. A message in sms.db therefore does not by itself show which of the user's devices sent it.
The main tables
| Table | Holds |
|---|---|
| message | One row per message, including system rows such as group changes and reactions (a tapback is a row whose associated_message_type is set and whose associated_message_guid names the message reacted to) |
| handle | One row per remote address (phone number or email) per service |
| chat | One row per conversation, one-to-one or group |
| chat_message_join | Links messages to chats |
| chat_handle_join | Links chats to their participants |
| attachment | One row per attachment file |
| message_attachment_join | Links messages to attachments |
Join tables matter. A message's chat is found through chat_message_join, and the participants of that chat through chat_handle_join. In a group chat, chat.chat_identifier is an internal identifier rather than a phone number, and the numbers are in handle.
Key columns in message
- ROWID and guid. ROWID is the local row number; guid is a globally unique message identifier, which other artifacts sometimes reference.
- text and attributedBody. text holds the plain text on older rows. On recent versions it is often empty and the text is only in attributedBody, an NSAttributedString in typedstream format (lesson 4.2). A parser that reads only text will miss messages.
- is_from_me. 1 for a message sent by the user's account, 0 for a received one. A value of 1 does not show that this device sent the message; it may have been sent from another device on the same account and synchronized.
- handle_id. For a received message, the ROWID of the sender in handle. For sent messages, use the chat's participants instead.
- service. iMessage, SMS or, from iOS 18, RCS. MMS is recorded under SMS.
- date, date_read, date_delivered. Mac absolute time in nanoseconds on iOS 11 and later (seconds on earlier versions); lesson 4.2 works through the conversion. A value of 0 means no value was stored.
- destination_caller_id. The phone number or Apple Account address of this device's line or account used for the message, which separates the two lines of a dual-SIM phone.
iMessage, SMS and RCS
The service column decides how to interpret the rest of the row. SMS travels through the carrier and leaves records in the carrier's systems (lesson 1.4). iMessage travels through Apple's servers, is end-to-end encrypted, can be addressed to an email address as well as a number, and supports delivery and read receipts. RCS, supported from iOS 18, travels through the carrier's messaging service and also supports receipts. It was not end-to-end encrypted on iOS 18; from iOS 26.5 Apple is rolling out end-to-end encryption for RCS chats with supported carriers (a lock icon marks an encrypted chat), so do not assume that the carrier holds readable RCS content. A date_read value on an SMS row reflects when this device marked the message read, not when the recipient read a sent message.
Attachments
The attachment table records filename (a path beginning ~/Library/SMS/Attachments, where ~ is /private/var/mobile), mime_type, transfer_name (the original file name), total_bytes and a creation date. A row with no file on disk may mean the attachment was offloaded to iCloud, was never downloaded or was deleted. Report which is the case if you can establish it.
Edited, unsent and deleted messages
iOS 16 introduced three features that change what sms.db can show.
Editing. A sent iMessage can be edited up to five times within 15 minutes of sending, and both sides can see earlier versions. When a message is edited, date_edited is set, and the binary plist in message_summary_info gains an ec entry that lists the stored versions of each edited part, each with its own text and time. The text column of an edited message is typically empty, and attributedBody holds the current text. In iLEAPP's tests on iOS 18 and iOS 26 databases, the time of the last stored version equaled date_edited on every edited message, which is a useful consistency check.
Unsending. A sent iMessage can be unsent within 2 minutes. Messages keeps the row but removes the text. message_summary_info gains an rp entry listing the retracted parts, and an otr entry may still record the original length of the text. In iLEAPP's tests the time of the change was in date_edited, while the date_retracted column held 0. The content of an unsent message is not recoverable from these columns. It may survive elsewhere: in notification records on the recipient's device (lesson 4.5), or in the conversation on a recipient's device that runs an older system version, where Apple warns that the contact may still see the message.
Recently Deleted. On iOS 16 and later, deleted messages and conversations stay recoverable for 30 to 40 days. In sms.db, a deleted message keeps its row in message, but the row loses its link in chat_message_join and gains a row in chat_recoverable_message_join (chat_id, message_id and delete_date, in Mac absolute nanoseconds). Deleted parts of a message that otherwise remains are listed in recoverable_message_part. Do not assume a strict 30-day window: one iOS 26 database tested by iLEAPP held deletion dates 60 days apart. Once the user empties Recently Deleted, or the period expires, these rows disappear, and only SQLite-level recovery (lesson 3.2) or other sources remain.
iOS 18 added Send Later. A scheduled message is written to sms.db at once, with schedule_type and schedule_state columns set and date holding the scheduled time, while date_delivered and date_read are not updated. Do not read such a row as a message sent at the time of its date without checking these columns.
Calls: CallHistory.storedata
Call history is kept in /private/var/mobile/Library/CallHistoryDB/CallHistory.storedata, a Core Data store in SQLite format (HomeDomain-Library/CallHistoryDB/CallHistory.storedata in an encrypted backup). A second file, CallHistoryTemp.storedata, may also hold records.
Core Data is Apple's object storage framework, and many iOS databases are Core Data stores. In such a store each kind of object is a table whose name and columns begin with Z, Z_PK is the row's primary key, Z_ENT is the number of the object's kind as listed in the table Z_PRIMARYKEY, and dates are normally Mac absolute seconds.
The calls are in the table ZCALLRECORD:
| Column | Meaning |
|---|---|
| ZDATE | Start of the call, Mac absolute seconds |
| ZDURATION | Duration in seconds, with a fraction |
| ZADDRESS | The other party's number or handle |
| ZORIGINATED | 1 outgoing, 0 incoming |
| ZANSWERED | 1 answered, 0 not answered |
| ZSERVICE_PROVIDER | The service: com.apple.Telephony for cellular calls, com.apple.FaceTime, or a third-party app's bundle ID |
| ZCALLTYPE | Call type code (values 1, 8 and 16 are commonly read as phone, FaceTime video and FaceTime audio, and 0 as a third-party app) |
| ZDISCONNECTED_CAUSE | How the call ended, as a code |
| ZISO_COUNTRY_CODE, ZLOCATION | Country code and a location label derived from the number |
Worked example, using the Day 1 call of the Corvane case on the course's illustrative calendar: ZDATE = 794,858,730.0 and ZDURATION = 47.3. The start is 2026-03-10 18:05:30 UTC, which is 19:05:30 at the case's UTC+01:00. The end is not stored; you calculate it as ZDATE + ZDURATION = 794,858,777.3, which is 18:06:17.3 UTC. Say in your report that the end time is derived.
Three cautions apply. First, the meanings of the ZCALLTYPE and ZDISCONNECTED_CAUSE codes are not documented by Apple; tools apply mappings that their authors describe as unconfirmed, so report the stored value next to any label. Second, VoIP (voice over IP) apps that use CallKit, Apple's framework for showing app calls in the system call interface, can write their calls here with their own bundle ID in ZSERVICE_PROVIDER, as WhatsApp does, so a call record is not always a cellular call. Third, call history can sync between devices signed in to the same Apple Account, so a record may describe a call made on an iPad or Mac. Stores from iOS 26 have additional columns, including one for the originating device's name, which was empty on the store iLEAPP tested; check it when present.
A call record proves that the device's call history recorded an attempt, its direction, timing and whether it connected. It does not prove who spoke. For cellular calls, compare with the carrier's records, after establishing which time zone they use and how they measure duration; FaceTime and app calls are not in them.
Contacts: AddressBook.sqlitedb
Contacts are in /private/var/mobile/Library/AddressBook/AddressBook.sqlitedb, with photos in AddressBookImages.sqlitedb in the same folder. The database holds contacts from every account on the device, including iCloud, Exchange and Google; the account each contact came from is recorded in its store.
- ABPerson: one row per contact, with First, Last, Organization and other name fields, and CreationDate and ModificationDate in Mac absolute seconds.
- ABMultiValue: the contact's phone numbers, emails, addresses and URLs, one row each, linked by record_id to ABPerson.ROWID. The property column says what kind of value it is: in iLEAPP's tested schemas 3 is a phone number and 4 an email address. Apple does not publish these constants.
- ABMultiValueLabel: the labels, such as mobile or work, linked from ABMultiValue.label.
Neither sms.db nor CallHistory.storedata stores the contact name shown on screen. Tools join numbers to contacts after the fact. Normalize numbers before matching: the same line can appear as +E.164 (+15551234567), as local digits or with a tel: prefix. A creation date tells you when the contact record was created on this account, which may be on another device that synced it.
Applying this to the Corvane case
On Lena's iPhone, ZCALLRECORD contains an outgoing record on the evening of Day 1 (19:05:30 local time in the worked example above) with ZSERVICE_PROVIDER com.apple.Telephony, ZANSWERED 1 and a duration of under a minute, to a number that ABMultiValue links to a contact named Victor Hale. The contact's CreationDate falls weeks before Day 1. The examiner reports the stored values, the derived end time and the contact match, and recommends comparing the record with the carrier's call detail records, which do not depend on the phone. sms.db holds no messages with that number; the exchange of Day 2 used WhatsApp, which lesson 5.2 examines.
Exam focus: Know the sms.db tables and how join tables link messages, chats, handles and attachments, and convert message.date from nanoseconds. Know where iOS 16 and later record edits, unsent parts and Recently Deleted messages, the ZCALLRECORD columns and why a call record may come from another app or device, and how ABPerson and ABMultiValue relate.
Practice questions
Check your understanding. These questions do not count towards the exam.
Sign in to save your progress and continue where you left off. It is free. Sign in