Archive

Archive for the ‘windows’ Category

how to dump all symbols in a .lib library under windows

May 29th, 2011 No comments

very simple, actually: open the Visual Studio command Prompt and call

1
dumpbin /SYMBOLS yourlib.lib

or if you want all available info out the lib:

1
dumpbin /all yourlib.lib > dump.txt
Categories: coding, windows Tags:

windows: finding GUID of self

January 22nd, 2010 No comments

so in the previous post i created a utility to get some exe's and .pdb's file GUID's. However i need to get this information for the process that is currently executed (self). So what do we do? We apply they same technique as before and just preset the filename with the current executable:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "stdafx.h"
#include "exeguid.h"
void  printGuid(GUID &g)
{
    char buf[120];
    sprintf(buf,"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", g.Data1,g.Data2,g.Data3,UINT(g.Data4[0]),UINT(g.Data4[1]),UINT(g.Data4[2]),UINT(g.Data4[3]),UINT(g.Data4[4]),UINT(g.Data4[5]),UINT(g.Data4[6]),UINT(g.Data4[7]));
    printf("%s\n", buf);
}

int _tmain(int argc, _TCHAR* argv[])
{
   
    GUID g;
    if(!getmyGUID(g))
        printGuid(g);
    else
        printf("error getting my GUID\n");
   
    return 0;
}

sounds easy, eh? :)

so to proof its working:

>SelfGUID.exe
8b73f207-5509-4b7d-82c9-a4979208416f

executed the same binary again: GUID stays the same:

>SelfGUID.exe
8b73f207-5509-4b7d-82c9-a4979208416f

rebuild the binary two times and executed it after building:

>SelfGUID.exe
68ce44c6-5ca8-431d-a29b-5480cf7e53ac
>SelfGUID.exe
b91fae19-e200-4207-8468-a4ca54581949

EDIT: removed unused dependency from the project (zip updated)
Source code and executable: selfGUID.zip

Categories: coding, windows Tags:

windows GUID’s and debug builds

January 22nd, 2010 No comments

So i was experimenting with windows and the debug functions and needed a fast utility that will give me the GUID's for executables and .pdb files. This GUID is used to compare if the executable and the .pdb file fit together. (note: only in most recent [VS2008] versions, before a timestamp was used)

So with this little handy utility you can get the executable GUID:

>GUIDTool.exe exe RoR.exe
f8d102be-40e0-4409-8d94-c97e0bb4fce0

and its fitting .pdb file:

>GUIDTool.exe pdb ror.pdb
f8d102be-40e0-4409-8d94-c97e0bb4fce0

Please note that 99% of the code was copy-pasted together - origins are still in the source files.

Source code and executable: GUIDTool.zip

Categories: coding, windows Tags:

debugging crashing applications on customer’s windows

September 13th, 2009 No comments

this snipped using the windows debugger (shipped with win 2k and after) was very helpful in tracking a problem:

set _NT_DEBUG_LOG_FILE_OPEN=debug-log.txt
ntsd -v -c "kb;q" .exe

also, you might want to read this awesome article:
http://blogs.msdn.com/pfedev/archive/2008/09/26/all-the-ways-to-capture-a-dump.aspx

and generally:
http://blogs.msdn.com/pfedev/

have fun debugging :)

Categories: coding, windows Tags:

How to install QT4 under windows

May 26th, 2007 No comments

Just download it here:

http://trolltech.com/developer/downloads/qt/windows

be sure to use the mingw version!

after the download open a command line in the downloaded directory and start configure:
(be sure to use those options, because the default is to take the system libs)

configure -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg

after configure finishes, you may start the build process:

mingw32-make

and then you have app. 60 minutes time to do other useful things (cooking dinner, having 1-3 cups of coffee ;)

Categories: coding, tutorials, windows Tags:

How to compile QT-win 3.3 under windows

May 26th, 2007 No comments

It is not such easy as you may think :)

After you downloaded and installed the Free Visual Studio 2005 c++ Express Edition, you must first follow this guide to install the Windows SDK:
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/

Addintionally you must modify this file: C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat and append all those include and lib path as in the howto above by MS. After this is done, you may follow this guide:
http://qtwin.sourceforge.net/qt3-win32/compile-msvc-2005.php

Please note that the original (and so latest) free QT version does not support msvc as compiler (For this you must buy QT), so i will use this custom mod of qt which re-enables msvc in QT 3.3.

Happy compiling !

Categories: coding, tutorials, windows Tags: