srum-energy-usages

Retrieves energy usage history including battery charge level and cycle count from a Windows SRUM (System Resource Usage Monitor) database file.

Command properties

ItemDescription
Command typeDriver query
Required permissionLocal file read permission
License usageCounted
Parallel executionNot supported
Distributed executionNot supported

Syntax

srum-energy-usages [zipcharset=STR] [zippath=STR] FILE_PATH

Options

zipcharset=STR
Character encoding for ZIP entry names (Default: utf-8)
zippath=STR
ZIP file path. If specified, the SRUDB.dat file inside the ZIP file is queried.

Target

FILE_PATH
Path to the SRUDB.dat file. Wildcards (*) can be used to specify multiple files. If zippath is specified, enter the path inside the ZIP file. On Windows, this file is located at C:\Windows\System32\sru\SRUDB.dat.

Output fields

FieldTypeDescription
_timetimestampRecord timestamp
_filestringSource file name
app_idintegerApp ID (SruDbIdMapTable index)
app_namestringApp name
sidstringSID of the account that ran the program
user_idintegerAccount ID (SruDbIdMapTable index)
auto_inc_idintegerAuto-increment ID
charge_levelintegerBattery charge level (%)
cycle_countintegerBattery charge cycle count
designed_capacityintegerBattery designed capacity (mWh)
full_charged_capacityintegerBattery full charge capacity (mWh). Less than or equal to the designed capacity.
configuration_hashlongSystem configuration hash value
event_timestamplongEvent timestamp (Windows FILETIME value)
state_transitionintegerPower state transition value

Error codes

Parse errors

N/A

Runtime errors

N/A

Description

The srum-energy-usages command retrieves energy usage history from the {FEE4E14F-02A9-4550-B5CE-5FA2DA202E37} table of the Windows SRUM database. This table records battery status information including charge level, cycle count, and current full charge capacity compared to the designed capacity.

The command first reads the SruDbIdMapTable to map app IDs and user IDs to their actual names and SIDs. CamelCase column names in the ESE database are automatically converted to snake_case.

The event_timestamp field is a 64-bit integer in Windows FILETIME format. FILETIME represents the number of 100-nanosecond intervals since January 1, 1601.

Examples

  1. Retrieve energy usage from SRUDB.dat

    srum-energy-usages C:\Windows\System32\sru\SRUDB.dat
    

    Retrieves all energy usage records from the SRUM database.

  2. Query SRUDB.dat inside a ZIP file

    srum-energy-usages zippath=D:\evidence\sru.zip SRUDB.dat
    

    Retrieves energy usage history from the SRUDB.dat file contained in the ZIP file.

  3. Retrieve battery charge level trends over time

    srum-energy-usages C:\Windows\System32\sru\SRUDB.dat
    | fields _time, charge_level, full_charged_capacity, designed_capacity
    | sort _time
    

    Retrieves battery charge level changes in chronological order.