diff -r 000000000000 -r 83f4b4db085c toolsandutils/e32tools/pefile/pe_utl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolsandutils/e32tools/pefile/pe_utl.cpp Tue Feb 02 01:39:43 2010 +0200 @@ -0,0 +1,93 @@ +// 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" + +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; + }