blabberer
The xxx project - looking under the hoods of guids
by
, April 2nd, 2014 at 19:43 (12820 Views)
The xxx project - looking under the hoods of guids
In the olden golden times things were simple and humanely understandable
Todays machines don't like humans and their understandability
All they want is garbage to produce more garbage that requires more powerful machine with a higher processing power running multiple cores in parallel and utilizing multi petaabyte memory
In the olden times we wrote a simple void main (void ) { printf ("hello world \n"); } and all we needed was a 9 MB package that came with almost everything an hobbyist would ever want to write programs with.
Yes bcc 5.5 command line tools with / includes / libs / resource compilers / make utility / all combined was just a measly 9 MB
One fine day it went bust and ended up �embarcing� kylie or was it kulfi
Let it rest in peace in the museum where it may live forever.
So now comes in express editions of visual studio multi mega byte goliaths that didn�t compile and link but built
as long as it was a simple hello world build built it and there was no fiddling required and we could live with a 11 MB directory for a simple hello world
Yes we have to cough up more space than what was required for complete tool-set
don�t believe me let me dir /s for you one simple hello world
Code::\>cd C:\Documents and Settings\Admin\My Documents\Visual Studio 2010\Projectsweight_of_hello_from_express_to_the_world :\>set blah blah="f:\SysinternalsSuite\du.exe" :\>%blah% -q . Files: 61 Directories: 4 Size: 11,051,453 bytes Size on disk: 11,051,453 bytes :\>
A simple hello world.cpp compiled and linked to hello world.exe needs a 2 GB tool set and 61 intermediate files and obviously 500 GB hard disk get filled with litter in two months flat
hey bcc 5.5 you didn�t need anything more than a 4 GB hard disk and 128 MB ram machine that was running windows 98 for you to make a tiny little helloworld.exe you are sorely missed.
let�s find a way out of this madness lets break free even if it is painful to become a simple /one cpp /one make file /one compiler and /one linker project and no not using bcc but using visual studioGuru GoldblumEnough nostalgia let�s get on because the history of evolution is that life escapes all barriers. Life breaks free. Life expands to new territories. Painfully, perhaps even dangerously. But life finds a way
It can it did and it will but we have to coax an eighty million year old mosquito embedded in amber to become a Tyrannosaurus Rex
Lets open the mighty big hello world project and monitor it with process explorer to find clues to its operation
First clue we get is that once f7 or build is clicked in vcexpress we see msbuild.exe is spawned from vcexpress.exe which calls tracker.exe which calls cl.exe and linker.exe
Code:Command line: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nologo /nodemode:1 /nr
Code:Command line: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\Tracker.exe" @"C:\Documents and Settings\Admin\Local Settings\Temp\2855c911ce6c4f5a83da3ea06bb3f4e9.tmp" /c "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe" @"C:\Documents and Settings\Admin\Local Settings\Temp\aee14f5ff66544339403c2d0532a6b68.rsp"
Code:Command line: "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe" "@C:\Documents and Settings\Admin\Local Settings\Temp\aee14f5ff66544339403c2d0532a6b68.rsp"
Code:Command line: mspdbsrv.exe -start -spawn
lets check out msbuild whats it is ?Code:Command line: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\Tracker.exe" /a @"C:\Documents and Settings\Admin\Local Settings\Temp\0dca85d2d11f41dd86f25cdc7fd79dde.tmp" /c "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe" /ERRORREPORT:PROMPT @"C:\Documents and Settings\Admin\Local Settings\Temp\dd9954c18a824badb990e11888b528da.rsp"
From process explorer command line we know msbuild is in c:\windows\......\\
though if you have several .net framework installed each .net version comes with its own msbuild.exe
ok it seems this is a command line toolCode:C:\Program Files\Microsoft Visual Studio 10.0>ndff msbuild.exe Total filerecords to scan: 315232 \WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe \WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe \WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe Scanned 310259 filerecord(s) in 25.735 s. Found 3 file(s), 0 directory(ies), 0 alternate path(s).
Code:C:\Program Files\Microsoft Visual Studio 10.0>msbuild /? Microsoft (R) Build Engine Version 4.0.30319.1 [Microsoft .NET Framework, Version 4.0.30319.1] Copyright (C) Microsoft Corporation 2007. All rights reserved. Syntax: MSBuild.exe [options] [project file] Description: Builds the specified targets in the project file. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in "proj" and uses that file.
so it looks for a file with proj extension
lets check out hello world
so there is only one file a .vcxprojCode::\>dir /s /b *.*proj C:\Documents and Settings\Admin\My Documents\Visual Studio 2010\Projects\weight_of_hello_from_express_to_the_world\weight_of_hello_from_express_to_the_world.vcxproj :\>
so as a reverser the first instinct is to cut off all the shit and try only this file
Code::\>cd C:\Documents and Settings\Admin\Desktop\testvcxproj :\>copy "..\..\My Documents\Visual Studio 2010\Projects\ weight_of_hello_from_express_to_the_world\weight_of_hello_from_express_to_the_world.vcxproj". 1 file(s) copied. :\>msbuild c1xx : fatal error C1083: Cannot open source file: 'stdafx.cpp': Build FAILED. 1 Error(s) Time Elapsed 00:00:00.70
\> so it is looking for stdafx.cpp providing stdafx.cpp it looks for source.cpp then stdafx.h then targetvar.h lets copy all these 4 files
:Code:\>copy "..\..\My Documents\Visual Studio 2010\Projects\weight_of_hello_from_express_to_the_world\stdafx.cpp" . 1 file(s) copied. and so on :\>dir /s /b C:\Documents and Settings\Admin\Desktop\testvcxproj\stdafx.cpp C:\Documents and Settings\Admin\Desktop\testvcxproj\stdafx.h C:\Documents and Settings\Admin\Desktop\testvcxproj\targetver.h C:\Documents and Settings\Admin\Desktop\testvcxproj\weight_of_hello_from_express_to_the_world.cpp C:\Documents and Settings\Admin\Desktop\testvcxproj\weight_of_hello_from_express_to_the_world.vcxproj :\>msbuild Build started 03/04/2014 00:51:57. Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:01.70 :\>Debug\weight_of_hello_from_express_to_the_world.exe h y ello world ya mma :\>
so it worked it seems we don�t want all the file except one vcxproj file to compile link and build we are back to one cpp one make file
but we see only Debug Folder how to do a Release
Code::\>msbuild /p:Configuration=Release
so Debug and Release is possible from one proj fileCode::\>Release\weight_of_hello_from_express_to_the_world.exe h y ello world ya mma
if we need to clean the directory
:\>ls -lCode:/t:Clean /p:Configuration=<config>
total 24
drw-rw-rw- 2 Admin 0 0 2014-04-03 00:51 Debug
drw-rw-rw- 2 Admin 0 0 2014-04-03 00:58 Release
-rw-rw-rw- 1 Admin 0 328 2014-03-31 00:46 stdafx.cpp
-rw-rw-rw- 1 Admin 0 320 2014-03-31 00:46 stdafx.h
-rw-rw-rw- 1 Admin 0 314 2014-03-31 00:46 targetver.h
-rw-rw-rw- 1 Admin 0 273 2014-03-31 02:48 weight_of_hello_from_express_to_the_
world.cpp
-rw-rw-rw- 1 Admin 0 4434 2014-03-31 00:46 weight_of_hello_from_express_to_the_
world.vcxproj
now that we have cut away the masks let�s check what�s inside of this project file so that if need arises we can tweak and fiddle with it.
Opening this is WordPad we find it is written in some kind of markup language called xml
Some Google reveals xml is kind of html that enforces certain rules that html winks and let goes
Working with this file in notepad / WordPad is clumsy who want to write < > </>
Further Google yields an editor from ms xml notepad 2007
downloading xml notepad 2007 and opening this vcxproject in xml notepad 2007
We get a nice tree view in the left and text view in the right and handy controls to edit the file with undo redo / font and all other fancy beagles and buttons.
It is time to start exploring the project file (that is delete everything inside it and start with single line and stop when it seems it works.
googling for some references we see a lot of hits that explains bits and pieces of the property whatever
gist seems to be that this file contains an ordered and sequential format of several properties
All of the properties have permanent default values defined in XXXXXXXXXXXXX.props (defaults)
These defaults are based on which configuration you choose viz Debug / Release which platform you choose (on my machine it defaults to WIN32 only at the moment)
But Win64 seems to be possible from Google
there can be global defaults too that are applicable to both the Build Configuration (Debug / Release) (Win32 / Win64)
for the advanced type custom property sheets can be used for overriding default build
The defaults are dictated with import and import group properties
The most basic import is
The main job of this import is to define all the path details into the projectCode:<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
like Default Output Directory / Default Directory from where the Tools for Compiling and linking are to be used / and other paths like SDK include Paths etc
The next import is
This import defines all the switches that go to cl.exe and link .exeCode:<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
The last import is a targets import that defines what to do when target is Debug / Release /Clean etc
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
When you have only these three imports in the project file you have the most basic project with all defaults
lets try it out shall we ?
so according to specs this mandatory line is required in each file to denote this is an xml file so the first line would be
now you start the top level markup viz project and according to specs both open and close markups are required as xml does not wink at no closing markupsCode:<?xml version="1.0" encoding="utf-8"?>
So that would be
the project needs certain defaultsCode:<project> </project>
like default targets (i.e. what to do when invoked without any arguments )
default tool set (use msbuild 4 or 2 or 1 ??) and an xml namespace ( this namespace is mandatory else msbuild wouldn�t know which xml namespace is used and will err like posted below)
the default target is build / can be clean too if you so wishCode:"C:\Documents and Settings\Admin\Desktop\testvcxproj\fidlled.vcxproj" (default target) (1) -> C:\Documents and Settings\Admin\Desktop\testvcxproj\fidlled.vcxproj(2,1): err or MSB4041: The default XML namespace of the project must be the MSBuild XML na mespace. If the project is authored in the MSBuild 2003 format, please add xmln s="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> elemen t. If the project has been authored in the old 1.0 or 1.2 format, please conver t it to MSBuild 2003 format. 0 Warning(s) 1 Error(s)notice the line number / char number line 2 . char 1
using toolset 4.0 (microsoft .net 4.0)
and xml namespace (2003 msbuild format)
so our fiddled vcxproject file now becomes
next comes the itemgroupCode:<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> </Project>
so the project file now becomesCode:<ItemGroup Label="ProjectConfigurations"> </ItemGroup>
Code:<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> </ItemGroup> </Project>
inside itemgroup we now add the actual configuration like Debug /Release etc notice my special configuarion is Bullshit
we can have a DamnYou6162 Platform too but since i don�t have a machine with DamnYou6162 platform i use win32Code:<ProjectConfiguration Include="Bullshit|Win32"> <Configuration>Bullshit</Configuration> <Platform>DamnYou6162</Platform> </ProjectConfiguration>
for the adventurous ones here is what msbuld will say if you use a platform that doesn�t exist
Code::\>msbuild /p:Configuration=Bullshit;Platform=Damnyou6162 Build FAILED. "C:\Documents and Settings\Admin\Desktop\testvcxproj\fidlled.vcxproj" (defaulttarget) (1) -> (InvalidPlatformError target) -> C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Tar gets(23,7): error MSB8007: The Platform for project 'fidlled.vcxproj' is invali d. Platform='Damnyou6162'. You may be seeing this message because you are tryi ng to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [C:\Documents and Settings\Admin\Desktop\testvcxproj\fidlled.vcxproj] 0 Warning(s) 1 Error(s) Time Elapsed 00:00:00.06
now like i wrote earlier i am going to import all the defaults and use only the default
Code:<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"></Import> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
and iam going to buld these files
Code:<ItemGroup> <ClInclude Include="stdafx.h" /> <ClInclude Include="targetver.h"></ClInclude> <ClCompile Include="stdafx.cpp"></ClCompile> <ClCompile Include="weight_of_hello_from_express_to_the_world.cpp" /> </ItemGroup>
so my entire vcxproject file now looks like this
Code::\>type fidlled.vcxproj <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microso ft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Bullshit|Win32"> <Configuration>Bullshit</Configuration> <Platform>DamnYou6162</Platform> </ProjectConfiguration> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"></Import> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ItemGroup> <ClInclude Include="stdafx.h" /> <ClInclude Include="targetver.h"></ClInclude> <ClCompile Include="stdafx.cpp"></ClCompile> <ClCompile Include="weight_of_hello_from_express_to_the_world.cpp" /> </ItemGroup> </Project>
will it build ?? let�s try
Code::\>dir/s /b & msbuild /p:Configuration=Bullshit & dir /s /b
Code:C:\Documents and Settings\Admin\Desktop\testvcxproj\fidlled.vcxproj C:\Documents and Settings\Admin\Desktop\testvcxproj\stdafx.cpp C:\Documents and Settings\Admin\Desktop\testvcxproj\stdafx.h C:\Documents and Settings\Admin\Desktop\testvcxproj\targetver.h C:\Documents and Settings\Admin\Desktop\testvcxproj\weight_of_hello_from_express_to_the_world.cpp Microsoft (R) Build Engine Version 4.0.30319.1 [Microsoft .NET Framework, Version 4.0.30319.1] Copyright (C) Microsoft Corporation 2007. All rights reserved. Build started 03/04/2014 02:32:22. Project "C:\Documents and Settings\Admin\Desktop\testvcxproj\fidlled.vcxproj" o n node 1 (default targets). PrepareForBuild: Creating directory "Bullshit\". InitializeBuildStatus: Creating "Bullshit\fidlled.unsuccessfulbuild" because "AlwaysCreate" was spec ified. ClCompile: C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /nologo /W 1 /WX- /O2 /Oy- /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"B ullshit\\" /Fd"Bullshit\vc100.pdb" /Gd /TP /analyze- /errorReport:queue stdaf x.cpp weight_of_hello_from_express_to_the_world.cpp stdafx.cpp weight_of_hello_from_express_to_the_world.cpp Generating Code... Link: C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:QU EUE /OUT:"Bullshit\fidlled.exe" /NOLOGO kernel32.lib user32.lib gdi32.lib win spool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.l ib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"Bullshit\fidlled.exe.inte rmediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /PDB:"C: \Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\fidlled.pdb" /TLBI D:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"Bullshit\fidlled.lib" /MACHINE:X86 Bullsh it\stdafx.obj Bullshit\weight_of_hello_from_express_to_the_world.obj fidlled.vcxproj -> C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullsh it\fidlled.exe Manifest: C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /ou tputresource:"Bullshit\fidlled.exe;#1" /manifest Bullshit\fidlled.exe.interme diate.manifest FinalizeBuildStatus: Deleting file "Bullshit\fidlled.unsuccessfulbuild". Touching "Bullshit\fidlled.lastbuildstate". Done Building Project "C:\Documents and Settings\Admin\Desktop\testvcxproj\fidl led.vcxproj" (default targets). Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.65 C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit C:\Documents and Settings\Admin\Desktop\testvcxproj\fidlled.vcxproj C:\Documents and Settings\Admin\Desktop\testvcxproj\stdafx.cpp C:\Documents and Settings\Admin\Desktop\testvcxproj\stdafx.h C:\Documents and Settings\Admin\Desktop\testvcxproj\targetver.h C:\Documents and Settings\Admin\Desktop\testvcxproj\weight_of_hello_from_express_to_the_world.cpp C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\cl.command.1.tlog C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\CL.read.1.tlog C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\CL.write.1.tlog C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\fidlled.exe C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\fidlled.exe.intermediate.manifest C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\fidlled.lastbuildstate C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\link.command.1.tlog C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\link.read.1.tlog C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\link.write.1.tlog C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\mt.command.1.tlog C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\mt.read.1.tlog C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\mt.write.1.tlog C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\stdafx.obj C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\vc100.pdb C:\Documents and Settings\Admin\Desktop\testvcxproj\Bullshit\weight_of_hello_from_express_to_the_world.obj :\>Bullshit\fidlled.exe h y ello world ya mma :\>
it built and became its parent too by giving its name to the built exeand did you notice the name of directory ?
it is not Debug / Release but Bullshit
so we broke the mystery of the xxx files
you may be thinking why put so much effort into useless crap
hit f7 in visual studio and be happy
that is because I wanted to use visual studio to make ollydbg plugin and ollydbg 2.01 version plugin didn�t come with a visual studio project and it seems oleh was frustrated with the guids and other garbage kind of things that seem to mask the project creation in visual studio and didn�t provide one
so i thought let me look under the hood of the guids
and thus was born the movie xxx project - looking under the hoods of guids
based on the above research i put together a simple bat file that invokes msbuild under the hoods to build an
ollydbg plugin for odbg
copy paste to a folder
source files
header files
ollydbg.lib
this vcxproject file
buildbat file
and run the bat file with an argument
C:\Documents and Settings\Admin\Desktop\testbld>dir /b
build_ollydbg_201_plugin_template.bat
ollydbg.lib
ollydbg_201_plugin_template.cpp
ollydbg_201_plugin_template.vcxproj
plugin.h
Code:C:\Documents and Settings\Admin\Desktop\testbld>build_ollydbg_201_plugin_template.batCode:Setting environment for using Microsoft Visual Studio 2010 x86 tools. provide any one of the following arguments "bldall" to build both DebugMode and Release Mode Binaries "clnall" to clean both Debug ann Release Directory "bldrls" to build Release mode "clnrls" to clean Release Directory "blddbg" to build Debug mode "clndbg" to clean Debug DirectoryCode:C:\Documents and Settings\Admin\Desktop\testbld>build_ollydbg_201_plugin_template.bat bldall
happy spleunking (do i sound like some copy cat ?? well whatever )Code:Setting environment for using Microsoft Visual Studio 2010 x86 tools. building both Debug and Release C:\Documents and Settings\Admin\Desktop\testbld>dir /b build_ollydbg_201_plugin_template.bat Debug ollydbg.lib ollydbg_201_plugin_template.cpp ollydbg_201_plugin_template.vcxproj plugin.h Release C:\Documents and Settings\Admin\Desktop\testbld>dir Release\*.dll Directory of C:\Documents and Settings\Admin\Desktop\testbld\Release 03/04/2014 04:38 7,168 ollydbg_201_plugin_template.dll 1 File(s) 7,168 bytes 0 Dir(s) 942,186,496 bytes free C:\Documents and Settings\Admin\Desktop\testbld>dir Debug\*.dll Directory of C:\Documents and Settings\Admin\Desktop\testbld\Debug 03/04/2014 04:38 15,360 ollydbg_201_plugin_template.dll 1 File(s) 15,360 bytes 0 Dir(s) 942,186,496 bytes free C:\Documents and Settings\Admin\Desktop\testbld>
and you can use this same vcxproject file in visual studio
open -> file -> new -> project file -> and happily F7 to build a plugin too J
the finished vcxproject is
the bat file containsCode:<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <Keyword>Win32Proj</Keyword> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"></ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <LinkIncremental>false</LinkIncremental> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <LinkIncremental>false</LinkIncremental> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <PreprocessorDefinitions>WIN32;UNICODE;_CHAR_UNSIGNED;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <Optimization>Disabled</Optimization> </ClCompile> <Link> <TargetMachine>MachineX86</TargetMachine> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <AdditionalDependencies>ollydbg.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <PreprocessorDefinitions>WIN32;UNICODE;_CHAR_UNSIGNED;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <TargetMachine>MachineX86</TargetMachine> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <AdditionalDependencies>ollydbg.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="ollydbg_201_plugin_template.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="plugin.h" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"></ImportGroup> </Project>
Code:@echo OFF pushd .. @Call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 popd if "%1" == "" goto getlost if "%1" == "bldall" goto bldall if "%1" == "clnall" goto clnall if "%1" == "bldrls" goto bldrls if "%1" == "blddbg" goto blddbg if "%1" == "clndbg" goto clndbg if "%1" == "clnrls" ( goto clnrls ) else ( goto getlost ) :bldrls echo bulding in release mode msbuild /nologo /v:quiet /p:Configuration=Release goto :EOF :blddbg echo bulding in Debug mode msbuild /nologo /v:quiet /p:Configuration=Debug goto :EOF :clnrls echo Cleaning Release Directory msbuild /nologo /v:quiet /p:Configuration=Release /t:Clean goto :EOF :clndbg echo Cleaning Debug Directory msbuild /nologo /v:quiet /p:Configuration=Debug /t:Clean goto :EOF :bldall echo building both Debug and Release msbuild /nologo /v:quiet /p:Configuration=Debug msbuild /nologo /v:quiet /p:Configuration=Release goto :EOF :clnall echo cleaning both Debug and Release Directories msbuild /nologo /v:quiet /p:Configuration=Debug /t:Clean msbuild /nologo /v:quiet /p:Configuration=Release /t:Clean goto :EOF :getlost echo. echo provide any one of the following arguments echo. echo "bldall" to build both DebugMode and Release Mode Binaries echo "clnall" to clean both Debug ann Release Directory echo "bldrls" to build Release mode echo "clnrls" to clean Release Directory echo "blddbg" to build Debug mode echo "clndbg" to clean Debug Directory
and all else required is a bit of tweaking for file names in the projects and your source files