diff -r 22486c9c7b15 -r 378360dbbdba bintools/petools/pefile/pe_utl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bintools/petools/pefile/pe_utl.cpp Wed Jun 30 11:35:58 2010 +0800 @@ -0,0 +1,94 @@ +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include +#include +#include "pe_file.h" +#include +#include "e32image.h" +#include "h_utl.h" + +TInt PEFile::CmpSectionName(PIMAGE_SECTION_HEADER apSectionHeader, char *aName) +// +// Returns true if the name of the pe section is the same as aName +// + { + + return (strnicmp((const char *)apSectionHeader->Name, aName, IMAGE_SIZEOF_SHORT_NAME)==0); + } + +TInt PEFile::VirtualAddressInSection(TUint aVA, PIMAGE_SECTION_HEADER aHeader) +// +// Returns true if the virtual address is in the section +// + { + + TUint start = iLinkedBase + aHeader->VirtualAddress; + TUint finish = start + aHeader->Misc.VirtualSize; + return (aVA>=start) && (aVAVirtualAddress; + TUint finish = start + aHeader->Misc.VirtualSize; + if (aVA>=start) + { + if (aVA= 0x1000u) + s = -1; // too far for comfort + } + return s; + }