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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x200d4
call fcn.0040f130
mov ecx, dword [ebp + 0xc]
mov edx, dword [0x4221cc]
mov eax, dword [0x42139c]
push ebx
mov ebx, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 0x18]
push edi
mov edi, dword [ebp + 0x10]
mov dword [esp + 0x20], ecx
mov ecx, dword [edx + edi*4]
mov edx, dword [ecx + 0x4cc]
mov ecx, dword [ecx + 0x4c8]
push 0
push 0
xor eax, ebp
push edx
mov dword [esp + 0x200e8], eax
mov eax, dword [ebp + 8]
push ecx
push eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x406022
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx], eax
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x200d0]
xor ecx, ebp
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret
mov edx, dword [0x422320]
push fcn.00409920
push 0x40c1f0
push edx
lea eax, [esp + 0x34]
push eax
call fcn.00408480
add esp, 0x10
test eax, eax
jl 0x406362
lea edx, [esp + 0x28]
push edx
call fcn.004084f0
add esp, 4
test eax, eax
jge 0x406080
lea eax, [esp + 0x28]
push eax
call fcn.00408640
add esp, 4
mov eax, 0xfffffffd
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x200d0]
xor ecx, ebp
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x4221cc]
mov edx, dword [ecx + edi*4]
mov ebx, dword [sym.imp.USER32.dll_GetDlgItem]
push edx
push 0
push 0xc
push 0x1f5
push esi
call ebx
push eax
call dword [sym.imp.USER32.dll_SendMessageW]
push 0
push 0
push 0x402
push 0x1f6
push esi
call ebx
push eax
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [0x4221cc]
mov ecx, dword [eax + edi*4]
mov ecx, dword [ecx + 0x428]
mov eax, 0xcccccccd
mul ecx
shr edx, 3
xor edi, edi
xor ebx, ebx
test ecx, ecx
mov dword [esp + 0x10], edx
ja 0x406200
mov edx, dword [0x4221cc]
mov eax, dword [ebp + 0x10]
mov ecx, dword [edx + eax*4]
mov ecx, dword [ecx + 0x42c]
test ecx, ecx
je 0x406487
shl ecx, 4
mov ebx, ecx
shr ecx, 2
xor eax, eax
lea edi, [esp + 0xd8]
rep stosd dword es:[edi], eax
mov ecx, ebx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [ebp + 0x10]
mov eax, dword [edx + eax*4]
mov edi, dword [eax + 0x42c]
mov ecx, dword [eax + 0x428]
mov ebx, dword [eax + 0x424]
push 0
lea edx, [esp + 0x1c]
push edx
shl ecx, 0x10
shl edi, 4
push edi
lea eax, [esp + 0xe4]
sub ebx, ecx
mov ecx, dword [esp + 0x28]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x406348
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x14]
push 0
push 0
lea ecx, [esp + 0x14]
push ecx
push 0x400
push eax
push 0
push 0x1100
mov dword [edx], eax
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
mov edx, dword [0x4221c8]
add edx, 0xbd1
movzx eax, dx
lea ecx, [esp + 0x10]
push eax
call fcn.00402200
mov ecx, dword [eax]
mov edx, dword [esp + 0xc]
push 0x10
push ecx
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4061cb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, dword [esp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [esp + 0x28]
push ecx
call fcn.00408640
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x200d0]
xor ecx, ebp
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x10]
nop
cmp ebx, edx
jle 0x406264
test edi, edi
mov dword [esp + 0x24], edi
fild dword [esp + 0x24]
jge 0x406216
fadd qword [0x419700]
test ecx, ecx
mov dword [esp + 0x24], ecx
fild dword [esp + 0x24]
jge 0x406228
fadd qword [0x419700]
fdivp st(1)
fmul qword [0x4196f8]
call fcn.0040f170
push 0
push eax
push 0x402
push 0x1f6
push esi
call dword [sym.imp.USER32.dll_GetDlgItem]
push eax
call dword [sym.imp.USER32.dll_SendMessageW]
mov ebx, dword [sym.imp.USER32.dll_UpdateWindow]
push esi
call ebx
mov edx, dword [0x4220ec]
push edx
call ebx
xor ebx, ebx
mov edx, dword [esp + 0x1c]
push 0
lea eax, [esp + 0x1c]
push eax
push 0x10000
lea ecx, [esp + 0xe4]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40615a
push 0x10000
lea eax, [esp + 0xdc]
push eax
lea ecx, [esp + 0x30]
push ecx
call fcn.00408520
add esp, 0xc
test eax, eax
jl 0x4064bc
mov ecx, dword [0x422304]
push 0x10000
lea edx, [esp + 0x100dc]
push edx
lea eax, [esp + 0xe0]
push eax
push 0
push 1
push ecx
call fcn.00406ea0
add esp, 0x18
test eax, eax
jl 0x406321
mov ecx, dword [esp + 0x20]
push 0
lea edx, [esp + 0x1c]
push edx
push 0x10000
lea eax, [esp + 0x100e4]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4063fb
mov edx, dword [0x4221cc]
mov eax, dword [ebp + 0x10]
mov ecx, dword [edx + eax*4]
mov ecx, dword [ecx + 0x428]
inc edi
inc ebx
cmp edi, ecx
jb 0x4061fb
jmp 0x4060e9
lea eax, [esp + 0x28]
push eax
call fcn.00408640
add esp, 4
mov eax, 0xfffffffc
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x200d0]
xor ecx, ebp
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret
push edi
lea edx, [esp + 0xdc]
push edx
lea eax, [esp + 0x30]
push eax
call fcn.00408520
add esp, 0xc
test eax, eax
jge 0x406389
lea ecx, [esp + 0x28]
push ecx
call fcn.00408640
add esp, 4
mov eax, 0xfffffffd
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x200d0]
xor ecx, ebp
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x422304]
push edi
lea edx, [esp + 0x100dc]
push edx
lea eax, [esp + 0xe0]
push eax
push 0
push 1
push ecx
call fcn.00406ea0
add esp, 0x18
test eax, eax
jge 0x4063d8
lea edx, [esp + 0x28]
push edx
call fcn.00408640
add esp, 4
mov eax, 0xfffffffc
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x200d0]
xor ecx, ebp
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x20]
push 0
lea eax, [esp + 0x1c]
push eax
push ebx
lea ecx, [esp + 0x100e4]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x406487
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x14]
push 0
push 0
lea edx, [esp + 0x14]
push edx
push 0x400
push eax
push 0
push 0x1100
mov dword [ecx], eax
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
mov eax, dword [0x4221c8]
add eax, 0xbd1
movzx ecx, ax
push ecx
lea ecx, [esp + 0x14]
call fcn.00402200
mov edx, dword [eax]
mov eax, dword [esp + 0xc]
push 0x10
push edx
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
lea ecx, [esp + 0x10]
call fcn.00401ac0
mov ecx, dword [esp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea edx, [esp + 0x28]
push edx
call fcn.00408640
add esp, 4
mov eax, 0xfffffffe
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x200d0]
xor ecx, ebp
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret
push 0
push 0x64
push 0x402
push 0x1f6
push esi
call dword [sym.imp.USER32.dll_GetDlgItem]
push eax
call dword [sym.imp.USER32.dll_SendMessageW]
lea eax, [esp + 0xc4]
push eax
lea ecx, [esp + 0x2c]
push ecx
call fcn.00408610
add esp, 8
test eax, eax
jge 0x4064e3
lea edx, [esp + 0x28]
push edx
call fcn.00408640
add esp, 4
mov eax, 0xfffffffd
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x200d0]
xor ecx, ebp
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret
mov eax, dword [0x4221cc]
mov edx, dword [ebp + 0x10]
mov edi, dword [eax + edx*4]
add edi, 0x4d0
mov ecx, 5
lea esi, [esp + 0xc4]
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
je 0x40652d
lea ecx, [esp + 0x28]
push ecx
call fcn.00408640
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x200d0]
xor ecx, ebp
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret
lea edx, [esp + 0x28]
push edx
call fcn.00408640
mov ecx, dword [esp + 0x200e0]
add esp, 4
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.0040d4a6
mov esp, ebp
pop ebp
ret