网络安全分析:PE编程实例之地址转换器(2)
for ( nInNum = 0; nInNum < nSecNum; nInNum ++ ) { if ( dwAddr >= dwImageBase + m_pSecHdr[nInNum].VirtualAddress && dwAddr <= dwImageBase + m_pSecHdr[nInNum].VirtualAddress + m_pSecHdr[nInNum].Misc.VirtualSize) { return nInNum; } } break; } case 2: { for ( nInNum = 0; nInNum < nSecNum; nInNum ++ ) { if ( dwAddr >= m_pSecHdr[nInNum].VirtualAddress && dwAddr <= m_pSecHdr[nInNum].VirtualAddress + m_pSecHdr[nInNum].Misc.VirtualSize) { return nInNum; } } break; } case 3: { for ( nInNum = 0; nInNum < nSecNum; nInNum ++ ) { if ( dwAddr >= m_pSecHdr[nInNum].PointerToRawData && dwAddr <= m_pSecHdr[nInNum].PointerToRawData + m_pSecHdr[nInNum].SizeOfRawData) { return nInNum; } } break; } } return -1; (编辑:ASP站长网) |