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

Disassembly:
push 0xffffffffffffffff
push 0x5cee60
mov eax, dword fs:[0]
push eax
mov eax, 0x1164
call fcn.005b5ef0
mov eax, dword [0x65b4e4]
xor eax, esp
mov dword [esp + 0x1160], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x65b4e4]
xor eax, esp
push eax
lea eax, [esp + 0x1178]
mov dword fs:[0], eax
mov ecx, dword [esp + 0x1188]
mov esi, dword [esp + 0x118c]
xor ebx, ebx
cmp ecx, ebx
je 0x502a68
cmp esi, ebx
je 0x502a68
mov ebp, 0xf
mov eax, ecx
mov dword [esp + 0x170], ebp
mov dword [esp + 0x16c], ebx
mov byte [esp + 0x15c], bl
lea edi, [eax + 1]
mov edi, edi
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x502360
sub eax, edi
push eax
push ecx
lea ecx, [esp + 0x160]
call fcn.004098b0
mov eax, esi
mov dword [esp + 0x1180], 2
mov dword [esp + 0x154], ebp
mov dword [esp + 0x150], ebx
mov byte [esp + 0x140], 0
lea ecx, [eax + 1]
nop
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x5023a0
sub eax, ecx
push eax
push esi
lea ecx, [esp + 0x144]
call fcn.004098b0
mov ecx, dword [esp + 0x170]
cmp ecx, 0x10
mov edx, dword [esp + 0x15c]
mov byte [esp + 0x1180], 3
mov byte [esp + 0x17], 0x2f
mov byte [esp + 0x16], 0x5c
mov eax, edx
jae 0x5023e7
lea eax, [esp + 0x15c]
mov ebx, dword [esp + 0x16c]
lea edi, [eax + ebx]
test edi, edi
je 0x50241b
cmp ecx, 0x10
mov eax, edx
jae 0x502403
lea eax, [esp + 0x15c]
cmp eax, edi
ja 0x50241b
cmp ecx, 0x10
mov eax, edx
jae 0x502415
lea eax, [esp + 0x15c]
add eax, ebx
cmp edi, eax
jbe 0x502435
call fcn.005b0913
mov ecx, dword [esp + 0x170]
mov ebx, dword [esp + 0x16c]
mov edx, dword [esp + 0x15c]
cmp ecx, 0x10
lea ebp, [esp + 0x158]
jb 0x502600
test edx, edx
mov esi, edx
je 0x502471
cmp ecx, 0x10
mov eax, edx
jae 0x502459
lea eax, [esp + 0x15c]
cmp eax, esi
ja 0x502471
cmp ecx, 0x10
mov eax, edx
jae 0x50246b
lea eax, [esp + 0x15c]
add eax, ebx
cmp esi, eax
jbe 0x502476
call fcn.005b0913
lea ecx, [esp + 0x17]
push ecx
lea edx, [esp + 0x1a]
push edx
push edi
push ebp
lea eax, [esp + 0x168]
push esi
push eax
call fcn.0045cbd0
mov ecx, dword [esp + 0x16c]
mov edx, dword [esp + 0x158]
add esp, 0x18
cmp ecx, 0x10
mov byte [esp + 0x16], 0x2f
mov byte [esp + 0x17], 0x5c
mov eax, edx
jae 0x5024b9
lea eax, [esp + 0x140]
mov ebx, dword [esp + 0x150]
lea edi, [eax + ebx]
test edi, edi
je 0x5024ed
cmp ecx, 0x10
mov eax, edx
jae 0x5024d5
lea eax, [esp + 0x140]
cmp eax, edi
ja 0x5024ed
cmp ecx, 0x10
mov eax, edx
jae 0x5024e7
lea eax, [esp + 0x140]
add eax, ebx
cmp edi, eax
jbe 0x502507
call fcn.005b0913
mov ecx, dword [esp + 0x154]
mov ebx, dword [esp + 0x150]
mov edx, dword [esp + 0x140]
cmp ecx, 0x10
lea ebp, [esp + 0x13c]
jb 0x50260c
test edx, edx
mov esi, edx
je 0x502543
cmp ecx, 0x10
mov eax, edx
jae 0x50252b
lea eax, [esp + 0x140]
cmp eax, esi
ja 0x502543
cmp ecx, 0x10
mov eax, edx
jae 0x50253d
lea eax, [esp + 0x140]
add eax, ebx
cmp esi, eax
jbe 0x502548
call fcn.005b0913
lea ecx, [esp + 0x16]
push ecx
lea edx, [esp + 0x1b]
push edx
push edi
push ebp
lea eax, [esp + 0x14c]
push esi
push eax
call fcn.0045cbd0
mov ecx, dword [esp + 0x158]
mov esi, 0x10
add esp, 0x18
cmp dword [esp + 0x154], esi
jae 0x502581
lea ecx, [esp + 0x140]
cmp dword [esp + 0x170], esi
mov eax, dword [esp + 0x15c]
jae 0x502598
lea eax, [esp + 0x15c]
push ecx
push eax
call fcn.005b14c5
add esp, 8
test eax, eax
jne 0x502618
cmp dword [esp + 0x154], esi
jb 0x5025bf
mov eax, dword [esp + 0x140]
push eax
call fcn.00594e98
add esp, 4
cmp dword [esp + 0x170], esi
mov dword [esp + 0x154], 0xf
mov dword [esp + 0x150], 0
mov byte [esp + 0x140], 0
jb 0x5025f6
mov ecx, dword [esp + 0x15c]
push ecx
call fcn.00594e98
add esp, 4
mov eax, 1
jmp 0x502b1e
lea esi, [esp + 0x15c]
jmp 0x50244b
lea esi, [esp + 0x140]
jmp 0x50251d
cmp dword [esp + 0x1190], 0
je 0x50264d
cmp dword [esp + 0x154], esi
mov eax, dword [esp + 0x140]
jae 0x502639
lea eax, [esp + 0x140]
push 0
push eax
call fcn.00519e70
add esp, 8
cmp eax, 0xffffffff
jne 0x5029a0
cmp dword [esp + 0x170], esi
mov eax, dword [esp + 0x15c]
jae 0x502664
lea eax, [esp + 0x15c]
push 0x62b408
push eax
call fcn.005b0ac9
mov edi, eax
add esp, 8
mov dword [esp + 0x38], edi
test edi, edi
mov bl, 4
mov byte [esp + 0x1180], bl
jne 0x5027c6
push 1
push 2
lea ecx, [esp + 0x44]
call fcn.0040b160
mov eax, dword [esp + 0x15c]
mov esi, 0x10
cmp dword [esp + 0x170], esi
mov byte [esp + 0x1180], 5
jae 0x5026ba
lea eax, [esp + 0x15c]
push eax
lea edx, [esp + 0x40]
push edx
call fcn.00409c80
add esp, 8
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x40]
call fcn.00409610
cmp dword [eax + 0x18], esi
mov byte [esp + 0x1180], 6
jb 0x5026e8
mov eax, dword [eax + 4]
jmp 0x5026eb
add eax, 4
push eax
push str.BaseLib::CxxSDCopyFile
push 0x811
push str..common_function.cpp
push 0x803
call fcn.00409980
mov ecx, eax
call fcn.004fa910
lea ecx, [esp + 0x18]
call fcn.0040c050
lea ecx, [esp + 0x3c]
mov byte [esp + 0x1180], bl
call fcn.00409ef0
push 1
push 2
lea ecx, [esp + 0x44]
call fcn.0040b160
lea ecx, [esp + 0x3c]
push 0x5f34c0
push ecx
mov byte [esp + 0x1188], 7
call fcn.00409c80
add esp, 8
lea edx, [esp + 0x18]
push edx
lea ecx, [esp + 0x40]
call fcn.00409610
cmp dword [eax + 0x18], esi
mov byte [esp + 0x1180], 8
jb 0x50276c
mov eax, dword [eax + 4]
jmp 0x50276f
add eax, 4
push eax
push str.BaseLib::CxxSDCopyFile
push 0x812
push str..common_function.cpp
push 0x803
call fcn.00409980
mov ecx, eax
call fcn.004fa910
lea ecx, [esp + 0x18]
call fcn.0040c050
lea ecx, [esp + 0x3c]
mov byte [esp + 0x1180], bl
call fcn.00409ef0
lea ecx, [esp + 0x13c]
call fcn.0040c050
lea ecx, [esp + 0x158]
call fcn.0040c050
jmp 0x502b1c
mov eax, dword [esp + 0x140]
mov esi, 0x10
cmp dword [esp + 0x154], esi
jae 0x5027e2
lea eax, [esp + 0x140]
push 0x62b410
push eax
call fcn.005b0ac9
mov ebp, eax
add esp, 8
mov dword [esp + 0x34], ebp
test ebp, ebp
mov byte [esp + 0x1180], 9
jne 0x502931
push 1
push 2
lea ecx, [esp + 0x44]
call fcn.0040b160
cmp dword [esp + 0x154], esi
mov eax, dword [esp + 0x140]
mov byte [esp + 0x1180], 0xa
jae 0x502832
lea eax, [esp + 0x140]
push eax
lea eax, [esp + 0x40]
push eax
call fcn.00409c80
add esp, 8
lea ecx, [esp + 0x18]
push ecx
lea ecx, [esp + 0x40]
call fcn.00409610
cmp dword [eax + 0x18], esi
mov byte [esp + 0x1180], 0xb
jb 0x502860
mov eax, dword [eax + 4]
jmp 0x502863
add eax, 4
push eax
push str.BaseLib::CxxSDCopyFile
push 0x819
push str..common_function.cpp
push 0x803
call fcn.00409980
mov ecx, eax
call fcn.004fa910
lea ecx, [esp + 0x18]
call fcn.0040c050
lea ecx, [esp + 0x3c]
mov byte [esp + 0x1180], 9
call fcn.00409ef0
push 1
push 2
lea ecx, [esp + 0x44]
call fcn.0040b160
lea edx, [esp + 0x3c]
push 0x5f34a4
push edx
mov byte [esp + 0x1188], 0xc
call fcn.00409c80
add esp, 8
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x40]
call fcn.00409610
cmp dword [eax + 0x18], esi
mov byte [esp + 0x1180], 0xd
jb 0x5028e5
mov eax, dword [eax + 4]
jmp 0x5028e8
add eax, 4
push eax
push str.BaseLib::CxxSDCopyFile
push 0x81a
push str..common_function.cpp
push 0x803
call fcn.00409980
mov ecx, eax
call fcn.004fa910
lea ecx, [esp + 0x18]
call fcn.0040c050
lea ecx, [esp + 0x3c]
mov byte [esp + 0x1180], 9
call fcn.00409ef0
push edi
call fcn.005b0f84
add esp, 4
jmp 0x5027a9
push edi
call fcn.005b2590
add esp, 4
test eax, eax
jne 0x502991
mov ebx, dword [esp + 0x1194]
test ebx, ebx
je 0x50294e
cmp dword [ebx], 0
jne 0x502991
push edi
push 0x1000
lea ecx, [esp + 0x17c]
push 1
push ecx
call fcn.005b1816
mov esi, eax
add esp, 0x10
test esi, esi
jle 0x502984
push ebp
push esi
lea edx, [esp + 0x17c]
push 1
push edx
call fcn.005b0d41
add esp, 0x10
cmp eax, esi
jne 0x5029c2
push edi
call fcn.005b2590
add esp, 4
test eax, eax
je 0x502945
push ebp
call fcn.005b0f84
push edi
call fcn.005b0f84
add esp, 8
lea ecx, [esp + 0x13c]
call fcn.0040c050
lea ecx, [esp + 0x158]
call fcn.0040c050
mov eax, 1
jmp 0x502b1e
push 1
push 2
lea ecx, [esp + 0xc4]
call fcn.0040b160
lea eax, [esp + 0xbc]
push 0x5f3498
push eax
mov byte [esp + 0x1188], 0xe
call fcn.00409c80
add esp, 8
lea ecx, [esp + 0x18]
push ecx
lea ecx, [esp + 0xc0]
call fcn.00409610
cmp dword [eax + 0x18], 0x10
mov byte [esp + 0x1180], 0xf
jb 0x502a13
mov eax, dword [eax + 4]
jmp 0x502a16
add eax, 4
push eax
push str.BaseLib::CxxSDCopyFile
push 0x82b
push str..common_function.cpp
push 0xf0000000
call fcn.00409980
mov ecx, eax
call fcn.004fa910
lea ecx, [esp + 0x18]
call fcn.0040c050
lea ecx, [esp + 0xbc]
mov byte [esp + 0x1180], 9
call fcn.00409ef0
push ebp
call fcn.005b0f84
push edi
call fcn.005b0f84
add esp, 8
jmp 0x5027a9
push 1
push 2
lea ecx, [esp + 0x44]
call fcn.0040b160
lea edx, [esp + 0x3c]
push 0x5f3470
push edx
mov dword [esp + 0x1188], ebx
call fcn.00409c80
add esp, 8
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x40]
call fcn.00409610
mov esi, 0x10
cmp dword [eax + 0x18], esi
mov byte [esp + 0x1180], 1
jb 0x502ab3
mov eax, dword [eax + 4]
jmp 0x502ab6
add eax, 4
push eax
push str.BaseLib::CxxSDCopyFile
push 0x7f9
push str..common_function.cpp
push 0x803
call fcn.00409980
mov ecx, eax
call fcn.004fa910
cmp dword [esp + 0x30], esi
jb 0x502aea
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.00594e98
add esp, 4
lea ecx, [esp + 0x88]
mov dword [esp + 0x1180], 0xffffffff
call fcn.00409f20
lea edx, [esp + 0x88]
push edx
mov dword [esp + 0x8c], vtable.std::ios_base.0
call fcn.005cccbe
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x1178]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1160]
xor ecx, esp
call fcn.005b0968
add esp, 0x1170
ret