News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

64-bit assembly starter kit

Started by jj2007, July 16, 2016, 11:48:29 AM

Previous topic - Next topic

jj2007

Found this by accident in C:\Program Files (x86)\Windows Kits\8.1\Include\um\DbgHelp.h :(

QuoteImageRvaToVa(
    _In_ PIMAGE_NT_HEADERS NtHeaders,
    _In_ PVOID Base,
    _In_ ULONG Rva,
    _In_opt_ OUT PIMAGE_SECTION_HEADER *LastRvaSection
    );

#ifndef _WIN64
// This api won't be ported to Win64 - Fix your code.

typedef struct _IMAGE_DEBUG_INFORMATION {
    LIST_ENTRY List;

No IMAGE_DEBUG_INFORMATION structure in 64-bit code...

TWell


LiaoMi

Quote from: jj2007 on October 04, 2016, 11:58:05 AM
Found this by accident in C:\Program Files (x86)\Windows Kits\8.1\Include\um\DbgHelp.h :(

QuoteImageRvaToVa(
    _In_ PIMAGE_NT_HEADERS NtHeaders,
    _In_ PVOID Base,
    _In_ ULONG Rva,
    _In_opt_ OUT PIMAGE_SECTION_HEADER *LastRvaSection
    );

#ifndef _WIN64
// This api won't be ported to Win64 - Fix your code.

typedef struct _IMAGE_DEBUG_INFORMATION {
    LIST_ENTRY List;

No IMAGE_DEBUG_INFORMATION structure in 64-bit code...

C:\Program Files (x86)\Windows Kits\8.1\Include\um\ImageHlp.h

Quote#ifndef _WIN64
// This api won't be ported to Win64 - Fix your code.

typedef struct _IMAGE_DEBUG_INFORMATION {
    LIST_ENTRY List;
    DWORD ReservedSize;
    PVOID ReservedMappedBase;
    USHORT ReservedMachine;
    USHORT ReservedCharacteristics;
    DWORD ReservedCheckSum;
    DWORD ImageBase;
    DWORD SizeOfImage;

    DWORD ReservedNumberOfSections;
    PIMAGE_SECTION_HEADER ReservedSections;

    DWORD ReservedExportedNamesSize;
    PSTR ReservedExportedNames;

    DWORD ReservedNumberOfFunctionTableEntries;
    PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries;
    DWORD ReservedLowestFunctionStartingAddress;
    DWORD ReservedHighestFunctionEndingAddress;

    DWORD ReservedNumberOfFpoTableEntries;
    PFPO_DATA ReservedFpoTableEntries;

    DWORD SizeOfCoffSymbols;
    PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;

    DWORD ReservedSizeOfCodeViewSymbols;
    PVOID ReservedCodeViewSymbols;

    PSTR ImageFilePath;
    PSTR ImageFileName;
    PSTR ReservedDebugFilePath;

    DWORD ReservedTimeDateStamp;

    BOOL  ReservedRomImage;
    PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
    DWORD ReservedNumberOfDebugDirectories;

    DWORD ReservedOriginalFunctionTableBaseAddress;

    DWORD Reserved[ 2 ];

} IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;


PIMAGE_DEBUG_INFORMATION
IMAGEAPI
MapDebugInformation(
    _In_opt_ HANDLE FileHandle,
    _In_ PCSTR FileName,
    _In_opt_ PCSTR SymbolPath,
    _In_ ULONG ImageBase
    );


jj2007

Quote from: TWell on October 04, 2016, 06:16:23 PM
Nor functions that use it ?

Quote from: LiaoMi on October 04, 2016, 09:22:34 PM
C:\Program Files (x86)\Windows Kits\8.1\Include\um\ImageHlp.h

Point is that there are a number of functions and structures that are not "portable" between 32- and 64-bit code. I am working on a set of includes that works for both, so that struck my eye.