diff -r fa7a3cc6effd -r 6d08f4a05d93 bintools/petools/pefile/pe_utl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bintools/petools/pefile/pe_utl.cpp Fri Jun 25 18:11:34 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; + }