diff options
| author | Petr Mrázek | 2011-03-31 05:39:12 +0200 |
|---|---|---|
| committer | Petr Mrázek | 2011-03-31 05:39:12 +0200 |
| commit | 837ea52c2216436f6ffc0fd947ba45a3deb8852a (patch) | |
| tree | 32ac237b4b8e282072650542ccb421030abf246a /library/VersionInfoFactory.cpp | |
| parent | 6cd08c3f31621d8fe6745efa646f19197e541f33 (diff) | |
| download | dfhack-837ea52c2216436f6ffc0fd947ba45a3deb8852a.tar.gz dfhack-837ea52c2216436f6ffc0fd947ba45a3deb8852a.tar.bz2 dfhack-837ea52c2216436f6ffc0fd947ba45a3deb8852a.tar.xz | |
Fix windows/wine version information bugs related to processes without a PE header.
Diffstat (limited to 'library/VersionInfoFactory.cpp')
| -rw-r--r-- | library/VersionInfoFactory.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/library/VersionInfoFactory.cpp b/library/VersionInfoFactory.cpp index 20bc61ac..6484d7e1 100644 --- a/library/VersionInfoFactory.cpp +++ b/library/VersionInfoFactory.cpp @@ -112,26 +112,33 @@ VersionInfo * VersionInfoFactory::getVersionInfoByMD5(string hash) for(uint32_t i = 0; i < versions.size();i++) { vinfo = versions[i]; - if(vinfo->getMD5() == hash) + string test_hash; + if(vinfo->getMD5(test_hash) && hash == test_hash) { return vinfo; } } - return NULL; + return 0; } VersionInfo * VersionInfoFactory::getVersionInfoByPETimestamp(uint32_t timestamp) { VersionInfo * vinfo; + //cout << "lookup size:" << versions.size() << endl; for(uint32_t i = 0; i < versions.size();i++) { vinfo = versions[i]; - if(vinfo->getPE() == timestamp) + uint32_t test_PE; + //cout << "Testing version: " << hex << vinfo <<" No:" << dec << i << endl; + //cout << vinfo->getName() << endl; + if(vinfo->getPE(test_PE) && test_PE == timestamp) { return vinfo; } + //cout << "LOOP ENDS" << endl; } - return NULL; + //cout << "NOTHING!" << endl; + return 0; } @@ -746,8 +753,6 @@ bool VersionInfoFactory::loadFile(string path_to_xml) versions.push_back(version); } } - - // process found things here } error = false; return true; |
