Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does x32dbg support source level debugging? #2264

Closed
wangyue0101 opened this issue Dec 10, 2019 · 6 comments
Closed

Does x32dbg support source level debugging? #2264

wangyue0101 opened this issue Dec 10, 2019 · 6 comments
Labels
question The issue is a question.

Comments

@wangyue0101
Copy link

I want to view the source code of the program in x32, and the page is blank after clicking the source code bar. Is it because x32 does not support source code viewing, or does it need another way to display source code?

@wangyue0101 wangyue0101 changed the title Does x64dbg support source level debugging? Does x32dbg support source level debugging? Dec 10, 2019
@mrfearless
Copy link
Member

You can use source level debugging, if you have the source code, compile your project to use the appropriate debug flags and options for assembler/compiler and for the linker to output a pdb file.
Once debugging in x64dbg with this special debug build of exe you can then switch to source level debugging to step through code, set breakpoints etc instead of via the normal cpu view.

@wangyue0101
Copy link
Author

@mrfearless
thank you for your reply. I am trying to learn this
“Once debugging in x64dbg with this special debug build of exe you can then switch to source level debugging to step through code”?
Is this version not official?

@mrfearless
Copy link
Member

The special build of exe - comes from your own compiled source, which uses the correct debug flags and options to create the debug build of your exe along with the full pdb file for your exe. For me to build a properly debug source exe requires that i include the following switches for assembler (ml.exe):

ML.EXE /c /coff /Cp /Zi /Zd /nologo /I:"\Masm32\Include" MyApp.asm

And for the linker i require the following:

LINK.EXE /SUBSYSTEM:WINDOWS /DEBUG /DEBUGTYPE:CV /PDB:"MyApp.pdb" /VERSION:4.0 /LIBPATH:"\Masm32\Lib" /OUT:"MyApp.exe" MyApp.obj, MyApp.res

Once i debug MyApp.exe in x64dbg, i can view the source as the pdb and source are to be found alongside my special MyApp.exe debug build.

For C/C++ source level debugging, it will require specific options set when compiling, may have to ask someone who knows C/C++ to indicate the proper flags and switches required.

@mrexodia
Copy link
Member

mrexodia commented Dec 10, 2019 via email

@wangyue0101
Copy link
Author

Thanks for your reply. I will try it now

@mrexodia mrexodia added the question The issue is a question. label Jan 16, 2020
@mrexodia
Copy link
Member

Closing this for now. Let me know if you have further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue is a question.
Projects
None yet
Development

No branches or pull requests

3 participants