Function at 0x40e740
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
cmp dword [0x5d1710], 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 0x40e812
push 0x5d18a8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x5d18a0], 0
je 0x40e807
mov ecx, dword [0x5d189c]
mov edx, ecx
mov eax, dword [0x5d1898]
and ecx, 3
dec eax
shr edx, 2
and edx, eax
mov eax, dword [0x5d1894]
mov eax, dword [eax + edx*4]
mov edi, dword [eax + ecx*4]
add dword [0x5d18a0], 0xffffffff
mov dword [ebp - 0x20], edi
jne 0x40e7f4
push 0x5d18a8
mov dword [0x5d189c], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40e87f
inc dword [0x5d189c]
push 0x5d18a8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40e87f
push 0x5d18a8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push str.EXEC_WZ_GetItemSerial
push 0x43dde8
call fcn.00414500
add esp, 8
test al, al
je 0x40e864
push dword [0x43ddf4]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x40e864
push 0x43f5ce
call fcn.0041db2e
add esp, 4
mov edi, eax
mov dword [ebp - 0x20], edi
push dword [0x43ddf4]
call ebx
push 2
push dword [0x43ddf4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
jmp 0x40e87f
push dword [0x43ddf4]
call ebx
push 2
push dword [0x43ddf4]
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 0x40e897
mov ecx, 0x1a05
cmp ax, cx
jne 0x40e903
push edi
push str.SELECT_ItemSerial_FROM_T_PetItem_Info_WHERE_ItemSerial_d
push 0x43dde8
call fcn.00414500
add esp, 0xc
test al, al
je 0x40e8c0
push dword [0x43ddf4]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
jne 0x40e8ed
push dword [0x43ddf4]
call ebx
push 2
push dword [0x43ddf4]
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 0x43dde8
call fcn.00414500
add esp, 0x14
push dword [0x43ddf4]
call ebx
push 2
push dword [0x43ddf4]
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.00415df0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret