Technical Details - RiadDeveloper/Cursor-Machine-ID-Reset-Tool GitHub Wiki

Technical Details

Overview

The Cursor Reset Tool is a PowerShell script that resets machine identifiers used by Cursor IDE. This document explains the technical aspects of how the tool works and what files it modifies.

File Locations

The tool operates on files in the following locations:

%APPDATA%\Cursor\
├── machineId
├── User\
    └── globalStorage\
        ├── storage.json
        └── state.vscdb

Generated Identifiers

The tool generates several unique identifiers:

  1. devDeviceId

    • Format: UUID (e.g., "550e8400-e29b-41d4-a716-446655440000")
    • Used as: Primary device identifier
  2. machineId

    • Format: 64-character hexadecimal string
    • Generated using: Cryptographic random number generator
  3. macMachineId

    • Format: 128-character hexadecimal string
    • Generated using: Cryptographic random number generator
  4. sqmId

    • Format: Bracketed UUID (e.g., "{550E8400-E29B-41D4-A716-446655440000}")
    • Used for: System Quality Metrics

File Modifications

1. machineId File

  • Location: %APPDATA%\Cursor\machineId
  • Content: Contains only the devDeviceId
  • Format: Plain text file

2. storage.json

  • Location: %APPDATA%\Cursor\User\globalStorage\storage.json
  • Modified Keys:
    {
      "telemetry.devDeviceId": "<uuid>",
      "telemetry.machineId": "<64-char-hex>",
      "telemetry.macMachineId": "<128-char-hex>",
      "telemetry.sqmId": "<bracketed-uuid>",
      "storage.serviceMachineId": "<uuid>"
    }

3. SQLite Database

  • Location: %APPDATA%\Cursor\User\globalStorage\state.vscdb
  • Table: ItemTable
  • Modified using Python's sqlite3 module
  • Updated Keys:
    • telemetry.devDeviceId
    • telemetry.macMachineId
    • telemetry.machineId
    • telemetry.sqmId
    • storage.serviceMachineId

Security Measures

  1. Backup Creation

    • Automatic backup of all modified files
    • Backup files created with .backup extension
    • Original files preserved before modifications
  2. Permission Checks

    • Verifies administrator privileges
    • Checks file access permissions
    • Validates file existence before modifications
  3. Safe Operations

    • Uses secure random number generation
    • Implements proper error handling
    • Validates file operations

Dependencies

  1. PowerShell

    • Version: Windows PowerShell 5.1 or later
    • Required Modules: None (uses built-in cmdlets)
  2. Python

    • Used for: SQLite database modifications
    • Required Module: sqlite3 (built into Python)
    • Optional: Script can run without Python, but SQLite updates will be skipped

Error Handling

The script implements comprehensive error handling:

  1. Pre-execution Checks

    • Administrator privileges
    • Cursor process status
    • File existence and accessibility
  2. Operation Validation

    • Validates generated IDs
    • Verifies file writes
    • Confirms database updates
  3. Recovery Options

    • Automatic rollback capabilities
    • Backup file restoration
    • Clear error messages and instructions

Performance Considerations

  • Average execution time: 2-5 seconds
  • Minimal system resource usage
  • No network operations
  • Small file footprint
⚠️ **GitHub.com Fallback** ⚠️