Function at 0x404557
Capabilities:
Get hostname

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x358
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x28], 0
cmp dword [ebp + 8], 0
je 0x4045a4
cmp dword [ebp + 0xc], 0
jne 0x4045ae
mov eax, 0x80070057
jmp 0x404773
push 0x80000000
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
jne 0x4045d4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x30], eax
jmp 0x404771
mov eax, dword [ebp + 8]
push eax
lea ecx, [ebp - 0x358]
push ecx
call fcn.00405b70
add esp, 8
push 1
lea edx, [ebp - 0x358]
push edx
mov eax, dword [ebp - 0x44]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
jne 0x404611
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x30], eax
jmp 0x40476f
lea ecx, [ebp - 0x38]
push ecx
mov edx, dword [ebp - 0x3c]
push edx
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x404730
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0x7a
je 0x404643
jmp 0x40476d
mov edx, dword [ebp - 0x38]
push edx
call sub.MSVCRT.dll_malloc
add esp, 4
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x404664
mov dword [ebp - 0x30], 0xe
jmp 0x40476b
lea eax, [ebp - 0x38]
push eax
mov ecx, dword [ebp - 0x38]
push ecx
mov edx, dword [ebp - 0x2c]
push edx
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x40468c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x30], eax
jmp 0x404769
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ecx + 0x1c]
push edx
mov eax, dword [ebp + 0xc]
push eax
call sub.MSVCRT.dll_wcscpy
add esp, 8
push 0x103
mov ecx, dword [ebp + 0xc]
push ecx
lea edx, [ebp - 0x250]
push edx
call sub.MSVCRT.dll_wcsncpy
add esp, 0xc
mov word [ebp - 0x4a], 0
push 0x5c
lea eax, [ebp - 0x250]
push eax
call fcn.00405b50
add esp, 8
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x4046df
mov ecx, dword [ebp - 0x28]
mov word [ecx], 0
mov dword [ebp - 0x48], 0x10
lea edx, [ebp - 0x48]
push edx
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
test eax, eax
je 0x404729
mov ecx, dword [ebp - 0x250]
and ecx, 0xffff
cmp ecx, 0x2e
je 0x404720
lea edx, [ebp - 0x24]
push edx
lea eax, [ebp - 0x250]
push eax
call sub.MSVCRT.dll__wcsicmp
add esp, 8
test eax, eax
jne 0x404729
mov dword [ebp - 0x30], 0x80004005
jmp 0x404767
mov dword [ebp - 0x30], 0
cmp dword [ebp - 0x2c], 0
je 0x404742
mov ecx, dword [ebp - 0x2c]
push ecx
call sub.MSVCRT.dll_free
add esp, 4
cmp dword [ebp - 0x40], 0
je 0x404752
mov edx, dword [ebp - 0x40]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [ebp - 0x44], 0
je 0x404762
mov eax, dword [ebp - 0x44]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x30]
jmp 0x404773
jmp 0x404730
jmp 0x404730
jmp 0x404730
jmp 0x404730
jmp 0x404730
jmp 0x404730
mov esp, ebp
pop ebp
ret