Function at 0x401350
Capabilities:
Extract resource via kernel32 functions
Get disk size
Get system information on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x40e658
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push ebp
push esi
push edi
mov eax, dword [0x413040]
xor eax, esp
push eax
lea eax, [esp + 0x54]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x64]
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
xor edx, edx
mov ecx, 9
cmp cx, word [esp + 0x2c]
push 0
sete dl
add edx, 0x81
mov esi, edx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov edi, eax
movzx eax, si
push 0x410c60
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov ebx, eax
test ebx, ebx
jne 0x4013d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x54]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
lea ecx, [esp + 0x18]
push ecx
mov ecx, ebp
mov dword [esp + 0x20], eax
call fcn.00401fd0
lea esi, [esp + 0x18]
mov dword [esp + 0x5c], 0
call fcn.00401ad0
mov eax, dword [esp + 0x18]
push 0
push 0
lea edx, [esp + 0x2c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceExW]
test eax, eax
jne 0x401426
call dword [sym.imp.KERNEL32.dll_GetLastError]
or ebp, 0xffffffff
jmp 0x40153b
mov ecx, dword [esp + 0x28]
xor eax, eax
cmp ecx, eax
ja 0x401479
jb 0x40143c
mov edx, dword [esp + 0x24]
cmp edx, dword [esp + 0x1c]
jae 0x401479
or ebp, 0xffffffff
mov dword [esp + 0x5c], ebp
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebp, ebp
jg 0x401460
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 0x70
mov ecx, dword [esp + 0x54]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
push 0
push 0
push 2
push 0
push 0
push 0x40000000
push ebp
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
or ebp, 0xffffffff
test esi, esi
je 0x401535
cmp esi, ebp
je 0x401535
mov edx, dword [esp + 0x1c]
xor ebx, ebx
push ebx
lea ecx, [esp + 0x24]
push ecx
push edx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4014cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x5c], ebp
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebx, ebx
je 0x401511
test ebp, ebp
jg 0x4014fb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, ebx
mov ecx, dword [esp + 0x54]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
test ebp, ebp
jg 0x40151f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [esp + 0x54]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [esp + 0x5c], ebp
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebp, ebp
jg 0x40155e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [esp + 0x54]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret