Function at 0x508937
Capabilities:
Delete file
Get common file path
Get file size

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30c
push ebx
xor ebx, ebx
push edi
mov byte [esi + 0x1b4], bl
mov byte [esi + 0x1b5], bl
call fcn.00505808
movzx eax, ax
push 0x64
cdq
pop ecx
idiv ecx
cmp edx, 0x57
jge 0x50896a
mov byte [esi + 0x1b4], 1
cmp byte [esi + 0x1b4], bl
jne 0x508993
lea eax, [esi + 0x2b7]
push 0x104
push eax
push ebx
mov byte [esi + 0x1b6], bl
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
jmp 0x508a61
lea eax, [ebp - 0x30c]
mov edi, 0x104
push eax
push edi
mov byte [esi + 0x1b6], 1
mov byte [ebp - 0x30c], bl
call dword [sym.imp.KERNEL32.DLL_GetTempPathA]
cmp byte [ebp - 0x30c], bl
je 0x508bcf
lea eax, [esi + 0x2b7]
mov dword [ebp - 4], eax
push eax
mov byte [eax], bl
push ebx
lea eax, [ebp - 0x30c]
push 0x504734
push eax
call dword [sym.imp.KERNEL32.DLL_GetTempFileNameA]
mov eax, dword [ebp - 4]
cmp byte [eax], bl
je 0x508bcf
lea eax, [ebp - 0x30c]
push edi
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
mov byte [esi + 0x1b5], bl
call fcn.00505808
movzx eax, ax
push 0x64
cdq
pop ecx
idiv ecx
cmp edx, 0x3c
jge 0x508a18
mov byte [esi + 0x1b5], 1
cmp byte [esi + 0x1b5], bl
jne 0x508ac8
lea eax, [esi + 0x1b7]
push eax
lea eax, [ebp - 0x30c]
push dword [ebp - 4]
push eax
call fcn.0050819c
add esp, 0xc
test eax, eax
jne 0x508bcf
lea eax, [esi + 0x184]
push eax
lea eax, [esi + 0x1b7]
push 0x50472c
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push ebx
push 0x80
push 3
push ebx
push 3
push connect
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
cmp eax, ebx
mov dword [ebp - 8], eax
je 0x508bbe
cmp eax, 0xffffffff
je 0x508bbe
push ebx
push eax
lea edi, [esi + 0x3bc]
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
push dword [ebp - 8]
mov dword [edi], eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov edi, dword [edi]
cmp edi, 0x400
jl 0x508bbe
cmp edi, 0x4b000
jg 0x508bbe
xor eax, eax
jmp 0x508bd2
lea eax, [esi + 0x184]
push eax
lea eax, [ebp - 0x208]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcpyA]
mov edi, dword [sym.imp.KERNEL32.DLL_lstrcatA]
lea eax, [ebp - 0x208]
push 0x504728
push eax
call edi
call fcn.00505808
movzx eax, ax
push 0xa
cdq
pop ecx
idiv ecx
cmp edx, 7
ja case.default.0x508b03
jmp dword [edx*4 + 0x508bd6]
push 0x503800
jmp 0x508b40
push 0x503854
jmp 0x508b40
push 0x50381c
jmp 0x508b40
push 0x5037fc
jmp 0x508b40
push 0x5037f4
jmp 0x508b40
push 0x504724
jmp 0x508b40
push 0x504720
jmp 0x508b40
push 0x503858
lea eax, [ebp - 0x208]
push eax
call edi
call fcn.00505808
movzx eax, ax
push 0x78
cdq
pop ecx
idiv ecx
add edx, 0x28
cmp edx, ebx
jle 0x508b74
mov dword [ebp - 8], edx
lea eax, [ebp - 0x208]
push 0x503788
push eax
call edi
dec dword [ebp - 8]
jne 0x508b61
lea eax, [ebp - 0x208]
push 0x504728
push eax
call edi
call fcn.00505808
movzx eax, ax
push 3
cdq
pop ecx
idiv ecx
lea eax, [ebp - 0x208]
sub edx, ebx
je 0x508bab
dec edx
je 0x508ba4
push 0x504564
jmp 0x508bb0
push 0x50456c
jmp 0x508bb0
push 0x504570
push eax
call edi
lea eax, [ebp - 0x208]
jmp 0x508a2a
cmp byte [esi + 0x1b6], bl
je 0x508bcf
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
xor eax, eax
inc eax
pop edi
pop ebx
leave
ret