Function at 0x40e7b0
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
cmp dword [0x5d16f8], 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 0x40e882
push 0x5d1890
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x5d1888], 0
je 0x40e877
mov ecx, dword [0x5d1884]
mov edx, ecx
mov eax, dword [0x5d1880]
and ecx, 3
dec eax
shr edx, 2
and edx, eax
mov eax, dword [0x5d187c]
mov eax, dword [eax + edx*4]
mov edi, dword [eax + ecx*4]
add dword [0x5d1888], 0xffffffff
mov dword [ebp - 0x20], edi
jne 0x40e864
push 0x5d1890
mov dword [0x5d1884], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40e8ef
inc dword [0x5d1884]
push 0x5d1890
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40e8ef
push 0x5d1890
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push str.EXEC_WZ_GetItemSerial
push 0x43ddd8
call fcn.00414560
add esp, 8
test al, al
je 0x40e8d4
push dword [0x43dde4]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x40e8d4
push 0x43f5be
call fcn.0041d99e
add esp, 4
mov edi, eax
mov dword [ebp - 0x20], edi
push dword [0x43dde4]
call ebx
push 2
push dword [0x43dde4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
jmp 0x40e8ef
push dword [0x43dde4]
call ebx
push 2
push dword [0x43dde4]
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 0x40e907
mov ecx, 0x1a05
cmp ax, cx
jne 0x40e973
push edi
push str.SELECT_ItemSerial_FROM_T_PetItem_Info_WHERE_ItemSerial_d
push 0x43ddd8
call fcn.00414560
add esp, 0xc
test al, al
je 0x40e930
push dword [0x43dde4]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
jne 0x40e95d
push dword [0x43dde4]
call ebx
push 2
push dword [0x43dde4]
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 0x43ddd8
call fcn.00414560
add esp, 0x14
push dword [0x43dde4]
call ebx
push 2
push dword [0x43dde4]
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.00415e20
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret