Function at 0x408d77
Capabilities:
Get file size
Write file on windows

Disassembly:
sub esp, 0x190
push ebx
push ebp
push esi
push edi
xor ebx, ebx
lea eax, [esp + 0x8c]
push 0x114
push ebx
push eax
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x94], ebx
call fcn.00402647
xor edi, edi
mov dword [esp + 0x1c], ebx
inc edi
mov dword [esp + 0x20], ebx
push edi
push 0x20
mov dword [esp + 0x2c], ebx
call fcn.0040274b
add esp, 0x14
mov dword [esp + 0x44], ebx
mov ebp, eax
mov dword [esp + 0x3c], ebp
push ebx
push 0x80000000
push 3
push ebx
push ebx
push 0xc0000000
push dword [esp + 0x1bc]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4091f1
lea eax, [esp + 0x1c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x4091f1
mov eax, dword [esp + 0x1c]
or eax, dword [esp + 0x20]
je 0x4091f1
push 0xf
pop esi
push 0x20
push ebp
push dword [esp + 0x1b8]
dec esi
call fcn.0040667a
test eax, eax
je 0x408e2d
test esi, esi
jne 0x408e15
cmp esi, edi
jge 0x408e38
mov eax, edi
jmp 0x40921e
xor eax, eax
mov byte [esp + 0x48], 0
lea edi, [esp + 0x49]
mov byte [esp + 0x58], 0
stosd dword es:[edi], eax
push 7
pop ecx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
lea edi, [esp + 0x59]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x88]
push eax
call fcn.00402889
lea eax, [esp + 0x10]
push eax
call fcn.00406c91
push 1
push 6
call fcn.00406c72
push eax
lea eax, [esp + 0x18]
push eax
call fcn.00406cea
mov esi, eax
test esi, esi
jne 0x4091f3
xor edx, edx
mov al, byte [esp + 0x1c]
mov cl, dl
shl cl, 3
shr al, cl
mov byte [esp + edx + 0x58], al
inc edx
cmp edx, 8
jl 0x408e93
lea eax, [esp + 0x10]
push eax
call fcn.00406da2
push 8
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x18]
push eax
call fcn.00406dc2
push dword [esp + 0x1a4]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push dword [esp + 0x1a8]
lea eax, [esp + 0x18]
push eax
call fcn.00406dc2
lea eax, [esp + 0x58]
push eax
lea eax, [esp + 0x14]
push eax
call fcn.00406dea
push 0x10
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x50]
push eax
call fcn.00402625
movzx eax, byte [esp + 0x28]
and eax, 0x8000000f
jns 0x408f13
dec eax
or eax, 0xfffffff0
inc eax
mov dword [esp + 0x30], eax
mov byte [esp + 0x63], al
lea eax, [esp + 0x54]
push 0x10
push eax
lea eax, [esp + 0x8c]
push eax
call fcn.00402625
push 0x20
pop edi
push edi
lea eax, [esp + 0x74]
push 0
push eax
call fcn.00402647
push 0x10
lea eax, [esp + 0x70]
push eax
lea eax, [esp + 0x84]
push eax
call fcn.00402625
add esp, 0x30
push 2
pop esi
lea eax, [esp + 0x10]
push eax
call fcn.00406da2
push edi
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x18]
push eax
call fcn.00406dc2
push edi
push ebp
lea eax, [esp + 0x18]
push eax
call fcn.00406dc2
lea eax, [esp + 0x58]
push eax
lea eax, [esp + 0x14]
push eax
call fcn.00406dea
dec esi
jne 0x408f59
push 0x100
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x90]
push eax
call fcn.004028b7
push edi
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x18]
push eax
call fcn.00406e31
push 2
push esi
push esi
push ebx
call fcn.00408ac1
and eax, edx
cmp eax, 0xffffffff
jne 0x408fce
xor eax, eax
inc eax
jmp 0x408fd0
xor eax, eax
cdq
or eax, edx
je 0x408fe4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
inc eax
jmp 0x40921e
mov esi, 0x200
push esi
call fcn.00402779
push esi
push 0
push eax
mov dword [esp + 0x3c], eax
call fcn.00402647
mov edi, dword [esp + 0x30]
xor ecx, ecx
mov esi, dword [esp + 0x2c]
add esp, 0x10
mov dword [esp + 0x40], ecx
mov ebp, ecx
cmp edi, ecx
jl 0x409038
jg 0x40901d
cmp esi, 0x500000
jbe 0x409038
mov ebp, esi
mov eax, edi
mov esi, 0x280000
mov edi, ecx
sub ebp, esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], edi
sbb eax, ecx
mov dword [esp + 0x40], eax
push ecx
push 0x2000
push edi
push esi
call sub.ntdll.dll__alldiv
push 0
push 0x2000
push edi
push esi
mov dword [esp + 0x38], eax
mov dword [esp + 0x44], edx
call sub.ntdll.dll__allrem
mov edi, eax
xor esi, esi
mov eax, edx
mov dword [esp + 0x38], eax
test eax, eax
jl 0x409097
jg 0x40906f
test edi, edi
je 0x409097
push 0
push 2
push dword [esp + 0x3c]
push dword [esp + 0x34]
call sub.ntdll.dll__allrem
or eax, edx
jne 0x409097
mov eax, dword [esp + 0x24]
movzx esi, al
neg esi
and esi, 0xf
add edi, esi
adc dword [esp + 0x38], 0
lea eax, [esi + 0x380]
push eax
mov dword [esp + 0x34], eax
call fcn.00402779
lea ecx, [esi + 0x380]
mov dword [esp + 0x28], eax
push ecx
push 0
push eax
call fcn.00402647
add esp, 0x10
push 0x20
push dword [esp + 0x40]
push dword [0x40111c]
push dword [esp + 0x1b4]
push dword [esp + 0x3c]
call fcn.00409fca
test eax, eax
jne 0x408fd5
add esi, dword [esp + 0x24]
push 0x80
push dword [esp + 0x30]
push esi
call fcn.00402625
push 0x300
push dword [esp + 0x1bc]
lea eax, [esi + 0x80]
push eax
call fcn.00402625
mov esi, dword [esp + 0x3c]
lea eax, [esp + 0x5c]
add esp, 0x18
push 0
push eax
push dword [esp + 0x38]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0x30
push esi
call fcn.0040278d
push dword [esp + 0x34]
mov dword [esp + 0x3c], eax
call fcn.00402765
mov esi, dword [esp + 0x44]
lea eax, [esp + 0x1c]
add esp, 0xc
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x50]
push eax
push esi
push edi
push dword [esp + 0x48]
push dword [esp + 0x40]
push 0
push 0
push ebx
call fcn.00408c4c
mov ecx, dword [esp + 0x40]
mov eax, ebp
or eax, ecx
je 0x409196
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x50]
push eax
push esi
push edi
push dword [esp + 0x48]
push dword [esp + 0x40]
push ecx
push ebp
push ebx
call fcn.00408c4c
lea eax, [esp + 0x58]
push eax
lea eax, [esp + 0x14]
push eax
call fcn.00406f34
push 2
push 0
push 0
push ebx
call fcn.00408ac1
mov ebp, dword [esp + 0x30]
lea eax, [esp + 0x58]
push 0x20
push eax
push ebp
call fcn.00402625
push 0x10
lea eax, [esp + 0x88]
push eax
lea eax, [ebp + 0x20]
push eax
call fcn.00402625
add esp, 0x18
lea eax, [esp + 0x44]
push 0
push eax
push 0x30
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebp, dword [esp + 0x3c]
xor esi, esi
jmp 0x4091f3
mov esi, edi
test ebx, ebx
je 0x4091fe
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call fcn.00402765
pop ecx
lea eax, [esp + 0x10]
push eax
call fcn.00406ca4
lea eax, [esp + 0x88]
push eax
call fcn.0040289f
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x190
ret 0x10