Function at 0x40a321
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 0x40a358
push 0x64
push 2
jmp 0x40a726
push 2
pop edi
mov ecx, edi
call fcn.0040a303
push 0x17
pop esi
test eax, eax
jne 0x40a379
mov ecx, esi
call fcn.0040a303
mov edx, 0x4036a8
test eax, eax
jne 0x40a37e
mov edx, 0x40369c
mov ecx, dword [0x40e3d0]
sub esp, 0xc
call fcn.0040bda8
test eax, eax
je 0x40a720
mov eax, dword [0x40e3d0]
mov ecx, 0x3500
mov dword [0x40e3cc], 1
cmp word [eax], di
jne 0x40a3b6
mov word [eax + 2], cx
mov eax, dword [0x40e3d0]
cmp word [eax], si
jne 0x40a3bf
mov word [eax + 2], cx
mov edx, str.RegistryMachineSystemCurrentControlSetServicesTcpipParameters
lea ecx, [ebp - 4]
call fcn.0040b832
test eax, eax
jns 0x40a3e7
push 0x65
push edi
call fcn.0040b1f1
pop ecx
pop ecx
push 0x57
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_SetLastError]
jmp 0x40a72d
push 0x3200
call dword [sym.imp.msvcrt.dll_malloc]
mov esi, eax
pop ecx
test esi, esi
jne 0x40a410
push 0x64
push edi
call fcn.0040b1f1
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 0x40a3dc
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x4036ac
call fcn.0040b8ae
test eax, eax
js 0x40a458
mov eax, dword [esi]
sub eax, 1
je 0x40a458
sub eax, 1
je 0x40a44f
sub eax, 1
je 0x40a446
sub eax, 1
jne 0x40a458
mov dword [ebp - 8], 0x400
jmp 0x40a45f
mov dword [ebp - 8], 0x800
jmp 0x40a45f
mov dword [ebp - 8], 0x1000
jmp 0x40a45f
mov dword [ebp - 8], 0x2000
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x4036bc
call fcn.0040b8ae
mov edi, 0x40e3fa
test eax, eax
js 0x40a48b
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a480
sub ecx, edx
jne 0x40a4a2
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x4036c4
call fcn.0040b8ae
test eax, eax
js 0x40a4b7
push 0x31ff
push esi
push 0x3200
push edi
call dword [sym.imp.msvcrt.dll_strncpy_s]
add esp, 0x10
mov edx, str.RegistryMachineSoftwarePoliciesMicrosoftWindows_NTDNSClient
lea ecx, [ebp - 0x14]
call fcn.0040b832
test eax, eax
js 0x40a4f1
push ecx
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x4036d0
call fcn.0040b8ae
mov edi, eax
test edi, edi
js 0x40a4f1
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a4e6
sub ecx, edx
jne 0x40a506
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x4036d0
call fcn.0040b8ae
mov edi, eax
mov dword [ebp - 0x10], 0x411600
test edi, edi
js 0x40a5b8
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a51a
sub ecx, edx
je 0x40a5b8
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 0x40a5ad
cmp ecx, 0x4116c4
jae 0x40a5ad
mov cl, byte [eax]
cmp cl, 0x20
je 0x40a58b
cmp cl, 9
je 0x40a58b
cmp cl, 0x2c
je 0x40a58b
mov ecx, dword [ebp - 0xc]
test edi, edi
je 0x40a593
mov dword [ecx], eax
mov edi, edx
add ecx, 4
mov dword [ebp - 0xc], ecx
jmp 0x40a593
mov ecx, dword [ebp - 0xc]
xor edi, edi
mov byte [eax], dl
inc edi
inc eax
cmp byte [eax], dl
jne 0x40a55f
jmp 0x40a5ad
cmp cl, 0x20
je 0x40a669
cmp cl, 9
je 0x40a669
inc eax
mov cl, byte [eax]
test cl, cl
jne 0x40a59a
jmp 0x40a669
push ecx
mov ecx, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push esi
mov edx, 0x4036dc
xor edi, edi
call fcn.0040b8ae
test eax, eax
js 0x40a673
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a5da
push 0
pop edi
sub ecx, edx
je 0x40a673
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 0x40a663
cmp ecx, 0x4116c4
jae 0x40a663
mov cl, byte [eax]
cmp cl, 0x20
je 0x40a649
cmp cl, 9
je 0x40a649
mov ecx, dword [ebp - 0xc]
test edi, edi
je 0x40a651
mov dword [ecx], eax
mov edi, edx
add ecx, 4
mov dword [ebp - 0xc], ecx
jmp 0x40a651
mov ecx, dword [ebp - 0xc]
xor edi, edi
mov byte [eax], dl
inc edi
inc eax
cmp byte [eax], dl
jne 0x40a622
jmp 0x40a663
cmp cl, 0x20
je 0x40a669
cmp cl, 9
je 0x40a669
inc eax
mov cl, byte [eax]
test cl, cl
jne 0x40a658
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 0x40a6b9
push 0x3200
push esi
call dword [sym.imp.WS2_32.dll_gethostname]
test eax, eax
jne 0x40a6b9
push 0x2e
push esi
call dword [sym.imp.msvcrt.dll_strchr]
pop ecx
pop ecx
test eax, eax
je 0x40a6b9
inc eax
push eax
push 0x3200
push 0x40e3fa
call dword [sym.imp.msvcrt.dll_strcpy_s]
add esp, 0xc
test edi, edi
jne 0x40a70d
mov al, byte [0x40e3fa]
mov edx, 0x40e3fa
mov dword [0x4115fc], edx
mov ecx, edx
jmp 0x40a6d9
cmp al, 0x2e
jne 0x40a6d6
inc edi
inc ecx
mov al, byte [ecx]
test al, al
jne 0x40a6d1
mov eax, 0x411600
cmp edi, 2
jl 0x40a70a
cmp eax, 0x411608
jae 0x40a70a
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 0x40a6e2
and dword [eax], 0
or dword [0x40e3c8], 1
push esi
call dword [sym.imp.msvcrt.dll_free]
pop ecx
xor eax, eax
jmp 0x40a730
push 0xd5
push edi
call fcn.0040b1f1
pop ecx
pop ecx
or eax, 0xffffffff
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret