Skip to content

Commit

Permalink
Bugfixed assembly filename resolve in fallback methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Bert-Proesmans committed Jun 6, 2017
1 parent 3d92446 commit b3f243c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions HookRegistry/HookRegistry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\hs_link\Hearthstone_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\hs_link\Hearthstone_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>..\lib\PayloadFormat\Debug\net35\Google.Protobuf.dll</HintPath>
Expand All @@ -49,6 +51,7 @@
<Reference Include="System.Data" />
<Reference Include="UnityEngine">
<HintPath>..\hs_link\Hearthstone_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion Hooker/Hooker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
<Compile Include="src\Restore.cs" />
</ItemGroup>
<ItemGroup>
<None Include="example_hooks" />
<None Include="example_hooks">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="..\GameKnowledgeBase\GameKnowledgeBase.projitems" Label="Shared" />
Expand Down
6 changes: 4 additions & 2 deletions Hooker/src/hook/HookRegistryTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ public void Analyze(string hrAssemblyPath, string gameLibraryPath)
// the missing library dll file.
private Assembly FallbackAssemblyHRReference(object sender, ResolveEventArgs args)
{
var referenceName = new AssemblyName(args.Name);
// Filename of the assembly, minus the extension.
string libFileName = args.Name;
string libFileName = referenceName.Name;
// Check if the file exists under game lib folder.
// TODO: .dll is hardcoded, but it could also be .exe or whatnot..
string fullLibPath = Path.Combine(_hrLibraryPath, libFileName + ".dll");
Expand All @@ -134,8 +135,9 @@ private Assembly FallbackAssemblyHRReference(object sender, ResolveEventArgs arg
// the missing library dll file.
private Assembly FallbackAssemblyLoadGameLibrary(object sender, ResolveEventArgs args)
{
var referenceName = new AssemblyName(args.Name);
// Filename of the assembly, minus the extension.
string libFileName = args.Name;
string libFileName = referenceName.Name;
// Check if the file exists under game lib folder.
// TODO: .dll is hardcoded, but it could also be .exe or whatnot..
string fullLibPath = Path.Combine(_gameLibraryPath, libFileName + ".dll");
Expand Down

0 comments on commit b3f243c

Please sign in to comment.