Disassembly debugging won't find my address - debugging

I'm having an issue where I try and debug my application in Visual Studio 2012.
I press Ctrl + G to search for an address in the top address bar. I insert my address, for example, 00C44873, press enter and it errors back:
The specified address cannot be displayed. invalid octal digit.
Am I doing something wrong?

The answer is to append an "h" to your hexadecimal number, like in assembly.
For example, 00C44873h. This now allows Visual Studio 2012 to search for this address.

Related

Visual Studio debugger - Displaying integer values in Binary

I'm using Visual Studio 2017 and I need to look at the binary representation of integer variables.
How can this be achieved from the Visual Studio debugger?
Type 'var, b' in the watch, for example:
According to the Visual Studio debugger documentation:
You can change the format in which a value is displayed in the Watch, Autos, and Locals windows by using format specifiers.
This note on debugging engine updates and compatibility is also worth noting:
When the Visual Studio native debugger changed to a new debugging engine, some new format specifiers were added and some old ones were removed. The older debugger is still used when you do interop (mixed native and managed) debugging with C++/CLI.
Although it mentions it can be applied to Autos and Locals windows, it is unclear how it is done as the variable names cannot be edited in those windows.
A <variable>, <format> syntax may be used in Watch and Immediate windows, like so:
Here is a direct link to the complete list of format specifiers.
Right-click the value it’ll show a menu list, but it only give us the option of Hexadecimal Display.
To display the variable with binary value in watch window, I suggest you write function to covert it :
The function that in my code is:
public static string ToBinaryString(uint num)
{
return Convert.ToString(num, 2).PadLeft(32, '0');
}

How to disable F12 to debug application in Visual Studio 2012

If I hit F12 while my application runs under Visual Studio in debug mode, the WM_KEYDOWN never reaches my event loop, but it immediately triggers a breakpoint. Is it possible to disable this feature, or reassign it to another, less conflicting hotkey (e.g. CTRL+F12)? I figure the must be a registry key, but I can't find it...
Any help is greatly appreciated!
F12 is a reserved key for the debugger and its kernel-based https://msdn.microsoft.com/en-us/library/windows/desktop/ms646309.aspx
But you can change the registry entry
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug] UserDebuggerHotKey=dword:00000000
to something else like 0x13 (Pause)
got this from http://conemu.github.io/en/GlobalHotKeys.html
You can disable it from Tools->options->Keyboard
It's easy to reassign a value like that to whatever you want.
1) Go to Tools/Options and click on Keyboard (under environment). Then find the command associated with F12. Which one depends on which mapping scheme you use, so I can't tell you the one to find.)
Then change it to whatever you want.
Too bad I can't add comments...
When I type in F12 (for Press shortcut keys), I get Edit.GoToDefinition. If I remove that assignment and then try again, it shows how it is used with Page Inspector.
If you enter F12 and nothing shows, then you can assume that VS is not using F12 and something else is.
You can just try assigning F12 to something and see if that is called instead - then at least you will have some idea of if VS is controlling it or something external to VS is.
Remember that you could also have some application that has remapped F12 so that when you press it, your application is getting a signal that some other key or key combination has been pressed (happened to me once.)

What settings does Visual Studio 2012 require to print the Kernel debug messages?

Host Win7_x64, target VM Win7_x64 both on same physical machine.
Driver debugging using VS 2012 (Visual Studio Integrated Windows Debugger.)
Able to provisioning between Host and target using VS 2012 and WDK 8.0.
KmdfSmall driver given on msdn is properly able to install on target VM; showing into Device Manager as well on target VM, as posted in my last query.
when ever I'm pressing F5, 'Debugger Immediate Window' in VS 2012 also showing 'breakpoint hit' and as I mentioned earlier in my msg, return value of KdPrintEx is also correct i.e. STATUS_SUCCESS.
Do I missing some setting into VS 2012 to display the msg's of "KdPrintEx". Means why my KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "\n KmdfSmallEvtDeviceAdd has been called\n")) is not printing any msg's into 'Debugger Immediate Window'.
KdPrintEx has no effect in release configuration, make sure to compile in debug mode or use DbgPrintEx.
changed the value of Component Filter Mask on target machine where driver has been installed to debug.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter.
Under this key, created a value with the name "IHVDRIVER" and Set the value of this key equal to the DWORD value 0x8".
I choose "IHVDRIVER" because in my KdPrintEx((DPFLTR_"IHVDRIVER"_ID, DPFLTR_INFO_LEVEL, "\n KmdfSmallEvtDeviceAdd has been called\n"))
And DWORD value 0x8 because Leveling.
For detail: http://msdn.microsoft.com/en-us/library/windows/hardware/ff551519(v=vs.85).aspx
thanks you
regards
matt

Weird [?] characters in Visual Studio

I have created a private character using 'Private Character Editor' (http://en.wikipedia.org/wiki/Private_Character_Editor).
Unfortunately, the character i have created does not display in Visual Studio, instead i get a 'question mark inside a square' character.
I can type the private character into notepad using Alt+57344, but that same key combination does not even register in Visual Studio. Interestingly, whilst notepad outputs the next private character if i type Alt+57345, Visual Studio output the same as Alt+1 ... awesome :)
How can i get the private character to display properly?
Update!
The private character displays happily in Word and Notepad, and also in a RichTextBox in my own application, but not in Excel (i just get a 'computer says no ding' when i try to use Alt+57344). I can however paste the character into Excel using Character Map.
Cheers.

Visual Studio 2010 "Not enough storage is available to process this command"

I'm fighting with VS 2010 and this error that seems to be very common in previous versions, but it looks like not everyone is having it in the latest version.
I've got VS 2010 SP1 and I'm getting this error quite often.
The problem is that it's not even enough to restart VS in order to make it go away, I usually have to restart my PC, and I'm losing a lot of time doing this (it's quite frequent)
I've got Windows 7 32bits (can't upgrade to 64 bits, the company doesn't allow it), and I can't do things like creating another solution (please don't reply this :) )
I've used the command to make devenv.exe LARGEADDRESSAWARE, but the error keeps on happening.
My virtual memory size is set to automatic, and the weird thing is that VS doesn't even take 2GB of ram, so I don't know if the error is really because it's lacking memory, or if it's some bug in the program
Any ideas, things to try, something?
I tried everything else as well. The problems continued to come back until I tried
http://blog.rongabriel.com/2010/03/08/not-enough-storage-is-available-to-process-this-command/
Edit: Link is dead, archived version: http://web.archive.org/web/20100929160038/http://blog.rongabriel.com/2010/03/08/not-enough-storage-is-available-to-process-this-command/
Click on Start > Run > regedit & press Enter
Find this key name HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters
Locate IRPStackSize
If this value does not exist Righ Click on Parameters key and Click on New > Dword Value and type in IRPStackSize under the name.
The name of the value must be exactly (combination of uppercase and lowercase letters) the same as what I have above.
Right Click on the IRPStackSize and click on Modify
Select Decimal enter a value higher than 15(Maximum Value is 50 decimal) and Click Ok
You can close the registry editor and restart your computer.
This can be found under MS KB https://support.microsoft.com/en-us/kb/285089
Have a look at
Visual Studio 2010 -- how to reduce its memory footprint
I think I got the best results when I turned off C++ headers index. YMMV
Check the output project type in properties. In my case it was changed to "Windows Application" though it was a "Console Application".
Switching back to console application solved my problem.

Resources