Function at 0x40d170
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
cmp dword [0x5d5560], 1
push ebx
mov ebx, dword [sym.imp.ODBC32.dll_SQLCloseCursor]
push esi
push edi
mov edi, ecx
mov dword [ebp - 8], edx
mov word [ebp - 0x38], 0x30c1
mov byte [ebp - 0x36], 7
movzx eax, word [edi + 4]
movq xmm0, qword [edi + 6]
mov word [ebp - 0x34], ax
movzx eax, word [edi + 0xe]
mov word [ebp - 0x2a], ax
mov al, byte [edi + 0x10]
mov byte [ebp - 0x28], al
mov al, byte [edi + 0x11]
mov byte [ebp - 0x27], al
mov al, byte [edi + 0x12]
mov byte [ebp - 0x26], al
mov al, byte [edi + 0x13]
movq qword [ebp - 0x32], xmm0
mov byte [ebp - 0x25], al
jne 0x40d246
push 0x5d56d8
mov byte [ebp - 1], 0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x5d56d0], 0
je 0x40d232
mov ecx, dword [0x5d56c0]
test ecx, ecx
je 0x40d1ed
mov ecx, dword [ecx]
mov esi, dword [0x5d56cc]
mov edx, esi
mov eax, dword [ecx + 8]
and esi, 3
dec eax
shr edx, 2
and edx, eax
mov eax, dword [ecx + 4]
mov eax, dword [eax + edx*4]
mov esi, dword [eax + esi*4]
sub dword [0x5d56d0], 1
mov dword [ebp - 0x24], esi
jne 0x40d226
mov dword [0x5d56cc], 0
mov byte [ebp - 1], 1
jmp 0x40d235
inc dword [0x5d56cc]
mov byte [ebp - 1], 1
jmp 0x40d235
mov esi, dword [ebp - 0x24]
push 0x5d56d8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp byte [ebp - 1], 0
jne 0x40d2b3
push str.EXEC_WZ_GetItemSerial
push 0x442698
call fcn.00413700
add esp, 8
test al, al
je 0x40d298
push dword [0x4426a4]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x40d298
push 0x443e7e
call fcn.0041acc9
add esp, 4
mov esi, eax
mov dword [ebp - 0x24], esi
push dword [0x4426a4]
call ebx
push 2
push dword [0x4426a4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
jmp 0x40d2b3
push dword [0x4426a4]
call ebx
push 2
push dword [0x4426a4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
xor esi, esi
mov dword [ebp - 0x24], esi
movzx eax, word [edi + 0x14]
mov ecx, 0x1a04
cmp ax, cx
je 0x40d2cb
mov ecx, 0x1a05
cmp ax, cx
jne 0x40d337
push esi
push str.SELECT_ItemSerial_FROM_T_PetItem_Info_WHERE_ItemSerial_d
push 0x442698
call fcn.00413700
add esp, 0xc
test al, al
je 0x40d2f4
push dword [0x4426a4]
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
jne 0x40d321
push dword [0x4426a4]
call ebx
push 2
push dword [0x4426a4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
push 0
push 1
push esi
push str.INSERT_INTO_T_PetItem_Info__ItemSerial_Pet_Level_Pet_Exp__VALUES___d__d__d_
push 0x442698
call fcn.00413700
add esp, 0x14
push dword [0x4426a4]
call ebx
push 2
push dword [0x4426a4]
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
movzx eax, word [edi + 0x14]
mov word [ebp - 0x20], ax
mov al, byte [edi + 0x16]
mov byte [ebp - 0x1e], al
mov al, byte [edi + 0x17]
mov byte [ebp - 0x1d], al
mov al, byte [edi + 0x18]
mov byte [ebp - 0x1c], al
mov al, byte [edi + 0x19]
mov byte [ebp - 0x1b], al
mov al, byte [edi + 0x1a]
mov byte [ebp - 0x1a], al
mov al, byte [edi + 0x1b]
mov byte [ebp - 0x19], al
movzx eax, word [edi + 0x1c]
mov word [ebp - 0x18], ax
mov al, byte [edi + 0x1e]
mov byte [ebp - 0x16], al
mov al, byte [edi + 0x1f]
mov byte [ebp - 0x15], al
mov al, byte [edi + 0x20]
mov byte [ebp - 0x14], al
mov eax, dword [edi + 0x21]
mov dword [ebp - 0x13], eax
mov al, byte [edi + 0x25]
mov byte [ebp - 0xf], al
mov al, byte [edi + 0x26]
mov byte [ebp - 0xe], al
mov eax, dword [edi + 0x28]
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x38]
push 0x30
push eax
push dword [ebp - 8]
call fcn.00414e90
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret