Sign in to follow this  
Followers 0
cekot

help me

3 posts in this topic

#1 ·  Posted (edited)

I asked for help for you all to change this program language to autoit because I did not know with the ASM language thank you

;**********************************************************************************************

******************************************

;by [513] :: there might be lots of junk code.

;looks like a mess. anyway if you want further

;explanations just tel me.

;and also you shuld remember that this is just an idea to develop

;a pc executable of mig33.

;

;

;coding part from line 592 upto 611 were modified and or discovered by Yogo

;***************************************************************************************************

*************************************

.486

.model flat,stdcall

option casemap:none

; include files

include c:\masm32\include\dialogs.inc

include c:\masm32\include\windows.inc

include c:\masm32\include\user32.inc

include c:\masm32\include\kernel32.inc

include c:\masm32\include\wsock32.inc

; libraries

includelib c:\masm32\lib\user32.lib

includelib c:\masm32\lib\kernel32.lib

includelib c:\masm32\lib\wsock32.lib

DlgProc PROTO:DWORD,:DWORD,:DWORD,:DWORD

WinSockProc PROTO:DWORD,:DWORD,:DWORD

CreatLoginPacket PROTO:DWORD

CreatLoginResPacket PROTO:DWORD

GetHashCode PROTO:DWORD

CreatKikPacket PROTO:DWORD,:DWORD

ChatRoomJoinPacket PROTO:DWORD

OnConnect PROTO:DWORD,:DWORD

OnRecieve PROTO:DWORD,:DWORD

LeaveRoomJoinPacket PROTO:DWORD

AutoInc PROTO:DWORD

.data

DlgName db "MigDialog",0

hostname db "gateway.mig33.com",0

;***************************************************************************************************

*************************************

; SETUP

;***************************************************************************************************

*************************************

inifilename db "tub-.ini",0

khead db "tub- modified",0

unamafini db "id01",0

pfini db "pwd",0

chatroom db "room",0

kickUname db "kick",0

Port dd 9119

backslash db "\",0

szNull db 0

sucLogin db "Success",0

socketerror db "NOcnt..",0

wsadata WSADATA <>

sin sockaddr_in <>

OneMinPacket db 0002h,0000h,0002h,0000h,000Fh,0000h,0000h,0000h,0000h

LeaveRommS db 0002h,0002h,00C0h,0000h,0022h,0000h,0000h,0000h,000Fh,0000h,0001h,0000h,0000h,0000h,0009h

JoinRommS db 0002h,0002h,00BFh,0000h,0009h,0000h,0000h,0000h,0013h,0000h,0001h,0000h,0000h,0000h,000Dh

KikS db 0002h,0002h,00C2h,0000h,000Dh,0000h,0000h,0000h,0020h,0000h,0002h,0000h,0000h,0000h,0007h

KikE db 0000h,0001h,0000h,0000h,0000h,000Dh

printtemplate db "%x",0

loginResS db 0002h,0000h,00CAh,0000h,0002h,0000h,0000h,0000h,000Ah,0000h,0001h,0000h,0000h,0000h,0004h

loginS db 0002h,0000h,00C8h,0000h,0002h,0000h,0000h,0000h,0048h,0000h,0009h,0000h,0000h,0000h,0004h,0000h

db 0000h,0000h,0001h,0000h,0008h,0000h,0000h,0000h,0004h,006Ah,0032h,006Dh,0065h,0000h,0007h,0000h

db 0000h,0000h,0009h,004Ah,0032h,004Dh,0045h,0076h,0032h,002Eh,0030h,0034h,0000h,0005h,0000h,0000h

db 0000h,0008h

LoginE db 0000h,0003h,0000h,0000h,0000h,0002h,0000h,00CCh,0000h,0002h,0000h,0000h,0000h,0001h,0001h,0000h

db 0001h,0000h,0000h,0000h,0002h,0000h,0001h

.data?

id01 db 21 dup (?)

pwd db 256 dup (?)

hInstance HINSTANCE ?

;hFileWrite HANDLE ?

;SizeWritten DWORD ?

sock dd ?

Usize dd ?

temp dd ?

Ksize dd ?

Csize dd ?

JCRsize dd ?

LCRsize dd ?

HIhsize dd ?

rcsize dd ?

hwwnd dd ?

loginResPfinal dw 512 dup(?)

DLGtext db 81 dup(?)

stringTagBuff db 3072 dup(?)

LoginPBuffer db 3072 dup(?)

loginSr db 3072 dup(?)

LoginResGetHash db 3072 dup(?)

KikPBuffer db 3072 dup(?)

JRPBuffer db 3072 dup(?)

;RLBuffer db 3072 dup(?)

;RLGETBuffer db 3072 dup(?)

;RoomLBuffer db 3072 dup(?)

;Temp db 3072 dup(?)

printBuffer db 3072 dup(?)

storeBuffer db 3072 dup(?)

;tempFileBuffer db 3072 dup(?)

LRPBuffer db 3072 dup(?)

KUname db 3072 dup(?)

KCname db 3072 dup(?)

tempText db 3072 dup(?)

CurrentDir db 3072 dup(?)

;kcheck db 3072 dup(?)

check db 3072 dup(?)

IncriMent db 3072 dup(?)

.const

TEXT_MAIN equ 1000

TEXT_ID equ 1002

IDC_JOINCHAT equ 3001

IDC_KIKUSER equ 3002

IDC_TEMP equ 3003

IDC_LEAVEROOM equ 3004

IDC_LOGIN equ 3005

ID_TIMER equ 400

WM_SOCKET equ WM_USER+100h

.code

start:

mov IncriMent,0

mov check,0

invoke WSAStartup, 1,addr wsadata

.if eax!=NULL

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror

.endif

invoke GetModuleHandle, NULL

mov hInstance,eax

invoke DialogBoxParam, hInstance, ADDR DlgName,NULL,addr DlgProc,NULL

invoke ExitProcess,eax

DlgProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM

.IF uMsg==WM_INITDIALOG

mov edx,hWnd

mov hwwnd,edx

invoke GetCurrentDirectory,sizeof CurrentDir,addr CurrentDir

invoke lstrcat, addr CurrentDir,addr backslash

invoke lstrcat, addr CurrentDir,addr inifilename

invoke SetTimer,hWnd,ID_TIMER,60000,0

invoke GetPrivateProfileString,addr khead,addr unamafini,addr szNull,addr id01,sizeof id01,addr CurrentDir

invoke GetPrivateProfileString,addr khead,addr pfini,addr szNull,addr pwd,sizeof pwd,addr CurrentDir

invoke WinSockProc,addr hostname,Port,hWnd

invoke SetDlgItemText,hwwnd,TEXT_ID,addr id01

.ELSEIF uMsg==WM_CLOSE

invoke EndDialog, hWnd,NULL

.ELSEIF uMsg == WM_TIMER

invoke AutoInc,addr OneMinPacket

invoke send, sock, addr OneMinPacket, 09h, 0

.ELSEIF uMsg==WM_SOCKET

mov eax,lParam

.if ax==FD_CONNECT

shr eax,16

.if ax==NULL

invoke OnConnect,hWnd,sock

.else

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror

.endif

.elseif ax==FD_READ

shr eax,16

.if ax==NULL

invoke OnRecieve,hWnd,sock

.else

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror

.endif

.elseif ax==FD_CLOSE

shr eax,16

.if ax==NULL

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror

.else

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror

.endif

.endif

.ELSEIF uMsg==WM_COMMAND

mov eax,wParam

.IF lParam==0

.ELSE

mov edx,wParam

shr edx,16

.if dx==BN_CLICKED

.IF ax==IDC_JOINCHAT

invoke GetPrivateProfileString,addr khead,addr chatroom,addr szNull,addr KCname,sizeof KCname,addr CurrentDir

invoke ChatRoomJoinPacket,addr KCname

.ELSEIF ax==IDC_KIKUSER

invoke GetPrivateProfileString,addr khead,addr chatroom,addr szNull,addr KCname,sizeof KCname,addr CurrentDir

invoke GetPrivateProfileString,addr khead,addr kickUname,addr szNull,addr KUname,sizeof KUname,addr CurrentDir

invoke CreatKikPacket,addr KUname,addr KCname

.ELSEIF ax==IDC_LEAVEROOM

invoke GetPrivateProfileString,addr khead,addr chatroom,addr szNull,addr KCname,sizeof KCname,addr CurrentDir

invoke LeaveRoomJoinPacket,addr KCname

invoke AutoInc,addr LRPBuffer

invoke send, sock, addr LRPBuffer, LCRsize, 0

.ENDIF

.ENDIF

.ENDIF

.ELSE

mov eax,FALSE

ret

.ENDIF

mov eax,TRUE

ret

DlgProc endp

;***************************************************************************************************

*************************************

; WINSOCK PROC

;***************************************************************************************************

*************************************

WinSockProc proc ipaddress:DWORD, portaddress:DWORD, WhWnd:DWORD

invoke socket,PF_INET,SOCK_STREAM,0

.if eax!=INVALID_SOCKET

mov sock,eax

invoke WSAAsyncSelect, sock, WhWnd,WM_SOCKET, FD_CONNECT+FD_READ+FD_CLOSE

.if eax==SOCKET_ERROR

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror

.else

.endif

.else

invoke WSAGetLastError

.endif

mov sin.sin_family, AF_INET

invoke htons, portaddress

mov sin.sin_port,ax

invoke gethostbyname, addr hostname

mov eax,[eax+12]

mov eax,[eax]

mov eax,[eax]

mov sin.sin_addr,eax

invoke connect,sock,addr sin,sizeof sin

.if eax==SOCKET_ERROR

invoke WSAGetLastError

.if eax!=WSAEWOULDBLOCK

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror

.endif

.endif

ret

WinSockProc endp

;***************************************************************************************************

*************************************

; LOGIN PACKET GENERAL PROC

;***************************************************************************************************

*************************************

CreatLoginPacket proc Uname:DWORD

mov Usize,0

cld

mov esi, offset loginS

mov edi, offset LoginPBuffer

mov ecx, 32h

rep movsb

xor eax,eax

invoke lstrlen,Uname

mov Usize,eax

mov [LoginPBuffer+31h],al

xor eax,eax

mov eax,Usize

add eax,29h

add eax,17h

mov [LoginPBuffer+08h],al

mov esi,Uname

mov edi, offset LoginPBuffer+32h

mov ecx,Usize

rep movsb

xor eax,eax

mov eax,Usize

add eax,32h

mov esi, offset LoginE

mov edi, offset LoginPBuffer

xor eax,eax

mov eax,Usize

add eax,32h

add edi,eax

mov ecx,17h

rep movsb

add Usize,32h

add Usize,17h

ret

CreatLoginPacket endp

;***************************************************************************************************

*************************************

; LOGIN RESPOND PACKET GENERAL PROC

;***************************************************************************************************

*************************************

CreatLoginResPacket proc pname:DWORD

cld

xor eax,eax

mov al,[loginSr+1ch]

mov Usize,eax

mov esi, offset loginSr+1dh

mov edi, offset LoginResGetHash

xor ecx,ecx

mov ecx,Usize

rep movsb

mov esi, pname

mov edi, offset LoginResGetHash

add edi, Usize

xor ecx,ecx

invoke lstrlen, pname

add Usize,eax

mov ecx, eax

rep movsb

invoke GetHashCode, addr LoginResGetHash

.if temp != NULL

mov esi,offset loginResS

mov edi,offset loginResPfinal

mov ecx,0fh

rep movsb

mov edx,0fh

mov ebx,temp+2

invoke htons ,ebx

mov [loginResPfinal+dx],ax

add edx,2

mov ebx,temp

invoke htons ,ebx

mov [loginResPfinal+dx],ax

.endif

ret

CreatLoginResPacket endp

;***************************************************************************************************

*************************************

; HASHCODE GENERATING PROC

;***************************************************************************************************

*************************************

GetHashCode proc hCodeFrmS:DWORD

invoke RtlZeroMemory, addr printBuffer, 100

mov temp,0

mov esi, hCodeFrmS

mov edi, offset storeBuffer

continue:

mov ecx, 1

rep movsb

mov al,[esi-1]

mov eax,temp

mov edx,31

mul edx

mov temp,eax

xor eax,eax

mov al,[esi-1]

add eax,temp

mov temp,eax

push eax

push offset printtemplate

push offset printBuffer

call wsprintfA

add esp,12

mov al,[esi]

cmp al,0

jne continue

ret

GetHashCode endp

;***************************************************************************************************

*************************************

; KICK PROC

;***************************************************************************************************

*************************************

CreatKikPacket proc kUname:DWORD,kCroom:DWORD

cld

mov esi, offset KikS

mov edi, offset KikPBuffer

mov ecx, 0fh

rep movsb

xor eax,eax

invoke lstrlen,kUname

mov Ksize,eax

mov [KikPBuffer+0eh],al

mov esi, kUname

mov edi,offset KikPBuffer+0fh

mov ecx,Ksize

rep movsb

mov esi,offset KikE

mov edi,offset KikPBuffer

xor eax,eax

mov eax,Ksize

add eax,0fh

mov Ksize,eax

add edi,eax

mov ecx,06h

rep movsb

add Ksize,06h

xor eax,eax

invoke lstrlen,kCroom

mov Csize,eax

mov edx,Ksize

mov edi,offset KikPBuffer

add edi,edx

mov [edi-1],al

mov esi, kCroom

mov edi, offset KikPBuffer

add edi,Ksize

mov ecx,Csize

rep movsb

xor eax,eax

mov eax,Ksize

add eax,Csize

sub eax,09h

mov edi, offset KikPBuffer

add edi,09h

mov [edi-1],al

xor eax,eax

mov eax,Ksize

add eax,Csize

mov Csize,eax

invoke send, sock, addr KikPBuffer,Csize,0

ret

CreatKikPacket endp

;***************************************************************************************************

*************************************

; CHATROOM JOIN PROC

;***************************************************************************************************

*************************************

ChatRoomJoinPacket proc JCroom:DWORD

invoke RtlZeroMemory, addr JRPBuffer, 512

cld

mov esi, offset JoinRommS

mov edi, offset JRPBuffer

mov ecx, 0fh

rep movsb

xor eax,eax

invoke lstrlen, JCroom

mov JCRsize,eax

mov edi, offset JRPBuffer+0eh

mov [edi],al

mov esi, JCroom

mov edi, offset JRPBuffer+0fh

mov ecx,JCRsize

rep movsb

mov edi, offset JRPBuffer+08h

xor eax,eax

mov eax,JCRsize

add eax,06h

mov [edi],al

xor eax,eax

mov eax,0fh

add JCRsize,eax

invoke AutoInc,addr JRPBuffer

invoke send, sock, addr JRPBuffer, JCRsize, 0

ret

ChatRoomJoinPacket endp

;***************************************************************************************************

*************************************

; RECEIVE PROC (THIS WILL CHECK THE FLAGES)

;***************************************************************************************************

*************************************

OnConnect proc hwdl:DWORD, ssock:DWORD

.if check==0

invoke CreatLoginPacket, addr id01

invoke AutoInc,addr LoginPBuffer

invoke send, ssock, addr LoginPBuffer, Usize, 0

.endif

ret

OnConnect endp

;***************************************************************************************************

*************************************

; RECEIVE PROC

;***************************************************************************************************

*************************************

OnRecieve proc hwdl:DWORD, ssock:DWORD

.if check==0

mov check,1

invoke recv,ssock,addr loginSr,100,0

invoke CreatLoginResPacket,addr pwd

invoke AutoInc,addr loginResPfinal

invoke send, ssock, addr loginResPfinal, 13h, 0

mov check,2

.elseif check==2

invoke ioctlsocket,ssock,FIONREAD ,addr rcsize

.if eax==0

invoke recv,ssock,addr loginSr,rcsize,0

mov esi,offset loginSr+02h

xor eax,eax

mov al,BYTE PTR [esi]

.if al==00cbh

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr sucLogin

.else

mov esi,offset loginSr

mov edi,offset tempText

xor ecx,ecx

mov cl,BYTE PTR [esi+0eh]

add esi,0fh

rep movsb

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr tempText

.endif

.endif

mov check,4

.else

invoke RtlZeroMemory, addr loginSr, 512

invoke RtlZeroMemory, addr stringTagBuff, 512

invoke ioctlsocket,ssock,FIONREAD ,addr rcsize

.if eax==0

;***************************************************************************************************

**********

; THIS PART WAS DISCOVERED BY YOGO, THE PURPOSE IS TO MAKE THE LIST NAME IN THE ROOM SHOWN AGAIN

; THX TO HIM

;***************************************************************************************************

**********

invoke recv,ssock,addr loginSr,rcsize,0

mov esi,offset loginSr

mov edi,offset stringTagBuff

invoke GetPrivateProfileString,addr khead,addr chatroom,addr szNull,addr KCname,sizeof KCname,addr CurrentDir

xor eax,eax

invoke lstrlen,addr KCname

add eax,eax

add eax,1bh

add esi,eax

xor eax,eax

mov ax,[esi-2]

invoke htons ,eax

mov ecx,eax

rep movsb

invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr stringTagBuff

;***************************************************************************************************

**********

; END OF YOGO CODING PART

;***************************************************************************************************

**********

.endif

ret

.endif

ret

OnRecieve endp

;***************************************************************************************************

*************************************

; LEAVECHATROOM PROC

;***************************************************************************************************

*************************************

LeaveRoomJoinPacket proc JCroom:DWORD

cld

mov esi,offset LeaveRommS

mov edi,offset LRPBuffer

mov ecx,0fh

rep movsb

invoke lstrlen,JCroom

mov LCRsize,eax

mov edi,offset LRPBuffer

mov [edi+0eh],al

mov esi,JCroom

mov edi,offset LRPBuffer

add edi,0fh

mov ecx,LCRsize

rep movsb

mov edi, offset LRPBuffer

add edi,08h

xor eax,eax

mov eax,LCRsize

add eax,06h

mov LCRsize,eax

mov [edi],al

mov eax,LCRsize

add eax,09h

mov LCRsize,eax

ret

LeaveRoomJoinPacket endp

;***************************************************************************************************

*************************************

; AUTO INCREMENT

;***************************************************************************************************

*************************************

AutoInc proc JCroom:DWORD

mov edi, JCroom

mov al,IncriMent

mov [edi+4],al

inc al

mov IncriMent,al

ret

AutoInc endp

end start

Edited by cekot

Share this post


Link to post
Share on other sites



I asked for help for you all to change this program language to autoit because I did not know with the ASM language thank you

[left][/left];**********************************************************************************************
******************************************
;by [513] :: there might be lots of junk code.
;looks like a mess. anyway if you want further 
;explanations just tel me.
;and also you shuld remember that this is just an idea to develop
;a pc executable of mig33.
;
;
;coding part from line 592 upto 611 were modified and or discovered by Yogo
;***************************************************************************************************


*************************************

.486
.model flat,stdcall
option casemap:none

; include files

include c:\masm32\include\dialogs.inc
include c:\masm32\include\windows.inc
include c:\masm32\include\user32.inc
include c:\masm32\include\kernel32.inc
include c:\masm32\include\wsock32.inc

; libraries

includelib c:\masm32\lib\user32.lib
includelib c:\masm32\lib\kernel32.lib
includelib c:\masm32\lib\wsock32.lib

DlgProc         PROTO:DWORD,:DWORD,:DWORD,:DWORD
WinSockProc     PROTO:DWORD,:DWORD,:DWORD
CreatLoginPacket    PROTO:DWORD
CreatLoginResPacket PROTO:DWORD
GetHashCode     PROTO:DWORD
CreatKikPacket      PROTO:DWORD,:DWORD
ChatRoomJoinPacket  PROTO:DWORD
OnConnect       PROTO:DWORD,:DWORD
OnRecieve       PROTO:DWORD,:DWORD
LeaveRoomJoinPacket PROTO:DWORD
AutoInc         PROTO:DWORD

.data
DlgName         db "MigDialog",0
hostname        db "gateway.mig33.com",0
;***************************************************************************************************


*************************************
; SETUP
;***************************************************************************************************


*************************************

inifilename     db "tub-.ini",0
khead           db "tub- modified",0
unamafini       db "id01",0
pfini           db "pwd",0
chatroom        db "room",0
kickUname       db "kick",0
Port            dd 9119
backslash       db "\",0
szNull          db 0
sucLogin        db "Success",0
socketerror     db "NOcnt..",0
wsadata         WSADATA <>
sin                 sockaddr_in <>

OneMinPacket        db   0002h,0000h,0002h,0000h,000Fh,0000h,0000h,0000h,0000h
LeaveRommS      db   0002h,0002h,00C0h,0000h,0022h,0000h,0000h,0000h,000Fh,0000h,0001h,0000h,0000h,0000h,0009h
JoinRommS       db   0002h,0002h,00BFh,0000h,0009h,0000h,0000h,0000h,0013h,0000h,0001h,0000h,0000h,0000h,000Dh
KikS            db   0002h,0002h,00C2h,0000h,000Dh,0000h,0000h,0000h,0020h,0000h,0002h,0000h,0000h,0000h,0007h
KikE            db   0000h,0001h,0000h,0000h,0000h,000Dh
printtemplate       db   "%x",0
loginResS         db   0002h,0000h,00CAh,0000h,0002h,0000h,0000h,0000h,000Ah,0000h,0001h,0000h,0000h,0000h,0004h
loginS          db   0002h,0000h,00C8h,0000h,0002h,0000h,0000h,0000h,0048h,0000h,0009h,0000h,0000h,0000h,0004h,0000h
            db   0000h,0000h,0001h,0000h,0008h,0000h,0000h,0000h,0004h,006Ah,0032h,006Dh,0065h,0000h,0007h,0000h
            db   0000h,0000h,0009h,004Ah,0032h,004Dh,0045h,0076h,0032h,002Eh,0030h,0034h,0000h,0005h,0000h,0000h
            db   0000h,0008h
LoginE          db   0000h,0003h,0000h,0000h,0000h,0002h,0000h,00CCh,0000h,0002h,0000h,0000h,0000h,0001h,0001h,0000h
            db   0001h,0000h,0000h,0000h,0002h,0000h,0001h

.data?
id01            db 21 dup (?)
pwd         db 256 dup (?)
hInstance       HINSTANCE ?
;hFileWrite         HANDLE ?
;SizeWritten        DWORD ?
sock            dd ?
Usize           dd ?
temp            dd ?
Ksize           dd ?
Csize           dd ?
JCRsize         dd ?
LCRsize         dd ?
HIhsize         dd ?
rcsize          dd ?
hwwnd           dd ? 
loginResPfinal      dw 512 dup(?)
DLGtext         db 81 dup(?)
stringTagBuff       db 3072 dup(?)
LoginPBuffer        db 3072 dup(?)
loginSr         db 3072 dup(?)
LoginResGetHash     db 3072 dup(?)
KikPBuffer      db 3072 dup(?)  
JRPBuffer       db 3072 dup(?)
;RLBuffer       db 3072 dup(?)
;RLGETBuffer        db 3072 dup(?)
;RoomLBuffer        db 3072 dup(?)
;Temp           db 3072 dup(?)
printBuffer     db 3072 dup(?)
storeBuffer     db 3072 dup(?)
;tempFileBuffer     db 3072 dup(?)
LRPBuffer       db 3072 dup(?)
KUname          db 3072 dup(?)
KCname          db 3072 dup(?)
tempText        db 3072 dup(?)
CurrentDir      db 3072 dup(?)
;kcheck         db 3072 dup(?)
check           db 3072 dup(?)
IncriMent       db 3072 dup(?)

.const
TEXT_MAIN       equ 1000
TEXT_ID         equ 1002
IDC_JOINCHAT          equ 3001
IDC_KIKUSER         equ 3002
IDC_TEMP            equ 3003
IDC_LEAVEROOM       equ 3004
IDC_LOGIN       equ 3005
ID_TIMER        equ 400
WM_SOCKET       equ WM_USER+100h


.code
start:
    mov IncriMent,0
    mov check,0
    invoke WSAStartup, 1,addr wsadata
    .if eax!=NULL
        invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror
    .endif

    invoke GetModuleHandle, NULL
    mov hInstance,eax
    invoke DialogBoxParam, hInstance, ADDR DlgName,NULL,addr DlgProc,NULL
    invoke ExitProcess,eax

DlgProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
    .IF uMsg==WM_INITDIALOG
        mov edx,hWnd
        mov hwwnd,edx
        invoke GetCurrentDirectory,sizeof CurrentDir,addr CurrentDir
        invoke lstrcat, addr CurrentDir,addr backslash
        invoke lstrcat, addr CurrentDir,addr inifilename    
        invoke SetTimer,hWnd,ID_TIMER,60000,0
                                
        invoke GetPrivateProfileString,addr khead,addr unamafini,addr szNull,addr id01,sizeof id01,addr CurrentDir
        invoke GetPrivateProfileString,addr khead,addr pfini,addr szNull,addr pwd,sizeof pwd,addr CurrentDir
        invoke WinSockProc,addr hostname,Port,hWnd
        invoke SetDlgItemText,hwwnd,TEXT_ID,addr id01
                                
    .ELSEIF uMsg==WM_CLOSE
        invoke EndDialog, hWnd,NULL
        
    .ELSEIF uMsg == WM_TIMER
        invoke AutoInc,addr OneMinPacket
        invoke send, sock, addr OneMinPacket, 09h, 0
    
    .ELSEIF uMsg==WM_SOCKET 
        mov eax,lParam
        .if ax==FD_CONNECT         
            shr eax,16                           
            .if ax==NULL
                invoke OnConnect,hWnd,sock
            .else
                invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror
            .endif                                  
            .elseif ax==FD_READ
                shr eax,16
                .if ax==NULL
                    invoke OnRecieve,hWnd,sock
                .else
                    invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror
                .endif
            .elseif ax==FD_CLOSE
                shr eax,16
                .if ax==NULL
                    invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror
                .else
                    invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror
                .endif
        .endif      
        
    .ELSEIF uMsg==WM_COMMAND
        mov eax,wParam
        .IF lParam==0

        .ELSE
            mov edx,wParam
            shr edx,16
            .if dx==BN_CLICKED
                .IF ax==IDC_JOINCHAT
                    invoke GetPrivateProfileString,addr khead,addr chatroom,addr szNull,addr KCname,sizeof KCname,addr CurrentDir
                    invoke ChatRoomJoinPacket,addr KCname
                        
                .ELSEIF ax==IDC_KIKUSER
                    invoke GetPrivateProfileString,addr khead,addr chatroom,addr szNull,addr KCname,sizeof KCname,addr CurrentDir
                    invoke GetPrivateProfileString,addr khead,addr kickUname,addr szNull,addr KUname,sizeof KUname,addr CurrentDir          
                    invoke CreatKikPacket,addr KUname,addr KCname
                        
                .ELSEIF ax==IDC_LEAVEROOM
                    invoke GetPrivateProfileString,addr khead,addr chatroom,addr szNull,addr KCname,sizeof KCname,addr CurrentDir
                    invoke LeaveRoomJoinPacket,addr KCname
                    invoke AutoInc,addr LRPBuffer
                    invoke send, sock, addr LRPBuffer, LCRsize, 0

                .ENDIF
            .ENDIF
        .ENDIF
    .ELSE
        mov eax,FALSE
        ret
    .ENDIF
    mov eax,TRUE
    ret
DlgProc endp

;***************************************************************************************************


*************************************
; WINSOCK PROC
;***************************************************************************************************


*************************************

WinSockProc proc ipaddress:DWORD, portaddress:DWORD, WhWnd:DWORD
    invoke socket,PF_INET,SOCK_STREAM,0
        .if eax!=INVALID_SOCKET
            mov sock,eax
            invoke WSAAsyncSelect, sock, WhWnd,WM_SOCKET, FD_CONNECT+FD_READ+FD_CLOSE
        
            .if eax==SOCKET_ERROR
                invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror
            .else
            .endif
        .else
            invoke WSAGetLastError
        .endif

        mov sin.sin_family, AF_INET
        invoke htons, portaddress                  
        mov sin.sin_port,ax              
        invoke gethostbyname, addr hostname
        mov eax,[eax+12]
        mov eax,[eax]
        mov eax,[eax]
        mov sin.sin_addr,eax
        
        invoke connect,sock,addr sin,sizeof sin

        .if eax==SOCKET_ERROR     
            invoke WSAGetLastError         
            .if eax!=WSAEWOULDBLOCK    
                invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr socketerror     
            .endif
        .endif
        
    ret
WinSockProc endp

;***************************************************************************************************


*************************************
; LOGIN PACKET GENERAL PROC
;***************************************************************************************************


*************************************

CreatLoginPacket proc Uname:DWORD

    mov Usize,0
    cld             

    mov esi, offset loginS      
    mov edi, offset LoginPBuffer        
    mov ecx, 32h        
    rep movsb           

    xor eax,eax
    invoke lstrlen,Uname
    mov     Usize,eax
    mov     [LoginPBuffer+31h],al

    xor eax,eax
    mov eax,Usize
    add eax,29h
    add eax,17h
    mov     [LoginPBuffer+08h],al
    
    mov esi,Uname
    mov edi, offset LoginPBuffer+32h
    mov ecx,Usize
    rep movsb
    
    xor eax,eax
    mov eax,Usize
    add eax,32h 
    mov esi, offset LoginE
    mov edi, offset LoginPBuffer
    
    xor eax,eax
    mov eax,Usize
    add eax,32h
    add edi,eax

    mov ecx,17h
    rep movsb


    add Usize,32h
    add Usize,17h

ret
CreatLoginPacket endp

;***************************************************************************************************


*************************************
; LOGIN RESPOND PACKET GENERAL PROC
;***************************************************************************************************


*************************************

CreatLoginResPacket proc pname:DWORD


    cld             

    xor eax,eax
    mov al,[loginSr+1ch]
    mov Usize,eax
    
    
    mov esi, offset loginSr+1dh     
    mov edi, offset LoginResGetHash
    xor     ecx,ecx     
    mov ecx,Usize       
    rep movsb

    mov esi, pname      
    mov edi, offset LoginResGetHash
    add     edi, Usize
    xor     ecx,ecx
    invoke lstrlen, pname
    add     Usize,eax
    
    mov ecx, eax        
    rep movsb

    invoke GetHashCode, addr LoginResGetHash

    .if temp != NULL
        mov esi,offset loginResS
        mov edi,offset loginResPfinal
        mov ecx,0fh
        rep movsb
            
        mov edx,0fh
        mov ebx,temp+2
        invoke htons ,ebx
        mov [loginResPfinal+dx],ax
        add edx,2
        mov ebx,temp
        invoke htons ,ebx
        mov [loginResPfinal+dx],ax
    .endif

ret
CreatLoginResPacket endp

;***************************************************************************************************


*************************************
; HASHCODE GENERATING PROC
;***************************************************************************************************


*************************************

GetHashCode proc hCodeFrmS:DWORD
    
    invoke RtlZeroMemory, addr printBuffer, 100 
    mov temp,0
    mov esi, hCodeFrmS
    mov edi, offset storeBuffer

continue:
    mov ecx, 1
    rep movsb

    mov al,[esi-1]

    mov eax,temp
    mov edx,31
    mul edx
    
    mov temp,eax
    xor eax,eax
    mov al,[esi-1]
    add eax,temp
    mov temp,eax

    push eax
    push offset printtemplate
    push offset printBuffer
    call wsprintfA
    add esp,12
    
    mov al,[esi]
    cmp al,0
    jne continue

    ret
GetHashCode endp

;***************************************************************************************************


*************************************
; KICK PROC
;***************************************************************************************************


*************************************

CreatKikPacket proc kUname:DWORD,kCroom:DWORD
    cld             


    mov esi, offset KikS        
    mov edi, offset KikPBuffer      
    mov ecx, 0fh        
    rep movsb           

    xor eax,eax
    invoke lstrlen,kUname
    mov     Ksize,eax
    mov     [KikPBuffer+0eh],al
    
    mov esi, kUname
    mov edi,offset KikPBuffer+0fh
    mov ecx,Ksize
    rep movsb


    mov esi,offset KikE
    mov edi,offset KikPBuffer
    xor eax,eax
    mov eax,Ksize
    add eax,0fh
    mov Ksize,eax
    add edi,eax
    mov ecx,06h
    rep movsb
    add Ksize,06h

    xor eax,eax
    invoke lstrlen,kCroom
    mov Csize,eax
    mov edx,Ksize
    mov edi,offset KikPBuffer
    add edi,edx
    mov [edi-1],al
    
    
    mov esi, kCroom     
    mov edi, offset KikPBuffer      
    add     edi,Ksize
    mov     ecx,Csize
    rep movsb   

    xor eax,eax
    mov eax,Ksize
    add eax,Csize
    sub eax,09h
    mov edi, offset KikPBuffer
    add edi,09h
    mov [edi-1],al

    xor eax,eax
    mov eax,Ksize
    add eax,Csize
    mov Csize,eax

    invoke send, sock, addr KikPBuffer,Csize,0
ret
CreatKikPacket endp

;***************************************************************************************************


*************************************
; CHATROOM JOIN PROC
;***************************************************************************************************


*************************************

