Function at 0x40a790
Capabilities:
Create thread
Get hostname

Disassembly:
mov eax, dword [esp + 0x10]
push ebx
push esi
push edi
push eax
call dword [sym.imp.WS2_32.dll_htonl]
cmp byte [esp + 0x14], 0
mov ebx, eax
jne 0x40a869
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40a831
cmp eax, 2
je 0x40a831
mov esi, dword [esp + 0x20]
movzx ecx, word [esi + 0xe]
mov edi, dword [sym.imp.WS2_32.dll_htons]
push ecx
call edi
movzx edx, ax
movzx eax, word [esi + 0xc]
push edx
push eax
call edi
movzx edx, word [esi + 0xa]
movzx ecx, ax
push ecx
push edx
call edi
movzx ecx, word [esi + 8]
movzx eax, ax
push eax
push ecx
call edi
movzx edx, ax
movzx eax, word [esi + 6]
push edx
push eax
call edi
movzx edx, word [esi + 4]
movzx ecx, ax
push ecx
push edx
call edi
movzx ecx, word [esi + 2]
movzx eax, ax
push eax
push ecx
call edi
movzx edx, ax
movzx eax, word [esi]
push edx
push eax
call edi
mov edx, dword [esp + 0x40]
movzx ecx, ax
push ecx
push str.__x:_x:_x:_x:_x:_x:_x:_x_
push edx
call fcn.00412953
add esp, 0x28
pop edi
pop esi
xor al, al
pop ebx
ret
movzx eax, bl
push eax
mov eax, dword [esp + 0x28]
mov ecx, ebx
shr ecx, 8
mov edx, ebx
and ecx, 0xff
push ecx
shr edx, 0x10
and edx, 0xff
push edx
shr ebx, 0x18
push ebx
push str._d._d._d._d
push eax
call fcn.00412953
add esp, 0x18
pop edi
pop esi
xor al, al
pop ebx
ret
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
push ebp
mov ebp, dword [esp + 0x14]
push edi
push esi
push ebx
push ebp
call fcn.0040a440
add esp, 0x10
test al, al
jne 0x40a8f1
test ebp, ebp
je 0x40a88f
cmp ebp, 2
jne 0x40a8a9
cmp dword [esp + 0x20], 0
jne 0x40a8a9
mov ecx, dword [esp + 0x2c]
push ecx
push edi
call dword [sym.imp.WS2_32.dll_gethostname]
pop ebp
pop edi
pop esi
mov al, 1
pop ebx
ret
test ebp, ebp
je 0x40a8b2
cmp ebp, 2
jne 0x40a8f8
cmp dword [esp + 0x20], 0x100007f
jne 0x40a8f8
cmp dword [esp + 0x1c], 0
je 0x40a8d6
mov edx, dword [esp + 0x2c]
push edx
push edi
call dword [sym.imp.WS2_32.dll_gethostname]
pop ebp
pop edi
pop esi
mov al, 1
pop ebx
ret
mov eax, dword [str.localhost]
mov dword [edi], eax
mov ecx, dword [0x43ec24]
mov dword [edi + 4], ecx
mov dx, word [0x43ec28]
mov word [edi + 8], dx
pop ebp
pop edi
pop esi
mov al, 1
pop ebx
ret
test ebp, ebp
je 0x40a972
cmp ebp, 2
je 0x40a972
movzx eax, word [esi + 0xe]
mov edi, dword [sym.imp.WS2_32.dll_htons]
push eax
call edi
movzx edx, word [esi + 0xc]
movzx ecx, ax
push ecx
push edx
call edi
movzx ecx, word [esi + 0xa]
movzx eax, ax
push eax
push ecx
call edi
movzx edx, ax
movzx eax, word [esi + 8]
push edx
push eax
call edi
movzx edx, word [esi + 6]
movzx ecx, ax
push ecx
push edx
call edi
movzx ecx, word [esi + 4]
movzx eax, ax
push eax
push ecx
call edi
movzx edx, ax
movzx eax, word [esi + 2]
push edx
push eax
call edi
movzx edx, word [esi]
movzx ecx, ax
push ecx
push edx
call edi
mov ecx, dword [esp + 0x44]
movzx eax, ax
push eax
push str.__x:_x:_x:_x:_x:_x:_x:_x_
push ecx
call fcn.00412953
add esp, 0x28
jmp 0x40a9a1
movzx edx, bl
push edx
mov eax, ebx
shr eax, 8
mov ecx, ebx
and eax, 0xff
push eax
shr ecx, 0x10
and ecx, 0xff
push ecx
mov edx, ebx
shr edx, 0x18
push edx
push str._d._d._d._d
push edi
call fcn.00412953
add esp, 0x18
push 0x446d58
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x446e64]
test eax, eax
je 0x40a9c7
cmp dword [eax + 0x10c], ebx
je 0x40aa2e
mov eax, dword [eax + 0x120]
test eax, eax
jne 0x40a9b5
push 0x124
call fcn.00412493
mov ecx, dword [esp + 0x24]
add esp, 4
mov dword [eax], ebp
mov dword [eax + 0x108], ecx
mov dword [eax + 0x10c], ebx
test esi, esi
je 0x40aa0d
mov edx, dword [esi]
mov dword [eax + 0x110], edx
mov ecx, dword [esi + 4]
mov dword [eax + 0x114], ecx
mov edx, dword [esi + 8]
mov dword [eax + 0x118], edx
mov ecx, dword [esi + 0xc]
mov dword [eax + 0x11c], ecx
mov edx, dword [0x446e64]
push eax
push 0
mov dword [eax + 0x120], edx
push 0x40a510
mov dword [0x446e64], eax
call fcn.004140d9
add esp, 0xc
push 0x446d58
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop ebp
pop edi
pop esi
xor al, al
pop ebx
ret