forked from Xplatforms/mbseedkey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b28e666
commit 35f83d7
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "ecuseedkeydll.h" | ||
#include <QDir> | ||
#include <QFileInfo> | ||
#include <QTimer> | ||
#include <QDebug> | ||
#include <signal.h> | ||
|
||
auto tmp_ret_def_seedkey_len = [](int){return 4;}; | ||
|
||
QString GetLastErrorAsString() | ||
{ | ||
//Get the error message, if any. | ||
auto errorMessageID = ::GetLastError(); | ||
if(errorMessageID == 0)return QStringLiteral(""); //No error message has been recorded | ||
|
||
LPWSTR messageBuffer = Q_NULLPTR; | ||
size_t size = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, | ||
NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), messageBuffer, 0, NULL); | ||
|
||
auto message = QString::fromWCharArray(messageBuffer, size); | ||
LocalFree(messageBuffer); | ||
|
||
return message; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef ECUSEEDKEYDLL_H | ||
#define ECUSEEDKEYDLL_H | ||
|
||
#include <QObject> | ||
#include <QString> | ||
#include <QHash> | ||
#include <Windows.h> | ||
|
||
typedef int (__cdecl *_f_GetConfiguredAccessTypes)(int *); | ||
typedef int (__cdecl *_f_GetSeedLength)(int); | ||
typedef int (__cdecl *_f_GetKeyLength)(int); | ||
typedef const char * (__cdecl *_f_GetECUName)(); | ||
typedef const char * (__cdecl *_f_GetComment)(); | ||
|
||
typedef int (__cdecl * _f_GenerateKeyExOpt )( const unsigned char* ipSeedArray, | ||
unsigned int iSeedArraySize, | ||
const unsigned int iSecurityLevel, | ||
const char * ipVariant, | ||
const char* ipOptions, | ||
unsigned char* iopKeyArray, | ||
unsigned int iMaxKeyArraySize, | ||
unsigned int& oActualKeyArraySize ); | ||
|
||
|
||
|
||
#endif // ECUSEEDKEYDLL_H |