📄 other.cpp
字号:
// Other.cpp : implementation file
//
#include "stdafx.h"
#include "SkyRiver.h"
#include "Other.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COther dialog
COther::COther(CWnd* pParent /*=NULL*/)
: CDialog(COther::IDD, pParent)
{
//{{AFX_DATA_INIT(COther)
m_nCount = 0;
m_nFish = 0;
m_nBall = 0;
//}}AFX_DATA_INIT
}
void COther::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COther)
DDX_Control(pDX, IDC_LIST2, m_List2);
DDX_Control(pDX, IDC_LIST1, m_List1);
DDX_Text(pDX, IDC_COUNT, m_nCount);
DDX_Text(pDX, IDC_FISH, m_nFish);
DDX_Text(pDX, IDC_BALL, m_nBall);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(COther, CDialog)
//{{AFX_MSG_MAP(COther)
ON_BN_CLICKED(IDC_ADD, OnAdd)
ON_BN_CLICKED(IDC_DELETE, OnDelete)
ON_EN_KILLFOCUS(IDC_FISH, OnKillfocusFish)
ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COther message handlers
void COther::Show()
{
if(!m_Memory.GetHProcess())
return;
m_nFish=m_Memory.ReadMemory((LPVOID)0x00d1f774);
ShowProduct();
UpdateData(FALSE);
}
void COther::ShowProduct()
{
int count=m_Memory.ReadMemory((LPVOID)0x0156e628);
m_Memory.SetBaseAddress((LPVOID)0x0156e538);
m_List1.ResetContent();
for(int i=0;i<count;i++)
{
int pos=m_Memory.ReadMemory(i*8)-0x0000001a;
char save=m_pProduct[pos*15+15-1];
m_pProduct[pos*15+15-1]='\0';
m_List1.AddString(&m_pProduct[pos*15+3]);
m_pProduct[pos*15+15-1]=save;
}
}
void COther::SetCount()
{
UpdateData(TRUE);
int pos=m_List1.GetCurSel();
m_Memory.WriteMemory(pos*8+4,m_nCount);
}
void COther::ShowAll()
{
int temp=strlen(m_pProduct);
for(int i=0;i<temp;i+=15)
{
char save=m_pProduct[i+15-1];
m_pProduct[i+15-1]='\0';
m_List2.AddString(&m_pProduct[i+3]);
m_pProduct[i+15-1]=save;
}
}
LPVOID COther::GetProduct()
{
HRSRC hRsrc = FindResource(NULL, MAKEINTRESOURCE(IDR_PRODUCT), TEXT("Help"));
DWORD dwSize = SizeofResource(NULL, hRsrc);
HGLOBAL hGlobal = LoadResource(NULL, hRsrc);
LPVOID pBuffer = LockResource(hGlobal);
return pBuffer;
}
BOOL COther::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetButton(this,IDC_DELETE,3,IDI_ICON13,NULL,NULL,_T("移除"),NULL,TRUE);
SetButton(this,IDC_ADD ,3,IDI_ICON14,NULL,NULL,_T("添加"),NULL,TRUE);
m_pProduct=(PCHAR)GetProduct();
ShowAll();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void COther::OnAdd()
{
// TODO: Add your control notification handler code here
int count=m_Memory.ReadMemory((LPVOID)0x0156e628);
int pos=m_List2.GetCurSel();
int item=((m_pProduct[pos*15]-0x30)<10?m_pProduct[pos*15]-0x30:m_pProduct[pos*15]-0x37)*16+((m_pProduct[pos*15+1]-0x30)<10?m_pProduct[pos*15+1]-0x30:m_pProduct[pos*15+1]-0x37);
m_Memory.WriteMemory(count*8,item);
m_Memory.WriteMemory(count*8+4,0);
count++;
m_Memory.WriteMemory((LPVOID)0x0156e628,count);
m_List1.SetFocus();
m_List1.SetCurSel(count-1);
Show();
}
void COther::OnDelete()
{
// TODO: Add your control notification handler code here
}
void COther::SetHProcess(HANDLE hProcess)
{
m_Memory.Create(hProcess);
}
void COther::OnKillfocusFish()
{
// TODO: Add your control notification handler code here
if(!m_Memory.GetHProcess())
return;
UpdateData(TRUE);
m_Memory.WriteMemory((LPVOID)0x00d1f774,m_nFish);
}
void COther::OnSelchangeList1()
{
// TODO: Add your control notification handler code here
int pos=m_List1.GetCurSel();
m_nCount=m_Memory.ReadMemory(pos*8+4);
UpdateData(FALSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -