Function at 0x805aa7
Capabilities:
Copy file
Delete file
Get common file path
Get file size

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x410
push ebx
xor ebx, ebx
push edi
mov byte [esi + 0x4a8], bl
mov byte [esi + 0x4a9], bl
call fcn.00802e9c
movzx eax, ax
push 0x64
cdq
pop ecx
idiv ecx
cmp edx, 0x4b
jge 0x805ada
mov byte [esi + 0x4a8], 1
cmp byte [esi + 0x4a8], bl
jne 0x805b07
lea eax, [esi + 0x5ab]
push 0x104
push eax
push ebx
mov byte [esi + 0x4aa], bl
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
push esi
call fcn.00805a22
pop ecx
jmp 0x805d24
lea eax, [ebp - 0x410]
mov edi, 0x104
push eax
push edi
mov byte [esi + 0x4aa], 1
call dword [sym.imp.KERNEL32.DLL_GetTempPathA]
cmp byte [ebp - 0x410], bl
je 0x805d91
lea eax, [ebp - 0x10c]
push eax
push ebx
lea eax, [ebp - 0x410]
push 0x8022d0
push eax
call dword [sym.imp.KERNEL32.DLL_GetTempFileNameA]
lea eax, [ebp - 0x410]
push edi
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
lea eax, [ebp - 0x10c]
push ebx
push eax
lea eax, [ebp - 0x410]
push eax
call dword [sym.imp.KERNEL32.DLL_CopyFileA]
lea eax, [ebp - 0x10c]
push eax
call fcn.008059eb
pop ecx
lea eax, [ebp - 0x410]
push eax
push edi
mov byte [esi + 0x5ab], bl
call dword [sym.imp.KERNEL32.DLL_GetTempPathA]
lea edi, [esi + 0x5ab]
lea eax, [ebp - 0x410]
push edi
push ebx
push 0x8022d0
push eax
call dword [sym.imp.KERNEL32.DLL_GetTempFileNameA]
cmp byte [edi], bl
je 0x805d91
mov byte [esi + 0x4a9], bl
call fcn.00802e9c
movzx eax, ax
push 0x64
cdq
pop ecx
idiv ecx
cmp edx, 0x32
jge 0x805bce
mov byte [esi + 0x4a9], 1
cmp byte [esi + 0x4a9], bl
jne 0x805be3
lea eax, [esi + 0x4ab]
push eax
push edi
jmp 0x805ce4
lea eax, [esi + 0x408]
push eax
lea eax, [ebp - 0x30c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcpyA]
mov edi, dword [sym.imp.KERNEL32.DLL_lstrcatA]
lea eax, [ebp - 0x30c]
push 0x8014b0
push eax
call edi
call fcn.00802e9c
movzx eax, ax
push 5
cdq
pop ecx
idiv ecx
cmp edx, ebx
je 0x805c3e
jle 0x805c37
cmp edx, 2
jle 0x805c30
cmp edx, 3
jne 0x805c37
push 0x802300
jmp 0x805c43
push 0x8022fc
jmp 0x805c43
push 0x8022f8
jmp 0x805c43
push 0x8022f4
lea eax, [ebp - 0x30c]
push eax
call edi
call fcn.00802e9c
movzx eax, ax
cdq
mov ecx, 0xc8
idiv ecx
add edx, 0x1e
cmp edx, ebx
jle 0x805c79
mov dword [ebp - 4], edx
lea eax, [ebp - 0x30c]
push 0x801a50
push eax
call edi
dec dword [ebp - 4]
jne 0x805c66
lea eax, [ebp - 0x30c]
push 0x8014b0
push eax
call edi
call fcn.00802e9c
movzx eax, ax
push 3
cdq
pop ecx
idiv ecx
lea eax, [ebp - 0x30c]
sub edx, ebx
je 0x805cc0
dec edx
je 0x805cb1
push 0x8022f0
push eax
call edi
push 0x8022ec
jmp 0x805ccd
push 0x8022e8
push eax
call edi
push 0x8022e4
jmp 0x805ccd
push 0x8022e0
push eax
call edi
push 0x8022dc
lea eax, [ebp - 0x30c]
push eax
call edi
lea eax, [ebp - 0x30c]
push eax
lea eax, [esi + 0x5ab]
push eax
lea eax, [ebp - 0x10c]
push eax
call fcn.00805316
add esp, 0xc
test eax, eax
lea eax, [ebp - 0x10c]
push eax
jne 0x805d8b
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
lea eax, [esi + 0x408]
push eax
lea eax, [esi + 0x4ab]
push 0x8022d4
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push ebx
push 0x80
push 3
push ebx
push 3
lea edi, [esi + 0x5ab]
push bind
push edi
mov dword [ebp - 8], edi
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x805d82
cmp eax, 0xffffffff
je 0x805d82
push ebx
push eax
lea edi, [esi + 0x6b0]
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
push dword [ebp - 4]
mov dword [edi], eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp dword [edi], 0x400
jge 0x805d7e
cmp byte [esi + 0x4aa], bl
je 0x805d91
push dword [ebp - 8]
jmp 0x805d8b
xor eax, eax
jmp 0x805d94
cmp byte [esi + 0x4aa], bl
je 0x805d91
push edi
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
xor eax, eax
inc eax
pop edi
pop ebx
leave
ret