#include <windows.h>
#define UPD "Update : 2005.06.04" // 업데이트 날짜
#define TETCAP "넷마블 테트리스 Plus Ver1.05" // 테트 캡션이름 버젼까지만입력 뒤로 - [대전모드] 이런건 넣지마셈
DWORD Block_Map_Address=0x591970; //★중요★ 블럭맵의 첫번째 주소를 넣으면됨.
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
HINSTANCE g_hInst;
LPSTR lpszClass="Tetris+ Bug";
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpszCmdParam,int nCmdShow)
{
HWND hWnd;
MSG Message;
WNDCLASS WndClass;
g_hInst=hInstance;
WndClass.cbClsExtra=0;
WndClass.cbWndExtra=0;
WndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
WndClass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
WndClass.hInstance=hInstance;
WndClass.lpfnWndProc=(WNDPROC)WndProc;
WndClass.lpszClassName=lpszClass;
WndClass.lpszMenuName=NULL;
WndClass.style=CS_HREDRAW | CS_VREDRAW;
RegisterClass(&WndClass);
hWnd=CreateWindow(lpszClass,lpszClass,WS_SYSMENU,
1,1,150,100,
NULL,(HMENU)NULL,hInstance,NULL);
ShowWindow(hWnd,nCmdShow);
while(GetMessage(&Message,0,0,0)) {
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return Message.wParam;
}
char BMV[255]={0};
HWND ThWnd,ChWnd;
DWORD ProcessId=0,hProcess=0;
HWND GetHwnd(char N[128]){
HWND hWnd1=GetForegroundWindow(),hWnd2;
char WndText[128];
while(hWnd1){
GetWindowText(hWnd1,WndText,128);
if(strstr(WndText,N)!=NULL){
HWND RChWnd=GetWindow(hWnd1,5);
while(ChWnd==0){
ChWnd=FindWindowEx(RChWnd,0,"AfxWnd42s","GameView");
RChWnd=GetWindow(RChWnd,2);
}
return hWnd1;
}
hWnd2=hWnd1;
hWnd1=GetNextWindow(hWn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,7,7,
0,0,6,6,6,6,6,6,6,6,6,13,
0,0,5,5,5,5,5,5,5,5,5,13,
0,0,4,4,4,4,4,4,4,4,4,13,
0,0,3,3,3,3,3,3,3,3,3,11,
0,0,2,2,2,2,2,2,2,2,2,11,
0,0,1,1,1,1,1,1,1,1,1,11};
char tetholem[255]={
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
10,12,10,12,0,0,0,0,10,12,10,12,
4,4,2,2,0,0,0,0,2,2,4,4,
5,4,2,5,0,0,0,0,5,2,4,5,
5,4,2,5,0,0,0,0,5,2,4,5,
5,4,2,5,0,0,0,0,5,2,4,5,
5,2,2,5,0,0,0,0,5,2,2,5,
5,2,4,5,0,0,0,0,5,4,2,5,
5,2,4,5,0,0,0,0,5,4,2,5,
5,2,4,5,0,0,0,0,5,4,2,5,
2,2,4,4,0,0,0,0,4,4,2,2};
char attm[255]={
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12,
12,12,12,12,12,0,0,0,0,12,12,12};
void MKBL(int a){
PostMessage(ChWnd, WM_LBUTTONDOWN, 0x1, 0x20601F2);
PostMessage(ChWnd, WM_LBUTTONUP, 0x0, 0x20601F2);
ThWnd = GetHwnd(TETCAP);
ProcessId = GetProcId(ThWnd);
HANDLE hProcess = OpenProcess(0x1F0FFF,0,ProcessId);
DWORD BMA=0;
ReadProcessMemory(hProcess,(LPVOID*)Block_Map_Address,&BMA,0x4,NULL);
if(BMA){
for(int i=0;i<=11;i++){
PostMessage(ChWnd, WM_KEYDOWN, 0x44, 0x200001);
PostMessage(ChWnd, WM_KEYUP, 0x44, 0xC0200001);
}
Sleep(5);
WriteProcessMemory(hProcess,(LPVOID*)BMA,&clearm,0xFC,NULL);
PostMessage(ChWnd, WM_KEYDOWN, 0x20, 0x390001);
PostMessage(ChWnd, WM_KEYUP, 0x20, 0xC0390001);
Sleep(5);
switch(a){
case 0:
WriteProcessMemory(hProcess,(LPVOID*)BMA,&emptym,0xFC,NULL);
break;
case 1:
WriteProcessMemory(hProcess,(LPVOID*)BMA,&nangm,0xFC,NULL);
break;
case 2:
WriteProcessMemory(hProcess,(LPVOID*)BMA,&tetholem,0xFC,NULL);
break;
case 3:
WriteProcessMemory(hProcess,(LPVOID*)BMA,&attm,0xFC,NULL);
break;
}
Sleep(5);
for(i=0;i<=11;i++){
PostMessage(ChWnd, WM_KEYDOWN, 0x21, 0x1490001);
PostMessage(ChWnd, WM_KEYUP, 0x21, 0x1490001);
}
}
CloseHandle(hProcess);
}
void die(){
PostMessage(ChWnd, WM_LBUTTONDOWN, 0x1, 0x20601F2);
PostMessage(ChWnd, WM_LBUTTONUP, 0x0, 0x20601F2);
for(int i=0;i<=20;i++){
Sleep(5);
PostMessage(ChWnd, WM_KEYDOWN, 0x20, 0x390001);
PostMessage(ChWnd, WM_KEYUP, 0x20, 0xC0390001);
}
}
void OutPutText(HWND hWnd){
HDC hdc;
PAINTSTRUCT ps;
hdc=BeginPaint(hWnd,&ps);
char handle[256]={0};
char processid[256]={0};
char update[256]={UPD};
if(ThWnd)
wsprintf(handle, "Handle : 0x%X", ThWnd);
else
wsprintf(handle, "Handle : NULL", NULL);
if(ProcessId)
wsprintf(processid, "Process : 0x%X", ProcessId);
else
wsprintf(processid, "Process : NULL", NULL);
TextOut(hdc,7,7,handle,strlen(handle));
TextOut(hdc,7,24,processid,strlen(processid));
TextOut(hdc,7,41,update,strlen(update));
EndPaint(hWnd,&ps);
}
LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam)
{
static HANDLE hTimer;
static int BC=1;
switch(iMessage) {
case WM_CREATE:
hTimer=(HANDLE)SetTimer(hWnd,1,30,NULL);
return 0;
case WM_TIMER:
//if(BC++>9)BC=0; // 확률게임? ㅋㅋ
if(GetAsyncKeyState(96)==-32767){
if(BC)
MKBL(0);
else
die();
InvalidateRect(hWnd,NULL,TRUE);
}
if(GetAsyncKeyState(110)==-32767){
if(BC)
MKBL(3);
else
die();
InvalidateRect(hWnd,NULL,TRUE);
}
if(GetAsyncKeyState(123)==-32767){
if(BC)
MKBL(1);
else
die();
InvalidateRect(hWnd,NULL,TRUE);
}
if(GetAsyncKeyState(122)==-32767){
if(BC)
MKBL(2);
else
die();
InvalidateRect(hWnd,NULL,TRUE);
}
return 0;
case WM_DESTROY:
KillTimer(hWnd,1);
PostQuitMessage(0);
return 0;
case WM_PAINT:
OutPutText(hWnd);
return 0;
}
return(DefWindowProc(hWnd,iMessage,wParam,lParam));
}
관련영상 : http://blog.daum.net/syaica1/?t__nil_login=myblog
댓글 영역
획득법
① NFT 발행
작성한 게시물을 NFT로 발행하면 일주일 동안 사용할 수 있습니다. (최초 1회)
② NFT 구매
다른 이용자의 NFT를 구매하면 한 달 동안 사용할 수 있습니다. (구매 시마다 갱신)
사용법
디시콘에서지갑연결시 바로 사용 가능합니다.