Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64 #195

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Arm64 #195

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
1 change: 1 addition & 0 deletions ClrPhlib/include/ClrPhlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ namespace Dependencies {

// return the processorArchiture of PE
String^ GetProcessor();
bool CheckProcessor(String^ ProcessorArch);

// Return the ApiSetSchema
ApiSetSchema^ GetApiSetSchema();
Expand Down
13 changes: 12 additions & 1 deletion ClrPhlib/src/managed/PE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,18 @@ String^ PE::GetProcessor()
return gcnew String("arm");
if ((Properties->Machine & 0xffff) == IMAGE_FILE_MACHINE_ARM64)
return gcnew String("arm64");

if ((Properties->Machine & 0xffff) == IMAGE_FILE_MACHINE_AMD64)
return gcnew String("amd64");

return gcnew String("unknown");
}

bool PE::CheckProcessor(String^ ProcessorArch)
{
if (((Properties->Machine & 0xffff) == IMAGE_FILE_MACHINE_ARM64) && (ProcessorArch == "amd64"))
return true;

if (GetProcessor() == ProcessorArch)
return true;
return false;
}
2 changes: 1 addition & 1 deletion DependenciesLib/FindPeModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static string FindPeFromPath(string ModuleName, List<string> CandidateFolders, s
if (TestPe != null && TestPe.LoadSuccessful)
{
Debug.WriteLine("Attempt to load {0:s} {1:s} {2:s}", PeFilePath, TestPe.GetProcessor(), ProcessorArch);
if (TestPe.GetProcessor() == ProcessorArch)
if (TestPe.CheckProcessor(ProcessorArch))
return PeFilePath;
}
}
Expand Down