Function at 0x407d5c
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, 0x4c
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov dword [esp], 1
call fcn.00407d0c
push edx
test eax, eax
jne 0x407d8c
mov dword [0x42e4b8], 0x4c554e
test ebx, ebx
jne 0x407dda
jmp 0x407daa
mov dword [esp + 8], 5
mov dword [esp + 4], ebx
mov dword [esp], esi
call eax
sub esp, 0xc
test eax, eax
jne 0x407fe9
jmp 0x407d7c
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0x42e8b8
mov dword [esp], esi
call sub.KERNEL32.dll_GetShortPathNameA
sub esp, 0xc
cmp eax, 0x400
jg 0x407fef
test eax, eax
je 0x407fef
jmp 0x407e2d
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], ebx
call fcn.004075c5
sub esp, 0xc
mov dword [esp], eax
call sub.KERNEL32.dll_CloseHandle
push eax
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0x42e4b8
mov dword [esp], ebx
call sub.KERNEL32.dll_GetShortPathNameA
sub esp, 0xc
cmp eax, 0x400
jg 0x407fef
test eax, eax
jne 0x407daa
jmp 0x407fef
mov dword [esp + 0xc], 0x42e8b8
mov dword [esp + 8], 0x42e4b8
mov dword [esp + 4], str._s_s_r_n
mov dword [esp], 0x42ecb8
call sub.USER32.dll_wsprintfA
mov dword [ebp - 0x2c], eax
mov eax, dword [0x4307fc]
mov eax, dword [eax + 0x128]
mov dword [esp + 4], eax
mov dword [esp], 0x42e8b8
call fcn.00407935
push edi
push edi
mov dword [esp + 8], 4
mov dword [esp + 4], 0xc0000000
mov dword [esp], 0x42e8b8
call fcn.004075c5
sub esp, 0xc
mov edi, eax
cmp eax, 0xffffffff
je 0x407fe9
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.KERNEL32.dll_GetFileSize
push ecx
push ecx
mov ebx, eax
mov edx, dword [ebp - 0x2c]
lea eax, [eax + edx + 0xa]
mov dword [esp + 4], eax
mov dword [esp], 0x40
call sub.KERNEL32.dll_GlobalAlloc
push esi
push esi
mov esi, eax
test eax, eax
je 0x407fe0
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x1c]
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 0x407fe0
cmp ebx, dword [ebp - 0x1c]
jne 0x407fe0
mov dword [esp + 4], str._Rename__r_n
mov dword [esp], esi
call fcn.00407509
push edx
push edx
test eax, eax
jne 0x407f35
mov dword [esp + 4], str._Rename__r_n
lea eax, [esi + ebx]
mov dword [esp], eax
call fcn.004077f4
push ecx
push ecx
add ebx, 0xa
jmp 0x407f71
mov dword [esp + 4], 0x40b397
add eax, 0xa
mov dword [esp], eax
call fcn.00407509
push edx
push edx
test eax, eax
je 0x407f71
inc eax
mov dword [ebp - 0x30], eax
mov edx, eax
lea ecx, [esi + ebx]
mov dword [ebp - 0x34], ecx
jmp 0x407f65
mov al, byte [edx]
mov ecx, dword [ebp - 0x2c]
mov byte [edx + ecx], al
inc edx
cmp edx, dword [ebp - 0x34]
jb 0x407f5c
mov eax, dword [ebp - 0x30]
sub eax, esi
jmp 0x407f73
mov eax, ebx
mov edx, dword [ebp - 0x2c]
mov dword [esp + 8], edx
mov dword [esp + 4], 0x42ecb8
add eax, esi
mov dword [esp], eax
call fcn.00407572
sub esp, 0xc
add ebx, dword [ebp - 0x2c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], edi
call sub.KERNEL32.dll_SetFilePointer
sub esp, 0x10
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x1c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov dword [esp], edi
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
mov dword [esp], esi
call sub.KERNEL32.dll_GlobalFree
push ebx
mov dword [esp], edi
call sub.KERNEL32.dll_CloseHandle
push ecx
inc dword [0x4307cc]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 8