Function at 0x4064e0
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.0x406535.6
movzx eax, byte [eax + 0x406ac4]
jmp dword [eax*4 + 0x406a94]
push 8
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 0x10008c1
push eax
push esi
mov dword [esp + 0x34], 0
call fcn.00409580
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.00411013
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.0040a1d0
add esp, 0x18
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2c6
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, edi
call fcn.00406b00
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2c6
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 0x40664b
push 0x12
lea eax, [esp + 0x10]
mov byte [esp + 0x21], 0
push eax
push esi
call fcn.00409580
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2c6
mov esp, ebp
pop ebp
ret
mov ax, word [esp + 0x4c]
cmp ax, word [edi + 4]
jne 0x406625
mov ecx, dword [esp + 0x20]
mov ax, word [esp + 0x4e]
cmp ax, word [ecx + 0x508fc4]
jne 0x406625
cmp byte [esp + 0x50], 0
je 0x406680
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x54]
cmp eax, 0x7530
jb 0x406625
lea eax, [edi + 6]
push eax
push str.EXEC_WZ_DISCONNECT_MEMB__s
push 0x43bfa0
call fcn.004083e0
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.00409580
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.00403ef0
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.004079d0
add esp, 0x18
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2c6
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, edi
call fcn.004073c0
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2c6
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, edi
call fcn.00407570
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2c6
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.0x406535.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.004083e0
add esp, 0x18
test al, al
je 0x40682f
push dword [0x43bfac]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x40682f
push 0x508dc0
call fcn.00408680
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.00409580
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2c6
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.00409580
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2c6
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.0x406535.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.0040c2c6
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.004083e0
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.0040c2c6
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.0040c2c6
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.0x406535.6
mov ecx, dword [esp + 0x4e]
call fcn.0040a320
mov edx, eax
test edx, edx
je case.0x406535.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.00409580
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c2c6
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.00411013
mov eax, dword [edi + 4]
add esp, 0xc
mov dword [esp + 0x74], eax
xor esi, esi
mov edi, 0x508f6c
mov ecx, dword [esi + edi]
test ecx, ecx
js 0x406a72
cmp ecx, 0x190
jge 0x406a72
cmp dword [esi + 0x508f70], 0
je 0x406a72
cmp dword [esi + 0x508f84], 0xffffffff
je 0x406a72
movzx eax, byte [esp + 0x71]
push eax
lea eax, [esp + 0x74]
push eax
push ecx
call fcn.00409580
add esi, 0x70
cmp esi, 0xaf00
jl 0x406a40
mov ecx, dword [esp + 0xfc]
pop edi
pop esi
xor ecx, esp
call fcn.0040c2c6
mov esp, ebp
pop ebp
ret