Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions ModAnalyzer/Domain/AssetArchiveAnalyzer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using BA2Lib;
using libbsa;
using SharpBSABA2.BA2Util;
using SharpBSABA2.BSAUtil;
using ModAnalyzer.Utils;
using SharpCompress.Archive;
using SharpCompress.Common;
Expand All @@ -9,7 +9,9 @@
using System.IO;
using System.Linq;


namespace ModAnalyzer.Domain {

internal class AssetArchiveAnalyzer {
private readonly BackgroundWorker _backgroundWorker;

Expand Down Expand Up @@ -68,10 +70,12 @@ private string[] GetBSAAssets(string bsaPath) {
string[] entries = null;

// create BSAManager and use it to get the assets from the BSA
BSANET bsaManager = new BSANET();
if (bsaManager.bsa_open(bsaPath) == 0)
entries = bsaManager.bsa_get_assets(".*");
bsaManager.bsa_close();
if (BSA.IsSupportedVersion(bsaPath))
{
BSA bsaManager = new BSA(bsaPath);
entries = bsaManager.Files.Select(file => file.FullPath).ToArray();
bsaManager.Close();
}

// return the entries we found
return entries;
Expand All @@ -81,10 +85,9 @@ private string[] GetBA2Assets(string ba2Path) {
string[] entries = null;

// create ba2Manager and use it to get the assets from the BA2
using (BA2NET ba2Manager = new BA2NET()) {
if (ba2Manager.Open(ba2Path))
entries = ba2Manager.GetNameTable();
}
BA2 bsaManager = new BA2(ba2Path);
entries = bsaManager.Files.Select(file => file.FullPath).ToArray();
bsaManager.Close();

// return the entries we found
return entries;
Expand Down
32 changes: 19 additions & 13 deletions ModAnalyzer/ModAnalyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@
<ApplicationIcon>favicon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BA2Lib, Version=1.0.5941.16591, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\BA2Lib.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
<Private>True</Private>
Expand All @@ -122,9 +118,6 @@
<HintPath>..\packages\ini-parser.2.3.0\lib\net20\INIFileParser.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="libbsa">
<HintPath>lib\libbsa.dll</HintPath>
</Reference>
<Reference Include="MaterialDesignColors, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll</HintPath>
<Private>True</Private>
Expand All @@ -145,6 +138,10 @@
<HintPath>..\packages\Octokit.0.22.0\lib\net45\Octokit.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Sharp.BSA.BA2, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\Sharp.BSA.BA2.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.11.6.0, Culture=neutral, PublicKeyToken=beaf6f427e128133, processorArchitecture=MSIL">
<HintPath>..\packages\sharpcompress.0.11.6\lib\net40\SharpCompress.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -272,12 +269,6 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="lib\BA2Lib.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="lib\libbsa.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ModDumpLib.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -299,6 +290,21 @@
<Content Include="borlndmm.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="lib\ICSharpCode.SharpZipLib.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="lib\lz4.AnyCPU.loader.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="lib\lz4.x64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="lib\lz4.x86.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="lib\Sharp.BSA.BA2.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<!--<Resource Include="FodyWeavers.xml" />-->
</ItemGroup>
<ItemGroup>
Expand Down
Binary file removed ModAnalyzer/lib/BA2Lib.dll
Binary file not shown.
Binary file added ModAnalyzer/lib/ICSharpCode.SharpZipLib.dll
Binary file not shown.
Binary file added ModAnalyzer/lib/Sharp.BSA.BA2.dll
Binary file not shown.
Binary file removed ModAnalyzer/lib/libbsa.dll
Binary file not shown.
Binary file added ModAnalyzer/lib/lz4.AnyCPU.loader.dll
Binary file not shown.
Binary file added ModAnalyzer/lib/lz4.x64.dll
Binary file not shown.
Binary file added ModAnalyzer/lib/lz4.x86.dll
Binary file not shown.