# Detailed analysis of GeViSet structure focusing on sections and properties $filePath = "C:\Users\Administrator\Desktop\GeViSoft.set" $data = [System.IO.File]::ReadAllBytes($filePath) Write-Host "Detailed Structure Analysis" -ForegroundColor Cyan Write-Host ("=" * 80) Write-Host "" # Parse first section manually and document every byte $pos = 0 Write-Host "=== First Section (GeViSoft Parameters) ===" -ForegroundColor Yellow Write-Host "Offset 0x00: Type = 0x$($data[$pos].ToString('X2')) (Section marker)" $pos++ Write-Host "Offset 0x01: Length = $($data[$pos]) bytes" $nameLength = $data[$pos] $pos++ $sectionName = [System.Text.Encoding]::UTF8.GetString($data, $pos, $nameLength) Write-Host "Offset 0x$(($pos).ToString('X2'))-0x$(($pos + $nameLength - 1).ToString('X2')): Name = '$sectionName'" $pos += $nameLength Write-Host "" Write-Host "After section name, next bytes are:" for ($i = 0; $i < 50; $i++) { $offset = $pos + $i $byte = $data[$offset] $hexByte = "0x$($byte.ToString('X2'))" # Try to interpret $interpretation = "" if ($byte -eq 0x00) { $interpretation = "Section" } elseif ($byte -eq 0x01) { $interpretation = "Boolean" } elseif ($byte -eq 0x02) { $interpretation = "Int64" } elseif ($byte -eq 0x04) { $interpretation = "Int32" } elseif ($byte -eq 0x07) { $interpretation = "Property Name" } elseif ($byte -eq 0x08) { $interpretation = "String" } elseif ($byte -ge 0x20 -and $byte -lt 0x7F) { $interpretation = "ASCII: '$([char]$byte)'" } Write-Host (" +{0,3}: {1,-6} = {2,-3} {3}" -f $i, $hexByte, $byte, $interpretation) } Write-Host "" Write-Host "=== Attempting to parse structure after section name ===" -ForegroundColor Yellow # Reset to after section name $pos = 2 + $nameLength # Try reading as int32 + byte $metadata1 = [BitConverter]::ToUInt32($data, $pos) $pos += 4 Write-Host "Int32 value: $metadata1 (0x$($metadata1.ToString('X8')))" $metadata2 = $data[$pos] $pos++ Write-Host "Byte value: $metadata2 (0x$($metadata2.ToString('X2')))" Write-Host "" Write-Host "Next element:" $nextType = $data[$pos] Write-Host "Type marker: 0x$($nextType.ToString('X2'))" if ($nextType -eq 0x00) { Write-Host " -> This is a nested section" $pos++ $subLen = $data[$pos] $pos++ $subName = [System.Text.Encoding]::UTF8.GetString($data, $pos, $subLen) Write-Host " -> Section name: '$subName' (length: $subLen)" $pos += $subLen # Check what follows Write-Host " -> After nested section name:" for ($i = 0; $i < 10; $i++) { $byte = $data[$pos + $i] Write-Host (" +{0}: 0x{1:X2} = {2}" -f $i, $byte, $byte) } } Write-Host "" Write-Host "=== Looking at a property example (search for 'Enabled') ===" -ForegroundColor Yellow $text = [System.Text.Encoding]::GetEncoding("ISO-8859-1").GetString($data) $enabledPos = $text.IndexOf("Enabled") if ($enabledPos -ge 0) { Write-Host "Found 'Enabled' at offset: 0x$($enabledPos.ToString('X'))" Write-Host "Context (20 bytes before and 20 after):" $start = [Math]::Max(0, $enabledPos - 20) for ($i = $start; $i -lt ($enabledPos + 30) -and $i -lt $data.Length; $i++) { $byte = $data[$i] $char = if ($byte -ge 0x20 -and $byte -lt 0x7F) { [char]$byte } else { '.' } $mark = if ($i -eq $enabledPos) { " <-- 'Enabled' starts here" } else { "" } Write-Host (" 0x{0:X4}: 0x{1:X2} = {2,3} '{3}' {4}" -f $i, $byte, $byte, $char, $mark) } }