1

I use Visual Studio 2010 x64 Process

int main()
{
  long long EntryPoint = 0x13f501000;
  printf("Value %x", EntryPoint);
  system("pause");
}

Result value is 3f501000 what not 13f501000?

Mr.C64
  • 41,637
  • 14
  • 86
  • 162

1 Answers1

0

You can use the %llx specifier with printf():

#include <stdio.h>

int main()
{
    const long long EntryPoint = 0x13f501000;
    printf("Value: 0x%llx", EntryPoint);
}

Basically, you can use the ll prefix (for long long) with the x type specifier.

Command line:

C:\Temp\CppTests>cl /EHsc /W4 /nologo test.cpp
test.cpp

C:\Temp\CppTests>test.exe
Value: 0x13f501000

In addition, since this question has the [c++] tag, you may consider using std::cout with std::hex:

#include <iostream>

int main()
{
    const long long EntryPoint = 0x13f501000;
    std::cout << "0x" << std::hex << EntryPoint << '\n';
}
Mr.C64
  • 41,637
  • 14
  • 86
  • 162