├── .gitattributes ├── .gitignore ├── DllExport.bat ├── README.md ├── TestInject.sln └── TestInject ├── ILMerge.props ├── ILMergeOrder.txt ├── Memory.cs ├── MyLibrary.cs ├── Properties └── AssemblyInfo.cs ├── TestInject.csproj ├── app.config ├── bin └── Debug │ ├── Extreme Injector v3.exe │ ├── MyLibrary.dll │ └── settings.xml └── packages.config /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | # [Dd]ebug/ 18 | # [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | #[Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # ExtremeInjector Settings file 47 | [Bb]in/[Dd]ebug/*.xml; 48 | 49 | # Build Results of an ATL Project 50 | [Dd]ebugPS/ 51 | [Rr]eleasePS/ 52 | dlldata.c 53 | 54 | # Benchmark Results 55 | BenchmarkDotNet.Artifacts/ 56 | 57 | # .NET Core 58 | project.lock.json 59 | project.fragment.lock.json 60 | artifacts/ 61 | 62 | # StyleCop 63 | StyleCopReport.xml 64 | 65 | # Files built by Visual Studio 66 | *_i.c 67 | *_p.c 68 | *_h.h 69 | *.ilk 70 | *.meta 71 | *.obj 72 | *.iobj 73 | *.pch 74 | *.pdb 75 | *.ipdb 76 | *.pgc 77 | *.pgd 78 | *.rsp 79 | *.sbr 80 | *.tlb 81 | *.tli 82 | *.tlh 83 | *.tmp 84 | *.tmp_proj 85 | *_wpftmp.csproj 86 | *.log 87 | *.vspscc 88 | *.vssscc 89 | .builds 90 | *.pidb 91 | *.svclog 92 | *.scc 93 | 94 | # Chutzpah Test files 95 | _Chutzpah* 96 | 97 | # Visual C++ cache files 98 | ipch/ 99 | *.aps 100 | *.ncb 101 | *.opendb 102 | *.opensdf 103 | *.sdf 104 | *.cachefile 105 | *.VC.db 106 | *.VC.VC.opendb 107 | 108 | # Visual Studio profiler 109 | *.psess 110 | *.vsp 111 | *.vspx 112 | *.sap 113 | 114 | # Visual Studio Trace Files 115 | *.e2e 116 | 117 | # TFS 2012 Local Workspace 118 | $tf/ 119 | 120 | # Guidance Automation Toolkit 121 | *.gpState 122 | 123 | # ReSharper is a .NET coding add-in 124 | _ReSharper*/ 125 | *.[Rr]e[Ss]harper 126 | *.DotSettings.user 127 | 128 | # JustCode is a .NET coding add-in 129 | .JustCode 130 | 131 | # TeamCity is a build add-in 132 | _TeamCity* 133 | 134 | # DotCover is a Code Coverage Tool 135 | *.dotCover 136 | 137 | # AxoCover is a Code Coverage Tool 138 | .axoCover/* 139 | !.axoCover/settings.json 140 | 141 | # Visual Studio code coverage results 142 | *.coverage 143 | *.coveragexml 144 | 145 | # NCrunch 146 | _NCrunch_* 147 | .*crunch*.local.xml 148 | nCrunchTemp_* 149 | 150 | # MightyMoose 151 | *.mm.* 152 | AutoTest.Net/ 153 | 154 | # Web workbench (sass) 155 | .sass-cache/ 156 | 157 | # Installshield output folder 158 | [Ee]xpress/ 159 | 160 | # DocProject is a documentation generator add-in 161 | DocProject/buildhelp/ 162 | DocProject/Help/*.HxT 163 | DocProject/Help/*.HxC 164 | DocProject/Help/*.hhc 165 | DocProject/Help/*.hhk 166 | DocProject/Help/*.hhp 167 | DocProject/Help/Html2 168 | DocProject/Help/html 169 | 170 | # Click-Once directory 171 | publish/ 172 | 173 | # Publish Web Output 174 | *.[Pp]ublish.xml 175 | *.azurePubxml 176 | # Note: Comment the next line if you want to checkin your web deploy settings, 177 | # but database connection strings (with potential passwords) will be unencrypted 178 | *.pubxml 179 | *.publishproj 180 | 181 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 182 | # checkin your Azure Web App publish settings, but sensitive information contained 183 | # in these scripts will be unencrypted 184 | PublishScripts/ 185 | 186 | # NuGet Packages 187 | *.nupkg 188 | # The packages folder can be ignored because of Package Restore 189 | **/[Pp]ackages/* 190 | # except build/, which is used as an MSBuild target. 191 | !**/[Pp]ackages/build/ 192 | # Uncomment if necessary however generally it will be regenerated when needed 193 | #!**/[Pp]ackages/repositories.config 194 | # NuGet v3's project.json files produces more ignorable files 195 | *.nuget.props 196 | *.nuget.targets 197 | 198 | # Microsoft Azure Build Output 199 | csx/ 200 | *.build.csdef 201 | 202 | # Microsoft Azure Emulator 203 | ecf/ 204 | rcf/ 205 | 206 | # Windows Store app package directories and files 207 | AppPackages/ 208 | BundleArtifacts/ 209 | Package.StoreAssociation.xml 210 | _pkginfo.txt 211 | *.appx 212 | 213 | # Visual Studio cache files 214 | # files ending in .cache can be ignored 215 | *.[Cc]ache 216 | # but keep track of directories ending in .cache 217 | !?*.[Cc]ache/ 218 | 219 | # Others 220 | ClientBin/ 221 | ~$* 222 | *~ 223 | *.dbmdl 224 | *.dbproj.schemaview 225 | *.jfm 226 | *.pfx 227 | *.publishsettings 228 | orleans.codegen.cs 229 | 230 | # Including strong name files can present a security risk 231 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 232 | #*.snk 233 | 234 | # Since there are multiple workflows, uncomment next line to ignore bower_components 235 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 236 | #bower_components/ 237 | 238 | # RIA/Silverlight projects 239 | Generated_Code/ 240 | 241 | # Backup & report files from converting an old project file 242 | # to a newer Visual Studio version. Backup files are not needed, 243 | # because we have git ;-) 244 | _UpgradeReport_Files/ 245 | Backup*/ 246 | UpgradeLog*.XML 247 | UpgradeLog*.htm 248 | ServiceFabricBackup/ 249 | *.rptproj.bak 250 | 251 | # SQL Server files 252 | *.mdf 253 | *.ldf 254 | *.ndf 255 | 256 | # Business Intelligence projects 257 | *.rdl.data 258 | *.bim.layout 259 | *.bim_*.settings 260 | *.rptproj.rsuser 261 | *- Backup*.rdl 262 | 263 | # Microsoft Fakes 264 | FakesAssemblies/ 265 | 266 | # GhostDoc plugin setting file 267 | *.GhostDoc.xml 268 | 269 | # Node.js Tools for Visual Studio 270 | .ntvs_analysis.dat 271 | node_modules/ 272 | 273 | # Visual Studio 6 build log 274 | *.plg 275 | 276 | # Visual Studio 6 workspace options file 277 | *.opt 278 | 279 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 280 | *.vbw 281 | 282 | # Visual Studio LightSwitch build output 283 | **/*.HTMLClient/GeneratedArtifacts 284 | **/*.DesktopClient/GeneratedArtifacts 285 | **/*.DesktopClient/ModelManifest.xml 286 | **/*.Server/GeneratedArtifacts 287 | **/*.Server/ModelManifest.xml 288 | _Pvt_Extensions 289 | 290 | # Paket dependency manager 291 | .paket/paket.exe 292 | paket-files/ 293 | 294 | # FAKE - F# Make 295 | .fake/ 296 | 297 | # JetBrains Rider 298 | .idea/ 299 | *.sln.iml 300 | 301 | # CodeRush personal settings 302 | .cr/personal 303 | 304 | # Python Tools for Visual Studio (PTVS) 305 | __pycache__/ 306 | *.pyc 307 | 308 | # Cake - Uncomment if you are using it 309 | # tools/** 310 | # !tools/packages.config 311 | 312 | # Tabs Studio 313 | *.tss 314 | 315 | # Telerik's JustMock configuration file 316 | *.jmconfig 317 | 318 | # BizTalk build output 319 | *.btp.cs 320 | *.btm.cs 321 | *.odx.cs 322 | *.xsd.cs 323 | 324 | # OpenCover UI analysis results 325 | OpenCover/ 326 | 327 | # Azure Stream Analytics local run output 328 | ASALocalRun/ 329 | 330 | # MSBuild Binary and Structured Log 331 | *.binlog 332 | 333 | # NVidia Nsight GPU debugger configuration file 334 | *.nvuser 335 | 336 | # MFractors (Xamarin productivity tool) working folder 337 | .mfractor/ 338 | 339 | # Local History for Visual Studio 340 | .localhistory/ 341 | 342 | # BeatPulse healthcheck temp database 343 | healthchecksdb -------------------------------------------------------------------------------- /DllExport.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2016-2020 Denis Kuzmin [ x-3F@outlook.com ] 3 | :: https://github.com/3F/DllExport 4 | if "%~1"=="/?" goto bl 5 | set "aa=%~dpnx0" 6 | set ab=%* 7 | set ac=%* 8 | if defined ab ( 9 | if defined __p_call ( 10 | set ac=%ac:^^=^% 11 | ) else ( 12 | set ab=%ab:^=^^% 13 | ) 14 | ) 15 | set wMgrArgs=%ac% 16 | set ad=%ab:!=^!% 17 | setlocal enableDelayedExpansion 18 | set "ae=^" 19 | set "ad=!ad:%%=%%%%!" 20 | set "ad=!ad:&=%%ae%%&!" 21 | set "af=1.7.0" 22 | set "wAction=Configure" 23 | set "ag=DllExport" 24 | set "ah=tools/net.r_eg.DllExport.Wizard.targets" 25 | set "ai=packages" 26 | set "aj=https://www.nuget.org/api/v2/package/" 27 | set "ak=build_info.txt" 28 | set "al=!aa!" 29 | set "wRootPath=!cd!" 30 | set "am=" 31 | set "an=" 32 | set "ao=" 33 | set "ap=" 34 | set "aq=" 35 | set "ar=" 36 | set "as=" 37 | set "at=" 38 | set "au=" 39 | set /a av=0 40 | if not defined ab ( 41 | if defined wAction goto bm 42 | goto bl 43 | ) 44 | call :bn bg !ad! bh 45 | goto bo 46 | :bl 47 | echo. 48 | @echo .NET DllExport v1.7.0.60761+0a002a7 49 | @echo Copyright (c) 2009-2015 Robert Giesecke 50 | @echo Copyright (c) 2016-2020 Denis Kuzmin [ x-3F@outlook.com ] GitHub/3F 51 | echo. 52 | echo Licensed under the MIT license 53 | @echo https://github.com/3F/DllExport 54 | echo. 55 | echo Based on hMSBuild, MvsSln, +GetNuTool: https://github.com/3F 56 | echo. 57 | @echo. 58 | @echo Usage: DllExport [args to DllExport] [args to GetNuTool] 59 | echo ------ 60 | echo. 61 | echo Arguments: 62 | echo ---------- 63 | echo -action {type} - Specified action for Wizard. Where {type}: 64 | echo * Configure - To configure DllExport for specific projects. 65 | echo * Update - To update pkg reference for already configured projects. 66 | echo * Restore - To restore configured DllExport. 67 | echo * Export - To export configured projects data. 68 | echo * Recover - To re-configure projects via predefined/exported data. 69 | echo * Unset - To unset all data from specified projects. 70 | echo * Upgrade - Aggregates an Update action with additions for upgrading. 71 | echo. 72 | echo -sln-dir {path} - Path to directory with .sln files to be processed. 73 | echo -sln-file {path} - Optional predefined .sln file to be processed. 74 | echo -metalib {path} - Relative path to meta library. 75 | echo -metacor {path} - Relative path to meta core library. 76 | echo -dxp-target {path} - Relative path to entrypoint wrapper of the main core. 77 | echo -dxp-version {num} - Specific version of DllExport. Where {num}: 78 | echo * Versions: 1.6.6 ... 79 | echo * Keywords: 80 | echo `actual` - Unspecified local/latest remote version; 81 | echo ( Only if you know what you are doing ) 82 | echo. 83 | echo -msb {path} - Full path to specific msbuild. 84 | echo -packages {path} - A common directory for packages. 85 | echo -server {url} - Url for searching remote packages. 86 | echo -proxy {cfg} - To use proxy. The format: [usr[:pwd]@]host[:port] 87 | echo -pkg-link {uri} - Direct link to package from the source via specified URI. 88 | echo -force - Aggressive behavior, e.g. like removing pkg when updating. 89 | echo -mgr-up - Updates this manager to version from '-dxp-version'. 90 | echo -wz-target {path} - Relative path to entrypoint wrapper of the main wizard. 91 | echo -pe-exp-list {module} - To list all available exports from PE32/PE32+ module. 92 | echo -eng - Try to use english language for all build messages. 93 | echo -GetNuTool {args} - Access to GetNuTool core. https://github.com/3F/GetNuTool 94 | echo -debug - To show additional information. 95 | echo -version - Displays version for which (together with) it was compiled. 96 | echo -build-info - Displays actual build information from selected DllExport. 97 | echo -help - Displays this help. Aliases: -help -h 98 | echo. 99 | echo ------ 100 | echo Flags: 101 | echo ------ 102 | echo __p_call - To use the call-type logic when invoking %~nx0 103 | echo. 104 | echo -------- 105 | echo Samples: 106 | echo -------- 107 | echo DllExport -action Configure 108 | echo DllExport -action Restore -sln-file "Conari.sln" 109 | echo DllExport -proxy guest:1234@10.0.2.15:7428 -action Configure 110 | echo DllExport -action Configure -force -pkg-link http://host/v1.6.6.nupkg 111 | echo. 112 | echo DllExport -build-info 113 | echo DllExport -debug -restore -sln-dir ..\ 114 | echo DllExport -mgr-up -dxp-version 1.6.6 115 | echo DllExport -action Upgrade -dxp-version 1.6.6 116 | echo. 117 | echo DllExport -GetNuTool -unpack 118 | echo DllExport -GetNuTool /p:ngpackages="Conari;regXwild" 119 | echo DllExport -pe-exp-list bin\Debug\regXwild.dll 120 | goto bp 121 | :bo 122 | set /a aw=0 123 | :bq 124 | set ax=!bg[%aw%]! 125 | if [!ax!]==[-help] ( goto bl ) else if [!ax!]==[-h] ( goto bl ) else if [!ax!]==[-?] ( goto bl ) 126 | if [!ax!]==[-debug] ( 127 | set am=1 128 | goto br 129 | ) else if [!ax!]==[-action] ( set /a "aw+=1" & call :bs bg[!aw!] v 130 | set wAction=!v! 131 | for %%g in (Restore, Configure, Update, Export, Recover, Unset, Upgrade, Default) do ( 132 | if "!v!"=="%%g" goto br 133 | ) 134 | echo Unknown -action !v! 135 | exit/B 1 136 | ) else if [!ax!]==[-sln-dir] ( set /a "aw+=1" & call :bs bg[!aw!] v 137 | set wSlnDir=!v! 138 | goto br 139 | ) else if [!ax!]==[-sln-file] ( set /a "aw+=1" & call :bs bg[!aw!] v 140 | set wSlnFile=!v! 141 | goto br 142 | ) else if [!ax!]==[-metalib] ( set /a "aw+=1" & call :bs bg[!aw!] v 143 | set wMetaLib=!v! 144 | goto br 145 | ) else if [!ax!]==[-metacor] ( set /a "aw+=1" & call :bs bg[!aw!] v 146 | set wMetaCor=!v! 147 | goto br 148 | ) else if [!ax!]==[-dxp-target] ( set /a "aw+=1" & call :bs bg[!aw!] v 149 | set wDxpTarget=!v! 150 | goto br 151 | ) else if [!ax!]==[-dxp-version] ( set /a "aw+=1" & call :bs bg[!aw!] v 152 | set af=!v! 153 | goto br 154 | ) else if [!ax!]==[-msb] ( set /a "aw+=1" & call :bs bg[!aw!] v 155 | set ao=!v! 156 | goto br 157 | ) else if [!ax!]==[-packages] ( set /a "aw+=1" & call :bs bg[!aw!] v 158 | set ai=!v! 159 | goto br 160 | ) else if [!ax!]==[-server] ( set /a "aw+=1" & call :bs bg[!aw!] v 161 | set aj=!v! 162 | goto br 163 | ) else if [!ax!]==[-proxy] ( set /a "aw+=1" & call :bs bg[!aw!] v 164 | set at=!v! 165 | set wProxy=!v! 166 | goto br 167 | ) else if [!ax!]==[-pkg-link] ( set /a "aw+=1" & call :bs bg[!aw!] v 168 | set ap=!v! 169 | goto br 170 | ) else if [!ax!]==[-force] ( 171 | set ar=1 172 | goto br 173 | ) else if [!ax!]==[-mgr-up] ( 174 | set as=1 175 | goto br 176 | ) else if [!ax!]==[-wz-target] ( set /a "aw+=1" & call :bs bg[!aw!] v 177 | set ah=!v! 178 | goto br 179 | ) else if [!ax!]==[-pe-exp-list] ( set /a "aw+=1" & call :bs bg[!aw!] v 180 | set aq=!v! 181 | goto br 182 | ) else if [!ax!]==[-eng] ( 183 | chcp 437 >nul 184 | goto br 185 | ) else if [!ax!]==[-GetNuTool] ( 186 | call :bt "accessing to GetNuTool ..." 187 | for /L %%p IN (0,1,8181) DO ( 188 | if "!ay:~%%p,10!"=="-GetNuTool" ( 189 | set az=!ay:~%%p! 190 | call :bu !az:~10! 191 | set /a av=%ERRORLEVEL% 192 | goto bp 193 | ) 194 | ) 195 | call :bt "!ax! is corrupted: !ay!" 196 | set /a av=1 197 | goto bp 198 | ) else if [!ax!]==[-version] ( 199 | @echo v1.7.0.60761+0a002a7 200 | goto bp 201 | ) else if [!ax!]==[-build-info] ( 202 | set an=1 203 | goto br 204 | ) else if [!ax!]==[-tests] ( set /a "aw+=1" & call :bs bg[!aw!] v 205 | set au=!v! 206 | goto br 207 | ) else ( 208 | echo Incorrect key: !ax! 209 | set /a av=1 210 | goto bp 211 | ) 212 | :br 213 | set /a "aw+=1" & if %aw% LSS !bh! goto bq 214 | :bm 215 | call :bt "dxpName = " ag 216 | call :bt "dxpVersion = " af 217 | call :bt "-sln-dir = " wSlnDir 218 | call :bt "-sln-file = " wSlnFile 219 | call :bt "-metalib = " wMetaLib 220 | call :bt "-metacor = " wMetaCor 221 | call :bt "-dxp-target = " wDxpTarget 222 | call :bt "-wz-target = " ah 223 | if defined af ( 224 | if "!af!"=="actual" ( 225 | set "af=" 226 | ) 227 | ) 228 | set wPkgVer=!af! 229 | if z%wAction%==zUpgrade ( 230 | call :bt "Upgrade is on" 231 | set as=1 232 | set ar=1 233 | ) 234 | call :bv ai 235 | set "ai=!ai!\\" 236 | set "a0=!ag!" 237 | set "wPkgPath=!ai!!ag!" 238 | if defined af ( 239 | set "a0=!a0!/!af!" 240 | set "wPkgPath=!wPkgPath!.!af!" 241 | ) 242 | if defined ar ( 243 | if exist "!wPkgPath!" ( 244 | call :bt "Removing old version before continue. '-force' key rule. " wPkgPath 245 | rmdir /S/Q "!wPkgPath!" 246 | ) 247 | ) 248 | set a1="!wPkgPath!\\!ah!" 249 | call :bt "wPkgPath = " wPkgPath 250 | if not exist !a1! ( 251 | if exist "!wPkgPath!" ( 252 | call :bt "Trying to replace obsolete version ... " wPkgPath 253 | rmdir /S/Q "!wPkgPath!" 254 | ) 255 | call :bt "-pkg-link = " ap 256 | call :bt "-server = " aj 257 | if defined ap ( 258 | set aj=!ap! 259 | if "!aj::=!"=="!aj!" ( 260 | set aj=!cd!/!aj! 261 | ) 262 | if "!wPkgPath::=!"=="!wPkgPath!" ( 263 | set "a2=../" 264 | ) 265 | set "a0=:!a2!!wPkgPath!|" 266 | ) 267 | if defined ao ( 268 | set a3=-msbuild "!ao!" 269 | ) 270 | set a4=!a3! /p:ngserver="!aj!" /p:ngpackages="!a0!" /p:ngpath="!ai!" /p:proxycfg="!at! " 271 | call :bt "GetNuTool call: " a4 272 | if defined am ( 273 | call :bu !a4! 274 | ) else ( 275 | call :bu !a4! >nul 276 | ) 277 | ) 278 | if defined aq ( 279 | "!wPkgPath!\\tools\\PeViewer.exe" -list -pemodule "!aq!" 280 | set /a av=%ERRORLEVEL% 281 | goto bp 282 | ) 283 | if defined an ( 284 | call :bt "buildInfo = " wPkgPath ak 285 | if not exist "!wPkgPath!\\!ak!" ( 286 | echo information about build is not available. 287 | set /a av=2 288 | goto bp 289 | ) 290 | type "!wPkgPath!\\!ak!" 291 | goto bp 292 | ) 293 | if not exist !a1! ( 294 | echo Something went wrong. Try to use another keys. 295 | set /a av=2 296 | goto bp 297 | ) 298 | call :bt "wRootPath = " wRootPath 299 | call :bt "wAction = " wAction 300 | call :bt "wMgrArgs = " wMgrArgs 301 | if defined ao ( 302 | call :bt "Use specific MSBuild tools: " ao 303 | set a5="!ao!" 304 | goto bw 305 | ) 306 | call :bx bi & set a5="!bi!" 307 | if "!ERRORLEVEL!"=="0" goto bw 308 | echo MSBuild tools was not found. Try with `-msb` key. 309 | set /a av=2 310 | goto bp 311 | :bw 312 | if not defined a5 ( 313 | echo Something went wrong. Use `-debug` key for details. 314 | set /a av=2 315 | goto bp 316 | ) 317 | if not defined au ( 318 | if not defined ao if defined wPkgPath set a5="!wPkgPath!\\hMSBuild" 319 | call :bt "Target: " a5 a1 320 | call !a5! /nologo /v:m /m:4 !a1! 321 | ) 322 | :bp 323 | if defined au ( 324 | echo Running Tests ... "!au!" 325 | call :bx bj 326 | "!bj!" /nologo /v:m /m:4 "!au!" 327 | exit/B 0 328 | ) 329 | if defined as ( 330 | (copy /B/Y "!wPkgPath!\\DllExport.bat" "!al!" > nul) && ( echo Manager has been updated. & exit/B 0 ) || ( (echo -mgr-up failed:!av! 1>&2) & exit/B 1 ) 331 | ) 332 | exit/B !av! 333 | :bx 334 | call :bt "Searching from .NET Framework - .NET 4.0, ..." 335 | for %%v in (4.0, 3.5, 2.0) do ( 336 | call :by %%v Y & if defined Y ( 337 | set %1=!Y! 338 | exit/B 0 339 | ) 340 | ) 341 | call :bt "msb -netfx: not found" 342 | set "%1=" 343 | exit/B 2 344 | :by 345 | call :bt "check %1" 346 | for /F "usebackq tokens=2* skip=2" %%a in ( 347 | `reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\%1" /v MSBuildToolsPath 2^> nul` 348 | ) do if exist %%b ( 349 | set a6=%%~b 350 | call :bt ":msbfound " a6 351 | call :bz a6 bk 352 | set %2=!bk! 353 | exit/B 0 354 | ) 355 | set "%2=" 356 | exit/B 0 357 | :bz 358 | set %2=!%~1!\MSBuild.exe 359 | exit/B 0 360 | :bt 361 | if defined am ( 362 | set a7=%1 363 | set a7=!a7:~0,-1! 364 | set a7=!a7:~1! 365 | echo.[%TIME% ] !a7! !%2! !%3! 366 | ) 367 | exit/B 0 368 | :bv 369 | call :b0 %1 370 | call :b1 %1 371 | exit/B 0 372 | :b0 373 | call :b2 %1 "-=1" 374 | exit/B 0 375 | :b1 376 | call :b2 %1 "+=1" 377 | exit/B 0 378 | :b2 379 | set a8=z!%1!z 380 | if "%~2"=="-=1" (set "a9=1") else (set "a9=") 381 | if defined a9 ( 382 | set /a "i=-2" 383 | ) else ( 384 | set /a "i=1" 385 | ) 386 | :b3 387 | if "!a8:~%i%,1!"==" " ( 388 | set /a "i%~2" 389 | goto b3 390 | ) 391 | if defined a9 set /a "i+=1" 392 | if defined a9 ( 393 | set "%1=!a8:~1,%i%!" 394 | ) else ( 395 | set "%1=!a8:~%i%,-1!" 396 | ) 397 | exit/B 0 398 | :bn 399 | set "a_=%~1" 400 | set /a aw=-1 401 | :b4 402 | set /a aw+=1 403 | set %a_%[!aw!]=%~2 404 | shift & if not "%~3"=="" goto b4 405 | set /a aw-=1 406 | set %1=!aw! 407 | exit/B 0 408 | :bs 409 | set %2=!%1! 410 | exit/B 0 411 | :bu 412 | setlocal disableDelayedExpansion 413 | @echo off 414 | :: GetNuTool - Executable version 415 | :: Copyright (c) 2015-2018,2020 Denis Kuzmin [ x-3F@outlook.com ] 416 | :: https://github.com/3F/GetNuTool 417 | set ba=gnt.core 418 | set bb="%temp%\%random%%random%%ba%" 419 | if "%~1"=="-unpack" goto b5 420 | set bc=%* 421 | if defined __p_call if defined bc set bc=%bc:^^=^% 422 | set bd=%__p_msb% 423 | if defined bd goto b6 424 | if "%~1"=="-msbuild" goto b7 425 | for %%v in (4.0, 14.0, 12.0, 3.5, 2.0) do ( 426 | for /F "usebackq tokens=2* skip=2" %%a in ( 427 | `reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\%%v" /v MSBuildToolsPath 2^> nul` 428 | ) do if exist %%b ( 429 | set bd="%%~b\MSBuild.exe" 430 | goto b6 431 | ) 432 | ) 433 | echo MSBuild was not found. Try -msbuild "fullpath" args 1>&2 434 | exit/B 2 435 | :b7 436 | shift 437 | set bd=%1 438 | shift 439 | set be=%bc:!= #__b_ECL## % 440 | setlocal enableDelayedExpansion 441 | set be=!be:%%=%%%%! 442 | :b8 443 | for /F "tokens=1* delims==" %%a in ("!be!") do ( 444 | if "%%~b"=="" ( 445 | call :b9 !be! 446 | exit/B %ERRORLEVEL% 447 | ) 448 | set be=%%a #__b_EQ## %%b 449 | ) 450 | goto b8 451 | :b9 452 | shift & shift 453 | set "bc=" 454 | :b_ 455 | set bc=!bc! %1 456 | shift & if not "%~2"=="" goto b_ 457 | set bc=!bc: #__b_EQ## ==! 458 | setlocal disableDelayedExpansion 459 | set bc=%bc: #__b_ECL## =!% 460 | :b6 461 | call :ca 462 | call %bd% %bb% /nologo /p:wpath="%cd%/" /v:m /m:4 %bc% 463 | set "bd=" 464 | set bf=%ERRORLEVEL% 465 | del /Q/F %bb% 466 | exit/B %bf% 467 | :b5 468 | set bb="%cd%\%ba%" 469 | echo Generating minified version in %bb% ... 470 | :ca 471 | %bb% 472 | set a=PropertyGroup&set b=Condition&set c=ngpackages&set d=Target&set e=DependsOnTargets&set f=TaskCoreDllPath&set g=MSBuildToolsPath&set h=UsingTask&set i=CodeTaskFactory&set j=ParameterGroup&set k=Reference&set l=Include&set m=System&set n=Using&set o=Namespace&set p=IsNullOrEmpty&set q=return&set r=string&set s=delegate&set t=foreach&set u=WriteLine&set v=Combine&set w=Console.WriteLine&set x=Directory&set y=GetNuTool&set z=StringComparison&set _=EXT_NUSPEC 473 | ^ 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 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 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /TestInject/ILMergeOrder.txt: -------------------------------------------------------------------------------- 1 | # this file contains the partial list of the merged assemblies in the merge order 2 | # you can fill it from the obj\CONFIG\PROJECT.ilmerge generated on every build 3 | # and finetune merge order to your satisfaction 4 | 5 | -------------------------------------------------------------------------------- /TestInject/Memory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.ComponentModel; 4 | using System.Diagnostics; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Reflection; 9 | using System.Runtime.CompilerServices; 10 | using System.Runtime.InteropServices; 11 | using System.Security; 12 | using System.Text; 13 | 14 | namespace TestInject 15 | { 16 | public class Memory 17 | { 18 | public const string MODULE_NAME = "MyLibrary.dll"; 19 | public static Process HostProcess; 20 | public static ProcessModule OurModule; 21 | 22 | static Memory(/* string moduleName */) 23 | { 24 | HostProcess = Process.GetCurrentProcess(); 25 | /* MODULE_NAME = moduleName */ 26 | OurModule = HostProcess?.FindProcessModule(MODULE_NAME); 27 | } 28 | 29 | public static void UpdateProcessInformation() 30 | { 31 | HostProcess = Process.GetCurrentProcess(); 32 | OurModule = HostProcess?.FindProcessModule(MODULE_NAME); 33 | } 34 | 35 | public class Reader 36 | { 37 | public static unsafe byte[] ReadBytes(IntPtr location, uint numBytes) 38 | { 39 | byte[] buff = new byte[numBytes]; 40 | 41 | fixed (void* bufferPtr = buff) 42 | { 43 | Unsafe.CopyBlockUnaligned(bufferPtr, (void*)location, numBytes); 44 | return buff; 45 | } 46 | } 47 | 48 | public static unsafe T Read(IntPtr location) 49 | => Unsafe.Read(location.ToPointer()); 50 | 51 | public static string ReadString(IntPtr location, Encoding encodingType, int maxLength = 256) 52 | { 53 | var data = ReadBytes(location, (uint)maxLength); 54 | var text = new string(encodingType.GetChars(data)); 55 | if (text.Contains("\0")) 56 | text = text.Substring(0, text.IndexOf('\0')); 57 | return text; 58 | } 59 | } 60 | 61 | public class Writer 62 | { 63 | public static unsafe void WriteBytes(IntPtr location, byte[] buffer) 64 | { 65 | if (location == IntPtr.Zero) return; 66 | if (buffer == null || buffer.Length < 1) return; 67 | 68 | var ptr = (void*)location; 69 | fixed (void* pBuff = buffer) 70 | { 71 | Unsafe.CopyBlockUnaligned(ptr, pBuff, (uint)buffer.Length); 72 | } 73 | } 74 | 75 | public static unsafe void Write(IntPtr location, T value) 76 | => Unsafe.Write(location.ToPointer(), value); 77 | 78 | public static void WriteString(IntPtr location, string str, Encoding encodingType) 79 | { 80 | byte[] bytes = encodingType.GetBytes(str); 81 | WriteBytes(location, bytes); 82 | } 83 | } 84 | 85 | public class Pattern 86 | { 87 | public static unsafe ulong FindPattern(string processModule, string pattern, bool resultAbsolute = true) 88 | { 89 | UpdateProcessInformation(); 90 | 91 | ProcessModule pm = default; 92 | if (string.IsNullOrEmpty(processModule)) 93 | { 94 | // Scan all process modules 95 | // return first result 96 | 97 | return 0; 98 | } 99 | else 100 | { 101 | pm = HostProcess.Modules.Cast().FirstOrDefault(x => string.Equals(x.ModuleName, processModule, StringComparison.CurrentCultureIgnoreCase)); 102 | if (pm == null) 103 | return 0; 104 | } 105 | 106 | byte[] buffer = new byte[pm.ModuleMemorySize]; 107 | try 108 | { 109 | buffer = Reader.ReadBytes(pm.BaseAddress, (uint)pm.ModuleMemorySize); 110 | } 111 | catch 112 | { 113 | Console.WriteLine($"ReadBytes(location: 0x{pm.BaseAddress.ToInt32():X8}, numBytes: {buffer.Length}) failed ..."); 114 | return 0; 115 | } 116 | 117 | if (buffer == null || buffer.Length < 1) return 0; 118 | 119 | var tmpSplitPattern = pattern.TrimStart(' ').TrimEnd(' ').Split(' '); 120 | 121 | var tmpPattern = new byte[tmpSplitPattern.Length]; 122 | var tmpMask = new byte[tmpSplitPattern.Length]; 123 | 124 | for (var i = 0; i < tmpSplitPattern.Length; i++) 125 | { 126 | var ba = tmpSplitPattern[i]; 127 | 128 | if (ba == "??" || ba.Length == 1 && ba == "?") 129 | { 130 | tmpMask[i] = 0x00; 131 | tmpSplitPattern[i] = "0x00"; 132 | } 133 | else if (char.IsLetterOrDigit(ba[0]) && ba[1] == '?') 134 | { 135 | tmpMask[i] = 0xF0; 136 | tmpSplitPattern[i] = ba[0] + "0"; 137 | } 138 | else if (char.IsLetterOrDigit(ba[1]) && ba[0] == '?') 139 | { 140 | tmpMask[i] = 0x0F; 141 | tmpSplitPattern[i] = "0" + ba[1]; 142 | } 143 | else 144 | { 145 | tmpMask[i] = 0xFF; 146 | } 147 | } 148 | 149 | for (var i = 0; i < tmpSplitPattern.Length; i++) 150 | tmpPattern[i] = (byte)(Convert.ToByte(tmpSplitPattern[i], 16) & tmpMask[i]); 151 | 152 | if (tmpMask.Length != tmpPattern.Length) 153 | throw new ArgumentException($"{nameof(pattern)}.Length != {nameof(tmpMask)}.Length"); 154 | 155 | long result = 0 - tmpPattern.LongLength; 156 | fixed (byte* pPacketBuffer = buffer) 157 | { 158 | do 159 | { 160 | result = HelperMethods.FindPattern(pPacketBuffer, buffer.Length, tmpPattern, tmpMask, result + tmpPattern.LongLength); 161 | if (result >= 0) 162 | return resultAbsolute ? (ulong)pm.BaseAddress.ToInt64() + (ulong)result : (ulong)result; 163 | } while (result != -1); 164 | } 165 | return 0; 166 | } 167 | } 168 | 169 | public class Allocator 170 | { 171 | public class Managed 172 | { 173 | public static IntPtr ManagedAllocate(int size) 174 | => Marshal.AllocHGlobal(size); 175 | 176 | public static void ManagedFree(IntPtr address) 177 | => Marshal.FreeHGlobal(address); 178 | } 179 | public class Unmanaged 180 | { 181 | public static IntPtr Allocate(uint size, Enums.AllocationType flAllocType = Enums.AllocationType.Commit | Enums.AllocationType.Reserve, Enums.MemoryProtection flMemProtectType = Enums.MemoryProtection.ExecuteReadWrite) 182 | => PInvoke.VirtualAlloc(IntPtr.Zero, new UIntPtr(size), flAllocType, flMemProtectType); 183 | 184 | public static bool FreeMemory(IntPtr address, uint optionalSize = 0) 185 | => PInvoke.VirtualFree(address, optionalSize, Enums.FreeType.Release); 186 | } 187 | } 188 | 189 | public class Protection 190 | { 191 | public static bool SetPageProtection(IntPtr baseAddress, int size, Enums.MemoryProtection newProtection, out Enums.MemoryProtection oldProtection) 192 | { 193 | bool res = PInvoke.VirtualProtect(baseAddress, size, newProtection, out var oldProtect); 194 | oldProtection = oldProtect; 195 | return res; 196 | } 197 | public static bool GetPageProtection(IntPtr baseAddress, out Structures.MEMORY_BASIC_INFORMATION pageinfo) 198 | { 199 | int res = PInvoke.VirtualQuery(baseAddress, 200 | out pageinfo, 201 | (uint)Marshal.SizeOf()); 202 | return res == Marshal.SizeOf(); 203 | } 204 | } 205 | 206 | public class Threads 207 | { 208 | public static void SuspendProcess() 209 | { 210 | UpdateProcessInformation(); 211 | 212 | ProcessModule ourModule = OurModule; 213 | ProcessModule clrJit = HostProcess.FindProcessModule("clrjit.dll"); 214 | ProcessModule clr = HostProcess.FindProcessModule("clr.dll"); 215 | 216 | foreach (ProcessThread pT in HostProcess.Threads) 217 | { 218 | // Dont suspend any threads started from our module, clr.dll module or clr_jit.dll module 219 | if ((pT.StartAddress.ToInt64() >= ourModule.BaseAddress.ToInt64() || pT.StartAddress.ToInt64() <= (ourModule.BaseAddress + ourModule.ModuleMemorySize).ToInt64()) || 220 | (pT.StartAddress.ToInt64() >= clrJit.BaseAddress.ToInt64() || pT.StartAddress.ToInt64() <= (clrJit.BaseAddress + clrJit.ModuleMemorySize).ToInt64()) || 221 | (pT.StartAddress.ToInt64() >= clr.BaseAddress.ToInt64() || pT.StartAddress.ToInt64() <= (clr.BaseAddress + clr.ModuleMemorySize).ToInt64())) continue; 222 | 223 | IntPtr pOpenThread = PInvoke.OpenThread(Enums.ThreadAccess.SUSPEND_RESUME, false, (uint)pT.Id); 224 | if (pOpenThread == IntPtr.Zero) 225 | continue; 226 | 227 | PInvoke.SuspendThread(pOpenThread); 228 | PInvoke.CloseHandle(pOpenThread); 229 | } 230 | } 231 | public static void ResumeProcess() 232 | { 233 | if (HostProcess.ProcessName == string.Empty) 234 | return; 235 | 236 | foreach (ProcessThread pT in HostProcess.Threads) 237 | { 238 | IntPtr pOpenThread = PInvoke.OpenThread(Enums.ThreadAccess.SUSPEND_RESUME, false, (uint)pT.Id); 239 | 240 | if (pOpenThread == IntPtr.Zero) 241 | continue; 242 | 243 | var suspendCount = 0; 244 | do 245 | { 246 | suspendCount = PInvoke.ResumeThread(pOpenThread); 247 | } while (suspendCount > 0); 248 | 249 | PInvoke.CloseHandle(pOpenThread); 250 | } 251 | } 252 | } 253 | 254 | public class Modules 255 | { 256 | public static IntPtr GetModuleBaseAddress(string moduleName) 257 | { 258 | UpdateProcessInformation(); 259 | foreach (ProcessModule pm in HostProcess.Modules) 260 | if (string.Equals(pm.ModuleName, moduleName, StringComparison.CurrentCultureIgnoreCase)) 261 | return pm.BaseAddress; 262 | return PInvoke.GetModuleHandle(moduleName); 263 | } 264 | } 265 | 266 | public class Structures 267 | { 268 | [StructLayout(LayoutKind.Sequential)] 269 | public struct Vector4 270 | { 271 | public float X; 272 | public float Y; 273 | public float Z; 274 | public float W; 275 | } 276 | 277 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 278 | public struct Vector 279 | { 280 | public float X; 281 | public float Y; 282 | 283 | public Vector(float x, float y) 284 | { 285 | X = x; 286 | Y = y; 287 | } 288 | } 289 | 290 | [StructLayout(LayoutKind.Sequential)] 291 | public struct D3DMATRIX 292 | { 293 | public float _11, _12, _13, _14; 294 | public float _21, _22, _23, _24; 295 | public float _31, _32, _33, _34; 296 | public float _41, _42, _43, _44; 297 | 298 | public float[][] As2DArray() 299 | { 300 | return new float[4][] 301 | { 302 | new[] { _11, _12, _13, _14 }, 303 | new[] { _21, _22, _23, _24 }, 304 | new[] { _31, _32, _33, _34 }, 305 | new[] { _41, _42, _43, _44 }, 306 | }; 307 | } 308 | public float[] AsArray() 309 | { 310 | return new[] 311 | { 312 | _11, _12, _13, _14, 313 | _21, _22, _23, _24, 314 | _31, _32, _33, _34, 315 | _41, _42, _43, _44 316 | }; 317 | } 318 | } 319 | 320 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 321 | public unsafe struct Vector3 322 | { 323 | public Vector3(float x, float y, float z) 324 | { 325 | X = x; 326 | Y = y; 327 | Z = z; 328 | } 329 | 330 | public float X; 331 | public float Y; 332 | public float Z; 333 | 334 | public Vector3 Zero => new Vector3(0, 0, 0); 335 | 336 | public bool World2Screen(float[] matrix, out Vector screenPosition) 337 | { 338 | if (matrix == null || matrix.Length != 16) 339 | { 340 | screenPosition = new Vector(0f, 0f); 341 | return false; 342 | } 343 | 344 | Vector4 vec = new Vector4 345 | { 346 | X = this.X * matrix[0] + this.Y * matrix[4] + this.Z * matrix[8] + matrix[12], 347 | Y = this.X * matrix[1] + this.Y * matrix[5] + this.Z * matrix[9] + matrix[13], 348 | Z = this.X * matrix[2] + this.Y * matrix[6] + this.Z * matrix[10] + matrix[14], 349 | W = this.X * matrix[3] + this.Y * matrix[7] + this.Z * matrix[11] + matrix[15] 350 | }; 351 | 352 | if (vec.W < 0.1f) 353 | { 354 | screenPosition = new Vector(0f, 0f); 355 | return false; 356 | } 357 | 358 | Vector3 NDC = new Vector3 359 | { 360 | X = vec.X / vec.W, 361 | Y = vec.Y / vec.W, 362 | Z = vec.Z / vec.Z 363 | }; 364 | 365 | int* w = (int*)0x00510C94; 366 | int* h = (int*)0x00510C98; 367 | 368 | 369 | screenPosition = new Vector 370 | { 371 | X = (*w / 2 * NDC.X) + (NDC.X + *w / 2), 372 | Y = -(*h / 2 * NDC.Y) + (NDC.Y + *h / 2) 373 | }; 374 | return true; 375 | } 376 | 377 | public float Max => (X > Y) ? ((X > Z) ? X : Z) : ((Y > Z) ? Y : Z); 378 | public float Min => (X < Y) ? ((X < Z) ? X : Z) : ((Y < Z) ? Y : Z); 379 | public float EuclideanNorm => (float)Math.Sqrt(X * X + Y * Y + Z * Z); 380 | public float Square => X * X + Y * Y + Z * Z; 381 | public float Magnitude => (float)Math.Sqrt(SumComponentSqrs()); 382 | public float Distance(Vector3 v1, Vector3 v2) 383 | { 384 | return 385 | (float)Math.Sqrt 386 | ( 387 | (v1.X - v2.X) * (v1.X - v2.X) + 388 | (v1.Y - v2.Y) * (v1.Y - v2.Y) + 389 | (v1.Z - v2.Z) * (v1.Z - v2.Z) 390 | ); 391 | } 392 | public float Distance(Vector3 other) 393 | { 394 | return Distance(this, other); 395 | } 396 | 397 | public float Normalize() 398 | { 399 | float norm = (float)System.Math.Sqrt(X * X + Y * Y + Z * Z); 400 | float invNorm = 1.0f / norm; 401 | 402 | X *= invNorm; 403 | Y *= invNorm; 404 | Z *= invNorm; 405 | 406 | return norm; 407 | } 408 | public Vector3 Inverse() 409 | { 410 | return new Vector3( 411 | (X == 0) ? 0 : 1.0f / X, 412 | (Y == 0) ? 0 : 1.0f / Y, 413 | (Z == 0) ? 0 : 1.0f / Z); 414 | } 415 | public Vector3 Abs() 416 | { 417 | return new Vector3(Math.Abs(X), Math.Abs(Y), Math.Abs(Z)); 418 | } 419 | public Vector3 CrossProduct(Vector3 vector1, Vector3 vector2) 420 | { 421 | return new Vector3( 422 | vector1.Y * vector2.Z - vector1.Z * vector2.Y, 423 | vector1.Z * vector2.X - vector1.X * vector2.Z, 424 | vector1.X * vector2.Y - vector1.Y * vector2.X); 425 | } 426 | public float DotProduct(Vector3 vector1, Vector3 vector2) 427 | { 428 | return vector1.X * vector2.X + vector1.Y * vector2.Y + vector1.Z * vector2.Z; 429 | } 430 | 431 | 432 | public override string ToString() 433 | { 434 | return string.Format(CultureInfo.InvariantCulture, 435 | "{0}, {1}, {2}", X, Y, Z); 436 | } 437 | public float[] ToArray() 438 | { 439 | return new float[3] { X, Y, Z }; 440 | } 441 | 442 | public float this[int index] 443 | { 444 | get 445 | { 446 | switch (index) 447 | { 448 | case 0: { return X; } 449 | case 1: { return Y; } 450 | case 2: { return Z; } 451 | default: throw new IndexOutOfRangeException($"Range is from 0 to 2"); 452 | } 453 | } 454 | } 455 | 456 | public static Vector3 operator +(Vector3 vector, float value) 457 | { 458 | return new Vector3(vector.X + value, vector.Y + value, vector.Z + value); 459 | } 460 | public static Vector3 operator +(Vector3 vector1, Vector3 vector2) 461 | { 462 | return new Vector3(vector1.X + vector2.X, vector1.Y + vector2.Y, vector1.Z + vector2.Z); 463 | } 464 | public Vector3 Add(Vector3 vector1, Vector3 vector2) 465 | { 466 | return vector1 + vector2; 467 | } 468 | public Vector3 Add(Vector3 vector, float value) 469 | { 470 | return vector + value; 471 | } 472 | 473 | private Vector3 SqrComponents(Vector3 v1) 474 | { 475 | return 476 | ( 477 | new Vector3 478 | ( 479 | v1.X * v1.X, 480 | v1.Y * v1.Y, 481 | v1.Z * v1.Z 482 | ) 483 | ); 484 | } 485 | private double SumComponentSqrs(Vector3 v1) 486 | { 487 | Vector3 v2 = SqrComponents(v1); 488 | return v2.SumComponents(); 489 | } 490 | private double SumComponentSqrs() 491 | { 492 | return SumComponentSqrs(this); 493 | } 494 | private double SumComponents(Vector3 v1) 495 | { 496 | return (v1.X + v1.Y + v1.Z); 497 | } 498 | private double SumComponents() 499 | { 500 | return SumComponents(this); 501 | } 502 | 503 | public static Vector3 operator -(Vector3 vector1, Vector3 vector2) 504 | { 505 | return new Vector3(vector1.X - vector2.X, vector1.Y - vector2.Y, vector1.Z - vector2.Z); 506 | } 507 | public Vector3 Subtract(Vector3 vector1, Vector3 vector2) 508 | { 509 | return vector1 - vector2; 510 | } 511 | public static Vector3 operator -(Vector3 vector, float value) 512 | { 513 | return new Vector3(vector.X - value, vector.Y - value, vector.Z - value); 514 | } 515 | public Vector3 Subtract(Vector3 vector, float value) 516 | { 517 | return vector - value; 518 | } 519 | 520 | public static Vector3 operator *(Vector3 vector1, Vector3 vector2) 521 | { 522 | return new Vector3(vector1.X * vector2.X, vector1.Y * vector2.Y, vector1.Z * vector2.Z); 523 | } 524 | public Vector3 Multiply(Vector3 vector1, Vector3 vector2) 525 | { 526 | return vector1 * vector2; 527 | } 528 | public static Vector3 operator *(Vector3 vector, float factor) 529 | { 530 | return new Vector3(vector.X * factor, vector.Y * factor, vector.Z * factor); 531 | } 532 | public Vector3 Multiply(Vector3 vector, float factor) 533 | { 534 | return vector * factor; 535 | } 536 | 537 | public static Vector3 operator /(Vector3 vector1, Vector3 vector2) 538 | { 539 | return new Vector3(vector1.X / vector2.X, vector1.Y / vector2.Y, vector1.Z / vector2.Z); 540 | } 541 | public Vector3 Divide(Vector3 vector1, Vector3 vector2) 542 | { 543 | return vector1 / vector2; 544 | } 545 | public static Vector3 operator /(Vector3 vector, float factor) 546 | { 547 | return new Vector3(vector.X / factor, vector.Y / factor, vector.Z / factor); 548 | } 549 | public Vector3 Divide(Vector3 vector, float factor) 550 | { 551 | return vector / factor; 552 | } 553 | 554 | public static bool operator ==(Vector3 vector1, Vector3 vector2) 555 | { 556 | return ((vector1.X == vector2.X) && (vector1.Y == vector2.Y) && (vector1.Z == vector2.Z)); 557 | } 558 | public static bool operator !=(Vector3 vector1, Vector3 vector2) 559 | { 560 | return ((vector1.X != vector2.X) || (vector1.Y != vector2.Y) || (vector1.Z != vector2.Z)); 561 | } 562 | 563 | public static bool operator <(Vector3 v1, Vector3 v2) 564 | { 565 | return v1.SumComponentSqrs() < v2.SumComponentSqrs(); 566 | } 567 | public static bool operator <=(Vector3 v1, Vector3 v2) 568 | { 569 | return v1.SumComponentSqrs() <= v2.SumComponentSqrs(); 570 | } 571 | 572 | public static bool operator >=(Vector3 v1, Vector3 v2) 573 | { 574 | return v1.SumComponentSqrs() >= v2.SumComponentSqrs(); 575 | } 576 | public static bool operator >(Vector3 v1, Vector3 v2) 577 | { 578 | return v1.SumComponentSqrs() > v2.SumComponentSqrs(); 579 | } 580 | 581 | 582 | public bool Equals(Vector3 vector) 583 | { 584 | return ((vector.X == X) && (vector.Y == Y) && (vector.Z == Z)); 585 | } 586 | public override bool Equals(object obj) 587 | { 588 | if (obj is Vector3 vector3) 589 | { 590 | return Equals(vector3); 591 | } 592 | return false; 593 | } 594 | 595 | public override int GetHashCode() 596 | { 597 | return X.GetHashCode() + Y.GetHashCode() + Z.GetHashCode(); 598 | } 599 | } 600 | 601 | [StructLayout(LayoutKind.Sequential)] 602 | public struct MEMORY_BASIC_INFORMATION 603 | { 604 | public IntPtr BaseAddress; 605 | public IntPtr AllocationBase; 606 | public Enums.AllocationType AllocationProtect; 607 | public IntPtr RegionSize; 608 | public Enums.MemoryState State; 609 | public Enums.MemoryProtection Protect; 610 | public Enums.MemoryType Type; 611 | } 612 | } 613 | public class Enums 614 | { 615 | [Flags] 616 | public enum AllocationType 617 | { 618 | Commit = 0x1000, 619 | Reserve = 0x2000, 620 | Decommit = 0x4000, 621 | Release = 0x8000, 622 | Reset = 0x80000, 623 | Physical = 0x400000, 624 | TopDown = 0x100000, 625 | WriteWatch = 0x200000, 626 | LargePages = 0x20000000 627 | } 628 | 629 | [Flags] 630 | public enum MemoryProtection 631 | { 632 | Execute = 0x10, 633 | ExecuteRead = 0x20, 634 | ExecuteReadWrite = 0x40, 635 | ExecuteWriteCopy = 0x80, 636 | NoAccess = 0x01, 637 | ReadOnly = 0x02, 638 | ReadWrite = 0x04, 639 | WriteCopy = 0x08, 640 | GuardModifierflag = 0x100, 641 | NoCacheModifierflag = 0x200, 642 | WriteCombineModifierflag = 0x400 643 | } 644 | 645 | public enum FreeType 646 | { 647 | Decommit = 0x4000, 648 | Release = 0x8000, 649 | } 650 | 651 | [Flags] 652 | public enum MemoryState : uint 653 | { 654 | MEM_COMMIT = 0x1000, 655 | MEM_FREE = 0x10000, 656 | MEM_RESERVE = 0x2000 657 | } 658 | 659 | [Flags] 660 | public enum MemoryType : uint 661 | { 662 | MEM_IMAGE = 0x1000000, 663 | MEM_MAPPED = 0x40000, 664 | MEM_PRIVATE = 0x20000 665 | } 666 | 667 | [Flags] 668 | public enum DesiredAccess : uint 669 | { 670 | GenericRead = 0x80000000, 671 | GenericWrite = 0x40000000, 672 | GenericExecute = 0x20000000, 673 | GenericAll = 0x10000000 674 | } 675 | 676 | public enum StdHandle : int 677 | { 678 | Input = -10, 679 | Output = -11, 680 | Error = -12 681 | } 682 | 683 | public enum ThreadAccess : int 684 | { 685 | TERMINATE = (0x0001), 686 | SUSPEND_RESUME = (0x0002), 687 | GET_CONTEXT = (0x0008), 688 | SET_CONTEXT = (0x0010), 689 | SET_INFORMATION = (0x0020), 690 | QUERY_INFORMATION = (0x0040), 691 | SET_THREAD_TOKEN = (0x0080), 692 | IMPERSONATE = (0x0100), 693 | DIRECT_IMPERSONATION = (0x0200) 694 | } 695 | } 696 | public class PInvoke 697 | { 698 | [DllImport("kernel32", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)] 699 | public static extern IntPtr GetProcAddress(IntPtr hModule, string procName); 700 | 701 | [DllImport("kernel32.dll", SetLastError = true)] 702 | public static extern IntPtr VirtualAlloc(IntPtr lpAddress, UIntPtr dwSize, Enums.AllocationType lAllocationType, Enums.MemoryProtection flProtect); 703 | 704 | [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)] 705 | public static extern bool VirtualFree(IntPtr lpAddress, 706 | uint dwSize, Enums.FreeType dwFreeType); 707 | 708 | [DllImport("kernel32.dll", SetLastError = true)] 709 | public static extern bool VirtualProtect(IntPtr lpAddress, int dwSize, 710 | Enums.MemoryProtection flNewProtect, out Enums.MemoryProtection lpflOldProtect); 711 | 712 | [DllImport("kernel32.dll", SetLastError = true)] 713 | public static extern int VirtualQuery(IntPtr lpAddress, out Structures.MEMORY_BASIC_INFORMATION lpBuffer, uint dwLength); 714 | 715 | [DllImport("kernel32.dll")] 716 | public static extern bool AllocConsole(); 717 | 718 | [DllImport("kernel32.dll", SetLastError = true)] 719 | public static extern IntPtr CreateFile(string lpFileName 720 | , [MarshalAs(UnmanagedType.U4)] Enums.DesiredAccess dwDesiredAccess 721 | , [MarshalAs(UnmanagedType.U4)] FileShare dwShareMode 722 | , uint lpSecurityAttributes 723 | , [MarshalAs(UnmanagedType.U4)] FileMode dwCreationDisposition 724 | , [MarshalAs(UnmanagedType.U4)] FileAttributes dwFlagsAndAttributes 725 | , uint hTemplateFile); 726 | 727 | [DllImport("kernel32.dll", SetLastError = true)] 728 | public static extern bool SetStdHandle(Enums.StdHandle nStdHandle, IntPtr hHandle); 729 | 730 | [DllImport("kernel32.dll")] 731 | public static extern IntPtr OpenThread(Enums.ThreadAccess dwDesiredAccess, bool bInheritHandle, uint dwThreadId); 732 | 733 | [DllImport("kernel32.dll")] 734 | public static extern int SuspendThread(IntPtr hThread); 735 | 736 | [DllImport("kernel32.dll", SetLastError = true)] 737 | public static extern int ResumeThread(IntPtr hThread); 738 | 739 | [DllImport("kernel32.dll", SetLastError = true)] 740 | [SuppressUnmanagedCodeSecurity] 741 | [return: MarshalAs(UnmanagedType.Bool)] 742 | public static extern bool CloseHandle(IntPtr hObject); 743 | 744 | [DllImport("kernel32.dll", SetLastError = true)] 745 | public static extern void SetLastError(uint dwErrorCode); 746 | 747 | [DllImport("kernel32.dll", CharSet = CharSet.Auto)] 748 | public static extern IntPtr GetModuleHandle(string lpModuleName); 749 | } 750 | } 751 | 752 | public class DebugConsole 753 | { 754 | public static bool InitiateDebugConsole() 755 | { 756 | if (Memory.PInvoke.AllocConsole()) 757 | { 758 | //https://developercommunity.visualstudio.com/content/problem/12166/console-output-is-gone-in-vs2017-works-fine-when-d.html 759 | // Console.OpenStandardOutput eventually calls into GetStdHandle. As per MSDN documentation of GetStdHandle: http://msdn.microsoft.com/en-us/library/windows/desktop/ms683231(v=vs.85).aspx will return the redirected handle and not the allocated console: 760 | // "The standard handles of a process may be redirected by a call to SetStdHandle, in which case GetStdHandle returns the redirected handle. If the standard handles have been redirected, you can specify the CONIN$ value in a call to the CreateFile function to get a handle to a console's input buffer. Similarly, you can specify the CONOUT$ value to get a handle to a console's active screen buffer." 761 | // Get the handle to CONOUT$. 762 | var stdOutHandle = Memory.PInvoke.CreateFile("CONOUT$", Memory.Enums.DesiredAccess.GenericRead | Memory.Enums.DesiredAccess.GenericWrite, FileShare.ReadWrite, 0, FileMode.Open, FileAttributes.Normal, 0); 763 | var stdInHandle = Memory.PInvoke.CreateFile("CONIN$", Memory.Enums.DesiredAccess.GenericRead | Memory.Enums.DesiredAccess.GenericWrite, FileShare.ReadWrite, 0, FileMode.Open, FileAttributes.Normal, 0); 764 | 765 | if (stdOutHandle == new IntPtr(-1)) 766 | { 767 | throw new Win32Exception(Marshal.GetLastWin32Error()); 768 | } 769 | 770 | if (stdInHandle == new IntPtr(-1)) 771 | { 772 | throw new Win32Exception(Marshal.GetLastWin32Error()); 773 | } 774 | 775 | 776 | if (!Memory.PInvoke.SetStdHandle(Memory.Enums.StdHandle.Output, stdOutHandle)) 777 | { 778 | throw new Win32Exception(Marshal.GetLastWin32Error()); 779 | } 780 | 781 | if (!Memory.PInvoke.SetStdHandle(Memory.Enums.StdHandle.Input, stdInHandle)) 782 | { 783 | throw new Win32Exception(Marshal.GetLastWin32Error()); 784 | } 785 | 786 | var standardOutput = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true }; 787 | var standardInput = new StreamReader(Console.OpenStandardInput()); 788 | 789 | Console.SetIn(standardInput); 790 | Console.SetOut(standardOutput); 791 | return true; 792 | } 793 | return false; 794 | } 795 | } 796 | 797 | public class HelperMethods 798 | { 799 | public static void PrintExceptionData(object exceptionObj, bool writeToFile = false) 800 | { 801 | if (exceptionObj == null) return; 802 | Type actualType = exceptionObj.GetType(); 803 | 804 | Exception exceptionObject = exceptionObj as Exception; 805 | 806 | var s = new StackTrace(exceptionObject); 807 | var thisasm = Assembly.GetExecutingAssembly(); 808 | 809 | var methodName = s.GetFrames().Select(f => f.GetMethod()).First(m => m.Module.Assembly == thisasm).Name; 810 | var parameterInfo = s.GetFrames().Select(f => f.GetMethod()).First(m => m.Module.Assembly == thisasm).GetParameters(); 811 | var methodReturnType = s.GetFrame(1).GetMethod().GetType(); 812 | 813 | var lineNumber = s.GetFrame(0).GetFileLineNumber(); 814 | 815 | // string formatedMethodNameAndParameters = $"{methodReturnType} {methodName}("; 816 | string formatedMethodNameAndParameters = $"{methodName}("; 817 | 818 | if (parameterInfo.Length < 1) 819 | { 820 | formatedMethodNameAndParameters += ")"; 821 | } 822 | else 823 | { 824 | for (int n = 0; n < parameterInfo.Length; n++) 825 | { 826 | ParameterInfo param = parameterInfo[n]; 827 | string parameterName = param.Name; 828 | 829 | if (n == parameterInfo.Length - 1) 830 | formatedMethodNameAndParameters += $"{param.ParameterType} {parameterName})"; 831 | else 832 | formatedMethodNameAndParameters += $"{param.ParameterType} {parameterName},"; 833 | } 834 | } 835 | 836 | string formattedContent = $"[UNHANDLED_EXCEPTION] Caught Exception of type {actualType}\n\n" + 837 | $"Exception Message: {exceptionObject.Message}\n" + 838 | $"Exception Origin File/Module: {exceptionObject.Source}\n" + 839 | $"Method that threw the Exception: {formatedMethodNameAndParameters}\n"; 840 | 841 | Console.WriteLine(formattedContent); 842 | 843 | if (exceptionObject.Data.Count > 0) 844 | { 845 | Console.WriteLine($"Exception Data Dictionary Results:"); 846 | foreach (DictionaryEntry pair in exceptionObject.Data) 847 | { 848 | Console.WriteLine(" * {0} = {1}", pair.Key, pair.Value); 849 | } 850 | } 851 | 852 | if (writeToFile) 853 | WriteToFile(formattedContent); 854 | 855 | } 856 | 857 | public static unsafe long FindPattern(byte* body, int bodyLength, byte[] pattern, byte[] masks, long start = 0) 858 | { 859 | long foundIndex = -1; 860 | 861 | if (bodyLength <= 0 || pattern.Length <= 0 || start > bodyLength - pattern.Length || 862 | pattern.Length > bodyLength) return foundIndex; 863 | 864 | for (long index = start; index <= bodyLength - pattern.Length; index++) 865 | { 866 | if (((body[index] & masks[0]) != (pattern[0] & masks[0]))) continue; 867 | 868 | var match = true; 869 | for (int index2 = 1; index2 <= pattern.Length - 1; index2++) 870 | { 871 | if ((body[index + index2] & masks[index2]) == (pattern[index2] & masks[index2])) continue; 872 | match = false; 873 | break; 874 | 875 | } 876 | 877 | if (!match) continue; 878 | 879 | foundIndex = index; 880 | break; 881 | } 882 | 883 | return foundIndex; 884 | } 885 | 886 | public static void WriteToFile(string contents) 887 | { 888 | if (contents.Length < 1) return; 889 | File.WriteAllText($"{Memory.HostProcess.ProcessName}_SessionLogs.txt", contents); 890 | } 891 | } 892 | 893 | // Extensions 894 | public static class ProcessExtensions 895 | { 896 | public static ProcessModule FindProcessModule(this Process obj, string moduleName) 897 | { 898 | foreach (ProcessModule pm in obj.Modules) 899 | if (string.Equals(pm.ModuleName, moduleName, StringComparison.CurrentCultureIgnoreCase)) 900 | return pm; 901 | 902 | return null; 903 | } 904 | } 905 | } 906 | -------------------------------------------------------------------------------- /TestInject/MyLibrary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Runtime.InteropServices; 4 | using System.Windows.Forms; 5 | using static TestInject.Memory; 6 | 7 | namespace TestInject 8 | { 9 | public class MyLibrary 10 | { 11 | [DllExport("DllMain", CallingConvention.Cdecl)] 12 | public static void EntryPoint() 13 | { 14 | UpdateProcessInformation(); 15 | AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; 16 | 17 | if (!DebugConsole.InitiateDebugConsole()) 18 | MessageBox.Show("Failed initiating the debugging console, please restart the program as admin!", 19 | "Debugging Console Exception", 20 | MessageBoxButtons.OK, 21 | MessageBoxIcon.Error); 22 | 23 | // Probably dont do any hacking here, start a thread to your real main entry point 24 | 25 | Console.ReadLine(); 26 | } 27 | 28 | static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) 29 | { 30 | HelperMethods.PrintExceptionData(e?.ExceptionObject, true); 31 | if (!Debugger.IsAttached) return; 32 | 33 | Exception obj = (Exception)e?.ExceptionObject; 34 | if (obj != null) 35 | PInvoke.SetLastError((uint)obj.HResult); 36 | Debugger.Break(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /TestInject/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TestInject")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TestInject")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("06d14fca-581b-4e1e-ba59-7666b293d4a1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TestInject/TestInject.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {06D14FCA-581B-4E1E-BA59-7666B293D4A1} 9 | Library 10 | Properties 11 | TestInject 12 | MyLibrary 13 | v4.7 14 | 512 15 | true 16 | 17 | 18 | 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | x86 29 | true 30 | default 31 | 32 | 33 | pdbonly 34 | true 35 | bin\Release\ 36 | TRACE 37 | prompt 38 | 4 39 | 40 | 41 | E5CB0E9D-DA0D-448A-864C-5801390F70D7 42 | DllExport.dll 43 | TestInject 44 | true 45 | false 46 | Auto 47 | 1 48 | false 49 | false 50 | false 51 | false 52 | 30000 53 | 2 54 | 0 55 | 56 | 57 | true 58 | bin\x64\Debug\ 59 | DEBUG;TRACE 60 | true 61 | full 62 | x64 63 | default 64 | prompt 65 | MinimumRecommendedRules.ruleset 66 | 67 | 68 | bin\x64\Release\ 69 | TRACE 70 | true 71 | pdbonly 72 | x64 73 | prompt 74 | MinimumRecommendedRules.ruleset 75 | 76 | 77 | true 78 | bin\x86\ 79 | DEBUG;TRACE 80 | true 81 | full 82 | x86 83 | default 84 | prompt 85 | MinimumRecommendedRules.ruleset 86 | 87 | 88 | true 89 | bin\x64\x86\ 90 | DEBUG;TRACE 91 | true 92 | full 93 | x64 94 | default 95 | prompt 96 | MinimumRecommendedRules.ruleset 97 | 98 | 99 | 100 | $(SolutionDir)packages\DllExport.1.7.0\gcache\$(DllExportMetaXBase)\$(DllExportNamespace)\$(DllExportMetaLibName) 101 | True 102 | False 103 | 104 | 105 | 106 | 107 | 108 | ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /TestInject/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /TestInject/bin/Debug/Extreme Injector v3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TetteDev/CSharp-InternalBase/0452170133229b0006ff6a90bf0494454cabc56d/TestInject/bin/Debug/Extreme Injector v3.exe -------------------------------------------------------------------------------- /TestInject/bin/Debug/MyLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TetteDev/CSharp-InternalBase/0452170133229b0006ff6a90bf0494454cabc56d/TestInject/bin/Debug/MyLibrary.dll -------------------------------------------------------------------------------- /TestInject/bin/Debug/settings.xml: -------------------------------------------------------------------------------- 1 |  2 | <_x202A__x206C__x200C__x200B__x206A__x200E__x202E__x202E__x202A__x206F__x200D__x206D__x202C__x206E__x206D__x202D__x200E__x206F__x202A__x202D__x200F__x206A__x206F__x200F__x206A__x200C__x206D__x200E__x206F__x206B__x206F__x202E__x200D__x206A__x206B__x200F__x200F__x206C__x206F__x200C__x202E_ xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> 3 | 2020-02-14T10:43:56.8894426+01:00 4 | 5 | <_x202A__x202C__x200D__x200C__x200B__x202D__x200C__x200D__x202A__x202A__x206A__x202C__x200E__x200E__x206A__x206F__x200B__x202D__x202D__x206B__x206A__x202B__x200F__x200C__x206F__x206C__x202D__x206C__x202A__x200C__x200D__x202D__x206E__x200C__x206A__x200E__x202E__x206C__x206C__x206B__x202E_> 6 | Cdecl 7 | true 8 | DllMain 9 | 10 | C:\Users\Theo\source\repos\TestInject\TestInject\bin\Debug\MyLibrary.dll 11 | 12 | 13 | 14 | 15 | false 16 | false 17 | false 18 | false 19 | 20 | false 21 | DodgerBlue 22 | DeepSkyBlue 23 | false 24 | 0 25 | 0 26 | false 27 | false 28 | 0 29 | 30 | false 31 | false 32 | false 33 | false 34 | false 35 | false 36 | false 37 | false 38 | false 39 | false 40 | false 41 | false 42 | false 43 | 44 | false 45 | White 46 | 47 | ac_client.exe 48 | 49 | false 50 | false 51 | false 52 | 53 | -------------------------------------------------------------------------------- /TestInject/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------