Function at 0x401510
Capabilities:
Create thread
Get socket status
Initialize winsock library
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xdf4
mov eax, dword [0x4c3740]
xor eax, esp
mov dword [esp + 0xdf0], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, ecx
mov ecx, dword [eax]
mov dword [edi + 0x44], ecx
mov ecx, edi
mov dword [esp + 0x14], edi
call fcn.00403470
lea edx, [esp + 0xc68]
push edx
push 0x202
mov byte [edi + 0x28], 0
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x4015a4
call sub.Comn.dll_GetObjectLogPXE
mov ebx, eax
mov esi, dword [ebx]
push 0x30
add esi, 0xc
call fcn.00401200
add esp, 4
push eax
mov eax, dword [esi]
push str._s:__DHCP_WSAStartup_Fail
push ebx
call eax
add esp, 0xc
mov ecx, edi
call fcn.004033a0
mov eax, 0xfa4
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xdf0]
xor ecx, esp
call fcn.00437634
mov esp, ebp
pop ebp
ret 8
push 0
push 1
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
test eax, eax
mov dword [edi + 0x24], eax
jne 0x401600
call sub.Comn.dll_GetObjectLogPXE
mov ebx, eax
mov esi, dword [ebx]
push 0x38
add esi, 0xc
call fcn.00401200
mov ecx, dword [esi]
add esp, 4
push eax
push str._s:__DHCP_CreateEvent_Fail
push ebx
call ecx
add esp, 0xc
mov ecx, edi
call fcn.004033a0
mov eax, 0xfa4
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xdf0]
xor ecx, esp
call fcn.00437634
mov esp, ebp
pop ebp
ret 8
push 0
push 0
push edi
push 0x401d20
push 0
push 0
call dword [sym.imp.MSVCR80.dll__beginthreadex]
mov esi, eax
add esp, 0x18
test esi, esi
mov dword [esp + 0x1c], esi
jne 0x401668
call sub.Comn.dll_GetObjectLogPXE
mov ebx, eax
mov esi, dword [ebx]
push 0x40
add esi, 0xc
call fcn.00401200
mov edx, dword [esi]
add esp, 4
push eax
push str._s:__DHCP_Create_watch_thread_fail
push ebx
call edx
add esp, 0xc
mov ecx, edi
call fcn.004033a0
mov eax, 0xfa1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xdf0]
xor ecx, esp
call fcn.00437634
mov esp, ebp
pop ebp
ret 8
mov dword [esp + 0x10], 0
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0
push esi
call ebx
cmp eax, 0x102
jne 0x401ca8
cmp byte [edi + 0x29], 0
jne 0x40169c
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401c2d
mov eax, dword [edi + 0x24]
push 0xffffffffffffffff
push eax
call ebx
cmp byte [edi + 0x29], 0
jne 0x4016b9
mov ecx, dword [edi + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x401c2d
xor ebx, ebx
xor esi, esi
mov dword [esp + 0x28], 0xa
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], esi
mov dword [esp + 0xc], ebx
mov eax, dword [edi + 8]
test eax, eax
je 0x4017a8
mov ecx, dword [edi + 0xc]
sub ecx, eax
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jae 0x4017a8
mov eax, dword [edi + 8]
test eax, eax
je 0x40171b
mov ecx, dword [edi + 0xc]
sub ecx, eax
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jb 0x401725
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov esi, dword [esp + 0x30]
mov ecx, dword [edi + 8]
add ecx, dword [esp + 0xc]
xor eax, eax
test esi, esi
jbe 0x401742
mov edx, dword [ecx + 0x14]
cmp dword [esp + eax*4 + 0x34], edx
je 0x401742
add eax, 1
cmp eax, esi
jb 0x401735
cmp eax, esi
jne 0x401760
cmp esi, 0xfe
jae 0x401760
mov edx, dword [ecx + 0x14]
mov dword [esp + eax*4 + 0x34], edx
mov esi, dword [esp + 0x30]
add esi, 1
mov dword [esp + 0x30], esi
xor eax, eax
test esi, esi
jbe 0x40177d
mov edx, dword [ecx + 0x18]
lea esp, [esp]
cmp dword [esp + eax*4 + 0x34], edx
je 0x40177d
add eax, 1
cmp eax, esi
jb 0x401770
cmp eax, esi
jne 0x40179b
cmp esi, 0xfe
jae 0x40179b
mov ecx, dword [ecx + 0x18]
mov dword [esp + eax*4 + 0x34], ecx
mov esi, dword [esp + 0x30]
add esi, 1
mov dword [esp + 0x30], esi
add ebx, 1
add dword [esp + 0xc], 0x2c
jmp 0x4016d1
lea edx, [esp + 0x28]
push edx
push 0
push 0
lea eax, [esp + 0x3c]
push eax
push 0
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x401801
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [edi + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
call sub.Comn.dll_GetObjectLogPXE
mov ebx, eax
mov esi, dword [ebx]
push 0x6a
add esi, 0xc
call fcn.00401200
mov edx, dword [esi]
add esp, 4
push eax
push str._s:__DHCP_select_socket_error
push ebx
call edx
add esp, 0xc
jmp 0x401c29
xor esi, esi
cmp eax, esi
mov dword [esp + 0x18], esi
jle 0x401c1f
mov dword [esp + 0xc], esi
mov eax, dword [edi + 8]
test eax, eax
je 0x401c1f
mov ecx, dword [edi + 0xc]
sub ecx, eax
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp esi, eax
jae 0x401c1f
mov eax, dword [edi + 8]
test eax, eax
je 0x40185d
mov ecx, dword [edi + 0xc]
sub ecx, eax
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp esi, eax
jb 0x401863
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov ebx, dword [edi + 8]
add ebx, dword [esp + 0xc]
cmp byte [ebx + 0x1d], 0
mov dword [esp + 0x20], ebx
je 0x4018c5
mov ecx, dword [ebx + 0x14]
lea eax, [esp + 0x30]
push eax
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x401890
push 0
push edi
mov ecx, ebx
call fcn.00402690
mov eax, dword [ebx + 0x18]
lea edx, [esp + 0x30]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je case.0x401b2a.1
push 1
push edi
mov ecx, ebx
call fcn.00402690
mov esi, dword [esp + 0x18]
add esi, 1
add dword [esp + 0xc], 0x2c
mov dword [esp + 0x18], esi
jmp 0x401813
mov edx, dword [ebx + 0x18]
lea ecx, [esp + 0x30]
push ecx
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4018e1
push 1
push edi
mov ecx, ebx
call fcn.00402690
mov ecx, dword [ebx + 0x14]
lea eax, [esp + 0x30]
push eax
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je case.0x401b2a.1
mov esi, dword [ebx + 0x14]
push 0x400
lea edx, [esp + 0x46c]
push 0
push edx
call sub.MSVCR80.dll_memset
add esp, 0xc
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x434]
push ecx
push 0
push 0x400
lea edx, [esp + 0x478]
push edx
push esi
mov dword [esp + 0x3c], 0x10
call dword [sym.imp.WS2_32.dll_recvfrom]
cmp eax, 0xffffffff
jne 0x40194a
mov eax, dword [edi + 0x24]
push eax
jmp 0x401c04
cmp byte [esp + 0x55a], 0x61
jne 0x401a75
cmp byte [esp + 0x55b], 0x6d
jne 0x401a75
cmp byte [esp + 0x55c], 0x70
jne 0x401a75
cmp byte [esp + 0x55d], 0x78
jne 0x401a75
cmp byte [esp + 0x55e], 0x65
jne 0x401a75
push str.255.255.255.255
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0x400
lea ecx, [esp + 0x86c]
push 0
push ecx
mov dword [esp + 0x440], eax
call sub.MSVCR80.dll_memset
mov edx, dword [str.ampxe]
mov ebx, dword [ebx + 0x14]
mov al, byte [0x4b2f5c]
add esp, 0xc
push 0x10
mov ecx, 0x3c
lea esi, [esp + 0x46c]
lea edi, [esp + 0x86c]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x434]
push ecx
push 0
mov dword [esp + 0x966], edx
push 0x1f4
lea edx, [esp + 0x878]
push edx
push ebx
mov byte [esp + 0x970], 0xee
mov byte [esp + 0x971], 5
mov byte [esp + 0x976], al
mov byte [esp + 0x977], 0xff
call dword [sym.imp.WS2_32.dll_sendto]
cmp eax, 0xffffffff
jne 0x401a4e
call sub.Comn.dll_GetObjectLogPXE
mov edi, eax
mov esi, dword [edi]
push 0xa4
add esi, 0xc
call fcn.00401200
add esp, 4
push eax
mov eax, dword [esi]
push str._s:__DP_Send_Packet_Error
push edi
call eax
add esp, 0xc
mov ecx, dword [esp + 0x14]
mov edx, dword [ecx + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
add esi, 1
add dword [esp + 0xc], 0x2c
mov dword [esp + 0x18], esi
jmp 0x401813
cmp dword [esp + 0x434], 0
jne 0x401a91
push str.255.255.255.255
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [esp + 0x434], eax
lea esi, [esp + 0x440]
lea edx, [esp + 0x468]
call fcn.00408a70
test al, al
je 0x401c00
mov ecx, dword [esp + 0x448]
mov dx, word [esp + 0x44c]
sub esp, 8
mov eax, esp
mov dword [eax], ecx
mov esi, edi
mov word [eax + 4], dx
call fcn.00403d80
test al, al
jne 0x401c00
cmp byte [esp + 0x464], al
je 0x401c00
mov eax, dword [esp + 0x440]
test eax, eax
jne 0x401afa
mov dword [esp + 0x440], 1
jmp 0x401b17
cmp eax, 3
je 0x401b0d
cmp eax, 1
je 0x401b17
mov eax, dword [edi + 0x24]
push eax
jmp 0x401c04
cmp dword [edi + 0x44], 0
je 0x401c00
mov eax, dword [esp + 0x444]
add eax, 0xffffffff
cmp eax, 7
ja case.0x401b2a.1
jmp dword [eax*4 + 0x401cb8]
lea edx, [esp + 0x430]
push edx
push edi
lea ecx, [esp + 0x448]
mov esi, ebx
call fcn.00402f60
mov esi, dword [esp + 0x18]
add esi, 1
add dword [esp + 0xc], 0x2c
mov dword [esp + 0x18], esi
jmp 0x401813
lea eax, [esp + 0x440]
push eax
push edi
lea ecx, [esp + 0x438]
mov edx, ebx
call fcn.00403110
mov esi, dword [esp + 0x18]
add esi, 1
add dword [esp + 0xc], 0x2c
mov dword [esp + 0x18], esi
jmp 0x401813
lea eax, [esp + 0x440]
mov esi, ebx
mov ecx, edi
call fcn.00403220
mov esi, dword [esp + 0x18]
add esi, 1
add dword [esp + 0xc], 0x2c
mov dword [esp + 0x18], esi
jmp 0x401813
mov ecx, dword [esp + 0x20]
push edi
lea ebx, [esp + 0x434]
lea edx, [esp + 0x444]
call fcn.00403280
mov esi, dword [esp + 0x18]
add esi, 1
add dword [esp + 0xc], 0x2c
mov dword [esp + 0x18], esi
jmp 0x401813
lea eax, [esp + 0x440]
mov esi, ebx
mov ecx, edi
call fcn.00403340
mov esi, dword [esp + 0x18]
add esi, 1
add dword [esp + 0xc], 0x2c
mov dword [esp + 0x18], esi
jmp 0x401813
mov ecx, dword [edi + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov esi, dword [esp + 0x18]
add esi, 1
add dword [esp + 0xc], 0x2c
mov dword [esp + 0x18], esi
jmp 0x401813
mov edx, dword [edi + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov esi, dword [esp + 0x1c]
cmp byte [edi + 0x28], 0
je 0x401670
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0xffffffffffffffff
push esi
call ebx
cmp dword [esp + 0x10], 0
je 0x401c75
call sub.Comn.dll_GetObjectLogPXE
mov ecx, dword [esp + 0x10]
mov ebx, eax
mov esi, dword [ebx]
push ecx
push 0xdf
add esi, 0xc
call fcn.00401200
mov edx, dword [esi]
add esp, 4
push eax
push str._DHCP__s_DHCP_thread_code:_d
push ebx
call edx
add esp, 0x10
lea ebx, [edi + 0x2c]
call fcn.0040a950
mov eax, dword [edi + 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov ecx, dword [esp + 0xdfc]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00437634
mov esp, ebp
pop ebp
ret 8
lea eax, [esp + 0x10]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
jmp 0x401c3d