Skip to content

Commit

Permalink
修改密码错误提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Lsamien committed Mar 7, 2022
1 parent 00f4d4b commit 1365042
Show file tree
Hide file tree
Showing 7 changed files with 12,323 additions and 21,560 deletions.
4 changes: 2 additions & 2 deletions LSCrypt/LSCrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/* at Tue Jan 19 11:14:07 2038
*/
/* Compiler settings for LSCrypt.idl:
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0626
protocol : all , ms_ext, c_ext, robust
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0626
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
Expand Down
33,815 changes: 12,273 additions & 21,542 deletions LSCrypt/LSCrypt.map

Large diffs are not rendered by default.

15 changes: 1 addition & 14 deletions LSCrypt/PasswordDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


extern HINSTANCE g_hInst;
#define BITMAP_LOGO TEXT("EA_key3.0_Logo.bmp")

CPasswordDlg::CPasswordDlg(int nMode, HWND hwndParent)
{
Expand All @@ -16,19 +15,7 @@ CPasswordDlg::CPasswordDlg(int nMode, HWND hwndParent)
m_hWnd = NULL;
memset(m_password, 0, sizeof(m_password));

TCHAR szBitmapPath[MAX_PATH] = {0};

lstrcpy(szBitmapPath,pExt->m_szDllDir);
lstrcat(szBitmapPath,BITMAP_LOGO);

if (GetFileAttributes(szBitmapPath) == (DWORD)INVALID_HANDLE_VALUE)
{
m_hBitmapLogo = (HBITMAP)LoadBitmap(g_hInst,MAKEINTRESOURCE(IDB_LOGO));
}
else
{
m_hBitmapLogo = (HBITMAP)LoadImage(g_hInst,szBitmapPath,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
}
m_hBitmapLogo = (HBITMAP)LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_LOGO));

}

Expand Down
2 changes: 1 addition & 1 deletion LSCrypt/ProgressDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ bool CProgressDlg::OnError(WPARAM wParam, LPARAM lParam)
break;
case LSC_ERR_DECRYPT_FILE_FORMAT:
//解密文件格式错误, 通常是解密时, 输入的文件是未加密过的或密码错误
::MessageBoxW(m_hWnd,szDecryptError, PROJECT_NAME, MB_ICONWARNING);
::MessageBoxW(m_hWnd,L"解密文件格式错误, 通常是解密时, 输入的文件是未加密过的或密码错误", PROJECT_NAME, MB_ICONWARNING);
//取消任务
AbortTask();
break;
Expand Down
Binary file modified LSCrypt/res/logo.bmp
Binary file not shown.
35 changes: 35 additions & 0 deletions LSCryptGUI/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,41 @@ static void OnSurfaceReady(LCUI_Event e, void* arg)

int main(int argc, char** argv)
{
if (!LoadDLL())
{
return 0;
}

char file[MAX_PATH];
char* pCmdLine = NULL;
char* pFile = NULL;

file[0] = 0;

//文件路径形式, 如(包括双引号): "C:\\123.UFC"
if (argc>1)
{
pCmdLine = argv[1];
pFile = file;
if (*pCmdLine == '\"') pCmdLine++;
while (*pCmdLine && *pCmdLine != '\"')
{
*pFile++ = *pCmdLine++;
}
*pFile = '\0';

//IsFileExists(file);
if (file[0]/* && IsFileExists(file)*/)
{
//解密文件
if (LoadDLL())
fnDllOpenCrypt(AnsiToUnicode(file));
return FALSE;
}
}



LCUI_Widget root, pack;

LCUI_Init();
Expand Down
12 changes: 11 additions & 1 deletion include/LSCryptinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,15 @@ static void UnLoadDLL()
// LPWSTR lpAutoFileOut, int nAutoFileOut, DWORD *pLastSystemError);
//DWORD __declspec(dllimport) DllEncrypt(const char *password, const wchar_t *file, pfnEn_DeCallback pCallback,
// LPWSTR lpAutoFileOut, int nAutoFileOut, DWORD *pLastSystemError);

static wchar_t* AnsiToUnicode(const char* szStr)
{
int nLen = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szStr, -1, NULL, 0);
if (nLen == 0)
{
return NULL;
}
wchar_t* pResult = new wchar_t[nLen];
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szStr, -1, pResult, nLen);
return pResult;
}
#endif //_LS_CRYPT_H__

0 comments on commit 1365042

Please sign in to comment.