Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8088

Профиль | Отправить PM | Цитировать


Tosyk, ну, вот, попробуйте в первом приближении (на PowerShell):
Скрытый текст
Код: Выделить весь код
$sRootFolder     = 'C:\Мои проекты\0167'
$sEBXSubFolder   = Join-Path -Path $sRootFolder -ChildPath 'EBX'
$sCHUNKSubFolder = Join-Path -Path $sRootFolder -ChildPath 'CHUNK'

$aByte4Find = [System.Byte[]](0xFF, 0xFF, 0xFF, 0xFF)

if(Test-Path -Path $sRootFolder -PathType Container) {
    if(Test-Path -Path $sEBXSubFolder -PathType Container) {
        if(Test-Path -Path $sCHUNKSubFolder -PathType Container) {
            Get-ChildItem -Path "$sEBXSubFolder\*.MeshSet" | ForEach-Object -Process {
                Write-Host "[$($_.FullName)]" -ForegroundColor Yellow

                $aByteContent = [System.IO.File]::ReadAllBytes($_.FullName)
                $iCount = 0

                for($i = 0; $i -le $aByteContent.Length - $aByte4Find.Length - 1; $i++) {
                    $bFound = $true

                    for($j = 0; $j -le $aByte4Find.Length - 1; $j++) {
                        if($aByteContent[$i + $j] -ne $aByte4Find[$j]) {
                            $bFound = $false
                            break
                        }
                    }

                    if($bFound) {
                        $sFoundFileName = [System.BitConverter]::ToString($aByteContent[$($i - 16) .. $($i - 1)]) -replace '-', ''

                        Write-Host "`tOffset:          $i"
                        Write-Host "`tFound file name: $sFoundFileName"

                        if(Test-Path -Path "$sCHUNKSubFolder\$sFoundFileName.chunk" -PathType Leaf) {
                            Write-Host "`tFile exists!" -ForegroundColor Green
                            $iCount++
                            [System.IO.File]::Copy("$sCHUNKSubFolder\$sFoundFileName.chunk", "$($_.DirectoryName)\$($_.BaseName)_$($iCount.ToString("00")).chunk", $true)
                        } else {
                            Write-Host "`tFile not exists!" -ForegroundColor Red
                        }
                        Write-Host ''
                    }
                }
                Write-Host ''
            }
        } else {
            Write-Host "Can't find CHUNK subfolder [$sCHUNKSubFolder]." -ForegroundColor Red
        }
    } else {
        Write-Host "Can't find EBX subfolder [$sEBXSubFolder]." -ForegroundColor Red
    }
} else {
    Write-Host "Can't find root folder [$sRootFolder]." -ForegroundColor Red
}

У меня вышли такие результаты




Отправлено: 00:58, 27-06-2018 | #10