Function at 0x40cfb0
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x41c
mov eax, dword [0x41d018]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push edi
lea edi, [esi + 8]
push edi
push str.SELECT_GUID_FROM_T_FriendMain_WHERE_Name_s
mov ecx, 0x41ee38
call fcn.00412310
mov eax, dword [0x41ee44]
mov ebx, dword [sym.imp.ODBC32.dll_SQLFetch]
add esp, 8
push eax
call ebx
push str.GUID
call fcn.004124d0
cmp eax, 0xffffffff
jne 0x40d000
mov dword [ebp - 0x41c], eax
jmp 0x40d018
shl eax, 0xd
add eax, 0x41fa66
push eax
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
mov dword [ebp - 0x41c], eax
mov ecx, dword [0x41ee44]
push ecx
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
mov edx, dword [0x41ee44]
push 2
push edx
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
movzx eax, word [esi + 4]
mov edx, dword [edi + 4]
mov ecx, dword [edi]
mov word [ebp - 0x412], ax
movzx eax, word [edi + 8]
mov dword [ebp - 0x40c], edx
mov edx, dword [ebp - 0x41c]
mov word [ebp - 0x408], ax
movzx eax, word [esi + 6]
mov dword [ebp - 0x410], ecx
mov cl, byte [edi + 0xa]
push edx
push eax
mov byte [ebp - 0x406], cl
push str.SELECT_Memo_Photo_Dir_Act_FROM_T_FriendMail_WHERE_MemoIndex_d_AND_GUID_d
mov ecx, 0x41ee38
mov dword [ebp - 0x418], 0xb01404c2
mov byte [ebp - 0x414], 7
mov word [ebp - 0x404], ax
call fcn.00412310
mov ecx, dword [0x41ee44]
add esp, 0xc
push ecx
call ebx
push str.Photo
call fcn.004124d0
cmp eax, 0xffffffff
jne 0x40d0d5
xor eax, eax
mov dword [ebp - 0x400], eax
mov dword [ebp - 0x3fc], eax
mov dword [ebp - 0x3f8], eax
mov dword [ebp - 0x3f4], eax
mov word [ebp - 0x3f0], ax
jmp 0x40d0ee
shl eax, 0xd
add eax, 0x41fa66
push eax
mov ebx, 0x12
lea edi, [ebp - 0x400]
call fcn.00412630
push 0x4193fc
call fcn.004124d0
cmp eax, 0xffffffff
jne 0x40d101
or eax, eax
jmp 0x40d113
shl eax, 0xd
add eax, 0x41fa66
push eax
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
push 0x419400
mov byte [ebp - 0x3ee], al
call fcn.004124d0
cmp eax, 0xffffffff
jne 0x40d12c
or eax, eax
jmp 0x40d13e
shl eax, 0xd
add eax, 0x41fa66
push eax
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
push str.Memo
mov byte [ebp - 0x3ed], al
call fcn.004124d0
cmp eax, 0xffffffff
jne 0x40d16b
push 0x3e8
lea edx, [ebp - 0x3ec]
push 0
push edx
call sub.MSVCR100.dll_memset
add esp, 0xc
jmp 0x40d184
shl eax, 0xd
add eax, 0x41fa66
push eax
mov ebx, 0x3e8
lea edi, [ebp - 0x3ec]
call fcn.00412630
lea eax, [ebp - 0x3ec]
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d190
mov edi, dword [sym.imp.ODBC32.dll_SQLCloseCursor]
sub eax, edx
mov word [ebp - 0x402], ax
mov eax, dword [0x41ee44]
push eax
call edi
mov ecx, dword [0x41ee44]
mov ebx, dword [sym.imp.ODBC32.dll_SQLFreeStmt]
push 2
push ecx
call ebx
mov edx, dword [ebp - 0x41c]
movzx eax, word [esi + 6]
push edx
push eax
push str.UPDATE_T_FriendMail_SET_bRead1_WHERE_MemoIndex_d_AND_GUID_d
mov ecx, 0x41ee38
call fcn.00412310
mov ecx, dword [0x41ee44]
add esp, 0xc
push ecx
call edi
mov edx, dword [0x41ee44]
push 2
push edx
call ebx
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x418]
push eax
push ecx
mov ebx, 0x414
call fcn.00413de0
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.00415636
mov esp, ebp
pop ebp
ret 4