Skip to content

Build faile on arm64, error C2100: you cannot dereference an operand of type 'unsigned __int64' #65

@miyanyan

Description

@miyanyan

Hi, I got this error when I tried to add to vcpkg:

libpeconv\src\peb_lookup.cpp(48): error C2100: you cannot dereference an operand of type 'unsigned __int64'

this error refers to:

inline PPEB get_peb()
{
#if defined(_M_AMD64)
    return (PPEB)__readgsqword(0x60);
#elif defined(_M_ARM64)
    PPEB peb = (PPEB)(*(__getReg(18) + 0x60));  // <------ here
    #ifdef _DEBUG
    std::cout << "[+] ARM64 TEB: " << __getReg(18) << " PEB: " <<  peb << "\n";
    #endif
    return peb;
#else
    return (PPEB)__readfsdword(0x30);
/*
//alternative way to fetch it:
    LPVOID PEB = NULL;
    __asm {
        mov eax, fs:[30h]
        mov PEB, eax
    };
    return (PPEB)PEB;

    or:
    LPVOID PEB = RtlGetCurrentPeb();
*/
#endif
}

Here's the full log:

install-arm64-windows-static-md-dbg-out.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions