资源简介
source D2 plugin (plugy)
代码片段和文件信息
/*=================================================================
File created by Yohann NICOLAS.
Get Game version.
=================================================================*/
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include “VersionInfo.h“
#pragma comment(lib “Version.Lib“)
const char* VersionStrings[16] = { “1.00““1.07““1.08““1.09““1.09b““1.09d““1.10““1.11““1.11b““1.12““1.13c““1.13d““1.14a““1.14b““1.14c““1.14d“ };
const char* GetVersionString(int version)
{
if (version < 0 || version >= sizeof(VersionStrings))
return “UNKNOW“;
return VersionStrings[version];
}
eGameVersion GetD2Version(LPCVOID pVersionResource)
{
if (!pVersionResource) return UNKNOW;
UINT uLen;
VS_FIXEDFILEINFO* ptFixedFileInfo;
if (!VerQueryValue(pVersionResource “\\“ (LPVOID*)&ptFixedFileInfo &uLen))
return UNKNOW;
if (uLen == 0)
return UNKNOW;
WORD major = HIWORD(ptFixedFileInfo->dwFileVersionMS);
WORD minor = LOWORD(ptFixedFileInfo->dwFileVersionMS);
WORD revision = HIWORD(ptFixedFileInfo->dwFileVersionLS);
WORD subrevision = LOWORD(ptFixedFileInfo->dwFileVersionLS);
if (major != 1)
return UNKNOW;
if (minor == 0 && revision == 7 && subrevision == 0) return V107;
if (minor == 0 && revision == 8 && subrevision == 28) return V108;
if (minor == 0 && revision == 9 && subrevision == 19) return V109;
if (minor == 0 && revision == 9 && subrevision == 20) return V109b;
if (minor == 0 && revision == 9 && subrevision == 22) return V109d;
if (minor == 0 && revision == 10 && subrevision == 39) return V110;
if (minor == 0 && revision == 11 && subrevision == 45) return V111;
if (minor == 0 && revision == 11 && subrevision == 46) return V111b;
if (minor == 0 && revision == 12 && subrevision == 49) return V112;
if (minor == 0 && revision == 13 && subrevision == 60) return V113c;
if (minor == 0 && revision == 13 && subrevision == 64) return V113d;
if (minor == 14 && revision == 0 && subrevision == 64) return V114a;
if (minor == 14 && revision == 1 && subrevision == 68) return V114b;
if (minor == 14 && revision == 2 && subrevision == 70) return V114c;
if (minor == 14 && revision == 3 && subrevision == 71) return V114d;
return UNKNOW;
}
eGameVersion GetD2Version(char* gameExe)
{
DWORD len = GetFileVersionInfoSize(gameExe NULL);
if (len == 0)
return UNKNOW;
BYTE* pVersionResource = new BYTE[len];
GetFileVersionInfo(gameExe NULL len pVersionResource);
eGameVersion version = GetD2Version(pVersionResource);
delete pVersionResource;
return version;
}
eGameVersion GetD2Version(HMODULE hModule)
{
HRSRC hResInfo = FindResource(hModule MAKEINTRESOURCE(VS_VERSION_INFO) RT_VERSION);
if (!hResInfo) return UNKNOW;
HGLOBAL hResData = LoadResource(hModule hResInfo);
if (!hResData) return UNKNOW;
LPVOID pVersionResource = LockResource(hResData);
eGameVersion version = GetD2Versi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 242 2020-07-29 08:27 PlugY-master\.gitignore
文件 35147 2020-07-29 08:27 PlugY-master\LICENSE
文件 2618 2020-07-29 08:27 PlugY-master\README.md
文件 39332 2020-07-29 08:27 PlugY-master\Commons\d2BinFile.h
文件 22679 2020-07-29 08:27 PlugY-master\Commons\d2constants.h
文件 74628 2020-07-29 08:27 PlugY-master\Commons\D2Funcs.h
文件 925 2020-07-29 08:27 PlugY-master\Commons\d2StringTblStruct.h
文件 2415 2020-07-29 08:27 PlugY-master\Commons\d2Struct.h
文件 18135 2020-07-29 08:27 PlugY-master\Commons\D2UnitStruct.h
文件 1362 2020-07-29 08:27 PlugY-master\Commons\updatingConst.h
文件 3133 2020-07-29 08:27 PlugY-master\Commons\VersionInfo.cpp
文件 615 2020-07-29 08:27 PlugY-master\Commons\VersionInfo.h
文件 3137 2020-07-29 08:27 PlugY-master\PlugY\BigStash.cpp
文件 418 2020-07-29 08:27 PlugY-master\PlugY\bigStash.h
文件 3198 2020-07-29 08:27 PlugY-master\PlugY\ClientSaveFile.cpp
文件 409 2020-07-29 08:27 PlugY-master\PlugY\clientSaveFile.h
文件 15324 2020-07-29 08:27 PlugY-master\PlugY\Commands.cpp
文件 580 2020-07-29 08:27 PlugY-master\PlugY\commands.h
文件 542 2020-07-29 08:27 PlugY-master\PlugY\Common.cpp
文件 1116 2020-07-29 08:27 PlugY-master\PlugY\common.h
文件 396 2020-07-29 08:27 PlugY-master\PlugY\customData.h
文件 2599 2020-07-29 08:27 PlugY-master\PlugY\CustomLibraries.cpp
文件 1659 2020-07-29 08:27 PlugY-master\PlugY\customLibraries.h
文件 34018 2020-07-29 08:27 PlugY-master\PlugY\D2functions.cpp
文件 5047 2020-07-29 08:27 PlugY-master\PlugY\d2functions.h
文件 17206 2020-07-29 08:27 PlugY-master\PlugY\D2wrapper.cpp
文件 1919 2020-07-29 08:27 PlugY-master\PlugY\d2wrapper.h
文件 2224 2020-07-29 08:27 PlugY-master\PlugY\Error.cpp
文件 644 2020-07-29 08:27 PlugY-master\PlugY\error.h
文件 4558 2020-07-29 08:27 PlugY-master\PlugY\ExtendedSaveFile.cpp
文件 667 2020-07-29 08:27 PlugY-master\PlugY\extendedSaveFile.h
............此处省略110个文件信息
- 上一篇:煤巷超前探测双频交流激电接收机系统设计
- 下一篇:美元打印机
评论
共有 条评论