$assemblyPath
=
"C:\Users\g0mx\Desktop\RCData1.bin"
$methodToken
=
"0x0600026F"
$filePath
=
"C:\Users\g0mx\Desktop\AT.il"
$pattern
=
"\s+(IL_\w+):\s+ldc\.i4\s+([0-9a-fx]+)\r?\n\s+IL_\w+:\s+call\s+string A\.V::A\(int32\)"
try
{
$assembly
=
[System.Reflection.Assembly]::LoadFile($assemblyPath)
}
catch {
Write
-
Host
"Failed to load assembly: $_"
return
}
try
{
$method
=
$assembly.ManifestModule.ResolveMethod([
int
]$methodToken)
}
catch {
Write
-
Host
"Failed to resolve method: $_"
return
}
$matches
=
@()
Get
-
Content $filePath
-
Raw | Select
-
String
-
Pattern $pattern
-
AllMatches | ForEach
-
Object
{
$_.Matches | ForEach
-
Object
{
$key
=
$_.Groups[
1
].Value
$value
=
$_.Groups[
2
].Value
$matches
+
=
[PSCustomObject]@{Key
=
$key; Value
=
$value}
}
}
$results
=
$matches | ForEach
-
Object
{
$value
=
[
int
]$_.Value
$hexValue
=
"0x{0:x}"
-
f $value
$string
=
$method.invoke($null, $value)
[PSCustomObject]@{
Value
=
$hexValue
String
=
$string
}
}
$results | Export
-
Csv
-
Path
"C:\Users\g0mx\Desktop\Output.csv"
-
NoTypeInformation
$results | Out
-
GridView