Function at 0x40ec20
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
cmp dword [0x5d26f8], 1
push ebx
mov ebx, dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push esi
mov esi, ecx
mov dword [ebp - 4], edx
push edi
mov word [ebp - 0x34], 0x30c1
mov byte [ebp - 0x32], 7
movzx eax, word [esi + 4]
movq xmm0, qword [esi + 6]
mov word [ebp - 0x30], ax
movzx eax, word [esi + 0xe]
mov word [ebp - 0x26], ax
mov al, byte [esi + 0x10]
mov byte [ebp - 0x24], al
mov al, byte [esi + 0x11]
mov byte [ebp - 0x23], al
mov al, byte [esi + 0x12]
mov byte [ebp - 0x22], al
mov al, byte [esi + 0x13]
movq qword [ebp - 0x2e], xmm0
mov byte [ebp - 0x21], al
jne 0x40ecf2
push 0x5d2890
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x5d2888], 0
je 0x40ece7
mov ecx, dword [0x5d2884]
mov edx, ecx
mov eax, dword [0x5d2880]
and ecx, 3
dec eax
shr edx, 2
and edx, eax
mov eax, dword [0x5d287c]
mov eax, dword [eax + edx*4]
mov edi, dword [eax + ecx*4]
add dword [0x5d2888], 0xffffffff
mov dword [ebp - 0x20], edi
jne 0x40ecd4
push 0x5d2890
mov dword [0x5d2884], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40ed5f
inc dword [0x5d2884]
push 0x5d2890
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40ed5f
push 0x5d2890
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push str.EXEC_WZ_GetItemSerial
push 0x43edd8
call fcn.00414960
add esp, 8
test al, al
je 0x40ed44
push dword [0x43ede4]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x40ed44
push 0x4405be
call fcn.0041de3e
add esp, 4
mov edi, eax
mov dword [ebp - 0x20], edi
push dword [0x43ede4]
call ebx
push 2
push dword [0x43ede4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
jmp 0x40ed5f
push dword [0x43ede4]
call ebx
push 2
push dword [0x43ede4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
xor edi, edi
mov dword [ebp - 0x20], edi
movzx eax, word [esi + 0x14]
mov ecx, 0x1a04
cmp ax, cx
je 0x40ed77
mov ecx, 0x1a05
cmp ax, cx
jne 0x40ede3
push edi
push str.SELECT_ItemSerial_FROM_T_PetItem_Info_WHERE_ItemSerial_d
push 0x43edd8
call fcn.00414960
add esp, 0xc
test al, al
je 0x40eda0
push dword [0x43ede4]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
jne 0x40edcd
push dword [0x43ede4]
call ebx
push 2
push dword [0x43ede4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
push 0
push 1
push edi
push str.INSERT_INTO_T_PetItem_Info__ItemSerial_Pet_Level_Pet_Exp__VALUES___d__d__d_
push 0x43edd8
call fcn.00414960
add esp, 0x14
push dword [0x43ede4]
call ebx
push 2
push dword [0x43ede4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
movzx eax, word [esi + 0x14]
mov word [ebp - 0x1c], ax
mov al, byte [esi + 0x16]
mov byte [ebp - 0x1a], al
mov al, byte [esi + 0x17]
mov byte [ebp - 0x19], al
mov al, byte [esi + 0x18]
mov byte [ebp - 0x18], al
mov al, byte [esi + 0x19]
mov byte [ebp - 0x17], al
mov al, byte [esi + 0x1a]
mov byte [ebp - 0x16], al
mov al, byte [esi + 0x1b]
mov byte [ebp - 0x15], al
movzx eax, word [esi + 0x1c]
mov word [ebp - 0x14], ax
mov al, byte [esi + 0x1e]
mov byte [ebp - 0x12], al
mov al, byte [esi + 0x1f]
mov byte [ebp - 0x11], al
mov al, byte [esi + 0x20]
mov byte [ebp - 0x10], al
mov eax, dword [esi + 0x21]
mov dword [ebp - 0xf], eax
mov al, byte [esi + 0x25]
mov byte [ebp - 0xb], al
mov al, byte [esi + 0x26]
mov byte [ebp - 0xa], al
mov eax, dword [esi + 0x28]
mov dword [ebp - 8], eax
lea eax, [ebp - 0x34]
push 0x30
push eax
push dword [ebp - 4]
call fcn.00416260
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret