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

Disassembly:
sub esp, 0x24
push ebx
push ebp
mov ebp, dword [esp + 0x34]
push esi
test ebp, ebp
push edi
jne 0x407d19
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
push ebp
call fcn.0040aa70
add esp, 4
test eax, eax
jne 0x407d2e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov eax, dword [ebp]
mov edi, 1
cmp eax, edi
mov dword [esp + 0x14], 0
jne 0x407f09
mov ebp, dword [ebp + 4]
push edi
push 0
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
cmp esi, 0xffffffff
jne 0x407d66
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov dword [esp + 0x18], 0
sub ebx, esi
test ebx, ebx
mov dword [esp + 0x2c], ebx
jle 0x407dca
push ebx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov edi, eax
lea eax, [esp + 0x1c]
mov dword [esp + 0x18], edi
push 0
push eax
push ebx
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x407db9
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
push 0
push 0
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, 1
mov eax, dword [esp + 0x38]
mov dword [esp + 0x14], edi
mov dword [esp + 0x28], edi
cmp eax, edi
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
jle 0x407ea3
lea eax, [esp + 0x48]
mov dword [esp + 0x20], eax
jmp 0x407df2
mov eax, dword [esp + 0x20]
mov ecx, dword [eax + 8]
xor ebx, ebx
cmp ecx, 0x80000004
jne 0x407e03
mov esi, dword [eax]
jmp 0x407e29
push eax
call fcn.0040af00
mov esi, eax
add esp, 4
test esi, esi
jne 0x407e24
lea ecx, [esp + 0x1c]
push eax
push ecx
push 2
push 0x424218
push ebp
call edi
jmp 0x407e77
mov ebx, 1
push esi
call dword [0x4244dc]
add esp, 4
test eax, eax
jle 0x407e62
lea edx, [esp + 0x1c]
push 0
push edx
push eax
push esi
push ebp
call edi
test eax, eax
je 0x407e5a
lea eax, [esp + 0x1c]
push 0
push eax
push 2
push 0x424218
push ebp
call edi
jmp 0x407e62
mov dword [esp + 0x14], 0
test ebx, ebx
je 0x407e6f
push esi
call sub.MSVCRT.dll_free
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
je 0x407ee8
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x38]
inc eax
add edx, 0xc
cmp eax, ecx
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], edx
jl 0x407dee
mov eax, dword [esp + 0x14]
test eax, eax
je 0x407ee8
mov ebx, dword [esp + 0x2c]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x408311
push 1
push 0
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
push 0
push ecx
push ebx
push edx
push ebp
mov esi, eax
call edi
test eax, eax
je 0x407ee0
push 0
push 0
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x407ee8
mov dword [esp + 0x14], 0
mov eax, dword [esp + 0x18]
test eax, eax
je 0x408311
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [esp + 0x18]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
cmp eax, 2
jne 0x40802c
mov ebp, dword [ebp + 4]
mov ecx, ebp
mov eax, dword [ebp]
call dword [eax + 0x14]
mov edx, dword [ebp]
lea eax, [esp + 0x30]
lea ecx, [esp + 0x2c]
push eax
push ecx
push 0xffffffffffffffff
push 0
mov ecx, ebp
call dword [edx + 0x30]
mov ebx, eax
xor esi, esi
test ebx, ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x20], esi
jle 0x407f6d
push ebx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov esi, dword [esp + 0x30]
mov ecx, ebx
mov edx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
add esp, 4
and ecx, 3
mov dword [esp + 0x20], eax
rep movsb byte es:[edi], byte [esi]
mov esi, eax
mov edi, 1
mov eax, dword [esp + 0x38]
mov dword [esp + 0x14], edi
cmp eax, edi
jle 0x407ff0
dec eax
lea ebx, [esp + 0x48]
mov dword [esp + 0x38], eax
mov eax, dword [ebx + 8]
xor edi, edi
cmp eax, 0x80000004
jne 0x407f92
mov esi, dword [ebx]
jmp 0x407fa6
push ebx
call fcn.0040af00
mov esi, eax
add esp, 4
test esi, esi
je 0x407fda
mov edi, 1
push esi
call dword [0x4244dc]
add esp, 4
test eax, eax
jle 0x407fbe
mov edx, dword [ebp]
push eax
push esi
mov ecx, ebp
call dword [edx + 0x24]
mov eax, dword [ebp]
push 2
push 0x424218
mov ecx, ebp
call dword [eax + 0x24]
test edi, edi
je 0x407fda
push esi
call sub.MSVCRT.dll_free
add esp, 4
mov eax, dword [esp + 0x38]
add ebx, 0xc
dec eax
mov dword [esp + 0x38], eax
jne 0x407f82
mov esi, dword [esp + 0x20]
mov ebx, dword [esp + 0x28]
test esi, esi
je 0x408311
mov edx, dword [ebp]
mov ecx, ebp
call dword [edx + 0x14]
mov edi, eax
mov eax, dword [ebp]
push ebx
push esi
mov ecx, ebp
call dword [eax + 0x24]
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov edx, dword [ebp]
add esp, 4
mov ecx, ebp
push 0
push edi
call dword [edx + 0x18]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
cmp eax, 3
jne 0x408311
mov ebx, dword [ebp + 4]
push edi
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
cmp esi, 0xffffffff
jne 0x408055
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
mov dword [esp + 0x18], 0
sub edi, esi
test edi, edi
mov dword [esp + 0x24], edi
jle 0x4080dd
push edi
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
lea ecx, [esp + 0x1c]
mov dword [esp + 0x18], eax
push 0
push ecx
push edi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4080aa
mov edx, dword [esp + 0x18]
push edx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov edx, dword [ebp + 0xc]
mov eax, dword [esp + 0x1c]
lea ecx, [ebp + 0x10]
mov dword [esp + 0x24], eax
push ecx
lea ecx, [ebp + 0x34]
push edx
mov edx, dword [esp + 0x20]
push ecx
push eax
push edx
push esi
call fcn.0040a650
add esp, 0x18
push 0
push 0
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [esp + 0x24]
mov ecx, dword [esp + 0x38]
mov eax, 1
cmp ecx, eax
mov byte [esp + 0x12], 0
mov byte [esp + 0x13], 0
mov dword [esp + 0x14], eax
mov dword [esp + 0x2c], eax
jle 0x4082a3
lea eax, [esp + 0x48]
mov dword [esp + 0x28], eax
jmp 0x40810e
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 8]
mov dword [esp + 0x20], 0
cmp ecx, 0x80000004
jne 0x408125
mov esi, dword [eax]
jmp 0x408186
push eax
call fcn.0040af00
mov esi, eax
add esp, 4
test esi, esi
jne 0x40817e
push 1
push eax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp + 0xc]
lea ecx, [ebp + 0x10]
push ecx
lea ecx, [ebp + 0x34]
push edx
push ecx
lea edx, [esp + 0x1e]
push 2
push edx
push eax
mov byte [esp + 0x2a], 0xd
mov byte [esp + 0x2b], 0xa
call fcn.0040a650
add esp, 0x18
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x12]
push esi
push eax
push 2
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x408276
mov dword [esp + 0x20], 1
push esi
call dword [0x4244dc]
mov edi, eax
add esp, 4
test edi, edi
mov dword [esp + 0x30], edi
jle 0x408255
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x4081cd
push edi
call sub.MSVCRT.dll_malloc
mov ecx, edi
mov edi, eax
mov edx, ecx
add esp, 4
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov dword [esp + 0x20], 1
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, eax
mov edi, edx
push 1
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [ebp + 0x10]
lea edx, [ebp + 0x34]
push ecx
mov ecx, dword [ebp + 0xc]
push ecx
push edx
push edi
push esi
push eax
call fcn.0040a650
add esp, 0x18
lea edx, [esp + 0x1c]
push 0
push edx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
push ebx
call edi
test eax, eax
je 0x40824d
push 1
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [ebp + 0x10]
lea edx, [esp + 0x12]
push ecx
mov ecx, dword [ebp + 0xc]
push ecx
lea ecx, [ebp + 0x34]
push ecx
push 2
push edx
push eax
mov byte [esp + 0x2a], 0xd
mov byte [esp + 0x2b], 0xa
call fcn.0040a650
add esp, 0x18
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x12]
push 0
push eax
push 2
push ecx
push ebx
call edi
jmp 0x408255
mov dword [esp + 0x14], 0
mov eax, dword [esp + 0x20]
test eax, eax
je 0x408266
push esi
call sub.MSVCRT.dll_free
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
je 0x408300
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x38]
inc eax
add edx, 0xc
cmp eax, ecx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], edx
jl 0x40810a
mov eax, dword [esp + 0x14]
test eax, eax
je 0x408300
mov eax, 1
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x408311
push eax
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
mov eax, dword [ebp + 0xc]
lea edx, [ebp + 0x10]
add ebp, 0x34
push edx
push eax
push ebp
mov ebp, dword [esp + 0x24]
push edi
push ebp
push esi
call fcn.0040a650
add esp, 0x18
lea ecx, [esp + 0x1c]
push 0
push ecx
push edi
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4082f6
push 0
push 0
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x408304
mov dword [esp + 0x14], 0
jmp 0x408304
mov ebp, dword [esp + 0x18]
test ebp, ebp
je 0x408311
push ebp
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret