Function at 0x40a67b
Capabilities:
Get hostname

Disassembly:
mov edi, edi
push ebx
mov ebx, esp
push ecx
push ecx
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x18
push esi
push edi
push 0x40
call dword [sym.imp.msvcrt.dll_malloc]
mov dword [0x40e3d0], eax
pop ecx
test eax, eax
jne 0x40a6b2
push 0x64
push 2
jmp 0x40aa7f
push 2
pop edi
mov ecx, edi
call fcn.0040a65d
push 0x17
pop esi
test eax, eax
jne 0x40a6d3
mov ecx, esi
call fcn.0040a65d
mov edx, 0x4036e0
test eax, eax
jne 0x40a6d8
mov edx, 0x4036d4
mov ecx, dword [0x40e3d0]
sub esp, 0xc
call fcn.0040bf00
test eax, eax
je 0x40aa79
mov eax, dword [0x40e3d0]
mov ecx, 0x3500
mov dword [0x40e3cc], 1
cmp word [eax], di
jne 0x40a710
mov word [eax + 2], cx
mov eax, dword [0x40e3d0]
cmp word [eax], si
jne 0x40a719
mov word [eax + 2], cx
mov edx, str.RegistryMachineSystemCurrentControlSetServicesTcpipParameters
lea ecx, [ebp - 4]
call fcn.0040bb7e
test eax, eax
jns 0x40a741
push 0x65
push edi
call fcn.0040b547
pop ecx
pop ecx
push 0x57
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_SetLastError]
jmp 0x40aa86
push 0x3200
call dword [sym.imp.msvcrt.dll_malloc]
mov esi, eax
pop ecx
test esi, esi
jne 0x40a76a
push 0x64
push edi
call fcn.0040b547
pop ecx
pop ecx
push dword [ebp - 4]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
push 8
jmp 0x40a736
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x4036e4
call fcn.0040bbec
test eax, eax
js 0x40a7b2
mov eax, dword [esi]
sub eax, 1
je 0x40a7b2
sub eax, 1
je 0x40a7a9
sub eax, 1
je 0x40a7a0
sub eax, 1
jne 0x40a7b2
mov dword [ebp - 8], 0x400
jmp 0x40a7b9
mov dword [ebp - 8], 0x800
jmp 0x40a7b9
mov dword [ebp - 8], 0x1000
jmp 0x40a7b9
mov dword [ebp - 8], 0x2000
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x4036f4
call fcn.0040bbec
test eax, eax
js 0x40a7e0
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a7d5
sub ecx, edx
jne 0x40a7f7
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x4036fc
call fcn.0040bbec
test eax, eax
js 0x40a810
push 0x31ff
push esi
push 0x3200
push 0x40e3fa
call dword [sym.imp.msvcrt.dll_strncpy_s]
add esp, 0x10
mov edx, str.RegistryMachineSoftwarePoliciesMicrosoftWindows_NTDNSClient
lea ecx, [ebp - 0x14]
call fcn.0040bb7e
test eax, eax
js 0x40a84a
push ecx
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x403708
call fcn.0040bbec
mov edi, eax
test edi, edi
js 0x40a84a
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a83f
sub ecx, edx
jne 0x40a85f
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x403708
call fcn.0040bbec
mov edi, eax
mov dword [ebp - 0x10], 0x411600
test edi, edi
js 0x40a911
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a873
sub ecx, edx
je 0x40a911
push 0x31ff
push esi
push 0x3200
mov edi, 0x40e3fa
push edi
call dword [sym.imp.msvcrt.dll_strncpy_s]
xor edx, edx
mov dword [0x4115fc], edi
add esp, 0x10
mov ecx, 0x411600
mov eax, edi
mov dword [ebp - 0xc], ecx
mov edi, edx
cmp byte [0x40e3fa], dl
je 0x40a906
cmp ecx, 0x4116c4
jae 0x40a906
mov cl, byte [eax]
cmp cl, 0x20
je 0x40a8e4
cmp cl, 9
je 0x40a8e4
cmp cl, 0x2c
je 0x40a8e4
mov ecx, dword [ebp - 0xc]
test edi, edi
je 0x40a8ec
mov dword [ecx], eax
mov edi, edx
add ecx, 4
mov dword [ebp - 0xc], ecx
jmp 0x40a8ec
mov ecx, dword [ebp - 0xc]
xor edi, edi
mov byte [eax], dl
inc edi
inc eax
cmp byte [eax], dl
jne 0x40a8b8
jmp 0x40a906
cmp cl, 0x20
je 0x40a9c2
cmp cl, 9
je 0x40a9c2
inc eax
mov cl, byte [eax]
test cl, cl
jne 0x40a8f3
jmp 0x40a9c2
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x403714
xor edi, edi
call fcn.0040bbec
test eax, eax
js 0x40a9cc
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a933
push 0
pop edi
sub ecx, edx
je 0x40a9cc
push 0x31ff
push esi
push 0x3200
mov edi, 0x40e3fa
push edi
call dword [sym.imp.msvcrt.dll_strncpy_s]
xor edx, edx
mov dword [0x4115fc], edi
add esp, 0x10
mov ecx, 0x411600
mov eax, edi
mov dword [ebp - 0xc], ecx
mov edi, edx
cmp byte [0x40e3fa], dl
je 0x40a9bc
cmp ecx, 0x4116c4
jae 0x40a9bc
mov cl, byte [eax]
cmp cl, 0x20
je 0x40a9a2
cmp cl, 9
je 0x40a9a2
mov ecx, dword [ebp - 0xc]
test edi, edi
je 0x40a9aa
mov dword [ecx], eax
mov edi, edx
add ecx, 4
mov dword [ebp - 0xc], ecx
jmp 0x40a9aa
mov ecx, dword [ebp - 0xc]
xor edi, edi
mov byte [eax], dl
inc edi
inc eax
cmp byte [eax], dl
jne 0x40a97b
jmp 0x40a9bc
cmp cl, 0x20
je 0x40a9c2
cmp cl, 9
je 0x40a9c2
inc eax
mov cl, byte [eax]
test cl, cl
jne 0x40a9b1
mov byte [eax], dl
xor edi, edi
mov eax, dword [ebp - 0xc]
inc edi
mov dword [eax], edx
mov eax, dword [ebp - 8]
or dword [0x40e3c8], eax
cmp byte [0x40e3fa], 0
jne 0x40aa12
push 0x3200
push esi
call dword [sym.imp.WS2_32.dll_gethostname]
test eax, eax
jne 0x40aa12
push 0x2e
push esi
call dword [sym.imp.msvcrt.dll_strchr]
pop ecx
pop ecx
test eax, eax
je 0x40aa12
inc eax
push eax
push 0x3200
push 0x40e3fa
call dword [sym.imp.msvcrt.dll_strcpy_s]
add esp, 0xc
test edi, edi
jne 0x40aa66
mov al, byte [0x40e3fa]
mov edx, 0x40e3fa
mov dword [0x4115fc], edx
mov ecx, edx
jmp 0x40aa32
cmp al, 0x2e
jne 0x40aa2f
inc edi
inc ecx
mov al, byte [ecx]
test al, al
jne 0x40aa2a
mov eax, 0x411600
cmp edi, 2
jl 0x40aa63
cmp eax, 0x411608
jae 0x40aa63
push 0x2e
push edx
call dword [sym.imp.msvcrt.dll_strchr]
pop ecx
pop ecx
lea edx, [eax + 1]
mov eax, dword [ebp - 0x10]
mov dword [eax], edx
add eax, 4
mov dword [ebp - 0x10], eax
dec edi
jmp 0x40aa3b
and dword [eax], 0
or dword [0x40e3c8], 1
push esi
call dword [sym.imp.msvcrt.dll_free]
pop ecx
xor eax, eax
jmp 0x40aa89
push 0xd5
push edi
call fcn.0040b547
pop ecx
pop ecx
or eax, 0xffffffff
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret