// File: wangyufei95[P]watchdog_linux/./maile.h
// Function: CAutoMail::init_mail_info()
void CAutoMail::init_mail_info()
{
	wchar_t _buf[BUF_LEN] = {0};
	wifstream _ifs(STR_EMAIL_CONF_FILE);
	int _iPrefixLen = 4; // length of prefix per line, such as src=xxx@gmail.com, the prefix is "src="
	wstring _str_pre;
	
	while (!_ifs.eof()) 
	{
		memset(_buf, 0, sizeof(_buf));
		_ifs.getline(_buf, sizeof(_buf));
		_str_pre = _buf;
    	_str_pre = _str_pre.substr(0, _iPrefixLen); // get the prefix

		if (wcscmp(_str_pre.data(), L"src=") == 0) // get sender mail address
		{
			m_str_src_mail_p = _buf;
			m_str_src_mail_p = m_str_src_mail_p.substr(_iPrefixLen);
		}
		
		else if (wcscmp(_str_pre.data(), L"dst=") == 0) // get receiver mail address 
		{
			m_str_dst_mail_p = _buf;
			m_str_dst_mail_p = m_str_dst_mail_p.substr(_iPrefixLen);
		}
		else if (wcscmp(_str_pre.data(), L"svr=") == 0) // get the mail server, like "smtp.163.com"
		{
			m_str_email_server = _buf; 
			m_str_email_server = m_str_email_server.substr(_iPrefixLen);
		}
		else if (wcscmp(_str_pre.data(), L"prt=") == 0) // get the server port
		{
			char _buf_tmp[16] = {0};
			wstring _str(_buf);
			_str = _str.substr(_iPrefixLen);
			wcstombs(_buf_tmp, _str.data(), _iPrefixLen+1);
			m_ns_server_port = atoi(_buf_tmp);
		}
		else if (wcscmp(_str_pre.data(), L"psd=") == 0) // get sender email password
		{
			m_str_pwd_p = _buf;
			m_str_pwd_p = m_str_pwd_p.substr(_iPrefixLen);
		}
		else if (wcscmp(_str_pre.data(), L"dat=") == 0) // get the content of email
		{
			m_str_data = _buf;
			m_str_data = m_str_data.substr(_iPrefixLen);			
		}
		else if (wcscmp(_str_pre.data(), L"tit=") == 0) // get the title of email
		{
			m_str_title = _buf;
			m_str_title = m_str_title.substr(_iPrefixLen);
		}
		else // if content is multi-line，get all
		{
			m_str_data += L"\n";
			m_str_data += _buf;
		}
	}
	_ifs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7c0, %rsp            # imm = 0x7C0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x790(%rbp)
leaq -0x410(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x3220
movq 0xd644(%rip), %rsi      # 0x113f8
leaq -0x618(%rbp), %rdi
movl $0x8, %edx
callq 0x3310
movl $0x4, -0x61c(%rbp)
leaq -0x640(%rbp), %rdi
callq 0x31d0
movq -0x618(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x618(%rbp,%rax), %rdi
callq 0x3470
movb %al, -0x791(%rbp)
jmp 0x3dfb
movb -0x791(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3e0c
jmp 0x43a3
leaq -0x410(%rbp), %rdi
movq %rdi, -0x7a8(%rbp)
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
movq %rdx, -0x7a0(%rbp)
callq 0x3220
movq -0x7a8(%rbp), %rsi
movq -0x7a0(%rbp), %rdx
leaq -0x618(%rbp), %rdi
callq 0x33a0
jmp 0x3e49
leaq -0x640(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x3720
jmp 0x3e5e
movslq -0x61c(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x670(%rbp), %rdi
leaq -0x640(%rbp), %rsi
callq 0x31f0
jmp 0x3e7e
leaq -0x640(%rbp), %rdi
leaq -0x670(%rbp), %rsi
callq 0x3760
leaq -0x670(%rbp), %rdi
callq 0x3680
leaq -0x640(%rbp), %rdi
callq 0x3530
movq %rax, %rdi
leaq 0x87cd(%rip), %rsi      # 0xc680
callq 0x34d0
cmpl $0x0, %eax
jne 0x3f3c
movq -0x790(%rbp), %rdi
addq $0x8, %rdi
leaq -0x410(%rbp), %rsi
callq 0x3720
jmp 0x3ed6
movq -0x790(%rbp), %rsi
addq $0x8, %rsi
movslq -0x61c(%rbp), %rdx
leaq -0x690(%rbp), %rdi
movq $-0x1, %rcx
callq 0x31f0
jmp 0x3efd
movq -0x790(%rbp), %rdi
addq $0x8, %rdi
leaq -0x690(%rbp), %rsi
callq 0x3760
leaq -0x690(%rbp), %rdi
callq 0x3680
jmp 0x439e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x648(%rbp)
movl %eax, -0x64c(%rbp)
jmp 0x43d2
leaq -0x640(%rbp), %rdi
callq 0x3530
movq %rax, %rdi
leaq 0x8742(%rip), %rsi      # 0xc694
callq 0x34d0
cmpl $0x0, %eax
jne 0x3fc4
movq -0x790(%rbp), %rdi
addq $0x48, %rdi
leaq -0x410(%rbp), %rsi
callq 0x3720
jmp 0x3f75
movq -0x790(%rbp), %rsi
addq $0x48, %rsi
movslq -0x61c(%rbp), %rdx
leaq -0x6b0(%rbp), %rdi
movq $-0x1, %rcx
callq 0x31f0
jmp 0x3f9c
movq -0x790(%rbp), %rdi
addq $0x48, %rdi
leaq -0x6b0(%rbp), %rsi
callq 0x3760
leaq -0x6b0(%rbp), %rdi
callq 0x3680
jmp 0x439c
leaq -0x640(%rbp), %rdi
callq 0x3530
movq %rax, %rdi
leaq 0x86ce(%rip), %rsi      # 0xc6a8
callq 0x34d0
cmpl $0x0, %eax
jne 0x4055
movq -0x790(%rbp), %rdi
addq $0x308, %rdi            # imm = 0x308
leaq -0x410(%rbp), %rsi
callq 0x3720
jmp 0x4000
movq -0x790(%rbp), %rsi
addq $0x308, %rsi            # imm = 0x308
movslq -0x61c(%rbp), %rdx
leaq -0x6d0(%rbp), %rdi
movq $-0x1, %rcx
callq 0x31f0
jmp 0x402a
movq -0x790(%rbp), %rdi
addq $0x308, %rdi            # imm = 0x308
leaq -0x6d0(%rbp), %rsi
callq 0x3760
leaq -0x6d0(%rbp), %rdi
callq 0x3680
jmp 0x439a
leaq -0x640(%rbp), %rdi
callq 0x3530
movq %rax, %rdi
leaq 0x8651(%rip), %rsi      # 0xc6bc
callq 0x34d0
cmpl $0x0, %eax
jne 0x41a8
xorps %xmm0, %xmm0
movaps %xmm0, -0x6e0(%rbp)
leaq -0x701(%rbp), %rdi
movq %rdi, -0x7b0(%rbp)
callq 0x31b0
movq -0x7b0(%rbp), %rdx
leaq -0x700(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x3130
jmp 0x40b2
leaq -0x701(%rbp), %rdi
callq 0x3710
movslq -0x61c(%rbp), %rdx
leaq -0x728(%rbp), %rdi
leaq -0x700(%rbp), %rsi
movq $-0x1, %rcx
callq 0x31f0
jmp 0x40e1
leaq -0x700(%rbp), %rdi
leaq -0x728(%rbp), %rsi
callq 0x3760
leaq -0x728(%rbp), %rdi
callq 0x3680
leaq -0x6e0(%rbp), %rax
movq %rax, -0x7b8(%rbp)
leaq -0x700(%rbp), %rdi
callq 0x3530
movq -0x7b8(%rbp), %rdi
movq %rax, %rsi
movl -0x61c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x3360
leaq -0x6e0(%rbp), %rdi
callq 0x3620
movl %eax, %ecx
movq -0x790(%rbp), %rax
movw %cx, 0x328(%rax)
leaq -0x700(%rbp), %rdi
callq 0x3680
jmp 0x4398
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x648(%rbp)
movl %eax, -0x64c(%rbp)
leaq -0x701(%rbp), %rdi
callq 0x3710
jmp 0x43d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x648(%rbp)
movl %eax, -0x64c(%rbp)
leaq -0x700(%rbp), %rdi
callq 0x3680
jmp 0x43d2
leaq -0x640(%rbp), %rdi
callq 0x3530
movq %rax, %rdi
leaq 0x8512(%rip), %rsi      # 0xc6d0
callq 0x34d0
cmpl $0x0, %eax
jne 0x4239
movq -0x790(%rbp), %rdi
addq $0x88, %rdi
leaq -0x410(%rbp), %rsi
callq 0x3720
jmp 0x41e4
movq -0x790(%rbp), %rsi
addq $0x88, %rsi
movslq -0x61c(%rbp), %rdx
leaq -0x748(%rbp), %rdi
movq $-0x1, %rcx
callq 0x31f0
jmp 0x420e
movq -0x790(%rbp), %rdi
addq $0x88, %rdi
leaq -0x748(%rbp), %rsi
callq 0x3760
leaq -0x748(%rbp), %rdi
callq 0x3680
jmp 0x4396
leaq -0x640(%rbp), %rdi
callq 0x3530
movq %rax, %rdi
leaq 0x8495(%rip), %rsi      # 0xc6e4
callq 0x34d0
cmpl $0x0, %eax
jne 0x42ca
movq -0x790(%rbp), %rdi
addq $0xe8, %rdi
leaq -0x410(%rbp), %rsi
callq 0x3720
jmp 0x4275
movq -0x790(%rbp), %rsi
addq $0xe8, %rsi
movslq -0x61c(%rbp), %rdx
leaq -0x768(%rbp), %rdi
movq $-0x1, %rcx
callq 0x31f0
jmp 0x429f
movq -0x790(%rbp), %rdi
addq $0xe8, %rdi
leaq -0x768(%rbp), %rsi
callq 0x3760
leaq -0x768(%rbp), %rdi
callq 0x3680
jmp 0x4394
leaq -0x640(%rbp), %rdi
callq 0x3530
movq %rax, %rdi
leaq 0x8418(%rip), %rsi      # 0xc6f8
callq 0x34d0
cmpl $0x0, %eax
jne 0x4358
movq -0x790(%rbp), %rdi
addq $0xc8, %rdi
leaq -0x410(%rbp), %rsi
callq 0x3720
jmp 0x4306
movq -0x790(%rbp), %rsi
addq $0xc8, %rsi
movslq -0x61c(%rbp), %rdx
leaq -0x788(%rbp), %rdi
movq $-0x1, %rcx
callq 0x31f0
jmp 0x4330
movq -0x790(%rbp), %rdi
addq $0xc8, %rdi
leaq -0x788(%rbp), %rsi
callq 0x3760
leaq -0x788(%rbp), %rdi
callq 0x3680
jmp 0x4392
movq -0x790(%rbp), %rdi
addq $0xe8, %rdi
leaq 0x839f(%rip), %rsi      # 0xc70c
callq 0x30e0
jmp 0x4374
movq -0x790(%rbp), %rdi
addq $0xe8, %rdi
leaq -0x410(%rbp), %rsi
callq 0x30e0
jmp 0x4390
jmp 0x4392
jmp 0x4394
jmp 0x4396
jmp 0x4398
jmp 0x439a
jmp 0x439c
jmp 0x439e
jmp 0x3ddb
leaq -0x618(%rbp), %rdi
callq 0x3070
jmp 0x43b1
leaq -0x640(%rbp), %rdi
callq 0x3680
leaq -0x618(%rbp), %rdi
callq 0x32e0
addq $0x7c0, %rsp            # imm = 0x7C0
popq %rbp
retq
leaq -0x640(%rbp), %rdi
callq 0x3680
leaq -0x618(%rbp), %rdi
callq 0x32e0
movq -0x648(%rbp), %rdi
callq 0x36e0
nopw %cs:(%rax,%rax)