Function at 0x100068dc
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x203c
call fcn.100138e0
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push ebx
push 3
push ebx
push 1
push SysReAllocString
push dword [ebp + 8]
mov esi, ecx
mov dword [esi], ebx
mov dword [esi + 4], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [esp + 0x10], edi
cmp edi, ebx
je 0x10006bb8
cmp edi, 0xffffffff
je 0x10006bb8
push 8
pop ecx
lea eax, [esp + 0x28]
mov byte [eax], bl
inc eax
dec ecx
jne 0x1000692b
lea eax, [esp + 0x28]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x10006970
cmp byte [0x10019582], bl
je 0x1000695f
push 0x40010
push 0x10015b38
push str.Failed_to_get_size_of_source_file_
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, bl
jmp 0x10006be8
mov edi, dword [esp + 0x2c]
xor eax, eax
cmp edi, eax
jg 0x10006989
jl 0x10006985
mov ecx, dword [esp + 0x28]
cmp ecx, dword [ebp + 0x10]
ja 0x10006989
mov bl, 1
jmp 0x1000695f
cmp dword [ebp + 0x10], ebx
jbe 0x100069bc
push eax
push dword [ebp + 0x10]
push ebx
push dword [esp + 0x1c]
call fcn.100068b0
add esp, 0x10
test al, al
jne 0x100069bc
cmp byte [0x10019582], bl
je 0x1000695f
push 0x40010
push 0x10015bb0
push str.Failed_to_skip_the_offset_bytes_
jmp 0x10006958
push ebx
push ebx
push 4
push ebx
push ebx
push 4
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x14], eax
cmp eax, ebx
je 0x10006b7c
cmp eax, 0xffffffff
je 0x10006b7c
push ebx
push ebx
push 2
push eax
call fcn.100068b0
add esp, 0x10
test al, al
jne 0x10006a28
cmp byte [0x10019582], bl
je 0x10006a11
push 0x40010
push 0x10015ce0
push str.Failed_to_seek_to_the_end_of_output_file_
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push dword [esp + 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x14]
call esi
jmp 0x10006be6
mov eax, dword [esp + 0x28]
sub eax, dword [ebp + 0x10]
push 0
pop ecx
sbb edi, ecx
mov ecx, dword [ebp + 0x14]
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], edi
cmp ecx, ebx
jbe 0x10006a6a
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], ebx
cmp ebx, edi
jg 0x10006a5b
jl 0x10006a55
cmp ecx, eax
jae 0x10006a5b
lea eax, [esp + 0x30]
jmp 0x10006a5f
lea eax, [esp + 0x40]
mov ecx, dword [eax]
mov edi, dword [eax + 4]
mov dword [esp + 0x18], ecx
jmp 0x10006a6e
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edi
cmp edi, ebx
jl 0x10006b55
jg 0x10006a86
cmp dword [esp + 0x18], ebx
jbe 0x10006b55
mov dword [esp + 0x38], 0x2000
mov dword [esp + 0x3c], ebx
cmp edi, ebx
jg 0x10006aa8
jl 0x10006aa2
cmp dword [esp + 0x18], 0x2000
jae 0x10006aa8
lea eax, [esp + 0x18]
jmp 0x10006aac
lea eax, [esp + 0x38]
push ebx
lea ecx, [esp + 0x24]
push ecx
push dword [eax]
lea eax, [esp + 0x54]
push eax
push dword [esp + 0x20]
mov dword [esp + 0x34], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10006b37
cmp dword [esp + 0x20], 1
jb 0x10006b37
push ebx
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x28]
lea eax, [esp + 0x54]
push eax
push dword [esp + 0x24]
mov dword [esp + 0x38], ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10006b1e
mov eax, dword [esp + 0x24]
cmp eax, dword [esp + 0x20]
jne 0x10006b1e
sub dword [esp + 0x18], eax
sbb edi, ebx
add dword [esi], eax
mov dword [esp + 0x1c], edi
adc dword [esi + 4], ebx
cmp edi, ebx
jg 0x10006aa8
jl 0x10006b55
cmp dword [esp + 0x18], ebx
ja 0x10006a92
jmp 0x10006b55
cmp byte [0x10019582], bl
je 0x10006b55
push 0x40010
push str.StdUtils::AppendToFile
push str.Failed_to_write_to_output_file_
jmp 0x10006b4e
cmp byte [0x10019582], bl
je 0x10006b55
push 0x40010
push 0x10015d64
push str.Failed_to_read_from_source_file_
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push dword [esp + 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x14]
call esi
cmp edi, ebx
jg 0x10006b78
jl 0x10006b73
cmp dword [esp + 0x18], ebx
ja 0x10006b78
xor eax, eax
inc eax
jmp 0x10006be8
xor eax, eax
jmp 0x10006be8
cmp byte [0x10019582], bl
je 0x10006b9a
push 0x40010
push 0x10015c24
push str.Failed_to_open_output_file_for_writing_
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push dword [esp + 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
cmp dword [esp + 0x14], ebx
je 0x10006be6
cmp dword [esp + 0x14], 0xffffffff
je 0x10006be6
jmp 0x10006a1d
cmp byte [0x10019582], bl
je 0x10006bd6
push 0x40010
push 0x10015ab8
push str.Failed_to_open_source_file_for_reading_
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
cmp edi, ebx
je 0x10006be6
cmp edi, 0xffffffff
je 0x10006be6
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret