Function at 0x406390
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 [0x43c040]
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 + 0x509f34], eax
movzx eax, byte [esp + 0xb]
cmp eax, 0x30
ja case.0x4063e5.6
movzx eax, byte [eax + 0x406974]
jmp dword [eax*4 + 0x406944]
push 8
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 0x10008c1
push eax
push esi
mov dword [esp + 0x34], 0
call fcn.004097d0
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 + 0x509ef8]
push 0x32
push ecx
call fcn.004111f3
mov ecx, dword [esp + 0x2c]
add esp, 0xc
push esi
push edi
lea eax, [ecx + 0x509ef8]
mov word [ecx + 0x509f2a], di
push eax
push dword [ecx + 0x509ed4]
mov word [ecx + 0x509f2c], si
push str._ServerManager___d__ServerInfo___s____d____d_
push 0
call fcn.0040a420
add esp, 0x18
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, edi
call fcn.004069b0
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
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.004039e0
test al, al
jne 0x4064fb
push 0x12
lea eax, [esp + 0x10]
mov byte [esp + 0x21], 0
push eax
push esi
call fcn.004097d0
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret
mov ax, word [esp + 0x4c]
cmp ax, word [edi + 4]
jne 0x4064d5
mov ecx, dword [esp + 0x20]
mov ax, word [esp + 0x4e]
cmp ax, word [ecx + 0x509f2c]
jne 0x4064d5
cmp byte [esp + 0x50], 0
je 0x406530
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x54]
cmp eax, 0x7530
jb 0x4064d5
lea eax, [edi + 6]
push eax
push str.EXEC_WZ_DISCONNECT_MEMB__s
push 0x43cfa0
call fcn.00408290
add esp, 0xc
push dword [0x43cfac]
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push 2
push dword [0x43cfac]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
push 0x12
lea eax, [esp + 0x10]
push eax
push esi
call fcn.004097d0
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.00403f10
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 0x43cb70
call fcn.00407880
add esp, 0x18
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, edi
call fcn.00407270
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret
mov edx, esi
mov ecx, edi
call fcn.00407420
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret
lea eax, [edi + 6]
push eax
lea eax, [esp + 0x34]
push eax
call fcn.004039e0
test al, al
je case.0x4063e5.6
movzx eax, word [edi + 4]
lea ecx, [edi + 6]
movq xmm0, qword [ecx]
push ecx
push 0x509cf4
push 0x509d5c
mov word [esp + 0x1c], ax
movzx eax, word [ecx + 8]
push 0x509d28
mov word [esp + 0x2a], ax
mov al, byte [ecx + 0xa]
push str.SELECT__s_FROM__s_WHERE__s_s
push 0x43cfa0
mov word [esp + 0x24], 0x14c1
mov byte [esp + 0x26], 5
movq qword [esp + 0x2a], xmm0
mov byte [esp + 0x34], al
call fcn.00408290
add esp, 0x18
test al, al
je 0x4066df
push dword [0x43cfac]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x4066df
push 0x509d28
call fcn.00408530
push dword [0x43cfac]
mov word [esp + 0x22], ax
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push 2
push dword [0x43cfac]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
push 0x14
lea eax, [esp + 0x10]
push eax
push esi
call fcn.004097d0
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret
push dword [0x43cfac]
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push 2
push dword [0x43cfac]
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.004097d0
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret
lea eax, [edi + 6]
push eax
lea eax, [esp + 0x34]
push eax
call fcn.004039e0
test al, al
je case.0x4063e5.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.00403ba0
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
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 0x43cfa0
call fcn.00408290
add esp, 0x14
push dword [0x43cfac]
call dword [sym.imp.ODBC32.dll_SQLFetch]
push dword [0x43cfac]
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push 2
push dword [0x43cfac]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret
movzx eax, word [edi + 4]
mov dword [ecx + 0x509f38], eax
movzx eax, word [edi + 6]
mov dword [ecx + 0x509f3c], eax
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret
lea eax, [edi + 3]
push eax
lea eax, [esp + 0x34]
push eax
call fcn.004039e0
test al, al
je case.0x4063e5.6
mov ecx, dword [esp + 0x4e]
call fcn.0040a4f0
mov edx, eax
test edx, edx
je case.0x4063e5.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.004097d0
pop edi
pop esi
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040c493
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.004111f3
mov eax, dword [edi + 4]
add esp, 0xc
mov dword [esp + 0x74], eax
xor esi, esi
mov edi, 0x509ed4
mov ecx, dword [esi + edi]
test ecx, ecx
js 0x406922
cmp ecx, 0x190
jge 0x406922
cmp dword [esi + 0x509ed8], 0
je 0x406922
cmp dword [esi + 0x509eec], 0xffffffff
je 0x406922
movzx eax, byte [esp + 0x71]
push eax
lea eax, [esp + 0x74]
push eax
push ecx
call fcn.004097d0
add esi, 0x70
cmp esi, 0xaf00
jl 0x4068f0
mov ecx, dword [esp + 0xfc]
pop edi
pop esi
xor ecx, esp
call fcn.0040c493
mov esp, ebp
pop ebp
ret