Skip to content

Commit 32f2573

Browse files
committed
Added string tag support, combined hook verification
* Added InjectFlags.PassStringTag * InjectionDefinition.Inject now accepts constant string tags * TypeDefinitionExtensions.GetInjectionMethod and InjectionDefinition.ctr() now use the same hook method verification method
1 parent ba0e8e1 commit 32f2573

File tree

11 files changed

+755
-423
lines changed

11 files changed

+755
-423
lines changed

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
7+
# Standard to msysgit
8+
*.doc diff=astextplain
9+
*.DOC diff=astextplain
10+
*.docx diff=astextplain
11+
*.DOCX diff=astextplain
12+
*.dot diff=astextplain
13+
*.DOT diff=astextplain
14+
*.pdf diff=astextplain
15+
*.PDF diff=astextplain
16+
*.rtf diff=astextplain
17+
*.RTF diff=astextplain

.gitignore

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
Distribution/*
5+
Build/*
6+
Libs/*.dll
7+
Libs/*.exe
8+
lib/
9+
10+
# User-specific files
11+
*.suo
12+
*.user
13+
*.userosscache
14+
*.sln.docstates
15+
16+
# Build results
17+
[Dd]ebug/
18+
[Dd]ebugPublic/
19+
[Rr]elease/
20+
[Rr]eleases/
21+
x64/
22+
x86/
23+
build/
24+
bld/
25+
[Bb]in/
26+
[Oo]bj/
27+
28+
# Roslyn cache directories
29+
*.ide/
30+
31+
# MSTest test Results
32+
[Tt]est[Rr]esult*/
33+
[Bb]uild[Ll]og.*
34+
35+
#NUNIT
36+
*.VisualState.xml
37+
TestResult.xml
38+
39+
# Build Results of an ATL Project
40+
[Dd]ebugPS/
41+
[Rr]eleasePS/
42+
dlldata.c
43+
44+
*_i.c
45+
*_p.c
46+
*_i.h
47+
*.ilk
48+
*.meta
49+
*.obj
50+
*.pch
51+
*.pdb
52+
*.pgc
53+
*.pgd
54+
*.rsp
55+
*.sbr
56+
*.tlb
57+
*.tli
58+
*.tlh
59+
*.tmp
60+
*.tmp_proj
61+
*.log
62+
*.vspscc
63+
*.vssscc
64+
.builds
65+
*.pidb
66+
*.svclog
67+
*.scc
68+
69+
# Chutzpah Test files
70+
_Chutzpah*
71+
72+
# Visual C++ cache files
73+
ipch/
74+
*.aps
75+
*.ncb
76+
*.opensdf
77+
*.sdf
78+
*.cachefile
79+
80+
# Visual Studio profiler
81+
*.psess
82+
*.vsp
83+
*.vspx
84+
85+
# TFS 2012 Local Workspace
86+
$tf/
87+
88+
# Guidance Automation Toolkit
89+
*.gpState
90+
91+
# ReSharper is a .NET coding add-in
92+
_ReSharper*/
93+
*.[Rr]e[Ss]harper
94+
*.DotSettings.user
95+
96+
# JustCode is a .NET coding addin-in
97+
.JustCode
98+
99+
# TeamCity is a build add-in
100+
_TeamCity*
101+
102+
# DotCover is a Code Coverage Tool
103+
*.dotCover
104+
105+
# NCrunch
106+
_NCrunch_*
107+
.*crunch*.local.xml
108+
109+
# MightyMoose
110+
*.mm.*
111+
AutoTest.Net/
112+
113+
# Web workbench (sass)
114+
.sass-cache/
115+
116+
# Installshield output folder
117+
[Ee]xpress/
118+
119+
# DocProject is a documentation generator add-in
120+
DocProject/buildhelp/
121+
DocProject/Help/*.HxT
122+
DocProject/Help/*.HxC
123+
DocProject/Help/*.hhc
124+
DocProject/Help/*.hhk
125+
DocProject/Help/*.hhp
126+
DocProject/Help/Html2
127+
DocProject/Help/html
128+
129+
# Click-Once directory
130+
publish/
131+
132+
# Publish Web Output
133+
*.[Pp]ublish.xml
134+
*.azurePubxml
135+
# TODO: Comment the next line if you want to checkin your web deploy settings
136+
# but database connection strings (with potential passwords) will be unencrypted
137+
*.pubxml
138+
*.publishproj
139+
140+
# NuGet Packages
141+
*.nupkg
142+
# The packages folder can be ignored because of Package Restore
143+
**/packages/*
144+
# except build/, which is used as an MSBuild target.
145+
!**/packages/build/
146+
# If using the old MSBuild-Integrated Package Restore, uncomment this:
147+
#!**/packages/repositories.config
148+
149+
# Windows Azure Build Output
150+
csx/
151+
*.build.csdef
152+
153+
# Windows Store app package directory
154+
AppPackages/
155+
156+
# Others
157+
sql/
158+
*.Cache
159+
ClientBin/
160+
[Ss]tyle[Cc]op.*
161+
~$*
162+
*~
163+
*.dbmdl
164+
*.dbproj.schemaview
165+
*.pfx
166+
*.publishsettings
167+
node_modules/
168+
169+
# RIA/Silverlight projects
170+
Generated_Code/
171+
172+
# Backup & report files from converting an old project file
173+
# to a newer Visual Studio version. Backup files are not needed,
174+
# because we have git ;-)
175+
_UpgradeReport_Files/
176+
Backup*/
177+
UpgradeLog*.XML
178+
UpgradeLog*.htm
179+
180+
# SQL Server files
181+
*.mdf
182+
*.ldf
183+
184+
# Business Intelligence projects
185+
*.rdl.data
186+
*.bim.layout
187+
*.bim_*.settings
188+
189+
# Microsoft Fakes
190+
FakesAssemblies/
191+
192+
# =========================
193+
# Operating System Files
194+
# =========================
195+
196+
# OSX
197+
# =========================
198+
199+
.DS_Store
200+
.AppleDouble
201+
.LSOverride
202+
203+
# Thumbnails
204+
._*
205+
206+
# Files that might appear on external disk
207+
.Spotlight-V100
208+
.Trashes
209+
210+
# Directories potentially created on remote AFP share
211+
.AppleDB
212+
.AppleDesktop
213+
Network Trash Folder
214+
Temporary Items
215+
.apdisk
216+
217+
# Windows
218+
# =========================
219+
220+
# Windows image file caches
221+
Thumbs.db
222+
ehthumbs.db
223+
224+
# Folder config file
225+
Desktop.ini
226+
227+
# Recycle Bin used on file shares
228+
$RECYCLE.BIN/
229+
230+
# Windows Installer files
231+
*.cab
232+
*.msi
233+
*.msm
234+
*.msp
235+
236+
# Windows shortcuts
237+
*.lnk

Mono.Cecil.Inject/CollectionUtils.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ public static class CollectionUtils
1818
public static void ForEach<T>(this IEnumerable<T> self, Action<T> action)
1919
{
2020
foreach (T var in self)
21-
{
2221
action(var);
23-
}
2422
}
2523

2624
/// <summary>

Mono.Cecil.Inject/Exceptions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public class InjectionDefinitionException : Exception
1111
/// Initialises the exception with a message.
1212
/// </summary>
1313
/// <param name="message">Message to display.</param>
14-
public InjectionDefinitionException(string message) : base(message) {}
14+
public InjectionDefinitionException(string message) : base(message)
15+
{
16+
}
1517
}
1618
}

Mono.Cecil.Inject/ILUtils.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ public static Instruction CopyInstruction(Instruction ins)
1818
if (ins.Operand == null)
1919
result = Instruction.Create(ins.OpCode);
2020
else
21-
{
2221
result =
23-
(Instruction)
24-
typeof (Instruction).GetMethod("Create", new[] {typeof (OpCode), ins.Operand.GetType()})
25-
.Invoke(null, new[] {ins.OpCode, ins.Operand});
26-
}
22+
(Instruction)
23+
typeof(Instruction).GetMethod("Create", new[] {typeof(OpCode), ins.Operand.GetType()})
24+
.Invoke(null, new[] {ins.OpCode, ins.Operand});
2725
return result;
2826
}
2927

0 commit comments

Comments
 (0)