static bool hasCoreLibNI()
{
- FILE *fp;
- char buff[1024];
std::string ildasm = concatPath(__pm->getRuntimePath(), "ildasm");
std::string coreLib = concatPath(__pm->getRuntimePath(), "System.Private.CoreLib.dll");
- std::string cmd = ildasm + " " + coreLib + " | grep '\\.corflags'";
+ std::string cmd = ildasm + " " + coreLib + " -noil -stats | grep '\\.xdata'";
+
+ FILE *fp;
fp = popen(cmd.c_str(), "r");
if (fp != NULL) {
- while (fgets(buff, sizeof(buff), fp) != NULL) {
- buff[strlen(buff) - 1] = '\0';
- }
- std::string corflag = replaceAll(buff, ".corflags", "");
- corflag.erase(std::remove(corflag.begin(), corflag.end(), ' '), corflag.end());
- // CorFlags.ILLibrary=0x00000004 (.ni.dll)
- if (!strcmp(corflag.substr(0, 10).c_str(), "0x00000004")) {
+ char buff[1024];
+ if (fgets(buff, sizeof(buff), fp) != NULL) {
pclose(fp);
return true;
}