Function at 0x408521
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebx, dword [ebp + 0xc]
mov dword [esp + 4], 0x40b75e
mov dword [esp], 0x469d00
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
test ebx, ebx
push eax
mov esi, dword [sym.imp.KERNEL32.dll_GetShortPathNameW]
push eax
jne 0x40857d
mov eax, dword [ebp + 8]
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0x469500
mov dword [esp], eax
call esi
sub esp, 0xc
cmp eax, 0x400
jg 0x40876f
test eax, eax
jne 0x4085ce
jmp 0x40876f
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], ebx
call fcn.00407c94
sub esp, 0xc
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0x469d00
mov dword [esp], ebx
call esi
sub esp, 0xc
cmp eax, 0x400
jg 0x40876f
test eax, eax
jne 0x40854e
jmp 0x40876f
mov dword [esp + 0xc], 0x469500
mov dword [esp + 8], 0x469d00
mov dword [esp + 4], str._ls_ls_r_n
mov dword [esp], 0x469100
call dword [sym.imp.USER32.dll_wsprintfA]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x473c00]
mov eax, dword [eax + 0x128]
mov dword [esp], 0x469500
mov dword [esp + 4], eax
call fcn.004081cb
push esi
push esi
mov dword [esp + 8], 4
mov dword [esp + 4], 0xc0000000
mov dword [esp], 0x469500
call fcn.00407c94
sub esp, 0xc
cmp eax, 0xffffffff
mov edi, eax
je 0x40876f
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
mov eax, dword [ebp - 0x1c]
push ecx
push ecx
add eax, esi
mov dword [esp], 0x40
mov dword [ebp - 0x24], eax
add eax, 0xa
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
push ebx
push ebx
mov ebx, eax
je 0x408765
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.00407d61
sub esp, 0xc
test eax, eax
je 0x408765
mov dword [esp + 4], str._Rename__r_n
mov dword [esp], ebx
call fcn.00407b67
test eax, eax
push edx
push edx
jne 0x4086c8
lea eax, [ebx + esi]
mov dword [esp + 4], str._Rename__r_n
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea edx, [esi + 0xa]
push eax
push eax
mov esi, edx
jmp 0x408705
add eax, 0xa
mov dword [esp + 4], 0x40b77b
mov dword [esp], eax
call fcn.00407b67
test eax, eax
push ecx
mov dword [ebp - 0x20], eax
push ecx
mov edx, esi
je 0x408705
mov ecx, dword [ebp - 0x24]
lea edx, [ebx + esi]
add ecx, ebx
cmp edx, dword [ebp - 0x20]
jbe 0x4086fd
dec edx
mov al, byte [edx + 1]
dec ecx
mov byte [ecx + 1], al
jmp 0x4086ee
mov eax, dword [ebp - 0x20]
sub eax, ebx
lea edx, [eax + 1]
mov eax, dword [ebp - 0x1c]
add edx, ebx
mov dword [esp + 4], 0x469100
mov dword [esp], edx
mov dword [esp + 8], eax
call fcn.00407bd6
add esi, dword [ebp - 0x1c]
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]
sub esp, 0x10
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], edi
call fcn.00407da7
sub esp, 0xc
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edx
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret