├── .gitattributes
├── .gitignore
├── AutoProfilingForm
├── AutoProfilingForm.csproj
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── GameDB.xml
├── MdiChildFoRunGame.Designer.cs
├── MdiChildFoRunGame.cs
├── MdiChildFoRunGame.resx
├── MdiChildForAllAndEstimate.Designer.cs
├── MdiChildForAllAndEstimate.cs
├── MdiChildForAllAndEstimate.resx
├── MdiChildForAnalysis.Designer.cs
├── MdiChildForAnalysis.cs
├── MdiChildForAnalysis.resx
├── MdiChildForAnalysisAll.Designer.cs
├── MdiChildForAnalysisAll.cs
├── MdiChildForAnalysisAll.resx
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── DataSources
│ │ ├── AutoProfilingForm.Properties.Resources.datasource
│ │ ├── AutoProfilingForm.Properties.Settings.datasource
│ │ └── MdiChildFoRunGame.datasource
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── bin
│ └── Release
│ │ ├── AutoProfilingForm.exe
│ │ ├── AutoProfilingForm.pdb
│ │ ├── AutoProfilingForm.vshost.exe
│ │ ├── AutoProfilingForm.vshost.exe.manifest
│ │ ├── AutoProfilingTool.exe
│ │ ├── ConsoleControl.dll
│ │ ├── ConsoleControl.pdb
│ │ ├── ConsoleControlAPI.dll
│ │ ├── ConsoleControlAPI.pdb
│ │ ├── HookD3D.dll
│ │ ├── HookD3DAll.dll
│ │ ├── netchartdir_cp.dll
│ │ └── netchartdir_cp.xml
└── clougame.arff
├── AutoProfilingTool.v10.sdf
├── AutoProfilingTool.v10.sln
├── AutoProfilingTool.v10.suo
├── AutoProfilingTool.v10.vcxproj
├── AutoProfilingTool.v10.vcxproj.filters
├── AutoProfilingTool.v10.vcxproj.user
├── AutoProfilingTool
├── AutoProfilingTool.vcxproj
├── AutoProfilingTool.vcxproj.filters
├── AutoProfilingTool.vcxproj.user
├── AutoRrofilingTool.vcxproj
├── AutoRrofilingTool.vcxproj.filters
├── ReadMe.txt
├── common.h
├── detours
│ ├── detours.h
│ ├── detours.lib
│ └── detours.pdb
├── gamecharactormaker.cpp
├── gamecharactormaker.h
├── log.cpp
├── log.h
├── main.cpp
├── profile.input.txt
├── schedulewindow.cpp
└── schedulewindow.h
├── ConsoleControl
├── ConsoleControl.Designer.cs
├── ConsoleControl.cs
├── ConsoleControl.csproj
├── ConsoleControl.resx
├── ConsoleEventArgs.cs
├── KeyMapping.cs
├── Properties
│ └── AssemblyInfo.cs
└── bin
│ └── Release
│ ├── ConsoleControl.dll
│ ├── ConsoleControl.pdb
│ ├── ConsoleControlAPI.dll
│ └── ConsoleControlAPI.pdb
├── ConsoleControlAPI
├── ConsoleControlAPI.csproj
├── Imports.cs
├── ProcessEventArgs.cs
├── ProcessInterface.cs
├── Properties
│ └── AssemblyInfo.cs
└── bin
│ └── Release
│ ├── ConsoleControlAPI.dll
│ └── ConsoleControlAPI.pdb
├── ConsoleControlBack
├── ConsoleControl.dll
├── ConsoleControl.pdb
├── ConsoleControl.xml
├── ConsoleControlAPI.dll
├── ConsoleControlAPI.pdb
└── ConsoleControlAPI.xml
├── Debug
├── AutoProfilingTool.exe
├── AutoProfilingTool.ilk
├── AutoProfilingTool.pdb
├── HookD3DAll.dll
├── HookD3DAll.exp
├── HookD3DAll.ilk
├── HookD3DAll.lib
├── HookD3DAll.pdb
└── Utility.lib
├── HookD3D
├── HookD3D.vcxproj
├── HookD3D.vcxproj.filters
├── HookD3D.vcxproj.user
├── ReadMe.txt
├── d3dsource.cpp
├── detours
│ ├── detours.h
│ ├── detours.lib
│ └── detours.pdb
├── dllentry.cpp
├── hook-function.cpp
├── hook-function.h
├── hook_direct3D_API.cpp
├── hook_direct3D_API.h
├── hookcommon.h
├── hookd3d.def
├── inforecoder.h
├── inforecorder.cpp
├── lightweightrecoder.cpp
├── lightweightreocder.h
├── nvapi.lib
├── videosource.h
└── windowsource.cpp
├── HookD3DAll
├── HookD3DAll.vcxproj
├── HookD3DAll.vcxproj.filters
├── HookD3DAll.vcxproj.user
├── ReadMe.txt
├── detours
│ ├── detours.h
│ ├── detours.lib
│ └── detours.pdb
├── dll_entry.cpp
├── hook_common.h
├── hookd3dall.def
├── nvapi.lib
├── recoder.cpp
├── recorder.h
├── wrap_device_nontrivial.cpp
├── wrap_device_trivial.cpp
├── wrap_direct3d9.cpp
├── wrap_direct3d9.h
├── wrap_direct3dcubetexture9.cpp
├── wrap_direct3dcubetexture9.h
├── wrap_direct3ddevice9.h
├── wrap_direct3dindexbuffer9.cpp
├── wrap_direct3dindexbuffer9.h
├── wrap_direct3dpixelshader9.cpp
├── wrap_direct3dpixelshader9.h
├── wrap_direct3dstateblock9.cpp
├── wrap_direct3dstateblock9.h
├── wrap_direct3dsurface9.cpp
├── wrap_direct3dsurface9.h
├── wrap_direct3dswapchain9.cpp
├── wrap_direct3dswapchain9.h
├── wrap_direct3dtexture9.cpp
├── wrap_direct3dtexture9.h
├── wrap_direct3dvertexbuffer9.cpp
├── wrap_direct3dvertexbuffer9.h
├── wrap_direct3dvertexdeclaration9.cpp
├── wrap_direct3dvertexdeclaration9.h
├── wrap_direct3dvertexshader9.cpp
├── wrap_direct3dvertexshader9.h
├── wrap_direct3dvolume9.cpp
├── wrap_direct3dvolume9.h
├── wrap_direct3dvolumetexture9.cpp
└── wrap_direct3dvolumetexture9.h
├── NetChart
├── chartdir.lic
├── netchartdir_cp.dll
└── netchartdir_cp.xml
├── README.md
├── Release
├── AutoProfilingTool.exe
├── AutoProfilingTool.pdb
├── HookD3D.dll
├── HookD3D.exp
├── HookD3D.lib
├── HookD3D.pdb
├── HookD3DAll.dll
├── HookD3DAll.exp
├── HookD3DAll.lib
├── HookD3DAll.pdb
└── Utility.lib
└── Utility
├── CpuWatch.cpp
├── CpuWatch.h
├── GpuWatch.cpp
├── GpuWatch.h
├── ReadMe.txt
├── Utility.vcxproj
├── Utility.vcxproj.filters
├── Utility.vcxproj.user
├── adl_sdk
├── adl_defines.h
├── adl_sdk.h
└── adl_structures.h
├── hash.cpp
├── hash_set.cpp
├── hash_set.h
├── log.cpp
├── log.h
├── nv_sdk
└── nvapi.h
├── nvapi.lib
├── stdafx.h
├── targetver.h
└── utility.h
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 |
17 | # =========================
18 | # Operating System Files
19 | # =========================
20 |
21 | # OSX
22 | # =========================
23 |
24 | .DS_Store
25 | .AppleDouble
26 | .LSOverride
27 |
28 | # Icon must end with two \r
29 | Icon
30 |
31 |
32 | # Thumbnails
33 | ._*
34 |
35 | # Files that might appear on external disk
36 | .Spotlight-V100
37 | .Trashes
38 |
39 | # Directories potentially created on remote AFP share
40 | .AppleDB
41 | .AppleDesktop
42 | Network Trash Folder
43 | Temporary Items
44 | .apdisk
45 | .svn
46 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace AutoProfilingForm
11 | {
12 | public partial class Form1 : Form
13 | {
14 |
15 | public Form1()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void runGameRToolStripMenuItem_Click(object sender, EventArgs e)
21 | {
22 | MdiChildFoRunGame frmChidChildForRunGame = MdiChildFoRunGame.GetForm();
23 | frmChidChildForRunGame.MdiParent = this;
24 | frmChidChildForRunGame.WindowState = FormWindowState.Maximized;
25 | frmChidChildForRunGame.Show();
26 | }
27 |
28 | private void analysisAToolStripMenuItem_Click(object sender, EventArgs e)
29 | {
30 |
31 | }
32 |
33 | private void analysisWindowSizeWToolStripMenuItem_Click(object sender, EventArgs e)
34 | {
35 | MdiChildForAnalysis frmChildForAnalysis = MdiChildForAnalysis.GetForm();
36 | frmChildForAnalysis.MdiParent = this;
37 | frmChildForAnalysis.WindowState = FormWindowState.Maximized;
38 | frmChildForAnalysis.Show();
39 | }
40 |
41 | private void analysisAllTToolStripMenuItem_Click(object sender, EventArgs e)
42 | {
43 | MdiChildForAnalysisAll frmChildForAnalysisAll = MdiChildForAnalysisAll.GetForm();
44 | frmChildForAnalysisAll.MdiParent = this;
45 | frmChildForAnalysisAll.WindowState = FormWindowState.Maximized;
46 | frmChildForAnalysisAll.Show();
47 | }
48 |
49 | private void allCharactorAndEstimateToolStripMenuItem_Click(object sender, EventArgs e)
50 | {
51 | MdiChildForAllAndEstimate frmChildForAllCharactor = MdiChildForAllAndEstimate.GetForm();
52 | frmChildForAllCharactor.MdiParent = this;
53 | frmChildForAllCharactor.WindowState = FormWindowState.Maximized;
54 | frmChildForAllCharactor.Show();
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/AutoProfilingForm/GameDB.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Trine
5 | F:\TestDemo\Games\Trine
6 | F:\TestDemo\AllResultSets
7 | Trine.single.set
8 | HookD3DAll.dll
9 |
10 |
11 | DemoUnity
12 | F:\TestDemo\Games\4-0_AngryBots
13 | F:\TestDemo\AllResultSets
14 | DemoUnity.single.set
15 | HookD3DAll.dll
16 |
17 |
--------------------------------------------------------------------------------
/AutoProfilingForm/MdiChildForAllAndEstimate.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/AutoProfilingForm/MdiChildForAnalysis.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/AutoProfilingForm/MdiChildForAnalysisAll.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Windows.Forms;
5 |
6 | namespace AutoProfilingForm
7 | {
8 | static class Program
9 | {
10 | ///
11 | /// 应用程序的主入口点。
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new Form1());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("AutoProfilingForm")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("AutoProfilingForm")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("e49f9097-9ea2-4f8c-9e8a-c87db6dd5ecc")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Properties/DataSources/AutoProfilingForm.Properties.Resources.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | AutoProfilingForm.Properties.Resources, AutoProfilingForm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Properties/DataSources/AutoProfilingForm.Properties.Settings.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | AutoProfilingForm.Properties.Settings, AutoProfilingForm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Properties/DataSources/MdiChildFoRunGame.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | AutoProfilingForm.MdiChildFoRunGame, AutoProfilingForm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本: 4.0.30319.18449
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AutoProfilingForm.Properties
12 | {
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// 返回此类使用的、缓存的 ResourceManager 实例。
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoProfilingForm.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// 为所有资源查找重写当前线程的 CurrentUICulture 属性,
56 | /// 方法是使用此强类型资源类。
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18449
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AutoProfilingForm.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/AutoProfilingForm/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/AutoProfilingForm.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/AutoProfilingForm.exe
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/AutoProfilingForm.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/AutoProfilingForm.pdb
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/AutoProfilingForm.vshost.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/AutoProfilingForm.vshost.exe
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/AutoProfilingForm.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/AutoProfilingTool.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/AutoProfilingTool.exe
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/ConsoleControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/ConsoleControl.dll
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/ConsoleControl.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/ConsoleControl.pdb
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/ConsoleControlAPI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/ConsoleControlAPI.dll
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/ConsoleControlAPI.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/ConsoleControlAPI.pdb
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/HookD3D.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/HookD3D.dll
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/HookD3DAll.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/HookD3DAll.dll
--------------------------------------------------------------------------------
/AutoProfilingForm/bin/Release/netchartdir_cp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingForm/bin/Release/netchartdir_cp.dll
--------------------------------------------------------------------------------
/AutoProfilingTool.v10.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingTool.v10.sdf
--------------------------------------------------------------------------------
/AutoProfilingTool.v10.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingTool.v10.suo
--------------------------------------------------------------------------------
/AutoProfilingTool.v10.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {630627F4-128B-4FE1-B207-4F14A5D4089F}
15 | Win32Proj
16 | AutoProfilingToolv10
17 |
18 |
19 |
20 | Application
21 | true
22 | Unicode
23 |
24 |
25 | Application
26 | false
27 | true
28 | Unicode
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | true
42 |
43 |
44 | false
45 |
46 |
47 |
48 |
49 |
50 | Level3
51 | Disabled
52 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
53 |
54 |
55 | Windows
56 | true
57 |
58 |
59 |
60 |
61 | Level3
62 |
63 |
64 | MaxSpeed
65 | true
66 | true
67 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
68 |
69 |
70 | Windows
71 | true
72 | true
73 | true
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/AutoProfilingTool.v10.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AutoProfilingTool.v10.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/AutoProfilingTool/AutoProfilingTool.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {4F56DE92-AD06-479A-BFD8-502782A97039}
15 | Win32Proj
16 | AutoProfilingTool
17 |
18 |
19 |
20 | Application
21 | true
22 | MultiByte
23 |
24 |
25 | Application
26 | false
27 | true
28 | MultiByte
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | true
42 |
43 |
44 | false
45 |
46 |
47 |
48 |
49 |
50 | Level3
51 | Disabled
52 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
53 |
54 |
55 | Console
56 | true
57 |
58 |
59 |
60 |
61 | Level3
62 |
63 |
64 | MaxSpeed
65 | true
66 | true
67 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
68 |
69 |
70 | Console
71 | true
72 | true
73 | true
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/AutoProfilingTool/AutoProfilingTool.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | 头文件
20 |
21 |
22 | 头文件
23 |
24 |
25 | 头文件
26 |
27 |
28 | 头文件
29 |
30 |
31 |
32 |
33 | 源文件
34 |
35 |
36 | 源文件
37 |
38 |
39 | 源文件
40 |
41 |
42 | 源文件
43 |
44 |
45 |
--------------------------------------------------------------------------------
/AutoProfilingTool/AutoProfilingTool.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/AutoProfilingTool/AutoRrofilingTool.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {270C5374-2F8B-457D-8920-83A93E6C772F}
15 | Win32Proj
16 | AutoRrofilingTool
17 |
18 |
19 |
20 | Application
21 | true
22 | v120
23 | MultiByte
24 |
25 |
26 | Application
27 | false
28 | v120
29 | true
30 | MultiByte
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | true
44 |
45 |
46 | false
47 |
48 |
49 |
50 |
51 |
52 | Level3
53 | Disabled
54 | WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
55 |
56 |
57 | Console
58 | true
59 |
60 |
61 |
62 |
63 | Level3
64 |
65 |
66 | MaxSpeed
67 | true
68 | true
69 | WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
70 |
71 |
72 | Console
73 | true
74 | true
75 | true
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | {1d728a27-4457-4fab-90bb-0439452b5356}
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/AutoProfilingTool/AutoRrofilingTool.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 |
20 | Resource Files
21 |
22 |
23 |
24 |
25 | Header Files
26 |
27 |
28 | Header Files
29 |
30 |
31 | Header Files
32 |
33 |
34 |
35 |
36 | Source Files
37 |
38 |
39 | Source Files
40 |
41 |
42 | Source Files
43 |
44 |
45 |
--------------------------------------------------------------------------------
/AutoProfilingTool/ReadMe.txt:
--------------------------------------------------------------------------------
1 | this project is for auto-profiling.
2 | author: Alan Zhang, alanzw@163.com
3 |
4 | the main idea is to generate game charactor files and get the most suitable scheduling time for a cloud gaming system.
--------------------------------------------------------------------------------
/AutoProfilingTool/common.h:
--------------------------------------------------------------------------------
1 | #ifndef __COMMON_H__
2 | #define __COMMON_H__
3 | // for common use in auto profiling tool
4 |
5 | // the input data is in sencods or fps level
6 | enum UNIT{
7 | UNIT_FPS,
8 | UNIT_SECONDS
9 | };
10 |
11 |
12 | // the inteval for each unit
13 | enum IntervalBase{
14 | SECOND_INTERVAL_BASE = 10,
15 | FPS_INTERVAL_BASE = 300
16 |
17 | };
18 |
19 | // the increasing speed
20 | enum IntervalIncreaseStep{
21 | SECOND_INCREASE_SPEED = 5,
22 | FPS_INCREASE_SPEED = 150
23 | };
24 |
25 | // the max step
26 | enum MaxInterval{
27 | SECOND_MAX_STEP = 100,
28 | FPS_MAX_STEP = 3000
29 | };
30 |
31 | enum VARIANCE_TYPE{
32 | CPU_VAR,
33 | GPU_VAR
34 | };
35 |
36 |
37 | #pragma comment(lib, "detours\\detours.lib")
38 |
39 | #endif
--------------------------------------------------------------------------------
/AutoProfilingTool/detours/detours.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingTool/detours/detours.lib
--------------------------------------------------------------------------------
/AutoProfilingTool/detours/detours.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingTool/detours/detours.pdb
--------------------------------------------------------------------------------
/AutoProfilingTool/gamecharactormaker.h:
--------------------------------------------------------------------------------
1 | #ifndef __GAMECHARACTORMAKER_H__
2 | #define __GAMECHARACTORMAKER_H__
3 | // this is for the charactor maker for any d3d game. record the cpu usage, gpu usage and the fps
4 | #include
5 | #include "..\Utility\log.h"
6 | #include "common.h"
7 |
8 | #define DEFAULT_DLL_NAME "HookD3D.dll"
9 |
10 | class CharactorMaker{
11 | char * gameName, *dllName, *gameFolder;
12 | char * saveDirectory, * outputFileName;
13 |
14 | char argList[128];
15 | char path[MAX_PATH];
16 | int runTime; // the max time to run, in minutes
17 |
18 | UNIT unit; // identify the recording time interval, in frame or in seconds
19 | Log * charactorLogger; // write to file
20 |
21 | bool limitFps;
22 | bool toLogFrame;
23 | int maxFps;
24 |
25 | public:
26 | inline void setEnableFrameLog(bool val){ toLogFrame = val; }
27 | inline void setMaxFps(int mfps){ limitFps = true; maxFps = mfps; }
28 |
29 | inline void setSaveDirectory(char * directory){
30 | this->saveDirectory = _strdup(directory);
31 | }
32 | inline void setOutputFileName(char * fileName){
33 | this->outputFileName = _strdup(fileName);
34 | }
35 |
36 | // load game accordingly
37 | void loadGame();
38 |
39 | // load game with hookd3d.dll
40 | void loadGame(char * _gameName);
41 |
42 | // load game with specified dll
43 | void loadGame(char * _gameName, char * _dllName);
44 |
45 | void dealArgv(int argc, char ** argv, int startIndex, int stopIndex); // read the arg list for the loader and format the argList
46 |
47 | // the runtime indicate the time to run
48 |
49 | CharactorMaker(char * _gameName, char * _gameFolder, int _runtime, UNIT _unit);
50 |
51 | CharactorMaker(char * _gameName, char *_dllName, char * _gameFolder, int _runtime, UNIT _unit);
52 | ~CharactorMaker();
53 | };
54 |
55 |
56 | #endif
--------------------------------------------------------------------------------
/AutoProfilingTool/log.cpp:
--------------------------------------------------------------------------------
1 | #include "log.h"
2 | #include
3 | #include
4 |
5 | #define MAX_CHAR 512
6 |
7 | Log::Log(const char *filename){
8 | init(filename);
9 |
10 | }
11 | Log::~Log(){
12 | close();
13 |
14 | }
15 |
16 |
17 | // this is for the log component
18 | void Log::init(const char * filename){
19 | strcpy(fname_, filename);
20 | fs_.open(fname_, ios::out);
21 |
22 | log("Log::init(), filename = %s.\n", fname_);
23 |
24 | }
25 |
26 | void Log::close(){
27 | log("Log::close() called.\n");
28 | fs_.close();
29 | }
30 |
31 | void Log::log(const char * text, ...){
32 | //if (!is_init_) init("fuck.log");
33 | char buffer[MAX_CHAR];
34 | char timestr[30];
35 |
36 | tv = time(0);
37 | tm* ltime = localtime(&tv);
38 | strftime(timestr, sizeof(timestr), "%H:%M:%S", ltime);
39 |
40 | va_list ap;
41 | va_start(ap, text);
42 | vsprintf(buffer, text, ap);
43 | va_end(ap);
44 | DWORD thread = GetCurrentThreadId();
45 | fs_ << timestr << ": " << " [tid: " << thread << "]" << buffer;
46 | fs_.flush();
47 | }
48 |
49 | void Log::slog(const char* text, ...) {
50 | char buffer[MAX_CHAR];
51 |
52 | char timestr[30];
53 |
54 | tv = time(0);
55 | tm* ltime = localtime(&tv);
56 | strftime(timestr, sizeof(timestr), "%H:%M:%S", ltime);
57 |
58 | va_list ap;
59 | va_start(ap, text);
60 | vsprintf(buffer, text, ap);
61 | va_end(ap);
62 | DWORD thread = GetCurrentThreadId();
63 | fs_ << timestr << ": " << " [tid: " << thread << "]" << buffer;
64 | fs_.flush();
65 | }
66 |
67 | void Log::logscreen(const char * text, ...){
68 | char buffer[MAX_CHAR];
69 | char timestr[30];
70 |
71 | tv = time(0);
72 | tm * ltime = localtime(&tv);
73 | strftime(timestr, sizeof(timestr), "%H:%M:%S", ltime);
74 |
75 | va_list ap;
76 | va_start(ap, text);
77 | vsprintf(buffer, text, ap);
78 | va_end(ap);
79 |
80 | cerr << timestr << ": " << buffer;
81 | cerr.flush();
82 | }
--------------------------------------------------------------------------------
/AutoProfilingTool/log.h:
--------------------------------------------------------------------------------
1 | #ifndef __LOG_H__
2 | #define __LOG_H__
3 | // this for the log system for the project
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | using namespace std;
11 |
12 |
13 | class Log {
14 | time_t tv;
15 | public:
16 | void init(const char* fname);
17 | void log(const char* text, ...);
18 | void slog(const char* text, ...);
19 | void logscreen(const char * text, ...);
20 | void close();
21 |
22 | Log(const char * filename);
23 | ~Log();
24 |
25 | private:
26 | char fname_[100];
27 | ofstream fs_;
28 | };
29 |
30 | #endif
--------------------------------------------------------------------------------
/AutoProfilingTool/main.cpp:
--------------------------------------------------------------------------------
1 | // the main entry of the tool
2 |
3 | #include
4 | #include "gamecharactormaker.h"
5 | #include "schedulewindow.h"
6 | #if 1
7 |
8 | #define DEFAULT_GAME_FOLDER "\\Games\\"
9 | #else
10 | #define DEFAULT_GAME_FOLDER "\\"
11 | #endif
12 | using namespace std;
13 | // para: argv0, the tool name
14 | //
15 |
16 | int usage(int argc){
17 | cout << "usage:\n\tAutoProfilingTool [-U ] [[-S ] or [-I ]] [-D -P [-O [-F ] -G ...]." << endl;
18 | cout << "\t-U: the specific the unit to recoder, can be UNIT_FPS or UNIT_SECONDS." << endl;
19 | cout << "\t-I: the file contains the names of all the games' charactor file." << endl;
20 | cout << "\t-D: the specified the dll to use. if dll name is 'hookd3dall.dll', may need to use -u to specific the record unit for game." << endl;
21 | cout << "\t-F: the is to limit the games FPS." << endl;
22 | cout << "\t-G: the ... contains all the games to run and log the charactor to files." << endl;
23 | cout << "\t-P: the to save the ouputfile." << endl;
24 | cout << "\t-O: the to specfic the output file name." << endl;
25 |
26 | if (argc <= 2){
27 | cout << "usage: AutoProfilingTool -I , or AutoProfileTool -D -G ...." << endl;
28 | return -1;
29 | }
30 | else if (argc > 3){
31 |
32 | }
33 |
34 | }
35 |
36 |
37 | // the arg list, the argv is valid
38 | void dealArgList(int argc, char ** argv){
39 | for (int i = 0; i < argc; i++){
40 | if (!strcmp(argv[i], "-I")){
41 | // schedule window
42 |
43 | }
44 | else if (!strcmp(argv[i], "-D") || !strcmp(argv[i], "-F") || !strcmp(argv[i], "-G")){
45 | // charactor maker
46 | }
47 | }
48 | }
49 |
50 | int main(int argc, char ** argv){
51 | if (argc <= 2){
52 | usage(argc);
53 | return -1;
54 | }
55 |
56 | char * inputSet = NULL, *inputFile = NULL, * dllName = NULL, * gameName = NULL, * log = NULL;
57 | char * saveDirectory = NULL, * outputFileName = NULL;
58 |
59 | int maxFps = 0 ;
60 | bool limitFps = false, enableLogFrame = false;
61 | UNIT unitType = UNIT::UNIT_FPS;
62 |
63 | bool getWindow = false;
64 | // deal the args
65 | for (int i = 0; i < argc; i++){
66 | if (!strcmp(argv[i], "-U") || !strcmp(argv[i], "-u")){
67 | if (!strcmp(argv[i + 1], "UNIT_SECONDS")){
68 | unitType = UNIT_SECONDS;
69 | }
70 | }
71 | else if (!strcmp(argv[i], "-I") || !strcmp(argv[i], "-i")){
72 | // schedule window
73 | inputSet = _strdup(argv[i + 1]);
74 | ScheduleWindow * scheduleWindowForSet = new ScheduleWindow(inputSet, unitType);
75 | scheduleWindowForSet->processInputSet(inputSet);
76 | getWindow = true;
77 | break;
78 | }
79 | else if (!strcmp(argv[i], "-S") || !strcmp(argv[i], "-s")){
80 | inputFile = _strdup(argv[i + 1]);
81 |
82 | ScheduleWindow * scheduleWindowForSingle = new ScheduleWindow(inputFile, 0, unitType);
83 |
84 | scheduleWindowForSingle->getScheduleWindow(inputFile);
85 | getWindow = true;
86 | break;
87 | }
88 | else if (!strcmp(argv[i], "-D") || !strcmp(argv[i], "-d")){
89 | // charactor maker
90 | dllName = _strdup(argv[i + 1]);
91 | }
92 | else if (!strcmp(argv[i], "-F") || !strcmp(argv[i], "-f")){
93 | // charactor maker
94 | limitFps = true;
95 | maxFps = atoi(argv[i + 1]);
96 |
97 | }else if(!strcmp(argv[i], "-G") || !strcmp(argv[i], "-f")){
98 | // charactor maker
99 | gameName = _strdup(argv[i + 1]);
100 |
101 | }
102 | else if(!strcmp(argv[i], "-L") || !strcmp(argv[i], "-l")){
103 | log = _strdup(argv[i+1]);
104 | enableLogFrame = true;
105 | }
106 | else if(!strcmp(argv[i], "-P") || !strcmp(argv[i], "-p")){
107 | saveDirectory = _strdup(argv[i+1]);
108 | }
109 | else if(!strcmp(argv[i], "-O") || !strcmp(argv[i], "-o")){
110 | outputFileName = _strdup(argv[i+1]);
111 | }
112 | }
113 | // here to create charactor maker
114 | if (getWindow){
115 |
116 | }
117 | else{
118 | CharactorMaker * cmaker = new CharactorMaker(gameName, dllName, DEFAULT_GAME_FOLDER, 1, UNIT_FPS);
119 |
120 | if (limitFps){
121 | printf("[main]: limitFps true?\n");
122 | cmaker->setMaxFps(maxFps);
123 | }
124 | if(enableLogFrame){
125 | printf("[main]: allow to log frame data.\n");
126 | cmaker->setEnableFrameLog(true);
127 | }
128 |
129 | if(saveDirectory != NULL){
130 | cmaker->setSaveDirectory(saveDirectory);
131 | }
132 | if(outputFileName != NULL){
133 | cmaker->setOutputFileName(outputFileName);
134 | }
135 |
136 | cmaker->loadGame();
137 | }
138 | return 0;
139 | }
--------------------------------------------------------------------------------
/AutoProfilingTool/profile.input.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/AutoProfilingTool/profile.input.txt
--------------------------------------------------------------------------------
/ConsoleControl/ConsoleControl.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace ConsoleControl
2 | {
3 | partial class ConsoleControl
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region 组件设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.richTextBoxConsole = new System.Windows.Forms.RichTextBox();
32 | this.SuspendLayout();
33 | //
34 | // richTextBoxConsole
35 | //
36 | this.richTextBoxConsole.BackColor = System.Drawing.Color.Black;
37 | this.richTextBoxConsole.Dock = System.Windows.Forms.DockStyle.Fill;
38 | this.richTextBoxConsole.ForeColor = System.Drawing.Color.White;
39 | this.richTextBoxConsole.Location = new System.Drawing.Point(0, 0);
40 | this.richTextBoxConsole.Name = "richTextBoxConsole";
41 | this.richTextBoxConsole.Size = new System.Drawing.Size(150, 150);
42 | this.richTextBoxConsole.TabIndex = 0;
43 | this.richTextBoxConsole.Text = "";
44 | //
45 | // ConsoleControl
46 | //
47 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
49 | this.Controls.Add(this.richTextBoxConsole);
50 | this.Name = "ConsoleControl";
51 | this.ResumeLayout(false);
52 |
53 | }
54 |
55 | #endregion
56 |
57 | private System.Windows.Forms.RichTextBox richTextBoxConsole;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/ConsoleControl/ConsoleControl.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {45B56EF2-E04D-4925-BBEA-3A5B6F9DBD5E}
9 | Library
10 | Properties
11 | ConsoleControl
12 | ConsoleControl
13 | v4.0
14 | Client
15 | 512
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | UserControl
48 |
49 |
50 | ConsoleControl.cs
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | ConsoleControl.cs
60 |
61 |
62 |
63 |
64 | {7BEB3808-504D-4A34-A4F9-A6B5BCD954D7}
65 | ConsoleControlAPI
66 |
67 |
68 |
69 |
76 |
--------------------------------------------------------------------------------
/ConsoleControl/ConsoleControl.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/ConsoleControl/ConsoleEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace ConsoleControl
7 | {
8 | ///
9 | /// the ConsoleEventArgs are arguments for a console event
10 | ///
11 | public class ConsoleEventArgs : EventArgs
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public ConsoleEventArgs() { }
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | /// the content
21 | public ConsoleEventArgs(string content)
22 | {
23 | // set the content
24 | Content = content;
25 | }
26 |
27 | ///
28 | /// Gets the content.
29 | ///
30 | public string Content
31 | {
32 | get;
33 | private set;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/ConsoleControl/KeyMapping.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows.Forms;
6 |
7 | namespace ConsoleControl
8 | {
9 | ///
10 | /// A keymapping defines how a key combination should be mapped to SendKeys message.
11 | ///
12 | public class KeyMapping
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | public KeyMapping() { }
18 |
19 | ///
20 | /// Initalizes a new instance of the class
21 | ///
22 | /// if set to true [control].
23 | /// if set to true [alt].
24 | /// if set to true [shift].
25 | /// The key code.
26 | /// The send keys mapping.
27 | /// The stream mapping.
28 | public KeyMapping(bool control, bool alt, bool shift, Keys keyCode, string sendKeyMapping, string streamMapping)
29 | {
30 | IsControlPressed = control;
31 | IsAltPressed = alt;
32 | IsShiftPressed = shift;
33 | KeyCode = KeyCode;
34 | SendKeysMapping = sendKeyMapping;
35 | StreamMapping = streamMapping;
36 | }
37 |
38 | ///
39 | /// Gets or sets a value indicating whether this instace is control pressed
40 | ///
41 | ///
42 | /// true if this instance is control pressed; otherwise, false.
43 | ///
44 | public bool IsControlPressed
45 | {
46 | get;
47 | set;
48 | }
49 | ///
50 | /// Gets or sets a value indicating whether alt is pressed.
51 | ///
52 | ///
53 | /// true if this instance is alt pressed; otherwise, false.
54 | ///
55 | public bool IsAltPressed
56 | {
57 | get;
58 | set;
59 | }
60 |
61 | ///
62 | /// Gets or sets a value indicating whether this instance is shift pressed.
63 | ///
64 | ///
65 | /// true is this instance is shift pressed; otherwise, false.
66 | ///
67 | public bool IsShiftPressed
68 | {
69 | get;
70 | set;
71 | }
72 |
73 | ///
74 | /// Gets or sets the key code
75 | ///
76 | ///
77 | /// the key code.
78 | ///
79 | public Keys KeyCode
80 | {
81 | get;
82 | set;
83 | }
84 |
85 | ///
86 | ///
87 | /// Gets or sets the send keys mapping.
88 | ///
89 | /// the send keys mapping.
90 | public string SendKeysMapping
91 | {
92 | get;
93 | set;
94 | }
95 | ///
96 | /// Gets or sets the stream mapping.
97 | ///
98 | /// the stream mapping.
99 | public string StreamMapping
100 | {
101 | get;
102 | set;
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/ConsoleControl/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("ConsoleControl")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ConsoleControl")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("de6a31a1-c9ba-4be5-a99b-d599c7d1257b")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/ConsoleControl/bin/Release/ConsoleControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControl/bin/Release/ConsoleControl.dll
--------------------------------------------------------------------------------
/ConsoleControl/bin/Release/ConsoleControl.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControl/bin/Release/ConsoleControl.pdb
--------------------------------------------------------------------------------
/ConsoleControl/bin/Release/ConsoleControlAPI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControl/bin/Release/ConsoleControlAPI.dll
--------------------------------------------------------------------------------
/ConsoleControl/bin/Release/ConsoleControlAPI.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControl/bin/Release/ConsoleControlAPI.pdb
--------------------------------------------------------------------------------
/ConsoleControlAPI/ConsoleControlAPI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {7BEB3808-504D-4A34-A4F9-A6B5BCD954D7}
9 | Library
10 | Properties
11 | ConsoleControlAPI
12 | ConsoleControlAPI
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
56 |
--------------------------------------------------------------------------------
/ConsoleControlAPI/Imports.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Runtime.InteropServices;
6 |
7 | namespace ConsoleControlAPI
8 | {
9 | internal static class Imports
10 | {
11 | ///
12 | /// Sends a specified signal to a console process group that shares the console associated with the calling process.
13 | ///
14 | /// The type of signal to be generated.
15 | /// The identifier of the process group to receive the signal. A process group is created when the CREATE_NEW_PROCESS_GROUP flag is specified in a call to the CreateProcess function. The process identifier of the new process is also the process group identifier of a new process group. The process group includes all processes that are descendants of the root process. Only those processes in the group that share the same console as the calling process receive the signal. In other words, if a process in the group creates a new console, that process does not receive the signal, nor do its descendants.
16 | /// If this parameter is zero, the signal is generated in all processes that share the console of the calling process.
17 | /// If the function succeeds, the return value is nonzero.
18 | /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
19 | [DllImport("Kernel32.dll")]
20 | public static extern bool GenerateConsoleCtrlEvent(CTRL_EVENT dwCtrlEvent, UInt32 dwProcessGroupId);
21 | }
22 |
23 | ///
24 | /// The type of signal to be generated.
25 | ///
26 | internal enum CTRL_EVENT : uint
27 | {
28 | ///
29 | /// Generates a CTRL+C signal. This signal cannot be generated for process groups. If dwProcessGroupId is nonzero, this function will succeed, but the CTRL+C signal will not be received by processes within the specified process group.
30 | ///
31 | CTRL_C_EVENT = 0,
32 |
33 | ///
34 | /// Generates a CTRL+BREAK signal.
35 | ///
36 | CTRL_BREAK_EVENT = 1
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/ConsoleControlAPI/ProcessEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace ConsoleControlAPI
7 | {
8 | ///
9 | /// The ProcessEventArgs are arguments for a console event.
10 | ///
11 | public class ProcessEventArgs : EventArgs
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public ProcessEventArgs()
17 | {
18 | }
19 |
20 | ///
21 | /// Initializes a new instance of the class.
22 | ///
23 | /// The content.
24 | public ProcessEventArgs(string content)
25 | {
26 | // Set the content and code.
27 | Content = content;
28 | }
29 |
30 | ///
31 | /// Initializes a new instance of the class.
32 | ///
33 | /// The code.
34 | public ProcessEventArgs(int code)
35 | {
36 | // Set the content and code.
37 | Code = code;
38 | }
39 |
40 | ///
41 | /// Initializes a new instance of the class.
42 | ///
43 | /// The content.
44 | /// The code.
45 | public ProcessEventArgs(string content, int code)
46 | {
47 | // Set the content and code.
48 | Content = content;
49 | Code = code;
50 | }
51 |
52 | ///
53 | /// Gets the content.
54 | ///
55 | public string Content { get; private set; }
56 |
57 | ///
58 | /// Gets or sets the code.
59 | ///
60 | ///
61 | /// The code.
62 | ///
63 | public int? Code { get; private set; }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/ConsoleControlAPI/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("ConsoleControlAPI")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ConsoleControlAPI")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("738d5512-6630-4ad8-ba12-b2e8ea8d1de4")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/ConsoleControlAPI/bin/Release/ConsoleControlAPI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControlAPI/bin/Release/ConsoleControlAPI.dll
--------------------------------------------------------------------------------
/ConsoleControlAPI/bin/Release/ConsoleControlAPI.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControlAPI/bin/Release/ConsoleControlAPI.pdb
--------------------------------------------------------------------------------
/ConsoleControlBack/ConsoleControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControlBack/ConsoleControl.dll
--------------------------------------------------------------------------------
/ConsoleControlBack/ConsoleControl.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControlBack/ConsoleControl.pdb
--------------------------------------------------------------------------------
/ConsoleControlBack/ConsoleControlAPI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControlBack/ConsoleControlAPI.dll
--------------------------------------------------------------------------------
/ConsoleControlBack/ConsoleControlAPI.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/ConsoleControlBack/ConsoleControlAPI.pdb
--------------------------------------------------------------------------------
/Debug/AutoProfilingTool.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/Debug/AutoProfilingTool.exe
--------------------------------------------------------------------------------
/Debug/AutoProfilingTool.ilk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/Debug/AutoProfilingTool.ilk
--------------------------------------------------------------------------------
/Debug/AutoProfilingTool.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/Debug/AutoProfilingTool.pdb
--------------------------------------------------------------------------------
/Debug/HookD3DAll.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/Debug/HookD3DAll.dll
--------------------------------------------------------------------------------
/Debug/HookD3DAll.exp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/Debug/HookD3DAll.exp
--------------------------------------------------------------------------------
/Debug/HookD3DAll.ilk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/Debug/HookD3DAll.ilk
--------------------------------------------------------------------------------
/Debug/HookD3DAll.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/Debug/HookD3DAll.lib
--------------------------------------------------------------------------------
/Debug/HookD3DAll.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/Debug/HookD3DAll.pdb
--------------------------------------------------------------------------------
/Debug/Utility.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/Debug/Utility.lib
--------------------------------------------------------------------------------
/HookD3D/HookD3D.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {A40C2F77-3EF1-43CF-8BAC-B96F249EB58C}
15 | Win32Proj
16 | HookD3D
17 |
18 |
19 |
20 | DynamicLibrary
21 | true
22 | MultiByte
23 |
24 |
25 | DynamicLibrary
26 | false
27 | true
28 | MultiByte
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | true
42 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;
43 | $(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86;
44 |
45 |
46 | false
47 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;
48 | $(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86;
49 |
50 |
51 |
52 |
53 |
54 | Level3
55 | Disabled
56 | WIN32;_WIN32_DCOM;_DEBUG;_WINDOWS;_USRDLL;HOOKD3D_EXPORTS;%(PreprocessorDefinitions)
57 |
58 |
59 | Windows
60 | true
61 | hookd3d.def
62 |
63 |
64 |
65 |
66 | Level3
67 |
68 |
69 | MaxSpeed
70 | true
71 | true
72 | WIN32;_WIN32_DCOM;NDEBUG;_WINDOWS;_USRDLL;HOOKD3D_EXPORTS;%(PreprocessorDefinitions)
73 |
74 |
75 | Windows
76 | true
77 | true
78 | true
79 | hookd3d.def
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | {d16eb61c-da30-4174-bc6f-45324e72eafb}
104 |
105 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/HookD3D/HookD3D.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | 头文件
20 |
21 |
22 | 头文件
23 |
24 |
25 | 头文件
26 |
27 |
28 | 头文件
29 |
30 |
31 | 头文件
32 |
33 |
34 |
35 |
36 | 源文件
37 |
38 |
39 | 源文件
40 |
41 |
42 | 源文件
43 |
44 |
45 | 源文件
46 |
47 |
48 | 源文件
49 |
50 |
51 | 源文件
52 |
53 |
54 |
55 |
56 | 资源文件
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/HookD3D/HookD3D.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/HookD3D/ReadMe.txt:
--------------------------------------------------------------------------------
1 | this project is for hook d3d and get the usage and fps
2 |
3 | export HookD3D.dll
4 | used by GameCharactorMaker
5 |
6 |
7 | also, I need a tool to generate video file, a tool to encoding ? ( how about a simple video streming system )
8 | I need a tool to identify the resource requirement for each stage( capturing, transcoding, encoding[x264 and cuda])
9 | A basic version is to auto run the games and record the game's resource requirement with cmd flag to identify use
10 | second or fps, log into files and then get the scheduling window
--------------------------------------------------------------------------------
/HookD3D/d3dsource.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/HookD3D/d3dsource.cpp
--------------------------------------------------------------------------------
/HookD3D/detours/detours.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/HookD3D/detours/detours.lib
--------------------------------------------------------------------------------
/HookD3D/detours/detours.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alanzw/AutoProfilingToolTrunk/92ac4d71eae5aa28d815a3bedb947a945b35991a/HookD3D/detours/detours.pdb
--------------------------------------------------------------------------------
/HookD3D/hook-function.h:
--------------------------------------------------------------------------------
1 | #ifndef __HOOK_FUNCTION_H__
2 | #define __HOOK_FUNCTION_H__
3 |
4 | #pragma once
5 | #include "../utility/log.h"
6 | #include "hookcommon.h"
7 | #include "lightweightreocder.h"
8 | #include "inforecoder.h"
9 |
10 | #define HOOKALL
11 |
12 | #pragma comment(lib, "d3d10.lib")
13 | #pragma comment(lib, "d3d10_1.lib")
14 | #pragma comment(lib, "d3d11.lib")
15 | #pragma comment(lib, "nvapi.lib")
16 | #pragma comment(lib, "winmm.lib")
17 |
18 | //extern Log * logger;
19 | extern InfoRecorder * infoRecorder;
20 | //
21 | extern TDirect3DCreate9 pD3d;
22 | extern TD3D9CreateDevice pD3D9CreateDevice;
23 | extern TD3D9GetSwapChain pD3D9GetSwapChain;
24 | extern TD3D9DevicePresent pD3D9DevicePresent;
25 | extern TSwapChainPresent pSwapChainPresent;
26 |
27 | extern TD3D10CreateDeviceAndSwapChain pD3D10CreateDeviceAndSwapChain;
28 | extern TD3D10CreateDeviceAndSwapChain1 pD3D10CreateDeviceAndSwapChain1;
29 | extern TD3D11CreateDeviceAndSwapChain pD3D11CreateDeviceAndSwapChain;
30 | extern TCreateDXGIFactory pCreateDXGIFactory;
31 |
32 | extern void release_hook_resources();
33 |
34 | // --- DirectX 9 ---
35 | DllExport IDirect3D9* WINAPI hook_d3d(UINT SDKVersion);
36 |
37 | DllExport HRESULT __stdcall hook_D3D9CreateDevice(
38 | IDirect3DDevice9 * This,
39 | UINT Adapter,
40 | D3DDEVTYPE DeviceType,
41 | HWND hFocusWindow,
42 | DWORD BehaviorFlags,
43 | D3DPRESENT_PARAMETERS *pPresentationParameters,
44 | IDirect3DDevice9 **ppReturnedDeviceInterface
45 | );
46 |
47 | DllExport HRESULT __stdcall hook_D3D9GetSwapChain(
48 | IDirect3DDevice9 *This,
49 | UINT iSwapChain,
50 | IDirect3DSwapChain9 **ppSwapChain
51 | );
52 |
53 | DllExport HRESULT __stdcall hook_D3D9SwapChainPresent(
54 | IDirect3DSwapChain9 * This,
55 | CONST RECT* pSourceRect,
56 | CONST RECT* pDestRect,
57 | HWND hDestWindowOverride,
58 | CONST RGNDATA* pDirtyRegion,
59 | DWORD dwFlags
60 | );
61 |
62 | DllExport HRESULT __stdcall hook_D3D9DevicePresent(
63 | IDirect3DDevice9 * This,
64 | CONST RECT* pSourceRect,
65 | CONST RECT* pDestRect,
66 | HWND hDestWindowOverride,
67 | CONST RGNDATA* pDirtyRegion
68 | );
69 |
70 | #ifdef HOOKALL
71 |
72 | // ---- DXGI -----
73 | DllExport HRESULT __stdcall hook_CreateDXGIFactory(REFIID riid, void ** ppFactory);
74 |
75 | DllExport HRESULT __stdcall hook_DXGICreateSwapChain(IDXGIFactory * This, IUnknown * pDevice, DXGI_SWAP_CHAIN_DESC * pDesc, IDXGISwapChain ** ppSwapChain);
76 |
77 | // --- directx 10 / 10.1 / 11 -----
78 | DllExport HRESULT __stdcall hook_D3D10CreateDeviceAndSwapChain(IDXGIAdapter * pAdapter, D3D10_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, UINT SDKVersion, DXGI_SWAP_CHAIN_DESC * pSwapChainDesc, IDXGISwapChain ** ppSwapChain, ID3D10Device ** ppDevice);
79 |
80 | DllExport HRESULT __stdcall hook_D3D10CreateDeviceAndSwapChain1(IDXGIAdapter * pAdapter, D3D10_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, D3D10_FEATURE_LEVEL1 HardwareLevel, UINT SDKVersion, DXGI_SWAP_CHAIN_DESC * pSwapChainDesc, IDXGISwapChain ** ppSwapChain, ID3D10Device1 ** ppDevice);
81 |
82 | DllExport HRESULT __stdcall hook_D3D11CreateDeviceAndSwapChain(IDXGIAdapter * pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, const D3D_FEATURE_LEVEL * pFeatureLevels, UINT FeatureLevels, UINT SDKVersion, const DXGI_SWAP_CHAIN_DESC * pSwapChainDesc, IDXGISwapChain ** ppSwapChain, ID3D11Device ** ppDevice, D3D_FEATURE_LEVEL * pFeatureLevel, ID3D11DeviceContext **ppImmediateContext);
83 |
84 | // ----
85 |
86 | DllExport HRESULT __stdcall hook_DXGISwapChainPresent(IDXGISwapChain * This, UINT SyncInterval, UINT Flags);
87 |
88 | #endif
89 |
90 |
91 | void get_proc_name();
92 |
93 | extern CpuWatch observe_cpu;
94 | extern GpuWatch observe_gpu;
95 | #if 0
96 | IDirect3D9* (WINAPI* Direct3DCreate9Next)(UINT SDKVersion);
97 |
98 | IDirect3D9* WINAPI Direct3DCreate9Callback(UINT SDKVersion);
99 | #endif
100 |
101 | void WINAPI ExitProcessCallback(UINT uExitCode);
102 |
103 |
104 | /// global varibles
105 |
106 | extern bool rateControl;
107 | extern int maxFps;
108 |
109 |
110 | #endif
111 |
--------------------------------------------------------------------------------
/HookD3D/hook_direct3D_API.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 | #include "d3d10_1.h"
6 | #include "d3dx9tex.h"
7 | #include "dxerr.h"
8 | #include "../utility/log.h"
9 | #include "detours\detours.h"
10 | #include "../utility/utility.h"
11 | #include "../utility/ga_confvar.h"
12 | #include