Function at 0x40bb40
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
cmp dword [0x5cd670], 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 0x40bc12
push 0x5cd7a4
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x5cd79c], 0
je 0x40bc07
mov ecx, dword [0x5cd798]
mov edx, ecx
mov eax, dword [0x5cd794]
and ecx, 3
dec eax
shr edx, 2
and edx, eax
mov eax, dword [0x5cd790]
mov eax, dword [eax + edx*4]
mov edi, dword [eax + ecx*4]
add dword [0x5cd79c], 0xffffffff
mov dword [ebp - 0x20], edi
jne 0x40bbf4
push 0x5cd7a4
mov dword [0x5cd798], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40bc7f
inc dword [0x5cd798]
push 0x5cd7a4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40bc7f
push 0x5cd7a4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push str.EXEC_WZ_GetItemSerial
push 0x439d58
call fcn.004112b0
add esp, 8
test al, al
je 0x40bc64
push dword [0x439d64]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x40bc64
push 0x43b53e
call fcn.0041a6da
add esp, 4
mov edi, eax
mov dword [ebp - 0x20], edi
push dword [0x439d64]
call ebx
push 2
push dword [0x439d64]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
jmp 0x40bc7f
push dword [0x439d64]
call ebx
push 2
push dword [0x439d64]
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 0x40bc97
mov ecx, 0x1a05
cmp ax, cx
jne 0x40bd03
push edi
push str.SELECT_ItemSerial_FROM_T_PetItem_Info_WHERE_ItemSerial_d
push 0x439d58
call fcn.004112b0
add esp, 0xc
test al, al
je 0x40bcc0
push dword [0x439d64]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
jne 0x40bced
push dword [0x439d64]
call ebx
push 2
push dword [0x439d64]
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 0x439d58
call fcn.004112b0
add esp, 0x14
push dword [0x439d64]
call ebx
push 2
push dword [0x439d64]
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.00412cb0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret