Add standalone .asm BOM-extraction scripts and format documentation
Reverse-engineered the Creo .asm binary format enough to extract referenced component codes via a text heuristic, mirroring AssemblyComponentScanner's approach and Form1's recursive resolution against cad_index.db. Documents known false-positive classes (ModelView# view IDs, self-references, and phantom references to superseded/renamed codes). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
52483177f0
commit
f28cb818bd
5 files changed
+231
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// dotnet run scripts/Analyze.cs -- <file.asm> <pattern>
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
string path = args[0];
|
||||
string pattern = args[1];
|
||||
|
||||
byte[] data = File.ReadAllBytes(path);
|
||||
string testo = Encoding.Latin1.GetString(data);
|
||||
|
||||
foreach (Match m in Regex.Matches(testo, pattern))
|
||||
{
|
||||
int s = Math.Max(0, m.Index - 24);
|
||||
int e = Math.Min(testo.Length, m.Index + m.Length + 24);
|
||||
string ctx = testo.Substring(s, e - s).Replace("\r", "\\r").Replace("\n", "\\n");
|
||||
string hexCtx = string.Join(" ", data.Skip(s).Take(e - s).Select(b => b.ToString("x2")));
|
||||
Console.WriteLine($"offset={m.Index:x} val={m.Value}");
|
||||
Console.WriteLine($" txt: {ctx}");
|
||||
Console.WriteLine($" hex: {hexCtx}");
|
||||
}
|
||||
return 0;
|
||||
Reference in new issue
Block a user