Function at 0x418b24
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x9a4
mov eax, dword [0x51a448]
xor eax, esp
mov dword [esp + 0x9a0], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor ebx, ebx
mov dword [esp + 0x18], eax
push 0x400
lea eax, [esp + 0x5ac]
mov dword [esp + 0x18], edx
push ebx
mov edi, ebx
mov dword [esp + 0x18], ebx
push eax
mov esi, ecx
mov dword [esp + 0x28], edi
mov dword [esp + 0x30], ebx
call fcn.0049ef70
add esp, 0xc
cmp dword [esp + 0x14], ebx
je 0x418e7d
push 4
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [esp + 0x14]
mov dword [ecx], eax
test eax, eax
je 0x418e61
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x4a0]
mov dword [eax], 4
call fcn.00404436
lea eax, [esp + 0x4a0]
push str.K7WebEvents.db
push eax
call fcn.004c99e0
push ebx
push 1
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x4b4]
push eax
call fcn.0047c88f
add esp, 0x18
test eax, eax
jne 0x418e5d
cmp byte [esi + 0xc], bl
jne 0x418bf1
mov eax, str.SELECT_DISTINCT__FROM_tblDownloads_WHERE_size____AND_utc_____ORDER_BY_utc_DESC_LIMIT__
jmp 0x418c1c
lea ebx, [esp + 0x5a8]
movzx eax, byte [esi + edi + 0xd]
push eax
push str._02X
push ebx
call fcn.00402a6e
add esp, 0xc
add ebx, 2
inc edi
cmp edi, 0x10
jl 0x418bf8
xor ebx, ebx
mov eax, str.SELECT_DISTINCT__FROM_tblDownloads_WHERE_md5____AND_utc_____ORDER_BY_utc_DESC_LIMIT__
mov edi, dword [esp + 0x1c]
lea ecx, [esp + 0x10]
push ebx
push ecx
push 0xffffffffffffffff
push eax
push edi
call fcn.004663b0
add esp, 0x14
test eax, eax
jne 0x418e61
cmp byte [esi + 0xc], al
jne 0x418c52
push dword [esi + 0xd]
push 1
push dword [esp + 0x18]
call fcn.00447541
add esp, 0xc
jmp 0x418c6b
push ebx
push 0x20
lea eax, [esp + 0x5b0]
push eax
push 1
push dword [esp + 0x20]
call fcn.004475d3
add esp, 0x14
test eax, eax
jne 0x418e61
push dword [esi + 4]
push 2
push dword [esp + 0x18]
call fcn.00447541
add esp, 0xc
test eax, eax
jne 0x418e61
push dword [esi + 8]
push 3
push dword [esp + 0x18]
call fcn.00447541
add esp, 0xc
test eax, eax
jne 0x418e61
mov edi, esi
mov esi, dword [esp + 0x14]
push dword [esp + 0x10]
call fcn.00446d52
pop ecx
sub eax, 0x64
jne 0x418e5a
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x18]
inc eax
mov dword [esp + 0x24], eax
imul eax, eax, 0x471
add eax, dword [ecx]
push eax
push dword [esi]
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov dword [esi], eax
test eax, eax
je 0x418cab
push 0x471
lea eax, [esp + 0x2c]
push ebx
push eax
call fcn.0049ef70
add esp, 0xc
mov dword [esp + 0x20], ebx
push ebx
push dword [esp + 0x14]
call fcn.004471b9
push eax
lea eax, [esp + 0x34]
push str._.1023s
push eax
call fcn.00402a6e
add esp, 0x14
push 1
push dword [esp + 0x14]
call fcn.004471b9
push eax
lea eax, [esp + 0x434]
push 0x50811c
push eax
call fcn.00402a6e
add esp, 0x14
lea eax, [esp + 0x441]
push eax
push ecx
push 3
push dword [esp + 0x1c]
call fcn.004470e8
push 3
push dword [esp + 0x24]
mov esi, eax
call fcn.004471b9
add esp, 0x14
mov edx, esi
mov ecx, eax
call fcn.00418a99
pop ecx
push 2
push dword [esp + 0x14]
call fcn.00447162
cdq
push 4
push dword [esp + 0x1c]
mov dword [esp + 0x448], eax
mov dword [esp + 0x44c], edx
call fcn.00447162
push 5
push dword [esp + 0x24]
mov dword [esp + 0x499], eax
call fcn.004471b9
add esp, 0x18
test eax, eax
je 0x418dea
lea ecx, [esp + 0x495]
mov dword [esp + 0x20], 1
push ecx
lea ecx, [esp + 0x495]
push ecx
lea ecx, [esp + 0x495]
push ecx
lea ecx, [esp + 0x495]
push ecx
lea ecx, [esp + 0x495]
push ecx
push str._d__d__d__d__d
push eax
call fcn.004015fb
add esp, 0x1c
movzx eax, byte [edi + 0xc]
sub eax, ebx
je 0x418e01
sub eax, 1
jne 0x418e08
mov byte [esp + 0x440], 1
jmp 0x418e08
mov byte [esp + 0x440], bl
mov esi, dword [esp + 0x14]
lea eax, [esp + 0x24]
push 4
push eax
push dword [esi]
call fcn.0049f810
add esp, 0xc
lea eax, [esp + 0x28]
push 0x471
push eax
mov eax, dword [esp + 0x20]
mov eax, dword [eax]
add eax, dword [esi]
push eax
call fcn.0049f810
mov ecx, dword [esp + 0x24]
add esp, 0xc
mov eax, dword [ecx]
add eax, 0x471
cmp dword [esp + 0x20], 0
mov dword [ecx], eax
jne 0x418cab
add eax, 0xffffffec
mov dword [ecx], eax
jmp 0x418cab
xor ebx, ebx
inc ebx
mov edi, dword [esp + 0x1c]
cmp dword [esp + 0x10], 0
je 0x418e72
push dword [esp + 0x10]
call fcn.004465d3
pop ecx
test edi, edi
je 0x418e7d
push edi
call fcn.0047b2a7
pop ecx
mov ecx, dword [esp + 0x9ac]
mov eax, ebx
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0049d307
mov esp, ebp
pop ebp
ret