Function at 0x4064b0
Capabilities:
Check for time delay via gettickcount
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0xf8
mov eax, dword [0x43b040]
xor eax, esp
mov dword [esp + 0xf4], eax
push esi
mov esi, ecx
mov byte [esp + 7], dl
imul ecx, esi, 0x70
push edi
mov edi, dword [ebp + 8]
mov dword [esp + 0x2c], edi
mov dword [esp + 0x20], ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [esp + 0x20]
mov dword [ecx + 0x508fcc], eax
movzx eax, byte [esp + 0xb]
cmp eax, 0x30
ja case.0x406505.6
movzx eax, byte [eax + 0x406a94]
jmp dword [eax*4 + 0x406a64]
push 8
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 0x10008c1
push eax
push esi
mov dword [esp + 0x34], 0
call fcn.00409570
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x20]
add eax, 6
movzx esi, word [edi + 0x38]
movzx edi, word [edi + 4]
push eax
lea ecx, [ecx + 0x508f90]
push 0x32
push ecx
call fcn.00410ff3
mov ecx, dword [esp + 0x2c]
add esp, 0xc
push esi
push edi
lea eax, [ecx + 0x508f90]
mov word [ecx + 0x508fc2], di
push eax
push dword [ecx + 0x508f6c]
mov word [ecx + 0x508fc4], si
push str._ServerManager___d__ServerInfo___s____d____d_
push 0
call fcn.0040a1b0
add esp, 0x18
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, edi
call fcn.00406ad0
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
movzx eax, word [edi + 4]
lea ecx, [edi + 6]
movq xmm0, qword [ecx]
mov word [esp + 0x10], ax
movzx eax, word [ecx + 8]
mov word [esp + 0x1a], ax
mov al, byte [ecx + 0xa]
mov byte [esp + 0x1c], al
lea eax, [esp + 0x30]
push ecx
push eax
mov word [esp + 0x14], 0x12c1
mov byte [esp + 0x16], 2
movq qword [esp + 0x1a], xmm0
mov byte [esp + 0x25], 1
call fcn.004039c0
test al, al
jne 0x40661b
push 0x12
lea eax, [esp + 0x10]
mov byte [esp + 0x21], 0
push eax
push esi
call fcn.00409570
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
mov ax, word [esp + 0x4c]
cmp ax, word [edi + 4]
jne 0x4065f5
mov ecx, dword [esp + 0x20]
mov ax, word [esp + 0x4e]
cmp ax, word [ecx + 0x508fc4]
jne 0x4065f5
cmp byte [esp + 0x50], 0
je 0x406650
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x54]
cmp eax, 0x7530
jb 0x4065f5
lea eax, [edi + 6]
push eax
push str.EXEC_WZ_DISCONNECT_MEMB__s
push 0x43bfa0
call fcn.004083b0
add esp, 0xc
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push 2
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
push 0x12
lea eax, [esp + 0x10]
push eax
push esi
call fcn.00409570
movups xmm0, xmmword [esp + 0x30]
sub esp, 0x40
mov eax, esp
movups xmmword [eax], xmm0
movups xmm0, xmmword [esp + 0x80]
movups xmmword [eax + 0x10], xmm0
movups xmm0, xmmword [esp + 0x90]
movups xmmword [eax + 0x20], xmm0
movups xmm0, xmmword [esp + 0xa0]
movups xmmword [eax + 0x30], xmm0
call fcn.00403ec0
movzx eax, word [esp + 0x4e]
push eax
lea eax, [esp + 0x3f]
push eax
lea eax, [esp + 0x38]
push eax
push str._AccountInfo__Account_disconnected__Account:__s__IpAddress:__s__GameServerCode:__d_
push 1
push 0x43bb70
call fcn.004079a0
add esp, 0x18
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, edi
call fcn.00407390
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, edi
call fcn.00407540
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
lea eax, [edi + 6]
push eax
lea eax, [esp + 0x34]
push eax
call fcn.004039c0
test al, al
je case.0x406505.6
movzx eax, word [edi + 4]
lea ecx, [edi + 6]
movq xmm0, qword [ecx]
push ecx
push 0x508d8c
push 0x508df4
mov word [esp + 0x1c], ax
movzx eax, word [ecx + 8]
push 0x508dc0
mov word [esp + 0x2a], ax
mov al, byte [ecx + 0xa]
push str.SELECT__s_FROM__s_WHERE__s_s
push 0x43bfa0
mov word [esp + 0x24], 0x14c1
mov byte [esp + 0x26], 5
movq qword [esp + 0x2a], xmm0
mov byte [esp + 0x34], al
call fcn.004083b0
add esp, 0x18
test al, al
je 0x4067ff
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x4067ff
push 0x508dc0
call fcn.00408650
push dword [0x43bfac]
mov word [esp + 0x22], ax
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push 2
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
push 0x14
lea eax, [esp + 0x10]
push eax
push esi
call fcn.00409570
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push 2
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
xor eax, eax
mov word [esp + 0x1e], ax
lea eax, [esp + 0xc]
push 0x14
push eax
push esi
call fcn.00409570
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
lea eax, [edi + 6]
push eax
lea eax, [esp + 0x34]
push eax
call fcn.004039c0
test al, al
je case.0x406505.6
movups xmm0, xmmword [esp + 0x30]
xor eax, eax
mov byte [esp + 0x50], 0
mov dword [esp + 0x5c], eax
sub esp, 0x40
mov dword [esp + 0xa0], eax
mov dword [esp + 0xa4], eax
mov dword [esp + 0xa8], eax
mov dword [esp + 0xac], eax
mov eax, esp
mov dword [esp + 0x94], 0
mov dword [esp + 0x98], 0xffffffff
movups xmmword [eax], xmm0
movups xmm0, xmmword [esp + 0x80]
movups xmmword [eax + 0x10], xmm0
movups xmm0, xmmword [esp + 0x90]
movups xmmword [eax + 0x20], xmm0
movups xmm0, xmmword [esp + 0xa0]
movups xmmword [eax + 0x30], xmm0
call fcn.00403b80
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
push dword [edi + 0x14]
movzx eax, word [edi + 0x12]
push eax
lea eax, [edi + 6]
push eax
push str.EXEC_WZ_SetAccountLevel__s__d__d
push 0x43bfa0
call fcn.004083b0
add esp, 0x14
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLFetch]
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push 2
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
movzx eax, word [edi + 4]
mov dword [ecx + 0x508fd0], eax
movzx eax, word [edi + 6]
mov dword [ecx + 0x508fd4], eax
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
lea eax, [edi + 3]
push eax
lea eax, [esp + 0x34]
push eax
call fcn.004039c0
test al, al
je case.0x406505.6
mov ecx, dword [esp + 0x4e]
call fcn.0040a300
mov edx, eax
test edx, edx
je case.0x406505.6
mov ax, word [esp + 0x38]
mov cx, word [esp + 0x4c]
movq xmm0, qword [esp + 0x30]
mov word [esp + 0x1a], ax
mov al, byte [esp + 0x3a]
mov byte [esp + 0x1c], al
lea eax, [esp + 0xc]
push 0x12
push eax
push dword [edx + 4]
mov word [esp + 0x18], 0x12c1
mov byte [esp + 0x1a], 2
mov word [esp + 0x1c], cx
movq qword [esp + 0x1e], xmm0
mov byte [esp + 0x29], 0
call fcn.00409570
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret
lea eax, [edi + 8]
mov word [esp + 0x70], 0x88c1
push eax
lea eax, [esp + 0x7c]
mov byte [esp + 0x76], 0x2f
push 0x7d
push eax
call fcn.00410ff3
mov eax, dword [edi + 4]
add esp, 0xc
mov dword [esp + 0x74], eax
xor esi, esi
nop dword [eax + eax]
mov ecx, dword [esi + 0x508f6c]
test ecx, ecx
js 0x406a45
cmp ecx, 0x190
jge 0x406a45
cmp dword [esi + 0x508f70], 0
je 0x406a45
cmp dword [esi + 0x508f84], 0xffffffff
je 0x406a45
movzx eax, byte [esp + 0x71]
push eax
lea eax, [esp + 0x74]
push eax
push ecx
call fcn.00409570
add esi, 0x70
cmp esi, 0xaf00
jl 0x406a10
mov ecx, dword [esp + 0xfc]
pop edi
pop esi
xor ecx, esp
call fcn.0040c2a3
mov esp, ebp
pop ebp
ret