Function at 0x407a20
Capabilities:
Get file size
Read file on windows

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x28
test eax, eax
push ebx
push ebp
je 0x407d8c
mov ebx, dword [esp + 0x3c]
test ebx, ebx
je 0x407d8c
mov ebp, dword [esp + 0x40]
test ebp, ebp
je 0x407d8c
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov dword [esp + 0x18], 0
call edi
push ebx
mov esi, eax
call edi
lea ebx, [esi + eax + 0x10]
mov esi, dword [esp + 0x3c]
test esi, esi
je 0x407a72
push esi
call edi
add ebx, eax
push 0
push 0x80
push 4
push 0
push 0
push 0xc0000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x20], ebp
je 0x407d7e
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
jne 0x407aac
xor edi, edi
lea eax, [esp + 0x34]
lea ecx, [edi + ebx]
push eax
push ecx
call fcn.00407ed0
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x407d77
xor eax, eax
xor ebp, ebp
xor edx, edx
cmp edi, eax
mov byte [ebx], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x10], ebp
mov dword [esp + 0x48], eax
mov dword [esp + 0x18], edx
je 0x407bb6
lea edx, [esp + 0x28]
mov dword [esp + 0x14], eax
push edx
push edi
call fcn.00407ed0
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x407d6a
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x24]
push 0
push eax
push edi
push ebp
push ecx
mov dword [esp + 0x38], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x407b97
cmp dword [esp + 0x24], edi
jne 0x407b97
mov edx, dword [esp + 0x28]
push 0
push edx
push ebp
push ebx
mov dword [esp + 0x24], 1
call fcn.00407e30
mov eax, dword [esp + 0x38]
add esp, 0x10
test esi, esi
mov byte [eax + ebx], 0
je 0x407b80
cmp byte [esi], 0
je 0x407b80
lea ecx, [esp + 0x10]
push esi
push ecx
push ebx
call fcn.00407860
add esp, 0xc
mov dword [esp + 0x1c], eax
test eax, eax
je 0x407b97
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x18], edx
lea edx, [esp + 0x18]
push ecx
push edx
push eax
jmp 0x407b8b
mov eax, dword [esp + 0x40]
lea ecx, [esp + 0x18]
push eax
push ecx
push ebx
call fcn.00407900
add esp, 0xc
mov dword [esp + 0x48], eax
push ebp
call fcn.00407f40
mov eax, dword [esp + 0x18]
add esp, 4
test eax, eax
je 0x407d6a
mov ebp, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
xor eax, eax
mov dword [esp + 0x14], eax
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, ecx
test edx, edx
mov dword [esp + 0x2c], esi
je 0x407c2c
mov eax, dword [esp + 0x48]
test eax, eax
jne 0x407bdc
mov dword [esp + 0x48], edx
mov edi, dword [esp + 0x44]
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ebp, eax
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x18]
sub edx, eax
sub esi, eax
add ebp, edx
lea ecx, [esi + ebx + 1]
push ebp
push ecx
push eax
call fcn.00407da0
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, eax
mov esi, edi
mov edi, dword [esp + 0x48]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x2c]
jmp 0x407cf6
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x407c48
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x407c48
cmp byte [eax], 0
je 0x407c48
mov edi, 1
jmp 0x407c4a
xor edi, edi
test ebp, ebp
jne 0x407c55
lea ebp, [esi + ebx]
mov dword [esp + 0x10], ebp
mov ecx, dword [esp + 0x40]
mov al, byte [ebp]
mov ebp, dword [sym.imp.KERNEL32.dll_lstrlenA]
push ecx
mov byte [esp + 0x4c], al
call ebp
mov edx, eax
mov eax, dword [esp + 0x44]
mov dword [esp + 0x2c], edx
push eax
call ebp
test edi, edi
mov ecx, dword [esp + 0x2c]
lea ebp, [ecx + eax + 3]
je 0x407c91
mov edx, dword [esp + 0x3c]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ebp, [eax + ebp + 4]
mov eax, dword [esp + 0x10]
mov ecx, esi
sub ecx, eax
push ebp
lea edx, [ecx + ebx + 1]
push edx
push eax
call fcn.00407da0
add esp, 0xc
test edi, edi
je 0x407ccf
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
push eax
mov eax, dword [esp + 0x14]
push ecx
push edx
push str._r_n__s__r_n_s_s
push eax
call fcn.00419629
add esp, 0x14
jmp 0x407ceb
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x10]
push ecx
push edx
push str._r_n_s_s
push eax
call fcn.00419629
add esp, 0x10
mov ecx, dword [esp + 0x10]
mov dl, byte [esp + 0x48]
mov byte [ecx + ebp], dl
lea eax, [esp + 0x1c]
add ebp, esi
push eax
push ebp
call fcn.00407ed0
mov edi, eax
add esp, 8
test edi, edi
je 0x407d6a
mov ecx, dword [esp + 0x1c]
push 1
push ecx
push ebx
push edi
call fcn.00407e30
mov esi, dword [esp + 0x30]
add esp, 0x10
push 0
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea edx, [esp + 0x30]
push 0
mov eax, dword [esp + 0x20]
push edx
push eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x407d61
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x30]
cmp ecx, eax
jne 0x407d61
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov dword [esp + 0x14], 1
push edi
call fcn.00407f40
add esp, 4
push ebx
call fcn.00407f40
mov ebp, dword [esp + 0x24]
add esp, 4
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret 0x10
pop ebp
xor eax, eax
pop ebx
add esp, 0x28
ret 0x10