Function at 0x10020bc0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x814
push ebx
push ebp
push esi
mov esi, dword [esp + 0x82c]
push edi
mov edi, 0xa
test byte [esi + 0x4ef5], 0x40
mov eax, dword [esi + 0xa8]
mov dword [esp + 0x10], edi
je 0x10020d8f
cmp eax, 0xffffffff
je 0x10020d7e
mov ecx, dword [esp + 0x82c]
xor ebp, ebp
cmp ecx, ebp
je 0x10020d7e
cmp dword [ecx], 0xffffffff
je 0x10020d7e
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
je 0x10020d7e
mov eax, dword [esi + 0xa8]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x10020d7e
mov eax, dword [esi + 0x8b4]
mov dword [esp + 0x10], ebp
cmp eax, ebp
jne 0x10020c7f
test byte [esi + 0x4ef5], 0x10
je 0x10020c53
cmp dword [esi + 0x4ef8], ebp
jbe 0x10020c7f
lea ecx, [esi + 0xac]
lea edx, [esp + 0x24]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, dword [esi + 0x4ef8]
lea eax, [esp + 0x24]
push esi
push eax
inc ecx
push ebp
push ecx
push ebp
push 0xe
call fcn.10020640
add esp, 0x18
mov edx, dword [esi + 0x8b0]
mov ecx, dword [esi + 0x4ef8]
inc edx
lea ebx, [esi + 0xac]
inc ecx
push 0x2e
push ebx
mov dword [esi + 0x8b0], edx
mov dword [esi + 0x4ef8], ecx
call fcn.10033450
cmp eax, ebp
je 0x10020d7e
mov ecx, dword [esi + 0x4ef8]
inc eax
inc ecx
cmp ecx, 0x64
push ecx
jae 0x10020cc4
push str.z_02d
jmp 0x10020cc9
push str._03d
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push ebp
push 0x80
push 2
push ebp
push ebp
push 0xc0000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi + 0xa8], eax
jne 0x10020cf8
mov dword [esp + 0x10], edi
mov eax, dword [esp + 0x828]
mov dword [esi + 0x4ec0], ebp
mov dword [esi + 0x4f18], ebp
cmp eax, ebp
mov dword [esi + 0x4ec4], ebp
mov dword [esi + 0x4f1c], ebp
je 0x10020d32
cmp dword [esi + 0x4f28], ebp
jne 0x10020d32
mov dword [eax + 0x40], ebp
mov dword [eax + 0x44], ebp
mov edx, dword [esi + 0x4ef8]
mov dword [eax + 0x30], edx
cmp dword [esi + 0x4f28], ebp
je 0x10020d59
mov eax, dword [esp + 0x10]
mov dword [esi + 0x8b8], 0x200000
mov dword [esi + 0x8bc], ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x814
ret
push esi
push ebx
call fcn.1001f260
add esp, 8
mov dword [esi + 0x8b8], eax
mov eax, dword [esp + 0x10]
mov dword [esi + 0x8bc], edx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x814
ret
mov dword [esp + 0x10], edi
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x814
ret
cmp eax, 0xffffffff
je 0x10020f5d
mov ecx, dword [esp + 0x82c]
xor ebp, ebp
cmp ecx, ebp
je 0x10020f5d
cmp dword [ecx], 0xffffffff
je 0x10020f5d
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
je 0x10020f5d
mov eax, dword [esi + 0xa8]
push 2
push ebp
push ebp
push eax
call fcn.100348d0
mov ebx, edx
add esp, 0x10
cmp ebx, ebp
mov dword [esp + 0x14], eax
jg 0x10020dea
jl 0x10020de4
cmp eax, ebp
jae 0x10020dea
mov dword [esp + 0x14], ebp
xor ebx, ebx
mov ecx, dword [esi + 0xa8]
push ebp
push ebp
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
jne 0x10020f1e
push 0x7800
mov dword [esp + 0x14], ebp
call fcn.10039ff8
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x10020e21
mov dword [esp + 0x10], 4
mov edx, dword [esi + 0x4e90]
push esi
push edx
call fcn.1001f260
add esp, 8
cmp edx, ebx
jl 0x10020efd
jg 0x10020e45
cmp eax, dword [esp + 0x14]
jb 0x10020efd
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x10020f01
test ebx, ebx
jl 0x10020f01
jg 0x10020e67
mov eax, dword [esp + 0x14]
test eax, eax
jbe 0x10020f01
push esi
call fcn.10013980
add esp, 4
test eax, eax
jne 0x10020ef3
mov ecx, dword [esi + 0xa8]
push eax
lea eax, [esp + 0x24]
push eax
push 0x7800
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10020efd
mov eax, dword [esp + 0x20]
test eax, eax
mov edi, eax
jne 0x10020ea8
mov dword [esp + 0x14], eax
xor ebx, ebx
mov edi, 0xa
jmp 0x10020e51
lea edx, [esp + 0x1c]
push 0
push edx
push eax
mov eax, dword [esp + 0x838]
push ebp
mov ecx, dword [eax]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10020ee4
cmp dword [esp + 0x1c], edi
jne 0x10020ee4
mov ecx, dword [esp + 0x14]
mov eax, edi
cdq
sub ecx, eax
mov edi, 0xa
mov dword [esp + 0x14], ecx
sbb ebx, edx
jmp 0x10020e51
mov dword [esp + 0x10], 0xa
mov edi, 0xa
jmp 0x10020f01
mov dword [esp + 0x10], 9
jmp 0x10020f01
mov dword [esp + 0x10], edi
mov edx, dword [esp + 0x82c]
mov eax, dword [edx]
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test ebp, ebp
je 0x10020f1e
push ebp
call fcn.10039f0f
add esp, 4
mov ecx, dword [esi + 0xa8]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x10020f59
push 0
push 0x80
push 2
push 0
push 0
lea edx, [esi + 0xac]
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi + 0xa8], eax
jne 0x10020f5d
mov dword [esp + 0x10], edi
mov eax, dword [esi + 0x4e90]
push esi
push eax
call fcn.1001f260
add esp, 8
test edx, edx
jg 0x10020f9a
jl 0x10020f77
test eax, eax
ja 0x10020f9a
mov ecx, dword [esp + 0x82c]
push esi
push 0xffffffffffffffff
push 0xffffffffffffffff
push ecx
push 0
call fcn.10020210
add esp, 0x14
test eax, eax
je 0x10020f9a
mov dword [esp + 0x10], 9
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x814
ret