int main() {" /> int main() {" /> int main() {"/>

X64dbg is not loading program expected address space (Not same as Ghidra shows)

554 Views Asked by At

I have this code written in "Visual studio community edition" in main.cpp and built a release version called Test.exe

#include <iostream>

int main()
{
    int i = 0;
    i++;
    std::string s;

    std::cout << "Hello World" << i << std::endl;

    std::cout << "Hello World1" << std::endl;
    std::cin >> s;
    std::cout << s  << std::endl;
}

When I load it up in Ghidra the 0x140001290 but when load same binary in x64dbg I see the address 0x00007FF777311290 see picture enter image description here

here are the threads (just incase) enter image description here

Update: Added file that show link to main.cpp: enter image description here

Here is the code with rows: enter image description here

Question: How come these addresses are diffrent in Ghidra compare to x64dbg?

1

There are 1 best solutions below

0
Inndy Lin On BEST ANSWER

Because of ASLR, program will be loaded into randomized base address.

Here are some tips to overcome the problem that x64dbg and Ghidra showing different address: