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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xab0
mov eax, dword [0x446044]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
push 0x3f
mov esi, ecx
lea ecx, [ebp - 0x4b]
push 0
push ecx
mov edi, edx
mov dword [ebp - 0xaa8], eax
mov byte [ebp - 0x4c], 0
call fcn.00426670
lea edx, [ebp - 0x4c]
add esp, 0xc
mov eax, esi
sub edx, esi
mov edi, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40a5c0
lea eax, [ebp - 0x4c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a5d0
sub eax, edx
movzx ecx, ax
xor eax, eax
test ecx, ecx
jle 0x40a5eb
inc byte [ebp + eax - 0x4c]
inc eax
cmp eax, ecx
jl 0x40a5e2
xor edx, edx
push 0x7fe
push edx
lea eax, [ebp - 0x84a]
push eax
mov word [ebp - 0x84c], dx
call fcn.00426670
add esp, 0xc
lea ecx, [ebp - 0xa9c]
push ecx
push edi
mov dword [ebp - 0xaa4], 0
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov edx, dword [ebp - 0xa88]
mov ecx, dword [ebp - 0xa84]
push eax
mov dword [ebp - 0xab0], edx
mov dword [ebp - 0xaac], ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
push 0x439f8c
push edi
call fcn.0041eb6e
mov esi, eax
add esp, 8
test esi, esi
jne 0x40a692
push edi
lea edx, [ebp - 0x84c]
push 0x43b210
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0x10
push str.L_eQ_
lea eax, [ebp - 0x84c]
push eax
push esi
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041e7be
mov esp, ebp
pop ebp
ret
push 2
push 0
push esi
call fcn.0041f384
add esp, 0xc
push esi
call fcn.0041f295
add esp, 4
push esi
mov edi, eax
call fcn.0041ffba
add esp, 4
push edi
call fcn.0041ea1c
add esp, 4
mov ebx, eax
push esi
test ebx, ebx
jne 0x40a6f1
call fcn.0041f51b
add esp, 4
push 0x10
push str.L_eQ_
push 0x43b240
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041e7be
mov esp, ebp
pop ebp
ret
push edi
push 1
push ebx
call fcn.0042038d
add esp, 0x10
cmp eax, edi
je 0x40a73a
push esi
call fcn.0041f51b
add esp, 4
push ebx
call fcn.0041e9e2
add esp, 4
push 0x10
push str.L_eQ_
push 0x43b25c
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041e7be
mov esp, ebp
pop ebp
ret
lea eax, [edi + edi]
push eax
mov dword [ebp - 0xaa4], eax
call fcn.0041ea1c
mov edx, eax
add esp, 4
mov dword [ebp - 0xaa0], edx
test edx, edx
jne 0x40a791
push esi
call fcn.0041f51b
add esp, 4
push ebx
call fcn.0041e9e2
add esp, 4
push 0x10
push str.L_eQ_
push 0x43b270
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041e7be
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0xaa4]
push ecx
mov ecx, edi
mov eax, ebx
call fcn.004191f0
add esp, 4
cmp eax, 0xfffffffb
jne 0x40a7f1
push 0x10
push str.L_eQ_
push str.Z_BUF_ERROR
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
push esi
call fcn.0041f51b
add esp, 4
push ebx
call fcn.0041e9e2
add esp, 4
mov edx, dword [ebp - 0xaa0]
push edx
call fcn.0041e9e2
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041e7be
mov esp, ebp
pop ebp
ret
test eax, eax
je 0x40a81b
push eax
lea eax, [ebp - 0x84c]
push 0x43b2a4
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0x10
push str.L_eQ_
lea ecx, [ebp - 0x84c]
push ecx
jmp 0x40a7b5
push esi
call fcn.0041f51b
add esp, 4
push ebx
call fcn.0041e9e2
mov edi, dword [ebp - 0xaa8]
add esp, 4
push 0x43b2dc
push edi
call fcn.0041eb6e
mov esi, eax
add esp, 8
test esi, esi
jne 0x40a877
push edi
lea eax, [ebp - 0x84c]
push 0x43b210
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0x10
push str.L_eQ_
lea ecx, [ebp - 0x84c]
push ecx
push esi
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x40a7cf
push 2
push 0
push esi
call fcn.0041f384
add esp, 0xc
push esi
call fcn.0041f295
add esp, 4
mov edi, eax
push esi
mov dword [ebp - 0xaa8], edi
call fcn.0041ffba
add esp, 4
push edi
call fcn.0041ea1c
add esp, 4
mov ebx, eax
push esi
test ebx, ebx
jne 0x40a8eb
call fcn.0041f51b
mov eax, dword [ebp - 0xaa0]
add esp, 4
push eax
call fcn.0041e9e2
add esp, 4
push 0x10
push str.L_eQ_
push 0x43b2e4
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041e7be
mov esp, ebp
pop ebp
ret
push edi
push 1
push ebx
call fcn.0042038d
add esp, 0x10
cmp eax, edi
je 0x40a943
push esi
call fcn.0041f51b
add esp, 4
push ebx
call fcn.0041e9e2
mov ecx, dword [ebp - 0xaa0]
add esp, 4
push ecx
call fcn.0041e9e2
add esp, 4
push 0x10
push str.L_eQ_
push 0x43b25c
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041e7be
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0xaa8]
lea edi, [ebp - 0x4c]
call fcn.00401950
mov edi, eax
cmp edi, 0xffffffff
jne 0x40a969
push 0x10
push str.L_eQ_
push str.b_rN0R
jmp 0x40a7b5
mov eax, dword [ebx + edi + 7]
mov ecx, dword [ebp - 0xaa4]
cmp eax, ecx
jae 0x40a9a1
push eax
push ecx
lea eax, [ebp - 0x84c]
push str.L_eQzz
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push 0x10
push str.L_eQ_
lea ecx, [ebp - 0x84c]
push ecx
jmp 0x40a7b5
push 0
lea eax, [edi + 0x13]
push eax
push esi
call fcn.0041f384
add esp, 0xc
push esi
push 1
lea ecx, [ebp - 0xaa4]
push 4
push ecx
call fcn.0041ff0e
push 0
lea edx, [edi + 0xb]
push edx
push esi
call fcn.0041f384
add esp, 0x1c
push esi
push 1
lea eax, [ebp - 0xab0]
push 8
push eax
call fcn.0041ff0e
push 0
add edi, 0x17
push edi
push esi
call fcn.0041f384
mov ecx, dword [ebp - 0xaa4]
mov edi, dword [ebp - 0xaa0]
add esp, 0x1c
push esi
push ecx
push 1
push edi
call fcn.0041ff0e
push esi
call fcn.0041f51b
add esp, 0x14
push ebx
call fcn.0041e9e2
add esp, 4
push edi
call fcn.0041e9e2
mov ecx, dword [ebp - 8]
add esp, 4
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.0041e7be
mov esp, ebp
pop ebp
ret