I have written this simple library in c:
library.h:
int sum(int a, int b);
library.c:
#include "library.h"
int sum(int a, int b) {
return a+b;
}
I compiled it with cl.exe (visual studio 2012) using these commands:
cl /c /EHsc library.cpp
lib library.obj
which compiled it as a static link .lib library file. Now I would like to have a look at how the compiler generated the assembly code, for learning/academic purposes. Please note, I don't want to decompile it, I just want to read the generated assembly. I have tried to open the .lib with w32dasm but I get a lot of strange symbols and it looks like the tool is unable to read the file. I've HAVE done a similar task with a dynamic link library (generated from the same source) and it worked; in that I was able to view the assembly code using w32dasm. So, my question is: is possible to view the assembly code of a static link library as you can do with a dynamic link library? If so, what would be the correct tool to use, since w32dasm does not appear to be the correct tool.