Function at 0x40d610
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x70
mov eax, dword [0x41d018]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
push edi
push ecx
push str.SELECT_MemoIndex_FriendName_wDate_Subject_bRead_FROM_T_FriendMail_WHERE_GUID_d
mov ecx, 0x41ee38
mov dword [ebp - 0x70], eax
call fcn.00412310
add esp, 8
test al, al
je 0x40d8bc
mov edx, dword [0x41ee44]
push edx
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
je 0x40d8bc
mov edi, dword [sym.imp.MSVCR100.dll__stricmp]
mov ax, word [ebp + 0xc]
xor ecx, ecx
xor esi, esi
mov dword [ebp - 0x6c], 0xb06000c2
mov byte [ebp - 0x68], 6
mov word [ebp - 0x66], ax
cmp cx, word [0x41eeac]
jge 0x40d6ae
mov ebx, 0x41eeae
push ebx
push str.MemoIndex
call edi
add esp, 8
test eax, eax
je 0x40d6a9
movsx edx, word [0x41eeac]
inc esi
add ebx, 0x1e
cmp esi, edx
jl 0x40d686
or eax, 0xffffffff
jmp 0x40d6c6
cmp esi, 0xffffffff
jne 0x40d6b3
or eax, 0xffffffff
jmp 0x40d6c6
shl esi, 0xd
add esi, 0x41fa66
push esi
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
mov word [ebp - 0x64], ax
xor eax, eax
xor esi, esi
cmp ax, word [0x41eeac]
jge 0x40d714
mov ebx, 0x41eeae
lea esp, [esp]
push ebx
push str.FriendName
call edi
add esp, 8
test eax, eax
je 0x40d70f
movsx ecx, word [0x41eeac]
inc esi
add ebx, 0x1e
cmp esi, ecx
jl 0x40d6e0
xor eax, eax
mov dword [ebp - 0x62], eax
mov dword [ebp - 0x5e], eax
mov word [ebp - 0x5a], ax
mov byte [ebp - 0x58], al
jmp 0x40d740
cmp esi, 0xffffffff
jne 0x40d725
xor eax, eax
mov dword [ebp - 0x62], eax
mov dword [ebp - 0x5e], eax
mov word [ebp - 0x5a], ax
mov byte [ebp - 0x58], al
jmp 0x40d740
push 0xa
shl esi, 0xd
add esi, 0x41fa66
push esi
lea edx, [ebp - 0x62]
push 0xb
push edx
call dword [sym.imp.MSVCR100.dll_strncpy_s]
add esp, 0x10
mov eax, dword [ebp - 0x70]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [ebp - 0x57], ecx
mov cx, word [eax + 8]
mov dword [ebp - 0x53], edx
mov dl, byte [eax + 0xa]
xor eax, eax
xor esi, esi
mov word [ebp - 0x4f], cx
mov byte [ebp - 0x4d], dl
cmp ax, word [0x41eeac]
jge 0x40d795
mov ebx, 0x41eeae
mov edi, edi
push ebx
push str.wDate
call edi
add esp, 8
test eax, eax
je 0x40d790
movsx ecx, word [0x41eeac]
inc esi
add ebx, 0x1e
cmp esi, ecx
jl 0x40d770
jmp 0x40d795
cmp esi, 0xffffffff
jne 0x40d7b2
xor eax, eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], eax
mov word [ebp - 0x30], ax
jmp 0x40d7cd
push 0x1d
shl esi, 0xd
add esi, 0x41fa66
push esi
lea edx, [ebp - 0x4c]
push 0x1e
push edx
call dword [sym.imp.MSVCR100.dll_strncpy_s]
add esp, 0x10
xor eax, eax
xor esi, esi
cmp ax, word [0x41eeac]
jge 0x40d805
mov ebx, 0x41eeae
nop
push ebx
push str.Subject
call edi
add esp, 8
test eax, eax
je 0x40d800
movsx ecx, word [0x41eeac]
inc esi
add ebx, 0x1e
cmp esi, ecx
jl 0x40d7e0
jmp 0x40d805
cmp esi, 0xffffffff
jne 0x40d821
xor eax, eax
mov dword [ebp - 0x2e], eax
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x26], eax
mov dword [ebp - 0x22], eax
mov dword [ebp - 0x1e], eax
mov dword [ebp - 0x1a], eax
mov dword [ebp - 0x16], eax
mov dword [ebp - 0x12], eax
jmp 0x40d83c
push 0x1f
shl esi, 0xd
add esi, 0x41fa66
push esi
lea edx, [ebp - 0x2e]
push 0x20
push edx
call dword [sym.imp.MSVCR100.dll_strncpy_s]
add esp, 0x10
xor eax, eax
xor esi, esi
cmp ax, word [0x41eeac]
jge 0x40d878
mov ebx, 0x41eeae
mov edi, edi
push ebx
push str.bRead
call edi
add esp, 8
test eax, eax
je 0x40d873
movsx ecx, word [0x41eeac]
inc esi
add ebx, 0x1e
cmp esi, ecx
jl 0x40d850
or eax, 0xffffffff
jmp 0x40d890
cmp esi, 0xffffffff
jne 0x40d87d
or eax, 0xffffffff
jmp 0x40d890
shl esi, 0xd
add esi, 0x41fa66
push esi
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
lea edx, [ebp - 0x6c]
mov byte [ebp - 0xe], al
mov eax, dword [ebp + 8]
push edx
push eax
mov ebx, 0x60
call fcn.00413de0
mov ecx, dword [0x41ee44]
push ecx
call dword [sym.imp.ODBC32.dll_SQLFetch]
cmp ax, 0x64
jne 0x40d661
mov edx, dword [0x41ee44]
push edx
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
mov eax, dword [0x41ee44]
push 2
push eax
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00415636
mov esp, ebp
pop ebp
ret 0xc