ChatRoomJoinPacket proc JCroom:DWORD

    invoke RtlZeroMemory, addr JRPBuffer, 512   
    cld             

    mov esi, offset JoinRommS       
    mov edi, offset JRPBuffer       
    mov ecx, 0fh        
    rep movsb           

    xor eax,eax
    invoke lstrlen, JCroom
    mov JCRsize,eax
    mov edi, offset JRPBuffer+0eh
    mov [edi],al
    
    mov esi, JCroom
    mov edi, offset JRPBuffer+0fh
    mov ecx,JCRsize
    rep movsb

    mov edi, offset JRPBuffer+08h
    xor eax,eax
    mov eax,JCRsize
    add eax,06h
    mov [edi],al    
    
    xor eax,eax
    mov eax,0fh
    add JCRsize,eax

    invoke AutoInc,addr JRPBuffer
    invoke send, sock, addr JRPBuffer, JCRsize, 0
ret
ChatRoomJoinPacket endp

;***************************************************************************************************


*************************************
; RECEIVE PROC (THIS WILL CHECK THE FLAGES)
;***************************************************************************************************


*************************************

OnConnect proc hwdl:DWORD, ssock:DWORD

    .if check==0
        invoke CreatLoginPacket, addr id01
        invoke AutoInc,addr LoginPBuffer
        invoke send, ssock, addr LoginPBuffer, Usize, 0
    .endif
        
ret
OnConnect endp

;***************************************************************************************************


*************************************
; RECEIVE PROC
;***************************************************************************************************


*************************************

OnRecieve proc hwdl:DWORD, ssock:DWORD

    .if check==0
        mov check,1
        invoke recv,ssock,addr loginSr,100,0
        invoke CreatLoginResPacket,addr pwd
        invoke AutoInc,addr loginResPfinal
        invoke send, ssock, addr loginResPfinal, 13h, 0
        mov check,2
                
    .elseif check==2
        invoke ioctlsocket,ssock,FIONREAD ,addr rcsize
        .if eax==0
            invoke recv,ssock,addr loginSr,rcsize,0
            mov esi,offset loginSr+02h
            xor eax,eax
            mov al,BYTE PTR [esi]
            .if al==00cbh
                invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr sucLogin
            .else
                mov esi,offset loginSr
                mov edi,offset tempText
                xor ecx,ecx
                mov cl,BYTE PTR [esi+0eh]
                add esi,0fh
                rep movsb
                invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr tempText
            .endif
        .endif
        mov check,4

        .else
            invoke RtlZeroMemory, addr loginSr, 512
            invoke RtlZeroMemory, addr stringTagBuff, 512
            invoke ioctlsocket,ssock,FIONREAD ,addr rcsize
            .if eax==0
            ;************************************************************************************************

***
**********
            ; THIS PART WAS DISCOVERED BY YOGO, THE PURPOSE IS TO MAKE THE LIST NAME IN THE ROOM SHOWN AGAIN
            ; THX TO HIM
            ;************************************************************************************************

***
**********
                invoke recv,ssock,addr loginSr,rcsize,0
                            
                mov esi,offset loginSr
                mov edi,offset stringTagBuff

                invoke GetPrivateProfileString,addr khead,addr chatroom,addr szNull,addr KCname,sizeof KCname,addr CurrentDir
                xor eax,eax
                invoke lstrlen,addr KCname
                add eax,eax
                add eax,1bh
                add esi,eax

                xor eax,eax
                mov ax,[esi-2]
                invoke htons ,eax

                mov ecx,eax
                rep movsb                           
                            
                invoke SetDlgItemText,hwwnd,TEXT_MAIN,addr stringTagBuff
            ;************************************************************************************************

***
**********
            ; END OF YOGO CODING PART
            ;************************************************************************************************

***
**********
            .endif
ret
        .endif
ret
OnRecieve endp

;***************************************************************************************************


*************************************
; LEAVECHATROOM PROC
;***************************************************************************************************


*************************************

LeaveRoomJoinPacket proc JCroom:DWORD
    cld             

    mov esi,offset LeaveRommS
    mov edi,offset LRPBuffer
    mov ecx,0fh
    rep movsb
    
    invoke lstrlen,JCroom
    mov LCRsize,eax
    mov edi,offset LRPBuffer
    mov [edi+0eh],al
    
    mov esi,JCroom
    mov edi,offset LRPBuffer
    add edi,0fh
    mov ecx,LCRsize
    rep movsb


    mov edi, offset LRPBuffer
    add edi,08h
    xor eax,eax
    mov eax,LCRsize
    add eax,06h
    mov LCRsize,eax
    mov [edi],al
    
    mov eax,LCRsize
    add eax,09h
    mov LCRsize,eax
ret
LeaveRoomJoinPacket endp


;***************************************************************************************************


*************************************
; AUTO INCREMENT
;***************************************************************************************************


*************************************

AutoInc proc JCroom:DWORD

    mov edi, JCroom
    mov al,IncriMent
    mov [edi+4],al
    inc al
    mov IncriMent,al
    
ret
AutoInc endp

end start
You might want to put the code inside Code BB tags like i did above

[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

Share this post


Link to post
Share on other sites

You might want to put the code inside Code BB tags like i did above

help me pleace bro

i m newbie

Because uptil now I used autoit belim could conecting to mig33 requested the escort from relatives

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0