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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov dword [esp], 1
call fcn.004070a2
test eax, eax
push edx
je 0x407940
mov dword [esp + 8], 5
mov dword [esp + 4], ebx
mov dword [esp], esi
call eax
sub esp, 0xc
test eax, eax
jne 0x407b9b
mov dword [0x42dea8], 0x4c554e
test ebx, ebx
je 0x4079a0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], ebx
call fcn.0040780e
sub esp, 0xc
mov dword [esp], eax
call sub.KERNEL32.dll_CloseHandle
push edi
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0x42dea8
mov dword [esp], ebx
call sub.KERNEL32.dll_GetShortPathNameA
sub esp, 0xc
cmp eax, 0x400
jg 0x407ba1
test eax, eax
je 0x407ba1
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0x42e2a8
mov dword [esp], esi
call sub.KERNEL32.dll_GetShortPathNameA
sub esp, 0xc
cmp eax, 0x400
jg 0x407ba1
test eax, eax
je 0x407ba1
mov dword [esp + 0xc], 0x42e2a8
mov dword [esp + 8], 0x42dea8
mov dword [esp + 4], str._s_s_r_n
mov dword [esp], 0x42e6a8
call sub.USER32.dll_wsprintfA
mov dword [ebp - 0x2c], eax
mov eax, dword [0x430948]
mov eax, dword [eax + 0x128]
mov dword [esp], 0x42e2a8
mov dword [esp + 4], eax
call fcn.00407417
push esi
push esi
mov dword [esp + 8], 4
mov dword [esp + 4], 0xc0000000
mov dword [esp], 0x42e2a8
call fcn.0040780e
sub esp, 0xc
mov edi, eax
cmp eax, 0xffffffff
je 0x407b9b
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.KERNEL32.dll_GetFileSize
mov edx, dword [ebp - 0x2c]
push ebx
push ebx
mov ebx, eax
lea eax, [eax + edx + 0xa]
mov dword [esp + 4], eax
mov dword [esp], 0x40
call sub.KERNEL32.dll_GlobalAlloc
mov esi, eax
test eax, eax
push ecx
push ecx
je 0x407b92
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov dword [esp], edi
call sub.KERNEL32.dll_ReadFile
sub esp, 0x14
test eax, eax
je 0x407b92
cmp ebx, dword [ebp - 0x1c]
jne 0x407b92
mov dword [esp + 4], str._Rename__r_n
mov dword [esp], esi
call fcn.00407899
test eax, eax
push edx
push edx
jne 0x407ad8
lea eax, [esi + ebx]
mov dword [esp + 4], str._Rename__r_n
mov dword [esp], eax
call fcn.00407326
add ebx, 0xa
push ecx
push ecx
mov ecx, ebx
jmp 0x407b1c
add eax, 0xa
mov dword [esp + 4], 0x40b397
mov dword [esp], eax
call fcn.00407899
mov ecx, ebx
test eax, eax
push edx
push edx
je 0x407b1c
lea ecx, [eax + 1]
add eax, dword [ebp - 0x2c]
mov dword [ebp - 0x3c], eax
lea eax, [esi + ebx]
mov dword [ebp - 0x30], eax
mov edx, ecx
mov dword [ebp - 0x40], ecx
mov eax, dword [ebp - 0x3c]
jmp 0x407b11
mov cl, byte [edx]
inc edx
mov byte [eax], cl
inc eax
cmp edx, dword [ebp - 0x30]
jb 0x407b0c
mov ecx, dword [ebp - 0x40]
sub ecx, esi
lea ecx, [esi + ecx]
mov edx, dword [ebp - 0x2c]
xor eax, eax
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x30], ecx
jmp 0x407b3a
mov ecx, dword [ebp - 0x30]
mov bl, byte [eax + 0x42e6a8]
dec edx
mov byte [ecx + eax], bl
inc eax
test edx, edx
jg 0x407b2c
mov ebx, dword [ebp - 0x3c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], edi
call sub.KERNEL32.dll_SetFilePointer
add ebx, dword [ebp - 0x2c]
sub esp, 0x10
lea eax, [ebp - 0x1c]
mov dword [esp + 4], esi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov dword [esp], edi
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
mov dword [esp], esi
call sub.KERNEL32.dll_GlobalFree
push esi
mov dword [esp], edi
call sub.KERNEL32.dll_CloseHandle
push ebx
inc dword [0x4308f8]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 8