Author Topic: 64-bit assembly starter kit  (Read 21790 times)

jj2007

  • Member
  • *****
  • Posts: 11588
  • Assembler is fun ;-)
    • MasmBasic
Re: 64-bit assembly starter kit
« Reply #45 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 :(

Quote
ImageRvaToVa(
    _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

  • Member
  • ****
  • Posts: 748
Re: 64-bit assembly starter kit
« Reply #46 on: October 04, 2016, 06:16:23 PM »
Nor functions that use it ?

LiaoMi

  • Member
  • ****
  • Posts: 925
Re: 64-bit assembly starter kit
« Reply #47 on: October 04, 2016, 09:22:34 PM »
Found this by accident in C:\Program Files (x86)\Windows Kits\8.1\Include\um\DbgHelp.h :(

Quote
ImageRvaToVa(
    _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

  • Member
  • *****
  • Posts: 11588
  • Assembler is fun ;-)
    • MasmBasic
Re: 64-bit assembly starter kit
« Reply #48 on: October 04, 2016, 10:05:19 PM »
Nor functions that use it ?

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.