Function at 0x409e50
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x68
mov eax, dword [0x424018]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ecx
push str.SELECT_MemoIndex_FriendName_wDate_Subject_bRead_FROM_T_FriendMail_WHERE_GUID_d
mov ecx, 0x424ee0
mov dword [ebp - 0x68], eax
call fcn.00417790
add esp, 8
test al, al
je 0x40a0f3
mov edx, dword [0x424eec]
push edx
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x40a0f3
push ebx
mov ebx, dword [sym.imp.MSVCR100.dll__stricmp]
push esi
push edi
mov ax, word [ebp + 0xc]
xor ecx, ecx
xor edi, edi
mov dword [ebp - 0x64], 0x715e00c2
mov word [ebp - 0x60], ax
cmp cx, word [0x424f54]
jge 0x409eea
mov esi, 0x424f56
push esi
push str.MemoIndex
call ebx
add esp, 8
test eax, eax
je 0x409ee5
movsx edx, word [0x424f54]
inc edi
add esi, 0x1e
cmp edi, edx
jl 0x409ec2
or eax, 0xffffffff
jmp 0x409f02
cmp edi, 0xffffffff
jne 0x409eef
or eax, 0xffffffff
jmp 0x409f02
shl edi, 0xd
add edi, 0x425b0e
push edi
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
mov word [ebp - 0x5e], ax
xor eax, eax
xor edi, edi
cmp ax, word [0x424f54]
jge 0x409f4c
mov esi, 0x424f56
push esi
push str.FriendName
call ebx
add esp, 8
test eax, eax
je 0x409f47
movsx ecx, word [0x424f54]
inc edi
add esi, 0x1e
cmp edi, ecx
jl 0x409f18
xor eax, eax
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], eax
mov word [ebp - 0x54], ax
mov byte [ebp - 0x52], al
jmp 0x409f78
cmp edi, 0xffffffff
jne 0x409f5d
xor eax, eax
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], eax
mov word [ebp - 0x54], ax
mov byte [ebp - 0x52], al
jmp 0x409f78
push 0xa
shl edi, 0xd
add edi, 0x425b0e
push edi
lea edx, [ebp - 0x5c]
push 0xb
push edx
call dword [sym.imp.MSVCR100.dll_strncpy_s]
add esp, 0x10
mov eax, dword [ebp - 0x68]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [ebp - 0x51], ecx
mov cx, word [eax + 8]
mov dword [ebp - 0x4d], edx
mov dl, byte [eax + 0xa]
xor eax, eax
xor edi, edi
mov word [ebp - 0x49], cx
mov byte [ebp - 0x47], dl
cmp ax, word [0x424f54]
jge 0x409fcb
mov esi, 0x424f56
push esi
push str.wDate
call ebx
add esp, 8
test eax, eax
je 0x409fc6
movsx ecx, word [0x424f54]
inc edi
add esi, 0x1e
cmp edi, ecx
jl 0x409fa6
jmp 0x409fcb
cmp edi, 0xffffffff
jne 0x409fe8
xor eax, eax
mov dword [ebp - 0x46], eax
mov dword [ebp - 0x42], eax
mov dword [ebp - 0x3e], eax
mov dword [ebp - 0x3a], eax
mov dword [ebp - 0x36], eax
mov dword [ebp - 0x32], eax
mov dword [ebp - 0x2e], eax
mov word [ebp - 0x2a], ax
jmp 0x40a003
push 0x1d
shl edi, 0xd
add edi, 0x425b0e
push edi
lea edx, [ebp - 0x46]
push 0x1e
push edx
call dword [sym.imp.MSVCR100.dll_strncpy_s]
add esp, 0x10
xor eax, eax
xor edi, edi
cmp ax, word [0x424f54]
jge 0x40a03a
mov esi, 0x424f56
push esi
push str.Subject
call ebx
add esp, 8
test eax, eax
je 0x40a035
movsx ecx, word [0x424f54]
inc edi
add esi, 0x1e
cmp edi, ecx
jl 0x40a015
jmp 0x40a03a
cmp edi, 0xffffffff
jne 0x40a056
xor eax, eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
jmp 0x40a071
push 0x1f
shl edi, 0xd
add edi, 0x425b0e
push edi
lea edx, [ebp - 0x28]
push 0x20
push edx
call dword [sym.imp.MSVCR100.dll_strncpy_s]
add esp, 0x10
xor eax, eax
xor edi, edi
cmp ax, word [0x424f54]
jge 0x40a0ab
mov esi, 0x424f56
push esi
push str.bRead
call ebx
add esp, 8
test eax, eax
je 0x40a0a6
movsx ecx, word [0x424f54]
inc edi
add esi, 0x1e
cmp edi, ecx
jl 0x40a083
or eax, 0xffffffff
jmp 0x40a0c3
cmp edi, 0xffffffff
jne 0x40a0b0
or eax, 0xffffffff
jmp 0x40a0c3
shl edi, 0xd
add edi, 0x425b0e
push edi
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
mov esi, dword [ebp + 8]
lea edx, [ebp - 0x64]
push edx
mov ecx, 0x5e
mov byte [ebp - 8], al
call fcn.004086c0
mov eax, dword [0x424eec]
add esp, 4
push eax
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
jne 0x409ea1
pop edi
pop esi
pop ebx
mov ecx, dword [0x424eec]
push ecx
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
mov edx, dword [0x424eec]
push 2
push edx
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041ae5c
mov esp, ebp
pop ebp
ret