Function at 0x1047878
Capabilities:
Write file on windows

Disassembly:
push 0x60
mov eax, 0x105efbb
call fcn.0104dc9c
mov esi, ecx
push dword [ebp + 8]
and dword [ebp - 0x28], 0
and dword [ebp - 0x20], 0
lea edi, [esi + 4]
mov ecx, edi
call fcn.0104759f
mov eax, dword [eax]
mov ecx, dword [eax + 0x10]
mov eax, dword [eax + 0x14]
push dword [ebp + 8]
mov dword [ebp - 0x44], ecx
mov ecx, edi
mov dword [ebp - 0x40], eax
call fcn.0104759f
mov eax, dword [eax]
mov ecx, dword [eax + 0x10]
mov ebx, dword [eax + 0x14]
push dword [ebp + 8]
mov dword [ebp - 0x4c], ecx
mov ecx, edi
mov dword [ebp - 0x48], ebx
call fcn.0104759f
mov eax, dword [eax]
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
and dword [ebp - 0x1c], 0
and dword [ebp - 0x2c], 0
and dword [ebp - 4], 0
mov dword [ebp - 0x6c], ecx
push 0x1066af4
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x38], ebx
call fcn.010442ec
mov eax, dword [esi + 0x1c]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [ebp - 0x34]
push ecx
push dword [ebp - 0x6c]
mov byte [ebp - 4], 1
push eax
call ebx
cmp eax, 0xffffffff
jne 0x1047966
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x1047966
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
test eax, eax
jle 0x1047933
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x14], eax
test eax, eax
jl 0x1047941
mov dword [ebp - 0x14], 0x80004005
push 0x1013d8c
push 0x1013d64
call esi
push eax
call fcn.01048d15
add esp, 0xc
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.0102fb3e
jmp 0x1047de8
lea eax, [ebp - 0x18]
push eax
push dword [ebp + 8]
mov ecx, esi
call fcn.01047639
push dword [ebp + 8]
mov dword [ebp - 0x14], eax
test eax, eax
jge 0x1047995
push 0x1013d08
push 0x1013cdc
push dword [ebp - 0x14]
call fcn.01048c52
add esp, 0x10
jmp 0x1047956
mov ecx, edi
call fcn.0104759f
mov eax, dword [eax]
mov eax, dword [eax]
mov ecx, dword [esi]
push eax
push ecx
push dword [ebp - 0x18]
push 0x1013c78
push 0x4000000
call fcn.01048b79
add esp, 0x14
xor edi, edi
push edi
lea eax, [ebp - 0x18]
push eax
call fcn.01041f0d
cmp eax, edi
mov dword [ebp - 0x14], eax
jge 0x10479db
push dword [ebp - 0x18]
push 0x1013c44
push 0x1013c1c
jmp 0x1047988
push edi
push 0x80
push 2
push edi
push edi
push 0x40000000
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x1c], eax
cmp eax, edi
je 0x1047d8f
cmp eax, 0xffffffff
je 0x1047d8f
push edi
lea ecx, [ebp - 0x38]
push ecx
push dword [ebp - 0x4c]
push eax
call ebx
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xffffffff
jne 0x1047a52
call edi
test eax, eax
je 0x1047a52
call edi
test eax, eax
jle 0x1047a33
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x14], eax
test eax, eax
jl 0x1047a41
mov dword [ebp - 0x14], 0x80004005
push 0x1013d8c
push 0x1013bf4
call edi
jmp 0x1047dbf
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x1047a89
call edi
test eax, eax
jle 0x1047a6f
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x14], eax
test eax, eax
jl 0x1047a7d
mov dword [ebp - 0x14], 0x80004005
push 0x1013b68
push 0x1013b40
jmp 0x1047a4b
xor eax, eax
push eax
push eax
push eax
push dword [ebp - 0x1c]
call ebx
cmp eax, 0xffffffff
jne 0x1047ac8
call edi
test eax, eax
je 0x1047ac8
call edi
test eax, eax
jle 0x1047aae
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x14], eax
test eax, eax
jl 0x1047abc
mov dword [ebp - 0x14], 0x80004005
push 0x1013ae0
push 0x1013ab8
jmp 0x1047a4b
mov ebx, 0x80000000
mov edi, dword [esi + 0x14]
xor eax, eax
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x40], eax
ja 0x1047ae4
jb 0x1047ae1
cmp dword [ebp - 0x44], edi
jae 0x1047ae4
mov edi, dword [ebp - 0x44]
cmp dword [ebp - 0x24], 0
jbe 0x1047af5
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esi + 0x1c]
push 0
lea ecx, [ebp - 0x28]
push ecx
push edi
push dword [esi + 0x20]
push eax
call fcn.01047547
test eax, eax
jne 0x1047b4a
mov eax, dword [ebp - 0x24]
inc dword [ebp - 0x24]
cmp eax, 2
jb 0x1047ae4
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
test eax, eax
jle 0x1047b2d
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x14], eax
test eax, eax
jl 0x1047b3b
mov dword [ebp - 0x14], 0x80004005
push 0x1013a7c
push 0x1013a54
jmp 0x1047dbd
mov edi, dword [ebp - 0x28]
test edi, edi
jne 0x1047b80
push dword [ebp + 8]
mov edi, 0x8000ffff
lea ecx, [esi + 4]
mov dword [ebp - 0x14], edi
call fcn.0104759f
mov eax, dword [eax]
push dword [eax]
push 0x10139e8
push 0x10139bc
push edi
call fcn.01048c52
add esp, 0x10
jmp 0x1047dc8
push edi
push dword [esi + 0x20]
push dword [ebp - 0x2c]
call fcn.0104c436
sub dword [ebp - 0x44], edi
push 0
pop edi
sbb dword [ebp - 0x40], edi
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x20], edi
mov ecx, dword [ebp - 0x28]
cmp dword [ebp - 0x20], ecx
jae 0x1047c1a
mov eax, dword [esi + 0x20]
push 0
lea edx, [ebp - 0x20]
push edx
sub ecx, edi
push ecx
add eax, edi
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1047bf2
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
test eax, eax
jle 0x1047bd5
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x14], eax
test eax, eax
jl 0x1047be3
mov dword [ebp - 0x14], 0x80004005
push 0x101397c
push 0x1013954
jmp 0x1047dbd
cmp dword [ebp - 0x20], 0
jne 0x1047c15
push 0x10138b8
mov edi, 0x8000ffff
push 0x1013890
push edi
mov dword [ebp - 0x14], edi
call fcn.01048c52
jmp 0x1047dc5
add edi, dword [ebp - 0x20]
jmp 0x1047b9b
cmp dword [ebp + 0x18], 0
je 0x1047d3f
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x48]
xor edi, edi
mov ecx, edx
sub ecx, dword [ebp - 0x44]
mov dword [ebp - 0x54], edi
sbb eax, dword [ebp - 0x40]
mov dword [ebp - 0x64], ecx
mov dword [ebp - 0x50], eax
and dword [ebp - 0x50], ebx
mov ecx, 0x7fffffff
and eax, ecx
mov dword [ebp - 0x60], eax
fild qword [ebp - 0x64]
mov eax, dword [ebp - 0x48]
fild qword [ebp - 0x54]
mov dword [ebp - 0x58], eax
and dword [ebp - 0x58], ebx
and eax, ecx
fchs
mov dword [ebp - 0x68], eax
mov eax, dword [ebp + 0x10]
faddp st(1)
sub eax, dword [ebp + 0xc]
mov dword [ebp - 0x6c], edx
fild qword [ebp - 0x6c]
mov dword [ebp - 0x5c], edi
fild qword [ebp - 0x5c]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x24], edi
fchs
faddp st(1)
fdivp st(1)
fild dword [ebp - 0x30]
test eax, eax
jge 0x1047c8d
fadd qword [0x1005288]
fmulp st(1)
call sub.msvcrt.dll__ftol2
push dword [ebp + 8]
mov edi, eax
add edi, dword [ebp + 0xc]
lea ecx, [esi + 4]
mov dword [ebp - 0x30], ecx
call fcn.0104759f
mov eax, dword [eax]
mov eax, dword [eax]
lea ecx, [ebp - 0x24]
push ecx
push dword [ebp + 0x14]
push edi
push eax
push dword [ebp + 0x1c]
call dword [ebp + 0x18]
mov eax, dword [ebp - 0x24]
dec eax
je 0x1047d3f
dec eax
je 0x1047d0d
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
test eax, eax
jle 0x1047cd9
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 0x14], eax
test eax, eax
jl 0x1047ce7
mov dword [ebp - 0x14], 0x80004005
push dword [ebp + 8]
mov ecx, dword [ebp - 0x30]
call fcn.0104759f
mov eax, dword [eax]
push dword [eax]
push 0x1013854
push 0x101382c
call esi
push eax
call fcn.01048d15
jmp 0x1047b78
push dword [ebp + 8]
mov ecx, dword [ebp - 0x30]
call fcn.0104759f
mov eax, dword [eax]
push dword [eax]
push 0x10137e0
push 0x10137b4
push 0x4c7
call fcn.01048dd8
add esp, 0x10
mov dword [ebp - 0x14], 0x800704c7
jmp 0x1047dc8
mov eax, dword [ebp - 0x44]
or eax, dword [ebp - 0x40]
jne 0x1047acd
push dword [ebp + 8]
add esi, 4
mov ecx, esi
call fcn.0104759f
mov eax, dword [eax]
mov edi, dword [ebp - 0x2c]
cmp edi, dword [eax + 0x18]
je 0x1047dc8
push dword [ebp + 8]
mov ecx, esi
call fcn.0104759f
mov eax, dword [eax]
push dword [eax + 0x18]
push edi
push 0x1013730
push 0x1013704
push 0xd
call fcn.01048dd8
add esp, 0x14
mov dword [ebp - 0x14], 0x8007000d
jmp 0x1047dc8
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, edi
jle 0x1047da5
and eax, 0xffff
or eax, 0x80070000
cmp eax, edi
mov dword [ebp - 0x14], eax
jl 0x1047db3
mov dword [ebp - 0x14], 0x80004005
push 0x10136a8
push 0x1013680
call esi
push eax
call fcn.01048d15
add esp, 0xc
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.0102fb3e
cmp dword [ebp - 0x1c], 0
je 0x1047de8
cmp dword [ebp - 0x1c], 0xffffffff
je 0x1047de8
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x14]
call fcn.0104dd50
ret 0x18