.text:00401000 ; int __cdecl wmain(int argc, wchar_t **argv)
.text:00401000 _wmain proc near ; CODE XREF: __tmainCRTStartup+11Dp
.text:00401000
.text:00401000 m = dword ptr -4
.text:00401000 argc = dword ptr 8
.text:00401000 argv = dword ptr 0Ch
.text:00401000
.text:00401000 push ebp
.text:00401001 mov ebp, esp
.text:00401003 and esp, 0FFFFFFF8h
.text:00401006 sub esp, 8
.text:00401009 mov ecx, ds:std::basic_istream<char,std::char_traits<char>> std::cin
.text:0040100F lea eax, [esp+8+m]
.text:00401013 push eax
.text:00401014 call ds:std::basic_istream<char,std::char_traits<char>>::operator>>(int &)
.text:0040101A cmp [esp+8+m], 0
.text:0040101F jle short loc_40103B
.text:00401021 mov ecx, ds:std::basic_ostream<char,std::char_traits<char>> std::cout
.text:00401027 push offset _Val ; "dsadasdasda\n"
.text:0040102C push ecx ; _Ostr
.text:0040102D call std::operator<<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,char const *)
.text:00401032 add esp, 8
.text:00401035 xor eax, eax
.text:00401037 mov esp, ebp
.text:00401039 pop ebp
.text:0040103A retn;函数的结束标志,但是其后方并不是另一函数的开始。。。
.text:0040103B ; ---------------------------------------------------------------------------
.text:0040103B
.text:0040103B loc_40103B: ; CODE XREF: _wmain+1Fj
.text:0040103B mov edx, ds:std::basic_ostream<char,std::char_traits<char>> std::cout
.text:00401041 push offset aDiushdaiosdbnh ; "diushdaiosdbnhakls\n"
.text:00401046 push edx ; _Ostr
.text:00401047 call std::operator<<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,char const *)
.text:0040104C add esp, 8
.text:0040104F xor eax, eax
.text:00401051 mov esp, ebp
.text:00401053 pop ebp
.text:00401054 retn
.text:00401054 _wmain endp;函数的结束标志


#include


using namespace std;
int test(int a)
{
if(a>0)
{
cout<<"dsadasdasda\n";
return 9;
}
else
{
cout<<"diushdaiosdbnhakls\n";
return 8;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
int m;
cin>>m;

test(m);
return 0;
}

这是对应的C++源代码像我们上一节讲的,pop ebp,add esp,..h;和mov esp,ebp; pop ebp 这是函数结束的标志,

在.text:0040103A中有retn,是我们之前说的函数结束标志,但是在其后方的代码并不是函数的起始位置,所以,我们可以知道,该函数有多个出口。

所以标志性的函数结束标志,并不一定是函数的结束地址,可能只是一个函数出口,关键在于在函数结束标志的后面是不是另一函数的开始!!!