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

Disassembly:
sub esp, 0x28
fldz
push ebp
push esi
fstp qword [esp + 0x28]
mov esi, dword [esp + 0x38]
push edi
xor ebp, ebp
push ebp
push ebp
push 3
push ebp
push ebp
push 0x80000000
push esi
mov dword [esp + 0x30], ebp
mov dword [esp + 0x34], ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x38], ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4075c4
mov eax, dword [esp + 0x38]
push 3
push 0x192
push esi
push 0x7d9
push eax
call fcn.004062d0
mov ecx, dword [esp + 0x5c]
add esp, 0x14
mov dword [ecx], edi
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x28
ret
push ebx
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov dword [esp + 0x28], ebx
cmp ebx, 0xffffffff
jne 0x407609
mov edx, dword [esp + 0x3c]
push 3
push 0x193
push esi
push 0x7da
push edx
call fcn.004062d0
add esp, 0x14
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x4c]
mov dword [eax], ebx
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x28
ret
push ebx
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
push ebx
mov esi, eax
push 0
push esi
call fcn.004122b0
add esp, 0xc
push 0
lea ecx, [esp + 0x1c]
push ecx
push ebx
push esi
push edi
mov dword [esp + 0x2c], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x18], ebx
jne 0x407913
test eax, eax
je 0x407913
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [esi], 0x4d
jne 0x4078cf
cmp byte [esi + 1], 0x5a
jne 0x4078cf
mov ecx, dword [esi + 0x3c]
cmp ecx, ebx
jbe 0x4076b6
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x3c]
push 1
push 0x198
push edx
push 0x7d3
push eax
call fcn.004062d0
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov edx, dword [esp + 0x4c]
pop ebx
pop edi
pop esi
mov dword [edx], 0xffffffff
xor eax, eax
pop ebp
add esp, 0x28
ret
movzx edi, word [ecx + esi + 0x14]
lea eax, [ecx + esi + 4]
movzx eax, word [eax + 2]
lea edx, [ecx + esi + 0x18]
mov ebx, 1
add edi, edx
mov dword [esp + 0x24], edx
mov dword [esp + 0x2c], eax
cmp eax, ebx
jb 0x407713
lea eax, [edi + 0xc]
jmp 0x4076e4
mov edx, dword [esp + 0x24]
test byte [eax + 0x18], 0x20
je 0x407709
mov ecx, dword [eax]
mov edx, dword [edx + 0x10]
cmp edx, ecx
jb 0x407709
mov ebp, dword [eax + 4]
add ebp, ecx
cmp edx, ebp
jae 0x407705
lea ebp, [ebx - 1]
mov dword [esp + 0x10], ebp
jmp 0x407709
mov ebp, dword [esp + 0x10]
inc ebx
add eax, 0x28
cmp ebx, dword [esp + 0x2c]
jbe 0x4076e0
push ebp
push edi
push esi
call fcn.00402050
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x20]
push ecx
push ebp
push edi
push esi
call fcn.004021a0
mov ebx, dword [esp + 0x40]
add esp, 0x20
cmp ebx, 0x2800
jb 0x407745
mov ebx, 0x2800
lea edx, [esp + 0x30]
push edx
mov edx, dword [esp + 0x40]
lea eax, [ebp + ebp*4]
mov ecx, dword [edi + eax*8 + 0x10]
push ecx
push ebx
push edx
call fcn.004027f0
add esp, 0x10
test eax, eax
jne 0x407798
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
lea ecx, [esp + 0x10]
push ecx
call fcn.00402020
mov edx, dword [esp + 0x50]
add esp, 4
pop ebx
pop edi
pop esi
mov dword [edx], 0xffffffff
xor eax, eax
pop ebp
add esp, 0x28
ret
fld qword [esp + 0x30]
push ebx
sub esp, 8
lea eax, [esp + 0x1c]
fstp qword [esp]
push eax
call fcn.00402920
mov ebx, dword [esp + 0x20]
mov ecx, dword [esp + 0x34]
push ebx
push ebp
push edi
push ecx
push esi
call fcn.00402270
push ebx
mov dword [esp + 0x54], eax
call fcn.00402000
mov ebp, dword [esp + 0x6c]
mov ebx, dword [esp + 0x74]
add esp, 0x28
push 0
push 0
push 2
push 0
push 0
push 0x40000000
push ebp
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x407823
mov edx, dword [esp + 0x3c]
push 3
push 0x192
push ebp
push 0x7d9
push edx
call fcn.004062d0
lea eax, [esp + 0x24]
push eax
call fcn.00402020
add esp, 0x18
mov dword [ebx], edi
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x28
ret
mov edx, dword [esp + 0x28]
push 0
lea ecx, [esp + 0x20]
push ecx
push edx
push esi
push edi
mov dword [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x28]
cmp dword [esp + 0x1c], ecx
jne 0x40787f
test eax, eax
je 0x40787f
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [esp + 0x10]
push edx
call fcn.00402020
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x2c]
pop ebx
pop edi
pop esi
pop ebp
add esp, 0x28
ret
mov ecx, dword [esp + 0x3c]
push 3
push 0x1a9
push ebp
push 0x7d7
push ecx
call fcn.004062d0
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0x10]
push eax
call fcn.00402020
add esp, 4
mov dword [ebx], 0xffffffff
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x28
ret
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
push 1
push 0x197
push ecx
push 0x7d2
push edx
call fcn.004062d0
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x4c]
pop ebx
pop edi
pop esi
mov dword [ecx], 0xffffffff
xor eax, eax
pop ebp
add esp, 0x28
ret
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x3c]
push 3
push 0x196
push edx
push 0x7db
push eax
call fcn.004062d0
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x4c]
pop ebx
pop edi
pop esi
mov dword [edx], 0xffffffff
xor eax, eax
pop ebp
add esp, 0x28
ret