Function at 0x40c5c0
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x478
mov eax, dword [0x421018]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
push 0x5b6680
mov esi, ecx
movzx eax, word [esi + 6]
mov ecx, dword [esi + 0xc]
mov edx, dword [esi + 0x10]
push 0
lea edi, [esi + 0x17]
push edi
push 0
push 0xb
lea ebx, [esi + 0xc]
push 0xc
mov word [ebp - 0x46c], ax
movzx eax, word [ebx + 8]
push 1
push 1
mov word [ebp - 0x462], ax
mov eax, dword [0x4ed8cc]
mov dword [ebp - 0x46a], ecx
mov cl, byte [ebx + 0xa]
mov dword [ebp - 0x466], edx
mov edx, dword [esi + 8]
push 1
push eax
mov dword [ebp - 0x470], 0x5b018c1
mov byte [ebp - 0x460], cl
mov byte [ebp - 0x45f], 1
mov dword [ebp - 0x45c], edx
mov dword [0x5b6680], 0xfffffffd
call dword [sym.imp.ODBC32.dll_SQLBindParameter]
mov edx, dword [0x4ed8cc]
push 0x5b6684
push 0
lea ecx, [esi + 0x22]
push ecx
push 0
push 0x20
push 0xc
push 1
push 1
push 2
push edx
mov dword [0x5b6684], 0xfffffffd
call dword [sym.imp.ODBC32.dll_SQLBindParameter]
movzx eax, byte [esi + 0x43]
movzx ecx, byte [esi + 0x42]
push eax
push ecx
push ebx
push str.WZ_WriteMail__s______d__d
mov ecx, 0x4ed8c0
call fcn.00414e40
mov edx, dword [0x4ed8cc]
add esp, 0x10
push edx
call dword [sym.imp.ODBC32.dll_SQLFetch]
push 0x4ee4ee
call dword [sym.imp.MSVCR100.dll_atoi]
mov ebx, eax
push 0x4f04ee
mov dword [ebp - 0x478], ebx
call dword [sym.imp.MSVCR100.dll_atoi]
mov dword [ebp - 0x458], eax
mov eax, dword [0x4ed8cc]
add esp, 8
push eax
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
mov ecx, dword [0x4ed8cc]
push 2
push ecx
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
cmp ebx, 0xa
ja 0x40c720
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x470]
push edx
mov byte [ebp - 0x45f], bl
push eax
mov ebx, 0x18
call fcn.00416c00
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00417d4a
mov esp, ebp
pop ebp
ret 4
push 0x3e8
lea ecx, [ebp - 0x3f4]
push 0
push ecx
call sub.MSVCR100.dll_memset
movzx edx, word [esi + 0x44]
push edx
lea eax, [esi + 0x58]
push eax
lea ecx, [ebp - 0x3f4]
push ecx
call sub.MSVCR100.dll_memcpy
mov eax, dword [0x4ed8cc]
add esp, 0x18
push 0x5b6680
push 0
lea edx, [ebp - 0x3f4]
push edx
push 0
push 0x3e8
push 0xfffffffffffffffd
push 0xfffffffffffffffe
push 1
push 1
push eax
mov dword [0x5b6680], 0x3e8
call dword [sym.imp.ODBC32.dll_SQLBindParameter]
mov ecx, dword [0x4ed8cc]
push 0x5b6684
push 0
add esi, 0x46
push esi
push 0
push 0x12
push 0xfffffffffffffffd
push 0xfffffffffffffffe
push 1
push 2
push ecx
mov dword [0x5b6684], 0x12
call dword [sym.imp.ODBC32.dll_SQLBindParameter]
mov edx, dword [ebp - 0x458]
push edx
push ebx
push str.UPDATE_T_FriendMail_SET_Memo__Photo__WHERE_MemoIndex_d_AND_GUID_d
mov ecx, 0x4ed8c0
call fcn.00414e40
mov eax, dword [0x4ed8cc]
add esp, 0xc
push eax
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
mov ecx, dword [0x4ed8cc]
push 2
push ecx
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x470]
push edx
push eax
mov ebx, 0x18
call fcn.00416c00
cmp byte [ebp - 0x45f], 1
jne 0x40c928
lea ecx, [ebp - 0x474]
push ecx
mov ecx, edi
call fcn.00406460
test al, al
je 0x40c928
mov edx, dword [ebp - 0x458]
mov eax, dword [ebp - 0x478]
push edx
push eax
push str.SELECT_MemoIndex_FriendName_wDate_Subject_bRead_FROM_T_FriendMail_WHERE_MemoIndex_d_AND_GUID_d
mov ecx, 0x4ed8c0
call fcn.00414e40
mov ecx, dword [0x4ed8cc]
add esp, 0xc
push ecx
call dword [sym.imp.ODBC32.dll_SQLFetch]
mov dx, word [ebp - 0x45e]
push str.MemoIndex
mov ebx, 0x4ed8c0
mov dword [ebp - 0x454], 0xb06000c2
mov byte [ebp - 0x450], 6
mov word [ebp - 0x44e], dx
call fcn.00415000
mov word [ebp - 0x44c], ax
push 0xb
lea eax, [ebp - 0x44a]
push eax
push str.FriendName
call fcn.00415170
mov edx, dword [edi + 4]
mov ecx, dword [edi]
mov ax, word [edi + 8]
mov dword [ebp - 0x43b], edx
push 0x1e
lea edx, [ebp - 0x434]
mov dword [ebp - 0x43f], ecx
mov cl, byte [edi + 0xa]
push edx
push str.wDate
mov word [ebp - 0x437], ax
mov byte [ebp - 0x435], cl
call fcn.00415170
push 0x20
lea eax, [ebp - 0x416]
push eax
push str.Subject
call fcn.00415170
push str.bRead
call fcn.00415000
mov edx, dword [ebp - 0x45c]
mov byte [ebp - 0x3f6], al
call fcn.00417720
test eax, eax
je 0x40c90d
mov edx, dword [eax + 4]
lea ecx, [ebp - 0x454]
push ecx
push edx
mov ebx, 0x60
call fcn.00416c00
mov eax, dword [0x4ed8cc]
push eax
call dword [sym.imp.ODBC32.dll_SQLCloseCursor]
mov ecx, dword [0x4ed8cc]
push 2
push ecx
call dword [sym.imp.ODBC32.dll_SQLFreeStmt]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00417d4a
mov esp, ebp
pop ebp
ret 4