- <# : PS
- @echo off
- powershell -noprofile -NoLogo "iex (${%~f0} | out-string)"
- pause & exit
- #>
- $filename = ls '.\01.txt'
- $file = ls 'basetik.tik';
- $offset = @(0x01DC,0x01BF);
- $text = [IO.File]::ReadAllText($filename);
- [regex]$reg = '(?i)(?<=Using title id: *|generated encrypted: *)([0-9a-f]{2})+';
- $group = $reg.Matches($text);
- $fs=new-object io.filestream $file,open;
- (0..($group.Count-1)).ForEach({
- [void]$fs.seek($offset[$_],0);
- $Group[$_].Groups[1].Captures.Value.ForEach({$fs.writebyte( "0x$_" )});
- })
- $fs.flush();
- $fs.close();
复制代码
|