|
Архивный участник
Join Date: Nov 2005
Posts: 403
|
hm, maybe we can talk in another threed or with some another method if this need, but this topic have different header.
and i dont understand only one, if im so bad, you ban 2 accounts but now only: "get lost", hm realy nice, so this is last one, ban it too as i ask before.
btw here is a source of one dll like this one, yes it without CP, autoSS, Recomendation system posted somewhere here - search, but what difference, who know what to do - do it, all anothers will stay on same place
Code:
;----------------------------------------------
;
;----------------------------------------------
.386
.model flat, stdcall
option casemap:none
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
include \masm32\m32lib\masm32.inc
includelib \masm32\m32lib\masm32.lib
.data?
hInstance dd ?
hMainInst dd ?
hViewWinMain dd ?
dwProcessID dd ?
szViewPacket db 1024 dup (?)
.const
szViewPacketWinClass db 'ViewPacketWinClass',0
szViewPacketWindow db 'ViewPacketWindow',0
szViewPacketWinCaptin db 'Packet Viewer',0
szInfoCaption db 'Infomation',0
szInfoOK db 'Dll works OK!',0
szErrCaption db 'Error Notice!',0
szErrReadProcMem db 'Can not read process memory!',0
szErrWriteProcMem db 'Can not write process memory!',0
szErrCodeNotMatch db 'The file version maybe error!',0
szErrTooShortCode db 'The target code is too short!',0
szErrOpenProcess db 'Cant not open the process!',0
szPacketFormat db '------------------------------------------',0Dh,0Ah,
'Receive %d-%d bytes, OpCode is: %#02x',0Dh,0Ah,
'%s',0Dh,0Ah,
'------------------------------------------',0Dh,0Ah,0
szC4PacketFormat db '------------------------------------------',0Dh,0Ah,
'Receive %d-%d bytes, OpCode is: %#02x(%#04x)',0Dh,0Ah,
'%s',0Dh,0Ah,
'------------------------------------------',0Dh,0Ah,0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; ДЈїйМхјю±аТл
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
__DEBUG__ equ TRUE
__PATCH_WINDOW__ equ TRUE
__PATCH_RECV_PACKET__ equ TRUE
;__PATCH_SEND_PACKET__ equ TRUE
__USERINFO_PACKET__ equ TRUE
__CHARINFO_PACKET_1__ equ TRUE
__CHARINFO_PACKET_2__ equ TRUE
ifdef __DEBUG__
include debug.inc
endif
.code
;------------------------------------------------------------------------
; ФЪґґЅЁґ°їЪґъВ봦ґтІ№¶ЎЈ¬УГУЪґґЅЁТ»ёцПФКѕКдіц·в°ьКэѕЭµДґ°їЪ
;------------------------------------------------------------------------
PatchAddrProc proc uses ebx edi esi
local @OldCodeBuff[8]:byte
local @NewCodeBuff[8]:byte
pushad
invoke GetCurrentProcessId
mov dwProcessID,eax
invoke OpenProcess,PROCESS_ALL_ACCESS,NULL,dwProcessID
.if !eax
invoke MessageBox,NULL,addr szErrOpenProcess,addr szErrCaption,\
MB_OK or MB_ICONSTOP
.else
mov hMainInst,eax
;========================================================================
; ґґЅЁґ°їЪ»тїШјю
;========================================================================
ifdef __PATCH_WINDOW__
;ґґЅЁґ°їЪ
CreateWindowAddr equ 0041694Eh
.const
dbCreateWindowCode db 0B8h,5Bh,69h,41h
.code
invoke ReadProcessMemory,hMainInst,CreateWindowAddr,addr @OldCodeBuff,\
sizeof dword,NULL
.if eax
mov eax,dword ptr @OldCodeBuff
.if eax == dword ptr dbCreateWindowCode
mov eax,offset CreateWindowProc
mov dword ptr [@NewCodeBuff],eax ;РґИлМшЧЄµШЦ·
invoke WriteProcessMemory,hMainInst,CreateWindowAddr + 1,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
.else
invoke MessageBox,NULL,addr szErrCodeNotMatch,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
.else
invoke MessageBox,NULL,addr szErrReadProcMem,addr szErrCaption,\
MB_OK or MB_ICONSTOP
.endif
endif
;========================================================================
; ЅУКХ°ьЈ¬ґтУЎјаКУ
;========================================================================
ifdef __PATCH_RECV_PACKET__
;ЅУКХКэѕЭ°ь
RecvPacketAddr equ 00416987h
.const
dbRecvPacketCode db 0B8h,91h,69h,41h
.code
invoke ReadProcessMemory,hMainInst,RecvPacketAddr,addr @OldCodeBuff,\
sizeof dword,NULL
.if eax
mov eax,dword ptr @OldCodeBuff
.if eax == dword ptr dbRecvPacketCode
mov eax,offset RecvPacketProc
mov dword ptr [@NewCodeBuff],eax ;РґИлМшЧЄµШЦ·
invoke WriteProcessMemory,hMainInst,RecvPacketAddr + 1,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
.else
invoke MessageBox,NULL,addr szErrCodeNotMatch,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
.else
invoke MessageBox,NULL,addr szErrReadProcMem,addr szErrCaption,\
MB_OK or MB_ICONSTOP
.endif
endif
;========================================================================
; userinfo ·в°ьёсКЅРЮёД
; їШЦЖЅЗЙ«ГыСХЙ«Ј¬·ў№вµИ
;========================================================================
UserinfoPacketAddr equ 006B81D0h ;+1
UserinfoPacketFormatAddr equ 004FECECh ;+0
UserinfoESPAddr equ 004FECFBh
UserinfoPacketEsp equ 0210h ;РЮХэesp
.const
dbUserinfoPacketCode db 068h,0D6h,81h,6Bh
szUserinfoPacketFormat db "cdddddSdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddffffddddSdddddcccddhbcdcddddddddhhdhddddcdddddd",0
.code
invoke ReadProcessMemory,hMainInst,UserinfoPacketAddr,addr @OldCodeBuff,\
sizeof dword,NULL
.if eax
mov eax,dword ptr @OldCodeBuff
.if eax == dword ptr dbUserinfoPacketCode
;------------------------------------------------------------------------
; РЮёДЧйЧ°userinfo·в°ьґъВл
;------------------------------------------------------------------------
mov eax,offset UserinfoPacketProc
mov dword ptr [@NewCodeBuff],eax ;РґИлМшЧЄµШЦ·
invoke WriteProcessMemory,hMainInst,UserinfoPacketAddr + 1,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
;------------------------------------------------------------------------
; їЄКј
;------------------------------------------------------------------------
ifdef __USERINFO_PACKET__
;------------------------------------------------------------------------
; РЮёДuserinfo·в°ьёсКЅ
;------------------------------------------------------------------------
mov eax,offset szUserinfoPacketFormat
mov dword ptr [@NewCodeBuff],eax
invoke WriteProcessMemory,hMainInst,UserinfoPacketFormatAddr,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
;------------------------------------------------------------------------
; РЮХэuserinfo¶СХ»esp
;------------------------------------------------------------------------
mov eax,UserinfoPacketEsp
mov dword ptr [@NewCodeBuff],eax
invoke WriteProcessMemory,hMainInst,UserinfoESPAddr,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
endif
;------------------------------------------------------------------------
; ЅбКш
;------------------------------------------------------------------------
.else
invoke MessageBox,NULL,addr szErrCodeNotMatch,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
.else
invoke MessageBox,NULL,addr szErrReadProcMem,addr szErrCaption,\
MB_OK or MB_ICONSTOP
.endif
;========================================================================
; charinfo ·в°ьёсКЅРЮёД
;========================================================================
CharinfoPacketAddr1 equ 006B8280h ;+1
CharinfoPacketFormatAddr1 equ 004FF516h
CharinfoESPAddr1 equ 004FF522h
CharinfoPacketAddr2 equ 006B8260h ;+1
CharinfoPacketFormatAddr2 equ 004FFAB3h
CharinfoESPAddr2 equ 004FFAC2h
CharinfoPacketEsp equ 0148h ;РЮХэesp
.const
dbCharinfoPacketCode1 db 068h,086h,82h,6Bh
dbCharinfoPacketCode2 db 068h,066h,82h,6Bh
szCharinfoPacketFormat db "cdddddSddddddddddddddddddddddddddddffffdddSdddddccccccchbcdchdddccdcccdddd",0
.code
;------------------------------------------------------------------------
; 1 РЮХэїЄКј
;------------------------------------------------------------------------
invoke ReadProcessMemory,hMainInst,CharinfoPacketAddr1,addr @OldCodeBuff,\
sizeof dword,NULL
.if eax
mov eax,dword ptr @OldCodeBuff
.if eax == dword ptr dbCharinfoPacketCode1
;------------------------------------------------------------------------
; 1 РЮёДЧйЧ°Charinfo·в°ьґъВл
;------------------------------------------------------------------------
mov eax,offset CharinfoPacketProc1
mov dword ptr [@NewCodeBuff],eax ;РґИлМшЧЄµШЦ·
invoke WriteProcessMemory,hMainInst,CharinfoPacketAddr1 + 1,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
;------------------------------------------------------------------------
; їЄКј
;------------------------------------------------------------------------
ifdef __CHARINFO_PACKET_1__
;------------------------------------------------------------------------
; 1 РЮёДCharinfo·в°ьёсКЅ
;------------------------------------------------------------------------
mov eax,offset szCharinfoPacketFormat
mov dword ptr [@NewCodeBuff],eax
invoke WriteProcessMemory,hMainInst,CharinfoPacketFormatAddr1,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
;------------------------------------------------------------------------
; 1 РЮХэCharinfo¶СХ»esp
;------------------------------------------------------------------------
mov eax,CharinfoPacketEsp
mov dword ptr [@NewCodeBuff],eax
invoke WriteProcessMemory,hMainInst,CharinfoESPAddr1,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
endif
;------------------------------------------------------------------------
; ЅбКш
;------------------------------------------------------------------------
.else
invoke MessageBox,NULL,addr szErrCodeNotMatch,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
.else
invoke MessageBox,NULL,addr szErrReadProcMem,addr szErrCaption,\
MB_OK or MB_ICONSTOP
.endif
;------------------------------------------------------------------------
; 2 РЮХэїЄКј
;------------------------------------------------------------------------
invoke ReadProcessMemory,hMainInst,CharinfoPacketAddr2,addr @OldCodeBuff,\
sizeof dword,NULL
.if eax
mov eax,dword ptr @OldCodeBuff
.if eax == dword ptr dbCharinfoPacketCode2
;------------------------------------------------------------------------
; 2 РЮёДЧйЧ°Charinfo·в°ьґъВл
;------------------------------------------------------------------------
mov eax,offset CharinfoPacketProc2
mov dword ptr [@NewCodeBuff],eax ;РґИлМшЧЄµШЦ·
invoke WriteProcessMemory,hMainInst,CharinfoPacketAddr2 + 1,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
;------------------------------------------------------------------------
; їЄКј
;------------------------------------------------------------------------
ifdef __CHARINFO_PACKET_2__
;------------------------------------------------------------------------
; 2 РЮёДCharinfo·в°ьёсКЅ
;------------------------------------------------------------------------
mov eax,offset szCharinfoPacketFormat
mov dword ptr [@NewCodeBuff],eax
invoke WriteProcessMemory,hMainInst,CharinfoPacketFormatAddr2,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
;------------------------------------------------------------------------
; 2 РЮХэCharinfo¶СХ»esp
;------------------------------------------------------------------------
mov eax,CharinfoPacketEsp
mov dword ptr [@NewCodeBuff],eax
invoke WriteProcessMemory,hMainInst,CharinfoESPAddr2,\
addr @NewCodeBuff,sizeof dword,NULL
.if ! eax
invoke MessageBox,NULL,addr szErrWriteProcMem,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
endif
;------------------------------------------------------------------------
; ЅбКш
;------------------------------------------------------------------------
.else
invoke MessageBox,NULL,addr szErrCodeNotMatch,\
addr szErrCaption,MB_OK or MB_ICONSTOP
.endif
.else
invoke MessageBox,NULL,addr szErrReadProcMem,addr szErrCaption,\
MB_OK or MB_ICONSTOP
.endif
;*******************************************************************************
; І№¶ЎЅбКш
;*******************************************************************************
invoke CloseHandle,hMainInst
.endif
popad
ret
PatchAddrProc endp
;*******************************************************************************
; userinfo·в°ьґ¦АнєЇКэ
;*******************************************************************************
;БнТ»ЦЦІ№¶ЎО»ЦГКЗ·ЕФЪ 004FEA6E Ц®єуµД 004FEA74
;common patch addr 004FEA59
;004FEA59 . DD85 E8FEFFFF fld qword ptr ss:[ebp-118]
;004FEA5F . 8945 DC mov dword ptr ss:[ebp-24],eax
;004FEA62 . E8 45D90800 call L2Server.0058C3AC
;004FEA67 . 8B17 mov edx,dword ptr ds:[edi]
;004FEA69 . 8BCF mov ecx,edi ; USER32.TranslateAcceleratorW
;004FEA6B . 8945 C8 mov dword ptr ss:[ebp-38],eax
;004FEA6E . FF92 04030000 call dword ptr ds:[edx+304]
UserinfoJmpBackAddr equ 006B81D6h
UserinfoPacketProc proc
ifdef __USERINFO_PACKET__
push -1 ;charname color
push 0
push 0
push 0
push 0 ;0x01 fishing mode
;---------------begin-
push 0 ;УўРЫН·КО№в»·
;---------------end-
endif
;---------------begin-
push dword ptr ss:[ebp-58h] ;EnchantEffect
;---------------end-
push 7Fh ;CurrentCp
push 7Fh ;MaxCp
push 0 ;special effects? circles around player...
push dword ptr ss:[ebp-50h] ;ClassId
push 50h ;INVENTORY_MAXIMUM
push 0
push 0 ;c2 recommendations received
push 6 ;c2 recommendations remaining
push -1
push -1
push -1
push -1
push -1
push -1
push -1
push -1
push 0
push 0
;МшЧЄ»ШФ*ґ¦
push UserinfoJmpBackAddr
ret
UserinfoPacketProc endp
;*******************************************************************************
; 1 charinfo·в°ьґ¦АнєЇКэ
;*******************************************************************************
;004FF399
;CharinfoJmpBackAddr1 equ 006B8286h
CharinfoJmpBackAddr1 equ 004FF3A4h
CharinfoPacketProc1 proc
ifdef __CHARINFO_PACKET_1__
push 0
push -1 ;charname color
push 0
push 0
push 0
push 0 ;0x01 fishing mode
;---------------begin-
push 0 ;УўРЫН·КО№в»·
;---------------end-
push 0
push 0
endif
xor edx,edx
cmp byte ptr ds:[ebx+1BB8h],dl
setne dl
push edx
;---------------begin-
push dword ptr ss:[ebp-40]
;---------------end-
push 0
push 0
push 0
push 0
push 0
push 0
;МшЧЄ»ШФ*ґ¦
push CharinfoJmpBackAddr1
ret
CharinfoPacketProc1 endp
;*******************************************************************************
; 2 charinfo·в°ьґ¦АнєЇКэ
;*******************************************************************************
;004FF92D
;CharinfoJmpBackAddr2 equ 006B8266h
CharinfoJmpBackAddr2 equ 004FF93Eh
CharinfoPacketProc2 proc
ifdef __CHARINFO_PACKET_2__
push 0
push -1 ;charname color
push 0
push 0
push 0
push 0 ;0x01 fishing mode
;---------------begin-
push 0 ;УўРЫН·КО№в»·
;---------------end-
push 0
push 0
endif
xor edx,edx
cmp byte ptr ds:[ebx+1BB8h],dl
mov esi,dword ptr ds:[esi+19B8h]
setne dl
push edx
;---------------begin-
push dword ptr ss:[ebp-40]
;---------------end-
push 0
push 0
push 0
push 0
push 0
push 0
;МшЧЄ»ШФ*ґ¦
push CharinfoJmpBackAddr2
ret
CharinfoPacketProc2 endp
;*******************************************************************************
; Чй¶УРЮёґЦРЈ¬К№УГЅЗЙ«ГыИЎµГObjectID
;*******************************************************************************
FUNC_GET_OBJECTID_1 equ 517B90h
FUNC_GET_OBJECTID_2 equ 58C8B6h
FUNC_GET_OBJECTID_3 equ 406970h
FUNC_GET_OBJECTID_4 equ 41E4D0h
GetCharObjectByName proc uses ebx edi esi,_lpCharName
local @CharObject[12]:byte
local @szBuffer[148]:byte
lea eax,@szBuffer
push eax
push _lpCharName
mov eax,FUNC_GET_OBJECTID_1
call eax ;№№ЅЁІйСЇКэѕЭ°ь
add esp,08h
;ЅЁБўЅЗЙ«КэѕЭЅб№№
;ЧЬі¤¶И124h
;0000 00 00
;
;011C 00 00 00 00
;0120 00 00 00 8B
sub esp,124h ;їЄКјЅЁБўObjectКэѕЭЅб№№
mov esi,esp
xor ebx,ebx
mov dword ptr [esi + 0120h],8Bh
mov dword ptr [esi + 011Ch],ebx
mov word ptr ds:[esi + 4],bx
lea edx,@szBuffer
push edx
mov eax,FUNC_GET_OBJECTID_2
call eax ;strlen
add esp,4
push eax
lea eax,@szBuffer
push eax
mov ecx,esi
mov eax,FUNC_GET_OBJECTID_3
call eax ;УГКэѕЭМоідКэѕЭЅб№№
lea ecx,@CharObject
push ecx
mov ecx,16922550h
mov eax,FUNC_GET_OBJECTID_4
call eax ;ИЎµГЅЗЙ«ID
mov eax,dword ptr @CharObject
ret
GetCharObjectByName endp
;*******************************************************************************
; ФЪЅвГЬ·в°ьНкіЙґ¦ґъВ봦ґтІ№¶ЎЈ¬УГУЪМбЗ°ґ¦Ан·в°ь
;*******************************************************************************
RecvPacketProc proc uses ebx edi esi
local @szPacket[2048]:byte ;·в°ьЧЄ»»єуµГhex string
local @OpCode:dword ;ІЩЧчґъВл
local @isC4Packet:dword ;КЗ·с208Р*Тй
local @PacketSize:dword ;·в°ьі¤¶И
local @OpCodeLen:dword
;------------------------------------------------------------------------
; ИЎµГЧй¶У·в°ьЦРobjectid
;------------------------------------------------------------------------
local @lpstObject:dword
local @ObjectID:dword
pushad
;word ptr [ebp+10h]=·в°ьі¤¶И
;byte ptr [ebp+12h]=·в°ьР*Тй
;byte ptr [ebp+13h]=208·в°ьЧУР*Тй
;0x00-0xA8,C1-C2
;0xA9-0xCF,C3
;0xD0(byte),C4
C4OPCODE_208 equ 0D0h
OFFSET_LENGTH equ 10h
OFFSET_OPCODE equ 12h
mov ax,word ptr [ebx + OFFSET_LENGTH]
movzx eax,ax
mov @PacketSize,eax
mov al,byte ptr [ebx + OFFSET_OPCODE]
movzx eax,al
mov @OpCode,eax
.if @OpCode < C4OPCODE_208
mov @isC4Packet,0
mov @OpCodeLen,1
.else
mov @isC4Packet,1
mov @OpCodeLen,1 + 2 ;ЧУopcodeОЄ2ЧЦЅЪ
mov ax,word ptr [ebx + OFFSET_OPCODE + 1]
movzx eax,ax
shl @OpCode,10h ;16О»
add @OpCode,eax
.endif
mov ecx,@PacketSize
dec ecx
mov edx,ebx
add edx,OFFSET_OPCODE + 1
.if @isC4Packet != 0
sub ecx,2
add edx,2
.endif
invoke bin2hex,edx,ecx,addr @szPacket
mov eax,@OpCode
mov ecx,eax
shr ecx,10h
.if cx == 0
ifdef __DEBUG__
invoke wsprintf,addr szViewPacket,addr szPacketFormat,\
@PacketSize,@OpCodeLen,@OpCode,addr @szPacket
invoke _SendtoNotepad,addr szViewPacket
endif
;------------------------------------------------------------------------
; ИЎµГЧй¶У·в°ьЦРµГobjectid
;------------------------------------------------------------------------
.if @OpCode == 029h
mov ecx,ebx
add ecx,OFFSET_OPCODE + 1
invoke GetCharObjectByName,ecx
mov @lpstObject,eax
mov eax,dword ptr [eax + 18h]
mov @ObjectID,eax
ifdef __DEBUG__
.const
dbgRequestPartyMsg db 'RequestParty Packet Received, the character id is %X',0Dh,0Ah,0
.code
invoke wsprintf,addr szViewPacket,addr dbgRequestPartyMsg,@ObjectID
invoke _SendtoNotepad,addr szViewPacket
endif
mov eax,@ObjectID
mov [ebx + OFFSET_OPCODE + 1],eax
mov dword ptr [ebx + OFFSET_OPCODE + 1 + sizeof dword],0
mov word ptr [ebx + OFFSET_OPCODE + 1 + sizeof dword + sizeof dword],599h
mov word ptr [ebx + OFFSET_LENGTH],0Bh
.endif
;------------------------------------------------------------------------
; ИЎµГЧй¶У·в°ьЦРµГobjectid ЅбКш
;------------------------------------------------------------------------
.else
ifdef __DEBUG__
mov cx,ax
movzx ecx,cx
shr eax,10h
mov dx,ax
movzx edx,dx
invoke wsprintf,addr szViewPacket,addr szC4PacketFormat,\
@PacketSize,@OpCodeLen,edx,ecx,addr @szPacket
invoke _SendtoNotepad,addr szViewPacket
endif
.endif
popad
ret
RecvPacketProc endp
;*******************************************************************************
; јаКУґ°їЪґґЅЁ№эіМ
;*******************************************************************************
;--------------------------------------------------------------------
; ґ°їЪ№эіМєЇКэ
;--------------------------------------------------------------------
ProcViewWinMain proc uses ebx esi edi,hWnd,uMsg,wParam,lParam
local @stPs:PAINTSTRUCT
local @stRect:RECT
local @hDc:dword
mov eax,uMsg
.if eax == WM_PAINT
invoke BeginPaint,hWnd,addr @stPs
mov @hDc,eax
invoke EndPaint,hWnd,addr @stPs
.elseif eax == WM_CLOSE
invoke DestroyWindow,hViewWinMain
invoke PostQuitMessage,NULL
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
ProcViewWinMain endp
;--------------------------------------------------------------------
; ґ°їЪґґЅЁєЇКэ
;--------------------------------------------------------------------
ViewWinMain proc
local @stWndClass:WNDCLASSEX
local @stMsg:MSG
invoke GetModuleHandle,NULL
mov hMainInst,eax
invoke RtlZeroMemory,addr @stWndClass,sizeof @stWndClass
invoke LoadCursor,0,IDC_ARROW
mov @stWndClass.hCursor,eax
push hMainInst
pop @stWndClass.hInstance
mov @stWndClass.cbSize,sizeof @stWndClass
mov @stWndClass.style,CS_HREDRAW or CS_VREDRAW
mov @stWndClass.lpfnWndProc,offset ProcViewWinMain
mov @stWndClass.hbrBackground,COLOR_WINDOW + 1
mov @stWndClass.lpszClassName,offset szViewPacketWinClass
invoke RegisterClassEx,addr @stWndClass
invoke CreateWindowEx,WS_EX_CLIENTEDGE,\
offset szViewPacketWinClass,\
offset szViewPacketWinCaptin,\
WS_OVERLAPPEDWINDOW,\
100,100,600,400,\
NULL,NULL,hMainInst,NULL
mov hViewWinMain,eax
;invoke ShowWindow,hViewWinMain,SW_SHOWNORMAL
;invoke UpdateWindow,hViewWinMain
.while TRUE
invoke GetMessage,addr @stMsg,NULL,0,0
.break .if eax == 0
invoke TranslateMessage,addr @stMsg
invoke DispatchMessage,addr @stMsg
.endw
ret
ViewWinMain endp
;--------------------------------------------------------------------
; ґ°їЪЦчПЯіМєЇКэ
;--------------------------------------------------------------------
CreateWindowProc proc uses ebx edi esi
local @ViewWinTID:dword
pushad
;invoke MessageBox,NULL,addr szInfoOK,addr szInfoCaption,MB_OK
invoke CreateThread,NULL,0,offset ViewWinMain,NULL,NULL,\
addr @ViewWinTID
invoke CloseHandle,eax
popad
ret
CreateWindowProc endp
;*******************************************************************************
; DLLИлїЪ
;*******************************************************************************
DLLMain proc _hInstance,_dwReason,_dwReserved
;mov eax,TRUE
;ret
mov eax,_dwReason
.if eax == DLL_PROCESS_ATTACH
mov eax,_hInstance
mov hInstance,eax
invoke PatchAddrProc
mov eax,TRUE
.elseif eax == DLL_THREAD_ATTACH
mov eax,TRUE
.elseif eax == DLL_THREAD_DETACH
mov eax,TRUE
.elseif eax == DLL_PROCESS_DETACH
mov eax,TRUE
.endif
ret
DLLMain endp
end DLLMain
when i post it i brok my promises to one guy, hm i hope he will do something with me later^^
|