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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1002e5c7
mov eax, dword fs:[0]
push eax
sub esp, 0x50
mov eax, dword [0x10041008]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov esi, dword [ebp + 8]
push 4
mov dword [ebp - 0x24], 0
call fcn.1002a57a
mov dword [ebp - 0x30], eax
mov dword [ebp - 4], 0
mov dword [eax], 0
mov dword [eax], 0xffffffff
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x24], eax
mov dword [ebp - 4], 1
lea eax, [ebp - 0x24]
push 2
push 0
push 0x40000000
push esi
push eax
call fcn.10019630
mov esi, dword [ebp - 0x24]
test al, al
je 0x10017ba0
test esi, esi
je 0x10017a71
mov eax, dword [esi]
cmp eax, 0xffffffff
je 0x10017a71
lea ecx, [ebp - 0x30]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
jne 0x10017a5a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x10017a71
mov eax, dword [ebp - 0x30]
xor ecx, ecx
add ecx, edi
adc eax, 0
jne 0x10017a6a
test ecx, ecx
je 0x10017a71
mov bl, 1
jmp 0x10017ba2
xorps xmm0, xmm0
mov dword [ebp - 0x18], 0
movq qword [ebp - 0x20], xmm0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x5c]
call fcn.10016e20
mov byte [ebp - 4], 3
lea ecx, [ebx + 0x24]
mov eax, dword [ecx]
cmp eax, dword [ecx + 4]
jne 0x10017ab9
lea ecx, [ebp - 0x5c]
call fcn.10016ec0
jmp 0x10017ac2
push ecx
lea ecx, [ebp - 0x5c]
call fcn.10019820
lea edx, [ebp - 0x20]
lea ecx, [ebp - 0x5c]
call fcn.10017870
mov edi, dword [ebp - 0x1c]
sub edi, dword [ebp - 0x20]
mov dword [ebp - 0x28], 0
test esi, esi
jne 0x10017ae2
xor bl, bl
jmp 0x10017b2e
cmp dword [ebp - 0x20], 0
jne 0x10017aec
xor bl, bl
jmp 0x10017b16
mov eax, dword [esi]
cmp eax, 0xffffffff
jne 0x10017af7
xor bl, bl
jmp 0x10017b16
push 0
lea ecx, [ebp - 0x28]
push ecx
push edi
push dword [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10017b10
xor bl, bl
jmp 0x10017b16
cmp edi, dword [ebp - 0x28]
sete bl
mov eax, dword [esi]
cmp eax, 0xffffffff
je 0x10017b2e
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x10017b2e
mov dword [esi], 0xffffffff
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x20]
cmp dword [ebp - 0x28], eax
jne 0x10017b41
test bl, bl
je 0x10017b41
mov bl, 1
jmp 0x10017b43
xor bl, bl
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x5c]
call fcn.100196f0
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x20]
test ecx, ecx
je 0x10017ba2
mov edx, dword [ebp - 0x18]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x10017b7f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x10017b7f
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.1002a5aa
add esp, 8
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
jmp 0x10017ba2
xor bl, bl
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x10017bd7
mov eax, dword [esi]
cmp eax, 0xffffffff
je 0x10017bc5
test eax, eax
je 0x10017bc5
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi], 0
push 4
push esi
call fcn.1002a5aa
add esp, 8
mov dword [ebp - 0x24], 0
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.1002a569
mov esp, ebp
pop ebp
ret 4