Function at 0x4080a7
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], 2
call fcn.0040802f
test eax, eax
push edx
jne 0x4080dd
test ebx, ebx
mov dword [0x42ab40], 0x4c554e
mov edi, dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
jne 0x4080fb
jmp 0x40814b
mov dword [esp + 8], 5
mov dword [esp + 4], ebx
mov dword [esp], esi
call eax
sub esp, 0xc
test eax, eax
jne 0x40833e
jmp 0x4080c7
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], ebx
call fcn.00407820
sub esp, 0xc
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0x42ab40
mov dword [esp], ebx
call edi
sub esp, 0xc
test eax, eax
je 0x408344
cmp eax, 0x400
jg 0x408344
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0x42a740
mov dword [esp], esi
call edi
sub esp, 0xc
test eax, eax
je 0x408344
cmp eax, 0x400
jg 0x408344
mov dword [esp + 0xc], 0x42a740
mov dword [esp + 8], 0x42ab40
mov dword [esp + 4], str._s_s_r_n
mov dword [esp], 0x42a340
call dword [sym.imp.USER32.dll_wsprintfA]
mov dword [ebp - 0x2c], eax
mov eax, dword [0x42bc20]
mov eax, dword [eax + 0x128]
mov dword [esp], 0x42a740
mov dword [esp + 4], eax
call fcn.00407bae
push edi
push edi
mov dword [esp + 8], 4
mov dword [esp + 4], 0xc0000000
mov dword [esp], 0x42a740
call fcn.00407820
sub esp, 0xc
cmp eax, 0xffffffff
mov edi, eax
je 0x40833e
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov eax, dword [ebp - 0x2c]
push ecx
push ecx
lea eax, [ebx + eax + 0xa]
mov dword [esp], 0x40
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
push esi
push esi
mov esi, eax
je 0x408334
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov dword [esp], edi
mov dword [esp + 0xc], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x408334
cmp ebx, dword [ebp - 0x1c]
jne 0x408334
mov dword [esp + 4], str._Rename__r_n
mov dword [esp], esi
call fcn.0040775c
test eax, eax
push edx
push edx
jne 0x408284
lea eax, [esi + ebx]
mov dword [esp + 4], str._Rename__r_n
add ebx, 0xa
mov dword [esp], eax
call fcn.00407a5e
mov edx, ebx
push eax
push eax
jmp 0x4082c3
add eax, 0xa
mov dword [esp + 4], 0x40b3fc
mov dword [esp], eax
call fcn.0040775c
test eax, eax
push ecx
mov edx, ebx
push ecx
je 0x4082c3
inc eax
mov dword [ebp - 0x30], eax
mov edx, eax
lea eax, [esi + ebx]
mov dword [ebp - 0x34], eax
cmp edx, dword [ebp - 0x34]
jae 0x4082bc
mov cl, byte [edx]
mov eax, dword [ebp - 0x2c]
inc edx
mov byte [edx + eax - 1], cl
jmp 0x4082ab
mov eax, dword [ebp - 0x30]
sub eax, esi
mov edx, eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], 0x42a340
mov dword [esp + 8], eax
lea eax, [esi + edx]
mov dword [esp], eax
call fcn.004077cb
add ebx, dword [ebp - 0x2c]
sub esp, 0xc
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0x1c]
sub esp, 0x10
mov dword [esp + 0x10], 0
mov dword [esp + 8], ebx
mov dword [esp + 0xc], eax
mov dword [esp + 4], esi
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edx
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
inc dword [0x42bbf0]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 8