├── CANAPE.Scripting
├── Lib
│ ├── email
│ │ └── mime
│ │ │ ├── __init__.py
│ │ │ ├── nonmultipart.py
│ │ │ ├── base.py
│ │ │ ├── text.py
│ │ │ └── application.py
│ ├── pydoc_data
│ │ └── __init__.py
│ ├── lib2to3
│ │ ├── __init__.py
│ │ ├── fixes
│ │ │ ├── __init__.py
│ │ │ ├── fix_imports2.py
│ │ │ ├── fix_basestring.py
│ │ │ ├── fix_raw_input.py
│ │ │ ├── fix_getcwdu.py
│ │ │ ├── fix_standarderror.py
│ │ │ ├── fix_long.py
│ │ │ ├── fix_future.py
│ │ │ ├── fix_ne.py
│ │ │ ├── fix_buffer.py
│ │ │ ├── fix_nonzero.py
│ │ │ ├── fix_repr.py
│ │ │ ├── fix_methodattrs.py
│ │ │ ├── fix_funcattrs.py
│ │ │ ├── fix_xreadlines.py
│ │ │ ├── fix_input.py
│ │ │ ├── fix_unicode.py
│ │ │ ├── fix_numliterals.py
│ │ │ ├── fix_reduce.py
│ │ │ ├── fix_zip.py
│ │ │ ├── fix_sys_exc.py
│ │ │ ├── fix_exec.py
│ │ │ ├── fix_ws_comma.py
│ │ │ └── fix_callable.py
│ │ ├── __main__.py
│ │ ├── pgen2
│ │ │ └── __init__.py
│ │ └── pygram.py
│ ├── __phello__.foo.py
│ ├── heapq.py
│ ├── shlex.py
│ ├── antigravity.py
│ ├── tarfile.py
│ ├── sqlite3
│ │ ├── __init__.py
│ │ └── dbapi2.py
│ ├── struct.py
│ ├── encodings
│ │ ├── punycode.py
│ │ ├── string_escape.py
│ │ ├── utf_32_le.py
│ │ ├── utf_7.py
│ │ ├── utf_8.py
│ │ ├── utf_16_be.py
│ │ ├── utf_16_le.py
│ │ ├── unicode_escape.py
│ │ ├── unicode_internal.py
│ │ ├── mbcs.py
│ │ └── raw_unicode_escape.py
│ ├── site-packages
│ │ └── README.txt
│ ├── distutils
│ │ ├── debug.py
│ │ ├── __init__.py
│ │ └── command
│ │ │ └── __init__.py
│ ├── xml
│ │ ├── parsers
│ │ │ └── __init__.py
│ │ ├── dom
│ │ │ └── NodeFilter.py
│ │ └── __init__.py
│ ├── unittest
│ │ └── __main__.py
│ ├── md5.py
│ ├── ctypes
│ │ └── macholib
│ │ │ └── __init__.py
│ ├── sha.py
│ ├── new.py
│ ├── wsgiref
│ │ └── __init__.py
│ ├── statvfs.py
│ ├── json
│ │ └── tool.py
│ ├── this.py
│ └── dircache.py
├── packages.config
├── Templates
│ ├── python
│ │ ├── basicpipelinenode.py
│ │ ├── packetexport.py
│ │ ├── stringhexconv.py
│ │ ├── httpserver.py
│ │ ├── basicdataendpoint.py
│ │ ├── index.de.xml
│ │ ├── remutator.py
│ │ ├── index.xml
│ │ └── xorlayer.py
│ └── csharp
│ │ ├── index.de.xml
│ │ ├── index.xml
│ │ └── basicpipelinenode.cs
├── BasePersistDynamicNode.cs
├── BasePersistDataEndpoint.cs
├── StreamDataEndpoint.cs
├── IScriptedNode.cs
├── IRunScript.cs
├── IPersistDynamicNode.cs
└── IDataParser.cs
├── CANAPE
├── canape.snk
├── Utils
│ ├── DiffItem.cs
│ ├── NamespaceDoc.cs
│ ├── INodeInitializer.cs
│ └── INodeConverter.cs
├── Nodes
│ ├── NamespaceDoc.cs
│ └── SwitchNodeSelectionMode.cs
├── NodeFactories
│ ├── NamespaceDoc.cs
│ ├── ClientEndpointFactory.cs
│ └── ServerEndpointFactory.cs
├── DataFrames
│ └── NamespaceDoc.cs
├── DataAdapters
│ └── NamespaceDoc.cs
└── Parser
│ └── IChildObject.cs
├── LogViewer
├── CANAPE.ico
├── Properties
│ └── Settings.settings
├── LogViewerForm.cs
└── Program.cs
├── CANAPE.Gui
├── CANAPE.ico
├── Icons
│ ├── copy.ico
│ ├── py.ico
│ ├── Network.ico
│ ├── textdoc.ico
│ ├── Data_Schema.ico
│ ├── FloppyDisk.ico
│ ├── Network_Map.ico
│ ├── UtilityText.ico
│ ├── folderopen.ico
│ ├── 112_Tick_Green.ico
│ ├── VSObject_Class.bmp
│ ├── VSObject_Field.bmp
│ ├── otheroptions.ico
│ ├── 112_LeftArrowShort_Green.ico
│ ├── VSObject_Class_Private.bmp
│ ├── VSObject_Field_Private.bmp
│ ├── VSProject_genericproject.ico
│ └── 112_RightArrowShort_Green.ico
├── Logos
│ ├── 16x16.png
│ ├── 32x32.png
│ ├── 64x64.png
│ ├── 128x128.png
│ ├── 192x192.png
│ └── MainLogo.png
├── Context_logo_512x112.png
├── packages.config
└── Extension
│ ├── MainFormMenuExtensionManager.cs
│ └── IMainFormMenuExtension.cs
├── NCalc
├── Antlr3.Runtime.dll
├── EvaluateFunctionHandler.cs
├── EvaluateParameterHandler.cs
├── Domain
│ ├── Parameter.cs
│ ├── Function.cs
│ ├── LogicalExpressionVisitor.cs
│ ├── UnaryExpression.cs
│ ├── TernaryExpression.cs
│ └── BinaryExpression.cs
├── EvaluationException.cs
├── ParameterArgs.cs
├── EvaluationOption.cs
├── FunctionArgs.cs
└── NCalc.tokens
├── CANAPEInstaller
├── banner.bmp
├── dialog.bmp
├── copyfiles.bat
├── harvest.bat
├── build.bat
└── readme.txt
├── CANAPE.Controls
├── Icons
│ ├── copy.ico
│ ├── py.ico
│ ├── Folder.ico
│ ├── Paste.bmp
│ ├── delete.ico
│ ├── 126_Edit.ico
│ ├── Network.ico
│ ├── textdoc.ico
│ ├── 077_AddFile.ico
│ ├── Data_Schema.ico
│ ├── Edit_RedoHS.png
│ ├── Edit_UndoHS.png
│ ├── FloppyDisk.ico
│ ├── Network_Map.ico
│ ├── UtilityText.ico
│ ├── folderopen.ico
│ ├── 112_Tick_Green.ico
│ ├── DropdownIcon.ico
│ ├── Network_Map1.ico
│ ├── VSFolder_open.bmp
│ ├── VSObject_Class.bmp
│ ├── VSObject_Field.bmp
│ ├── otheroptions.ico
│ ├── Code_CodeFileCS.ico
│ ├── Code_CodeFileVB.ico
│ ├── ParserComponent.ico
│ ├── Utility_VBScript.ico
│ ├── VSFolder_closed.bmp
│ ├── 2392_ZoomIn_16x16.png
│ ├── 2392_ZoomOut_16x16.png
│ ├── VSObject_Namespace.bmp
│ ├── VSProject_component.bmp
│ ├── Web_GlobalAppClass.ico
│ ├── VSObject_Class_Script.bmp
│ ├── VSObject_Field_Script.bmp
│ ├── 112_DownArrowShort_Green.ico
│ ├── 112_LeftArrowShort_Green.ico
│ ├── 112_UpArrowShort_Green.ico
│ ├── VSObject_Class_Private.bmp
│ ├── VSObject_Field_Private.bmp
│ ├── VSProject_genericproject.ico
│ ├── 112_RightArrowShort_Green.ico
│ ├── VSObject_Class_Private_Script.bmp
│ └── VSObject_Field_Private_Script.bmp
├── Resources
│ └── DefaultPythonParserScript.txt
├── packages.config
├── app.config
├── Properties
│ └── Settings.settings
├── Extension
│ ├── MenuExtensionManager.cs
│ ├── HexConverterExtensionManager.cs
│ ├── ScriptHighlightingExtensionManager.cs
│ ├── PacketLogExtensionManager.cs
│ ├── HexInspectorExtensionManager.cs
│ ├── ParserSerializerExtensionManager.cs
│ ├── DocumentEditorManager.cs
│ ├── IPacketLogExtension.cs
│ ├── DocumentFactoryManager.cs
│ └── StringConverterExtensionManager.cs
├── Controls
│ ├── DocumentEditors
│ │ └── SourceHighlighters
│ │ │ ├── CSharpHighlighter.cs
│ │ │ └── PythonHighlighter.cs
│ ├── IDiffWindow.cs
│ ├── IReadOnlyControl.cs
│ └── HexEditorControlConfig.cs
└── Forms
│ ├── HistogramLogViewerForm.cs
│ ├── MetaEditorForm.cs
│ ├── BinaryFrameDiffForm.cs
│ └── ObjectEditorForm.cs
├── HelpContent
├── CANAPE_MainLogo.png
├── Media
│ ├── ui_overview.PNG
│ ├── ui_close_window.png
│ ├── ui_docking_icon.png
│ ├── ui_graph_editor.PNG
│ ├── ui_network_service.PNG
│ ├── ui_script_editor.PNG
│ ├── ui_packet_log_viewer.PNG
│ ├── ui_graph_property_edit.PNG
│ ├── ui_script_editor_config.PNG
│ ├── ui_script_editor_test.PNG
│ ├── ui_network_service_text_log.PNG
│ ├── ui_network_service_global_meta.PNG
│ └── ui_network_service_packet_log.PNG
└── Content Layout.content
├── Be.Windows.Forms.HexBox
├── HexBox.bmp
├── HexBox.cs
├── HexBox.snk
├── IByteProvider.cs
├── CaretHandler.cs
├── HexCasing.cs
├── BytePositionInfo.cs
├── NativeMethods.cs
├── DataBlock.cs
├── NativeCaretHandler.cs
└── HexAnnotation.cs
├── IronPythonShellExt
├── delete_16x.ico
├── packages.config
└── readme.txt
├── CANAPE.Documents
├── Templates
│ ├── Server
│ │ ├── echo_server.canape
│ │ ├── cert_http_server.canape
│ │ ├── basic_http_server.canape
│ │ ├── basic_https_server.canape
│ │ ├── index.xml
│ │ └── index.de.xml
│ └── Proxy
│ │ ├── http_proxy_http.canape
│ │ ├── basic_fixed_proxy.canape
│ │ ├── basic_http_proxy.canape
│ │ ├── basic_socks_proxy.canape
│ │ ├── socks_proxy_http.canape
│ │ ├── index.xml
│ │ └── index.de.xml
├── packages.config
├── Extension
│ ├── DocumentExtensionManager.cs
│ └── NetworkLayerFactoryManager.cs
└── Net
│ ├── HttpProxyDocument.cs
│ └── Factories
│ └── IProxyListenerFactory.cs
├── CANAPE.Parser
├── packages.config
├── Endian.cs
├── Members
│ ├── IMemberReference.cs
│ ├── IMemberReaderWriter.cs
│ ├── IMemberContainer.cs
│ └── PrimitiveMemberEntryFormat.cs
├── NameChangedEventArgs.cs
└── DataValueContainer.cs
├── CANAPE.NodeLibrary
├── packages.config
└── NodeLibraryClassCategory.cs
├── CANAPE.Security
├── packages.config
├── CertificateRequestDetails.cs
├── ICredentialObject.cs
└── ICertificateBuilder.cs
├── CANAPE.Cli
├── App.config
├── packages.config
├── PcapUtils.cs
├── cliexamples
│ ├── dnserver.py
│ ├── httpproxy.py
│ ├── socksproxy.py
│ ├── revhttpproxy.py
│ └── fixedproxy.py
└── PythonLib
│ └── canapecli
│ ├── __init__.py
│ └── docs
│ └── data.py
├── .gitignore
├── UpdateProjects
└── App.config
├── CANAPE.Net.NamedPipes
├── NamedPipeProxyServerDocument.cs
├── NamedPipeProxyServerDocumentFactory.cs
├── NamedPipeProxyClientFactory.cs
└── NamedPipeProxyClient.cs
├── CANAPE.Net
├── Layers
│ └── TextNetworkLayerConfig.cs
├── app.config
├── Tokens
│ └── FullHttpProxyToken.cs
├── Nodes
│ ├── LayerSectionGraphDirection.cs
│ └── LayerSectionNodeDefaultMode.cs
└── DataAdapters
│ └── IpBoundDataAdapter.cs
├── CANAPE.Net.Protocols
└── Server
│ ├── DynamicHttpDataServer.cs
│ └── BaseHttpDataServer.cs
├── CANAPE.Documents.ComPort
├── SerialPortProxyServerDocumentFactory.cs
└── SerialPortServerDocumentFactory.cs
└── README.md
/CANAPE.Scripting/Lib/email/mime/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/pydoc_data/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/__init__.py:
--------------------------------------------------------------------------------
1 | #empty
2 |
--------------------------------------------------------------------------------
/CANAPE/canape.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE/canape.snk
--------------------------------------------------------------------------------
/LogViewer/CANAPE.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/LogViewer/CANAPE.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/CANAPE.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/CANAPE.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/copy.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/copy.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/py.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/py.ico
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/__init__.py:
--------------------------------------------------------------------------------
1 | # Dummy file to make this directory a package.
2 |
--------------------------------------------------------------------------------
/NCalc/Antlr3.Runtime.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/NCalc/Antlr3.Runtime.dll
--------------------------------------------------------------------------------
/CANAPE.Gui/Logos/16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Logos/16x16.png
--------------------------------------------------------------------------------
/CANAPE.Gui/Logos/32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Logos/32x32.png
--------------------------------------------------------------------------------
/CANAPE.Gui/Logos/64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Logos/64x64.png
--------------------------------------------------------------------------------
/CANAPEInstaller/banner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPEInstaller/banner.bmp
--------------------------------------------------------------------------------
/CANAPEInstaller/dialog.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPEInstaller/dialog.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/copy.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/copy.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/py.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/py.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/Network.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/Network.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/textdoc.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/textdoc.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Logos/128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Logos/128x128.png
--------------------------------------------------------------------------------
/CANAPE.Gui/Logos/192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Logos/192x192.png
--------------------------------------------------------------------------------
/CANAPE.Gui/Logos/MainLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Logos/MainLogo.png
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/__phello__.foo.py:
--------------------------------------------------------------------------------
1 | # This file exists as a helper for the test.test_frozen module.
2 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/heapq.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Scripting/Lib/heapq.py
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/shlex.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Scripting/Lib/shlex.py
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Folder.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Folder.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Paste.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Paste.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/delete.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/delete.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/Data_Schema.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/Data_Schema.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/FloppyDisk.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/FloppyDisk.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/Network_Map.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/Network_Map.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/UtilityText.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/UtilityText.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/folderopen.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/folderopen.ico
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/antigravity.py:
--------------------------------------------------------------------------------
1 |
2 | import webbrowser
3 |
4 | webbrowser.open("http://xkcd.com/353/")
5 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/tarfile.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Scripting/Lib/tarfile.py
--------------------------------------------------------------------------------
/HelpContent/CANAPE_MainLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/CANAPE_MainLogo.png
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/HexBox.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/Be.Windows.Forms.HexBox/HexBox.bmp
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/HexBox.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/Be.Windows.Forms.HexBox/HexBox.cs
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/HexBox.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/Be.Windows.Forms.HexBox/HexBox.snk
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/126_Edit.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/126_Edit.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Network.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Network.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/textdoc.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/textdoc.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Context_logo_512x112.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Context_logo_512x112.png
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/112_Tick_Green.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/112_Tick_Green.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/VSObject_Class.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/VSObject_Class.bmp
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/VSObject_Field.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/VSObject_Field.bmp
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/otheroptions.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/otheroptions.ico
--------------------------------------------------------------------------------
/HelpContent/Media/ui_overview.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_overview.PNG
--------------------------------------------------------------------------------
/IronPythonShellExt/delete_16x.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/IronPythonShellExt/delete_16x.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/077_AddFile.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/077_AddFile.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Data_Schema.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Data_Schema.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Edit_RedoHS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Edit_RedoHS.png
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Edit_UndoHS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Edit_UndoHS.png
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/FloppyDisk.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/FloppyDisk.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Network_Map.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Network_Map.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/UtilityText.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/UtilityText.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/folderopen.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/folderopen.ico
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/__main__.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from .main import main
3 |
4 | sys.exit(main("lib2to3.fixes"))
5 |
--------------------------------------------------------------------------------
/HelpContent/Media/ui_close_window.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_close_window.png
--------------------------------------------------------------------------------
/HelpContent/Media/ui_docking_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_docking_icon.png
--------------------------------------------------------------------------------
/HelpContent/Media/ui_graph_editor.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_graph_editor.PNG
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/IByteProvider.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/Be.Windows.Forms.HexBox/IByteProvider.cs
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/112_Tick_Green.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/112_Tick_Green.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/DropdownIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/DropdownIcon.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Network_Map1.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Network_Map1.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSFolder_open.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSFolder_open.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSObject_Class.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSObject_Class.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSObject_Field.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSObject_Field.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/otheroptions.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/otheroptions.ico
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/sqlite3/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Scripting/Lib/sqlite3/__init__.py
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/sqlite3/dbapi2.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Scripting/Lib/sqlite3/dbapi2.py
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/struct.py:
--------------------------------------------------------------------------------
1 | from _struct import *
2 | from _struct import _clearcache
3 | from _struct import __doc__
4 |
--------------------------------------------------------------------------------
/HelpContent/Media/ui_network_service.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_network_service.PNG
--------------------------------------------------------------------------------
/HelpContent/Media/ui_script_editor.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_script_editor.PNG
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Code_CodeFileCS.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Code_CodeFileCS.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Code_CodeFileVB.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Code_CodeFileVB.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/ParserComponent.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/ParserComponent.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Utility_VBScript.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Utility_VBScript.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSFolder_closed.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSFolder_closed.bmp
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/punycode.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Scripting/Lib/encodings/punycode.py
--------------------------------------------------------------------------------
/HelpContent/Media/ui_packet_log_viewer.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_packet_log_viewer.PNG
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/2392_ZoomIn_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/2392_ZoomIn_16x16.png
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/2392_ZoomOut_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/2392_ZoomOut_16x16.png
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSObject_Namespace.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSObject_Namespace.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSProject_component.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSProject_component.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/Web_GlobalAppClass.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/Web_GlobalAppClass.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/112_LeftArrowShort_Green.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/112_LeftArrowShort_Green.ico
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/VSObject_Class_Private.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/VSObject_Class_Private.bmp
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/VSObject_Field_Private.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/VSObject_Field_Private.bmp
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/VSProject_genericproject.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/VSProject_genericproject.ico
--------------------------------------------------------------------------------
/HelpContent/Media/ui_graph_property_edit.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_graph_property_edit.PNG
--------------------------------------------------------------------------------
/HelpContent/Media/ui_script_editor_config.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_script_editor_config.PNG
--------------------------------------------------------------------------------
/HelpContent/Media/ui_script_editor_test.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_script_editor_test.PNG
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSObject_Class_Script.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSObject_Class_Script.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSObject_Field_Script.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSObject_Field_Script.bmp
--------------------------------------------------------------------------------
/CANAPE.Gui/Icons/112_RightArrowShort_Green.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Gui/Icons/112_RightArrowShort_Green.ico
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/string_escape.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Scripting/Lib/encodings/string_escape.py
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/112_DownArrowShort_Green.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/112_DownArrowShort_Green.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/112_LeftArrowShort_Green.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/112_LeftArrowShort_Green.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/112_UpArrowShort_Green.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/112_UpArrowShort_Green.ico
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSObject_Class_Private.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSObject_Class_Private.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSObject_Field_Private.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSObject_Field_Private.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSProject_genericproject.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSProject_genericproject.ico
--------------------------------------------------------------------------------
/HelpContent/Media/ui_network_service_text_log.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_network_service_text_log.PNG
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/112_RightArrowShort_Green.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/112_RightArrowShort_Green.ico
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Server/echo_server.canape:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Documents/Templates/Server/echo_server.canape
--------------------------------------------------------------------------------
/CANAPEInstaller/copyfiles.bat:
--------------------------------------------------------------------------------
1 | robocopy /E ..\bin\release SourceDir
2 | mkdir SourceDir\Help
3 | copy ..\Help\CANAPE_Documentation.chm SourceDir\Help
4 |
--------------------------------------------------------------------------------
/HelpContent/Media/ui_network_service_global_meta.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_network_service_global_meta.PNG
--------------------------------------------------------------------------------
/HelpContent/Media/ui_network_service_packet_log.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/HelpContent/Media/ui_network_service_packet_log.PNG
--------------------------------------------------------------------------------
/NCalc/EvaluateFunctionHandler.cs:
--------------------------------------------------------------------------------
1 | namespace NCalc
2 | {
3 | public delegate void EvaluateFunctionHandler(string name, FunctionArgs args);
4 | }
5 |
--------------------------------------------------------------------------------
/NCalc/EvaluateParameterHandler.cs:
--------------------------------------------------------------------------------
1 | namespace NCalc
2 | {
3 | public delegate void EvaluateParameterHandler(string name, ParameterArgs args);
4 | }
5 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSObject_Class_Private_Script.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSObject_Class_Private_Script.bmp
--------------------------------------------------------------------------------
/CANAPE.Controls/Icons/VSObject_Field_Private_Script.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Controls/Icons/VSObject_Field_Private_Script.bmp
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Proxy/http_proxy_http.canape:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Documents/Templates/Proxy/http_proxy_http.canape
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Proxy/basic_fixed_proxy.canape:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Documents/Templates/Proxy/basic_fixed_proxy.canape
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Proxy/basic_http_proxy.canape:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Documents/Templates/Proxy/basic_http_proxy.canape
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Proxy/basic_socks_proxy.canape:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Documents/Templates/Proxy/basic_socks_proxy.canape
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Proxy/socks_proxy_http.canape:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Documents/Templates/Proxy/socks_proxy_http.canape
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Server/cert_http_server.canape:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Documents/Templates/Server/cert_http_server.canape
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Server/basic_http_server.canape:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Documents/Templates/Server/basic_http_server.canape
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Server/basic_https_server.canape:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ctxis/canape/HEAD/CANAPE.Documents/Templates/Server/basic_https_server.canape
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/site-packages/README.txt:
--------------------------------------------------------------------------------
1 | This directory exists so that 3rd party packages can be installed
2 | here. Read the source for site.py for more details.
3 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Resources/DefaultPythonParserScript.txt:
--------------------------------------------------------------------------------
1 | # To use place in an expression using the name, e.g. ExampleScript.RunMe(this)
2 | def RunMe(self):
3 | return "Argh!
--------------------------------------------------------------------------------
/CANAPE.Gui/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CANAPE.Parser/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CANAPEInstaller/harvest.bat:
--------------------------------------------------------------------------------
1 | heat dir SourceDir -dr APPLICATIONROOTDIRECTORY -wixvar -projectname canape -template fragment -srd -scom -sreg -gg -cg canapefiles -o canape_files.wxs
--------------------------------------------------------------------------------
/CANAPE.NodeLibrary/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CANAPE.Security/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CANAPE.Documents/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CANAPE.Controls/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CANAPE.Cli/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/pgen2/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """The pgen2 package."""
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.suo
2 | obj/
3 | bin/
4 | Release/
5 | Debug/
6 | Help/
7 | Be.Windows.Forms.HexBox/Be.Windows.Forms.HexBox.xml
8 | *.user
9 | canape_doc.shfbproj_*
10 | Gnu.Getopt.xml
11 | TestResults/
12 | packages/
13 |
--------------------------------------------------------------------------------
/UpdateProjects/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/distutils/debug.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | __revision__ = "$Id$"
4 |
5 | # If DISTUTILS_DEBUG is anything other than the empty string, we run in
6 | # debug mode.
7 | DEBUG = os.environ.get('DISTUTILS_DEBUG')
8 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/xml/parsers/__init__.py:
--------------------------------------------------------------------------------
1 | """Python interfaces to XML parsers.
2 |
3 | This package contains one module:
4 |
5 | expat -- Python wrapper for James Clark's Expat parser, with namespace
6 | support.
7 |
8 | """
9 |
--------------------------------------------------------------------------------
/CANAPEInstaller/build.bat:
--------------------------------------------------------------------------------
1 | del *.wixobj *.msi
2 | candle -ext WiXNetFxExtension canape.wxs canape_files.wxs
3 | light -ext WiXNetFxExtension -ext WixUIExtension -cultures:en-us,de-de canape.wixobj canape_files.wixobj -out canape.msi
4 |
5 |
--------------------------------------------------------------------------------
/CANAPE.Cli/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/CANAPE.Controls/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/IronPythonShellExt/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/LogViewer/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CANAPE.Cli/PcapUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CANAPE.Documents.Net;
6 |
7 | namespace CANAPE.Cli
8 | {
9 | public static class PcapUtils
10 | {
11 | // LINKTYPE_RAW (101)
12 |
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/unittest/__main__.py:
--------------------------------------------------------------------------------
1 | """Main entry point"""
2 |
3 | import sys
4 | if sys.argv[0].endswith("__main__.py"):
5 | sys.argv[0] = "python -m unittest"
6 |
7 | __unittest = True
8 |
9 | from .main import main, TestProgram, USAGE_AS_MAIN
10 | TestProgram.USAGE = USAGE_AS_MAIN
11 |
12 | main(module=None)
13 |
--------------------------------------------------------------------------------
/IronPythonShellExt/readme.txt:
--------------------------------------------------------------------------------
1 | This Canape extension will create an IronPython console window when starting, you can then interact
2 | with the application to do things which are not necessarily exposed.
3 |
4 | To install put the DLL into either the Canape\Extensions directory in program files (you might have to
5 | create it), or under %APPDATA%\Context Information Security\CANAPE\Extensions.
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_imports2.py:
--------------------------------------------------------------------------------
1 | """Fix incompatible imports and module references that must be fixed after
2 | fix_imports."""
3 | from . import fix_imports
4 |
5 |
6 | MAPPING = {
7 | 'whichdb': 'dbm',
8 | 'anydbm': 'dbm',
9 | }
10 |
11 |
12 | class FixImports2(fix_imports.FixImports):
13 |
14 | run_order = 7
15 |
16 | mapping = MAPPING
17 |
--------------------------------------------------------------------------------
/NCalc/Domain/Parameter.cs:
--------------------------------------------------------------------------------
1 | namespace NCalc.Domain
2 | {
3 | public class Identifier : LogicalExpression
4 | {
5 | public Identifier(string name)
6 | {
7 | Name = name;
8 | }
9 |
10 | public string Name { get; set; }
11 |
12 |
13 | public override void Accept(LogicalExpressionVisitor visitor)
14 | {
15 | visitor.Visit(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_basestring.py:
--------------------------------------------------------------------------------
1 | """Fixer for basestring -> str."""
2 | # Author: Christian Heimes
3 |
4 | # Local imports
5 | from .. import fixer_base
6 | from ..fixer_util import Name
7 |
8 | class FixBasestring(fixer_base.BaseFix):
9 | BM_compatible = True
10 |
11 | PATTERN = "'basestring'"
12 |
13 | def transform(self, node, results):
14 | return Name(u"str", prefix=node.prefix)
15 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/md5.py:
--------------------------------------------------------------------------------
1 | # $Id$
2 | #
3 | # Copyright (C) 2005 Gregory P. Smith (greg@krypto.org)
4 | # Licensed to PSF under a Contributor Agreement.
5 |
6 | import warnings
7 | warnings.warn("the md5 module is deprecated; use hashlib instead",
8 | DeprecationWarning, 2)
9 |
10 | from hashlib import md5
11 | new = md5
12 |
13 | blocksize = 1 # legacy value (wrong in any useful sense)
14 | digest_size = 16
15 |
--------------------------------------------------------------------------------
/NCalc/EvaluationException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace NCalc
4 | {
5 | public class EvaluationException : ApplicationException
6 | {
7 | public EvaluationException(string message)
8 | : base(message)
9 | {
10 | }
11 |
12 | public EvaluationException(string message, Exception innerException)
13 | : base(message, innerException)
14 | {
15 | }
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/ctypes/macholib/__init__.py:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # This file should be kept compatible with Python 2.3, see PEP 291. #
3 | ######################################################################
4 | """
5 | Enough Mach-O to make your head spin.
6 |
7 | See the relevant header files in /usr/include/mach-o
8 |
9 | And also Apple's documentation.
10 | """
11 |
12 | __version__ = '1.0'
13 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/distutils/__init__.py:
--------------------------------------------------------------------------------
1 | """distutils
2 |
3 | The main package for the Python Module Distribution Utilities. Normally
4 | used from a setup script as
5 |
6 | from distutils.core import setup
7 |
8 | setup (...)
9 | """
10 |
11 | __revision__ = "$Id$"
12 |
13 | # Distutils version
14 | #
15 | # Updated automatically by the Python release process.
16 | #
17 | #--start constants--
18 | __version__ = "2.7.1"
19 | #--end constants--
20 |
--------------------------------------------------------------------------------
/NCalc/ParameterArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace NCalc
4 | {
5 | public class ParameterArgs : EventArgs
6 | {
7 | private object _result;
8 | public object Result
9 | {
10 | get { return _result; }
11 | set
12 | {
13 | _result = value;
14 | HasResult = true;
15 | }
16 | }
17 |
18 | public bool HasResult { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CANAPE.Net.NamedPipes/NamedPipeProxyServerDocument.cs:
--------------------------------------------------------------------------------
1 | using CANAPE.Documents.Net;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace CANAPE.Net.NamedPipes
8 | {
9 | public class NamedPipeProxyServerDocument : FixedProxyDocument
10 | {
11 | public NamedPipeProxyServerDocument()
12 | {
13 | this.Client = new NamedPipeProxyClientFactory();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CANAPE.Net.NamedPipes/NamedPipeProxyServerDocumentFactory.cs:
--------------------------------------------------------------------------------
1 | using CANAPE.Extension;
2 | using CANAPE.Utils;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace CANAPE.Net.NamedPipes
9 | {
10 | [DocumentFactory("Named Pipe Server"), LocalizedCategory("Named Pipers")]
11 | public class NamedPipeProxyServerDocumentFactory : DefaultDocumentFactory
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/sha.py:
--------------------------------------------------------------------------------
1 | # $Id$
2 | #
3 | # Copyright (C) 2005 Gregory P. Smith (greg@krypto.org)
4 | # Licensed to PSF under a Contributor Agreement.
5 |
6 | import warnings
7 | warnings.warn("the sha module is deprecated; use the hashlib module instead",
8 | DeprecationWarning, 2)
9 |
10 | from hashlib import sha1 as sha
11 | new = sha
12 |
13 | blocksize = 1 # legacy value (wrong in any useful sense)
14 | digest_size = 20
15 | digestsize = 20
16 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/python/basicpipelinenode.py:
--------------------------------------------------------------------------------
1 | # This pulls in the canape library namespaces
2 | import CANAPE.Nodes
3 | import CANAPE.DataFrames
4 |
5 | # Simple pipeline node
6 | class PipelineNode(CANAPE.Nodes.BaseDynamicPipelineNode):
7 |
8 | # Called when a new frame has arrived
9 | def OnInput(self, frame):
10 | # Create a new data frame with the contents of the string
11 | self.LogInfo("Received {0}", frame)
12 | self.WriteOutput(frame)
13 |
--------------------------------------------------------------------------------
/CANAPE.Cli/cliexamples/dnserver.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from canapecli import log, packets
3 | from canapecli.docs.net import DnsServerDocument
4 |
5 | doc = DnsServerDocument()
6 |
7 | logger = log.getverboselogger(sys.stdout)
8 | doc.ResponseAddress = "1.1.1.1"
9 | doc.ResponseAddress6 = "1010::1"
10 | doc.ReverseDns = "www.dummy.com"
11 |
12 | service = doc.Create(logger)
13 |
14 | service.Start()
15 |
16 | print "Created", service, "Press Enter to exit..."
17 | sys.stdin.readline()
18 |
19 | service.Stop()
20 |
21 |
--------------------------------------------------------------------------------
/CANAPE.Cli/cliexamples/httpproxy.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from canapecli import log, packets
3 | from canapecli.docs.net import HttpProxyDocument
4 |
5 | doc = HttpProxyDocument()
6 | doc.LocalPort = 3128
7 |
8 | logger = log.getverboselogger(sys.stdout)
9 | service = doc.Create(logger)
10 |
11 | service.Start()
12 |
13 | print "Created", service, "Press Enter to exit..."
14 | sys.stdin.readline()
15 |
16 | service.Stop()
17 |
18 | print "Captured packets:"
19 |
20 | for p in doc.Packets:
21 | print packets.tostr(p)
22 |
--------------------------------------------------------------------------------
/CANAPE.Cli/cliexamples/socksproxy.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from canapecli import log, packets
3 | from canapecli.docs.net import SocksProxyDocument
4 |
5 | doc = SocksProxyDocument()
6 | doc.LocalPort = 1080
7 |
8 | logger = log.getverboselogger(sys.stdout)
9 | service = doc.Create(logger)
10 |
11 | service.Start()
12 |
13 | print "Created", service, "Press Enter to exit..."
14 | sys.stdin.readline()
15 |
16 | service.Stop()
17 |
18 | print "Captured packets:"
19 |
20 | for p in doc.Packets:
21 | print packets.tostr(p)
22 |
--------------------------------------------------------------------------------
/CANAPE.Cli/cliexamples/revhttpproxy.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from canapecli import log, packets
3 | from canapecli.docs.net import HttpReverseProxyDocument
4 |
5 | doc = HttpReverseProxyDocument()
6 | doc.LocalPort = 3128
7 |
8 | logger = log.getverboselogger(sys.stdout)
9 | service = doc.Create(logger)
10 |
11 | service.Start()
12 |
13 | print "Created", service, "Press Enter to exit..."
14 | sys.stdin.readline()
15 |
16 | service.Stop()
17 |
18 | print "Captured packets:"
19 |
20 | for p in doc.Packets:
21 | print packets.tostr(p)
22 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/python/packetexport.py:
--------------------------------------------------------------------------------
1 | # Custom packet exporter, select packets in a log then choose Run Script
2 | # from the right click menu
3 |
4 | def ProcessPackets(packets):
5 | try:
6 | f = open("packets.csv", "w")
7 |
8 | f.write("Timestamp,Tag,Network,Data\n")
9 | # Iterate over selected packets
10 | for p in packets:
11 | f.write("{0},{1},{2},{3}\n".format(p.Timestamp,p.Tag,p.Network,p.Frame.Root.ToDataString()))
12 | f.close()
13 | except:
14 | print "Error"
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/CaretHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Windows.Forms;
4 |
5 | namespace Be.Windows.Forms
6 | {
7 | abstract class CaretHandler
8 | {
9 | public abstract bool CreateCaret(Control control, int nWidth, int nHeight);
10 |
11 | public abstract bool ShowCaret(Control control);
12 |
13 | public abstract bool DestroyCaret();
14 |
15 | public abstract bool SetCaretPos(int X, int Y);
16 |
17 | public abstract void Draw(Graphics g);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_raw_input.py:
--------------------------------------------------------------------------------
1 | """Fixer that changes raw_input(...) into input(...)."""
2 | # Author: Andre Roberge
3 |
4 | # Local imports
5 | from .. import fixer_base
6 | from ..fixer_util import Name
7 |
8 | class FixRawInput(fixer_base.BaseFix):
9 |
10 | BM_compatible = True
11 | PATTERN = """
12 | power< name='raw_input' trailer< '(' [any] ')' > any* >
13 | """
14 |
15 | def transform(self, node, results):
16 | name = results["name"]
17 | name.replace(Name(u"input", prefix=name.prefix))
18 |
--------------------------------------------------------------------------------
/CANAPE/Utils/DiffItem.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace CANAPE.Utils
3 | {
4 | /// details of one difference.
5 | public struct DiffItem
6 | {
7 | /// Start Line number in Data A.
8 | public int StartA;
9 | /// Start Line number in Data B.
10 | public int StartB;
11 |
12 | /// Number of changes in Data A.
13 | public int deletedA;
14 | /// Number of changes in Data B.
15 | public int insertedB;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/NCalc/Domain/Function.cs:
--------------------------------------------------------------------------------
1 | namespace NCalc.Domain
2 | {
3 | public class Function : LogicalExpression
4 | {
5 | public Function(Identifier identifier, LogicalExpression[] expressions)
6 | {
7 | Identifier = identifier;
8 | Expressions = expressions;
9 | }
10 |
11 | public Identifier Identifier { get; set; }
12 |
13 | public LogicalExpression[] Expressions { get; set; }
14 |
15 | public override void Accept(LogicalExpressionVisitor visitor)
16 | {
17 | visitor.Visit(this);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_getcwdu.py:
--------------------------------------------------------------------------------
1 | """
2 | Fixer that changes os.getcwdu() to os.getcwd().
3 | """
4 | # Author: Victor Stinner
5 |
6 | # Local imports
7 | from .. import fixer_base
8 | from ..fixer_util import Name
9 |
10 | class FixGetcwdu(fixer_base.BaseFix):
11 | BM_compatible = True
12 |
13 | PATTERN = """
14 | power< 'os' trailer< dot='.' name='getcwdu' > any* >
15 | """
16 |
17 | def transform(self, node, results):
18 | name = results["name"]
19 | name.replace(Name(u"getcwd", prefix=name.prefix))
20 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_standarderror.py:
--------------------------------------------------------------------------------
1 | # Copyright 2007 Google, Inc. All Rights Reserved.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """Fixer for StandardError -> Exception."""
5 |
6 | # Local imports
7 | from .. import fixer_base
8 | from ..fixer_util import Name
9 |
10 |
11 | class FixStandarderror(fixer_base.BaseFix):
12 | BM_compatible = True
13 | PATTERN = """
14 | 'StandardError'
15 | """
16 |
17 | def transform(self, node, results):
18 | return Name(u"Exception", prefix=node.prefix)
19 |
--------------------------------------------------------------------------------
/CANAPE.Cli/cliexamples/fixedproxy.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from canapecli import log, packets
3 | from canapecli.docs.net import FixedProxyDocument
4 |
5 | doc = FixedProxyDocument()
6 | doc.LocalPort = 12345
7 | doc.Host = 'www.google.com'
8 | doc.Port = 80
9 |
10 | logger = log.getverboselogger(sys.stdout)
11 | service = doc.Create(logger)
12 |
13 | service.Start()
14 |
15 | print "Created", str(service), "Press Enter to exit..."
16 | sys.stdin.readline()
17 |
18 | service.Stop()
19 |
20 | print "Captured packets:"
21 |
22 | for p in doc.Packets:
23 | print packets.tostr(p)
24 |
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/HexCasing.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Be.Windows.Forms
6 | {
7 | ///
8 | /// Specifies the case of hex characters in the HexBox control
9 | ///
10 | public enum HexCasing
11 | {
12 | ///
13 | /// Converts all characters to uppercase.
14 | ///
15 | Upper = 0,
16 | ///
17 | /// Converts all characters to lowercase.
18 | ///
19 | Lower = 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_long.py:
--------------------------------------------------------------------------------
1 | # Copyright 2006 Google, Inc. All Rights Reserved.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """Fixer that turns 'long' into 'int' everywhere.
5 | """
6 |
7 | # Local imports
8 | from lib2to3 import fixer_base
9 | from lib2to3.fixer_util import is_probably_builtin
10 |
11 |
12 | class FixLong(fixer_base.BaseFix):
13 | BM_compatible = True
14 | PATTERN = "'long'"
15 |
16 | def transform(self, node, results):
17 | if is_probably_builtin(node):
18 | node.value = u"int"
19 | node.changed()
20 |
--------------------------------------------------------------------------------
/HelpContent/Content Layout.content:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/NCalc/Domain/LogicalExpressionVisitor.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace NCalc.Domain
3 | {
4 | public abstract class LogicalExpressionVisitor
5 | {
6 | public abstract void Visit(LogicalExpression expression);
7 | public abstract void Visit(TernaryExpression expression);
8 | public abstract void Visit(BinaryExpression expression);
9 | public abstract void Visit(UnaryExpression expression);
10 | public abstract void Visit(ValueExpression expression);
11 | public abstract void Visit(Function function);
12 | public abstract void Visit(Identifier function);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/CANAPE.Net.NamedPipes/NamedPipeProxyClientFactory.cs:
--------------------------------------------------------------------------------
1 | using CANAPE.Documents.Net.Factories;
2 | using CANAPE.Utils;
3 | using System;
4 |
5 | namespace CANAPE.Net.NamedPipes
6 | {
7 | [Serializable]
8 | class NamedPipeProxyClientFactory : IProxyClientFactory
9 | {
10 | public event EventHandler ConfigChanged;
11 |
12 | public Clients.ProxyClient Create(CANAPE.Utils.Logger logger)
13 | {
14 | return new NamedPipeProxyClient("atsvc");
15 | }
16 |
17 | public object Clone()
18 | {
19 | return GeneralUtils.CloneObject(this);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/python/stringhexconv.py:
--------------------------------------------------------------------------------
1 | # Simple example of a hex + string converter in python
2 |
3 | from CANAPE.Utils import BinaryEncoding
4 |
5 | # Method to just XOR the byte array
6 | def doconvert(obj):
7 | for i in range(len(obj)):
8 | obj[i] = obj[i] ^ 42
9 | return obj
10 |
11 | # Entry point of hex converter, return byte array
12 | def ConvertHex(startPos, data):
13 | return doconvert(data)
14 |
15 | # Entry point for string converter, return string
16 | def ConvertString(startPos, data):
17 | return BinaryEncoding.Instance.GetString(doconvert(BinaryEncoding.Instance.GetBytes(args[1])))
18 |
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Server/index.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/csharp/index.de.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Server/index.de.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_future.py:
--------------------------------------------------------------------------------
1 | """Remove __future__ imports
2 |
3 | from __future__ import foo is replaced with an empty line.
4 | """
5 | # Author: Christian Heimes
6 |
7 | # Local imports
8 | from .. import fixer_base
9 | from ..fixer_util import BlankLine
10 |
11 | class FixFuture(fixer_base.BaseFix):
12 | BM_compatible = True
13 |
14 | PATTERN = """import_from< 'from' module_name="__future__" 'import' any >"""
15 |
16 | # This should be run last -- some things check for the import
17 | run_order = 10
18 |
19 | def transform(self, node, results):
20 | new = BlankLine()
21 | new.prefix = node.prefix
22 | return new
23 |
--------------------------------------------------------------------------------
/NCalc/Domain/UnaryExpression.cs:
--------------------------------------------------------------------------------
1 | namespace NCalc.Domain
2 | {
3 | public class UnaryExpression : LogicalExpression
4 | {
5 | public UnaryExpression(UnaryExpressionType type, LogicalExpression expression)
6 | {
7 | Type = type;
8 | Expression = expression;
9 | }
10 |
11 | public LogicalExpression Expression { get; set; }
12 |
13 | public UnaryExpressionType Type { get; set; }
14 |
15 | public override void Accept(LogicalExpressionVisitor visitor)
16 | {
17 | visitor.Visit(this);
18 | }
19 | }
20 |
21 | public enum UnaryExpressionType
22 | {
23 | Not,
24 | Negate,
25 | BitwiseNot
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/new.py:
--------------------------------------------------------------------------------
1 | """Create new objects of various types. Deprecated.
2 |
3 | This module is no longer required except for backward compatibility.
4 | Objects of most types can now be created by calling the type object.
5 | """
6 | from warnings import warnpy3k
7 | warnpy3k("The 'new' module has been removed in Python 3.0; use the 'types' "
8 | "module instead.", stacklevel=2)
9 | del warnpy3k
10 |
11 | from types import ClassType as classobj
12 | from types import FunctionType as function
13 | from types import InstanceType as instance
14 | from types import MethodType as instancemethod
15 | from types import ModuleType as module
16 |
17 | from types import CodeType as code
18 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_ne.py:
--------------------------------------------------------------------------------
1 | # Copyright 2006 Google, Inc. All Rights Reserved.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """Fixer that turns <> into !=."""
5 |
6 | # Local imports
7 | from .. import pytree
8 | from ..pgen2 import token
9 | from .. import fixer_base
10 |
11 |
12 | class FixNe(fixer_base.BaseFix):
13 | # This is so simple that we don't need the pattern compiler.
14 |
15 | _accept_type = token.NOTEQUAL
16 |
17 | def match(self, node):
18 | # Override
19 | return node.value == u"<>"
20 |
21 | def transform(self, node, results):
22 | new = pytree.Leaf(token.NOTEQUAL, u"!=", prefix=node.prefix)
23 | return new
24 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/wsgiref/__init__.py:
--------------------------------------------------------------------------------
1 | """wsgiref -- a WSGI (PEP 333) Reference Library
2 |
3 | Current Contents:
4 |
5 | * util -- Miscellaneous useful functions and wrappers
6 |
7 | * headers -- Manage response headers
8 |
9 | * handlers -- base classes for server/gateway implementations
10 |
11 | * simple_server -- a simple BaseHTTPServer that supports WSGI
12 |
13 | * validate -- validation wrapper that sits between an app and a server
14 | to detect errors in either
15 |
16 | To-Do:
17 |
18 | * cgi_gateway -- Run WSGI apps under CGI (pending a deployment standard)
19 |
20 | * cgi_wrapper -- Run CGI apps under WSGI
21 |
22 | * router -- a simple middleware component that handles URL traversal
23 | """
24 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_buffer.py:
--------------------------------------------------------------------------------
1 | # Copyright 2007 Google, Inc. All Rights Reserved.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """Fixer that changes buffer(...) into memoryview(...)."""
5 |
6 | # Local imports
7 | from .. import fixer_base
8 | from ..fixer_util import Name
9 |
10 |
11 | class FixBuffer(fixer_base.BaseFix):
12 | BM_compatible = True
13 |
14 | explicit = True # The user must ask for this fixer
15 |
16 | PATTERN = """
17 | power< name='buffer' trailer< '(' [any] ')' > any* >
18 | """
19 |
20 | def transform(self, node, results):
21 | name = results["name"]
22 | name.replace(Name(u"memoryview", prefix=name.prefix))
23 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_nonzero.py:
--------------------------------------------------------------------------------
1 | """Fixer for __nonzero__ -> __bool__ methods."""
2 | # Author: Collin Winter
3 |
4 | # Local imports
5 | from .. import fixer_base
6 | from ..fixer_util import Name, syms
7 |
8 | class FixNonzero(fixer_base.BaseFix):
9 | BM_compatible = True
10 | PATTERN = """
11 | classdef< 'class' any+ ':'
12 | suite< any*
13 | funcdef< 'def' name='__nonzero__'
14 | parameters< '(' NAME ')' > any+ >
15 | any* > >
16 | """
17 |
18 | def transform(self, node, results):
19 | name = results["name"]
20 | new = Name(u"__bool__", prefix=name.prefix)
21 | name.replace(new)
22 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_repr.py:
--------------------------------------------------------------------------------
1 | # Copyright 2006 Google, Inc. All Rights Reserved.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """Fixer that transforms `xyzzy` into repr(xyzzy)."""
5 |
6 | # Local imports
7 | from .. import fixer_base
8 | from ..fixer_util import Call, Name, parenthesize
9 |
10 |
11 | class FixRepr(fixer_base.BaseFix):
12 |
13 | BM_compatible = True
14 | PATTERN = """
15 | atom < '`' expr=any '`' >
16 | """
17 |
18 | def transform(self, node, results):
19 | expr = results["expr"].clone()
20 |
21 | if expr.type == self.syms.testlist1:
22 | expr = parenthesize(expr)
23 | return Call(Name(u"repr"), [expr], prefix=node.prefix)
24 |
--------------------------------------------------------------------------------
/CANAPEInstaller/readme.txt:
--------------------------------------------------------------------------------
1 | You need the Wix toolkit from http://wixtoolset.org/ installed and in your path for the batch files to work.
2 |
3 | To build first compile the canape project and generate the help file using the sandcastle help file builder. Once that is done run the copyfiles.bat file to copy the project data into the installer directory. This should also sign files as well if you have the Context key.
4 |
5 | Finally run the build.bat file to build the MSI and sign it.
6 |
7 | If you need to add new files to the distribution run copyfiles.bat and delete all files which should not be present from the distribution. Now run the harvert.bat file to capture all the files you need. This will regenerate canape_files.wxs. You can now follow the original build process.
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_methodattrs.py:
--------------------------------------------------------------------------------
1 | """Fix bound method attributes (method.im_? -> method.__?__).
2 | """
3 | # Author: Christian Heimes
4 |
5 | # Local imports
6 | from .. import fixer_base
7 | from ..fixer_util import Name
8 |
9 | MAP = {
10 | "im_func" : "__func__",
11 | "im_self" : "__self__",
12 | "im_class" : "__self__.__class__"
13 | }
14 |
15 | class FixMethodattrs(fixer_base.BaseFix):
16 | BM_compatible = True
17 | PATTERN = """
18 | power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* >
19 | """
20 |
21 | def transform(self, node, results):
22 | attr = results["attr"][0]
23 | new = unicode(MAP[attr.value])
24 | attr.replace(Name(new, prefix=attr.prefix))
25 |
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/BytePositionInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Be.Windows.Forms
6 | {
7 | ///
8 | /// Represents a position in the HexBox control
9 | ///
10 | struct BytePositionInfo
11 | {
12 | public BytePositionInfo(long index, int characterPosition)
13 | {
14 | _index = index;
15 | _characterPosition = characterPosition;
16 | }
17 |
18 | public int CharacterPosition
19 | {
20 | get { return _characterPosition; }
21 | } int _characterPosition;
22 |
23 | public long Index
24 | {
25 | get { return _index; }
26 | } long _index;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_funcattrs.py:
--------------------------------------------------------------------------------
1 | """Fix function attribute names (f.func_x -> f.__x__)."""
2 | # Author: Collin Winter
3 |
4 | # Local imports
5 | from .. import fixer_base
6 | from ..fixer_util import Name
7 |
8 |
9 | class FixFuncattrs(fixer_base.BaseFix):
10 | BM_compatible = True
11 |
12 | PATTERN = """
13 | power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'
14 | | 'func_name' | 'func_defaults' | 'func_code'
15 | | 'func_dict') > any* >
16 | """
17 |
18 | def transform(self, node, results):
19 | attr = results["attr"][0]
20 | attr.replace(Name((u"__%s__" % attr.value[5:]),
21 | prefix=attr.prefix))
22 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/python/httpserver.py:
--------------------------------------------------------------------------------
1 | from CANAPE.Scripting import BaseDataEndpoint
2 | from CANAPE.DataFrames import DataFrame
3 | from CANAPE.Net.Protocols.Server import DynamicHttpDataServer, HttpServerResponseData
4 | from CANAPE.Utils import GeneralUtils
5 |
6 | # Example HTTP Server
7 | class HttpServer(DynamicHttpDataServer):
8 |
9 | # Handle incoming request
10 | def HandleRequest(self, method, path, body, headers, version, logger):
11 | logger.LogInfo("Received Request: {0} {1} {2}", method, path,
12 | GeneralUtils.MakeByteString(body))
13 | return HttpServerResponseData("Hello World")
14 |
15 | # Gets a textual description of the endpoint
16 | def get_Description(self):
17 | return "Example HTTP Server"
18 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/python/basicdataendpoint.py:
--------------------------------------------------------------------------------
1 | from CANAPE.Scripting import BaseDataEndpoint
2 | from CANAPE.DataFrames import DataFrame
3 |
4 | class DataEndpoint(BaseDataEndpoint):
5 |
6 | # Run method, should exit when finished
7 | def Run(self, adapter, logger):
8 |
9 |
10 |
11 | frame = adapter.Read()
12 |
13 | while frame is not None:
14 | logger.LogInfo("Received {0}", frame)
15 |
16 | # Write it back out again reversed
17 | adapter.Write(DataFrame(frame.ToByteString()[::-1]))
18 |
19 | frame = adapter.Read();
20 |
21 | # Gets a textual description of the endpoint
22 | def get_Description(self):
23 | return "Example Reversing Endpoint"
24 |
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Proxy/index.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/email/mime/nonmultipart.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2002-2006 Python Software Foundation
2 | # Author: Barry Warsaw
3 | # Contact: email-sig@python.org
4 |
5 | """Base class for MIME type messages that are not multipart."""
6 |
7 | __all__ = ['MIMENonMultipart']
8 |
9 | from email import errors
10 | from email.mime.base import MIMEBase
11 |
12 |
13 |
14 | class MIMENonMultipart(MIMEBase):
15 | """Base class for MIME multipart/* type messages."""
16 |
17 | def attach(self, payload):
18 | # The public API prohibits attaching multiple subparts to MIMEBase
19 | # derived subtypes since none of them are, by definition, of content
20 | # type multipart/*
21 | raise errors.MultipartConversionError(
22 | 'Cannot attach additional subparts to non-multipart/*')
23 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/python/index.de.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/NCalc/Domain/TernaryExpression.cs:
--------------------------------------------------------------------------------
1 | namespace NCalc.Domain
2 | {
3 | public class TernaryExpression : LogicalExpression
4 | {
5 | public TernaryExpression(LogicalExpression leftExpression, LogicalExpression middleExpression, LogicalExpression rightExpression)
6 | {
7 | this.LeftExpression = leftExpression;
8 | this.MiddleExpression = middleExpression;
9 | this.RightExpression = rightExpression;
10 | }
11 |
12 | public LogicalExpression LeftExpression { get; set; }
13 |
14 | public LogicalExpression MiddleExpression { get; set; }
15 |
16 | public LogicalExpression RightExpression { get; set; }
17 |
18 | public override void Accept(LogicalExpressionVisitor visitor)
19 | {
20 | visitor.Visit(this);
21 | }
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/CANAPE.Documents/Templates/Proxy/index.de.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CANAPE.Cli/PythonLib/canapecli/__init__.py:
--------------------------------------------------------------------------------
1 | # CANAPE Network Testing Tool
2 | # Copyright (C) 2014 Context Information Security
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_xreadlines.py:
--------------------------------------------------------------------------------
1 | """Fix "for x in f.xreadlines()" -> "for x in f".
2 |
3 | This fixer will also convert g(f.xreadlines) into g(f.__iter__)."""
4 | # Author: Collin Winter
5 |
6 | # Local imports
7 | from .. import fixer_base
8 | from ..fixer_util import Name
9 |
10 |
11 | class FixXreadlines(fixer_base.BaseFix):
12 | BM_compatible = True
13 | PATTERN = """
14 | power< call=any+ trailer< '.' 'xreadlines' > trailer< '(' ')' > >
15 | |
16 | power< any+ trailer< '.' no_call='xreadlines' > >
17 | """
18 |
19 | def transform(self, node, results):
20 | no_call = results.get("no_call")
21 |
22 | if no_call:
23 | no_call.replace(Name(u"__iter__", prefix=no_call.prefix))
24 | else:
25 | node.replace([x.clone() for x in results["call"]])
26 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_input.py:
--------------------------------------------------------------------------------
1 | """Fixer that changes input(...) into eval(input(...))."""
2 | # Author: Andre Roberge
3 |
4 | # Local imports
5 | from .. import fixer_base
6 | from ..fixer_util import Call, Name
7 | from .. import patcomp
8 |
9 |
10 | context = patcomp.compile_pattern("power< 'eval' trailer< '(' any ')' > >")
11 |
12 |
13 | class FixInput(fixer_base.BaseFix):
14 | BM_compatible = True
15 | PATTERN = """
16 | power< 'input' args=trailer< '(' [any] ')' > >
17 | """
18 |
19 | def transform(self, node, results):
20 | # If we're already wrapped in a eval() call, we're done.
21 | if context.match(node.parent.parent):
22 | return
23 |
24 | new = node.clone()
25 | new.prefix = u""
26 | return Call(Name(u"eval"), [new], prefix=node.prefix)
27 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_unicode.py:
--------------------------------------------------------------------------------
1 | """Fixer that changes unicode to str, unichr to chr, and u"..." into "...".
2 |
3 | """
4 |
5 | import re
6 | from ..pgen2 import token
7 | from .. import fixer_base
8 |
9 | _mapping = {u"unichr" : u"chr", u"unicode" : u"str"}
10 | _literal_re = re.compile(ur"[uU][rR]?[\'\"]")
11 |
12 | class FixUnicode(fixer_base.BaseFix):
13 | BM_compatible = True
14 | PATTERN = "STRING | 'unicode' | 'unichr'"
15 |
16 | def transform(self, node, results):
17 | if node.type == token.NAME:
18 | new = node.clone()
19 | new.value = _mapping[node.value]
20 | return new
21 | elif node.type == token.STRING:
22 | if _literal_re.match(node.value):
23 | new = node.clone()
24 | new.value = new.value[1:]
25 | return new
26 |
--------------------------------------------------------------------------------
/CANAPE.Cli/PythonLib/canapecli/docs/data.py:
--------------------------------------------------------------------------------
1 | # CANAPE Network Testing Tool
2 | # Copyright (C) 2014 Context Information Security
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 |
17 | from CANAPE.Documents.Data import *
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Runtime.InteropServices;
4 |
5 | namespace Be.Windows.Forms
6 | {
7 | internal sealed class NativeMethods
8 | {
9 | static NativeMethods() {}
10 |
11 | // Caret definitions
12 | [DllImport("user32.dll", SetLastError=true)]
13 | public static extern bool CreateCaret(IntPtr hWnd, IntPtr hBitmap, int nWidth, int nHeight);
14 |
15 | [DllImport("user32.dll", SetLastError=true)]
16 | public static extern bool ShowCaret(IntPtr hWnd);
17 |
18 | [DllImport("user32.dll", SetLastError=true)]
19 | public static extern bool DestroyCaret();
20 |
21 | [DllImport("user32.dll", SetLastError=true)]
22 | public static extern bool SetCaretPos(int X, int Y);
23 |
24 | // Key definitions
25 | public const int WM_KEYDOWN = 0x100;
26 | public const int WM_KEYUP = 0x101;
27 | public const int WM_CHAR = 0x102;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/email/mime/base.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2001-2006 Python Software Foundation
2 | # Author: Barry Warsaw
3 | # Contact: email-sig@python.org
4 |
5 | """Base class for MIME specializations."""
6 |
7 | __all__ = ['MIMEBase']
8 |
9 | from email import message
10 |
11 |
12 |
13 | class MIMEBase(message.Message):
14 | """Base class for MIME specializations."""
15 |
16 | def __init__(self, _maintype, _subtype, **_params):
17 | """This constructor adds a Content-Type: and a MIME-Version: header.
18 |
19 | The Content-Type: header is taken from the _maintype and _subtype
20 | arguments. Additional parameters for this header are taken from the
21 | keyword arguments.
22 | """
23 | message.Message.__init__(self)
24 | ctype = '%s/%s' % (_maintype, _subtype)
25 | self.add_header('Content-Type', ctype, **_params)
26 | self['MIME-Version'] = '1.0'
27 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_numliterals.py:
--------------------------------------------------------------------------------
1 | """Fixer that turns 1L into 1, 0755 into 0o755.
2 | """
3 | # Copyright 2007 Georg Brandl.
4 | # Licensed to PSF under a Contributor Agreement.
5 |
6 | # Local imports
7 | from ..pgen2 import token
8 | from .. import fixer_base
9 | from ..fixer_util import Number
10 |
11 |
12 | class FixNumliterals(fixer_base.BaseFix):
13 | # This is so simple that we don't need the pattern compiler.
14 |
15 | _accept_type = token.NUMBER
16 |
17 | def match(self, node):
18 | # Override
19 | return (node.value.startswith(u"0") or node.value[-1] in u"Ll")
20 |
21 | def transform(self, node, results):
22 | val = node.value
23 | if val[-1] in u'Ll':
24 | val = val[:-1]
25 | elif val.startswith(u'0') and val.isdigit() and len(set(val)) > 1:
26 | val = u"0o" + val[1:]
27 |
28 | return Number(val, prefix=node.prefix)
29 |
--------------------------------------------------------------------------------
/CANAPE.Net/Layers/TextNetworkLayerConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CANAPE.Utils;
6 |
7 | namespace CANAPE.Net.Layers
8 | {
9 | ///
10 | /// Configuration for network layer
11 | ///
12 | [Serializable]
13 | public class TextNetworkLayerConfig
14 | {
15 | private bool _enabled;
16 | private BinaryStringEncoding _textEncoding;
17 |
18 | public BinaryStringEncoding TextEncoding
19 | {
20 | get { return _textEncoding; }
21 | set
22 | {
23 | if (_textEncoding != value)
24 | {
25 | _textEncoding = value;
26 | }
27 | }
28 | }
29 |
30 | public Encoding GetEncoding()
31 | {
32 | return GeneralUtils.GetEncodingFromType(_textEncoding);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/DataBlock.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Be.Windows.Forms
4 | {
5 | internal abstract class DataBlock
6 | {
7 | internal DataMap _map;
8 | internal DataBlock _nextBlock;
9 | internal DataBlock _previousBlock;
10 |
11 | public abstract long Length
12 | {
13 | get;
14 | }
15 |
16 | public DataMap Map
17 | {
18 | get
19 | {
20 | return _map;
21 | }
22 | }
23 |
24 | public DataBlock NextBlock
25 | {
26 | get
27 | {
28 | return _nextBlock;
29 | }
30 | }
31 |
32 | public DataBlock PreviousBlock
33 | {
34 | get
35 | {
36 | return _previousBlock;
37 | }
38 | }
39 |
40 | public abstract void RemoveBytes(long position, long count);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/CANAPE.Net/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/NativeCaretHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Be.Windows.Forms
5 | {
6 | class NativeCaretHandler : CaretHandler
7 | {
8 | public override bool CreateCaret(Control control, int nWidth, int nHeight)
9 | {
10 | return NativeMethods.CreateCaret(control.Handle, IntPtr.Zero, nWidth, nHeight);
11 | }
12 |
13 | public override bool ShowCaret(Control control)
14 | {
15 | return NativeMethods.ShowCaret(control.Handle);
16 | }
17 |
18 | public override bool DestroyCaret()
19 | {
20 | return NativeMethods.DestroyCaret();
21 | }
22 |
23 | public override bool SetCaretPos(int X, int Y)
24 | {
25 | return NativeMethods.SetCaretPos(X, Y);
26 | }
27 |
28 | public override void Draw(System.Drawing.Graphics g)
29 | {
30 | // Do nothing
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/statvfs.py:
--------------------------------------------------------------------------------
1 | """Constants for interpreting the results of os.statvfs() and os.fstatvfs()."""
2 | from warnings import warnpy3k
3 | warnpy3k("the statvfs module has been removed in Python 3.0", stacklevel=2)
4 | del warnpy3k
5 |
6 | # Indices for statvfs struct members in the tuple returned by
7 | # os.statvfs() and os.fstatvfs().
8 |
9 | F_BSIZE = 0 # Preferred file system block size
10 | F_FRSIZE = 1 # Fundamental file system block size
11 | F_BLOCKS = 2 # Total number of file system blocks (FRSIZE)
12 | F_BFREE = 3 # Total number of free blocks
13 | F_BAVAIL = 4 # Free blocks available to non-superuser
14 | F_FILES = 5 # Total number of file nodes
15 | F_FFREE = 6 # Total number of free file nodes
16 | F_FAVAIL = 7 # Free nodes available to non-superuser
17 | F_FLAG = 8 # Flags (see your local statvfs man page)
18 | F_NAMEMAX = 9 # Maximum file name length
19 |
--------------------------------------------------------------------------------
/NCalc/EvaluationOption.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace NCalc
4 | {
5 | // Summary:
6 | // Provides enumerated values to use to set evaluation options.
7 | [Flags]
8 | public enum EvaluateOptions
9 | {
10 | // Summary:
11 | // Specifies that no options are set.
12 | None = 1,
13 | //
14 | // Summary:
15 | // Specifies case-insensitive matching.
16 | IgnoreCase = 2,
17 | //
18 | // Summary:
19 | // No-cache mode. Ingores any pre-compiled expression in the cache.
20 | NoCache = 4,
21 | //
22 | // Summary:
23 | // Treats parameters as arrays and result a set of results.
24 | IterateParameters = 8,
25 | //
26 | // Summary:
27 | // When using Round(), if a number is halfway between two others, it is rounded toward the nearest number that is away from zero.
28 | RoundAwayFromZero = 16
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/distutils/command/__init__.py:
--------------------------------------------------------------------------------
1 | """distutils.command
2 |
3 | Package containing implementation of all the standard Distutils
4 | commands."""
5 |
6 | __revision__ = "$Id$"
7 |
8 | __all__ = ['build',
9 | 'build_py',
10 | 'build_ext',
11 | 'build_clib',
12 | 'build_scripts',
13 | 'clean',
14 | 'install',
15 | 'install_lib',
16 | 'install_headers',
17 | 'install_scripts',
18 | 'install_data',
19 | 'sdist',
20 | 'register',
21 | 'bdist',
22 | 'bdist_dumb',
23 | 'bdist_rpm',
24 | 'bdist_wininst',
25 | 'upload',
26 | 'check',
27 | # These two are reserved for future use:
28 | #'bdist_sdux',
29 | #'bdist_pkgtool',
30 | # Note:
31 | # bdist_packager is not included because it only provides
32 | # an abstract base class
33 | ]
34 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_reduce.py:
--------------------------------------------------------------------------------
1 | # Copyright 2008 Armin Ronacher.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """Fixer for reduce().
5 |
6 | Makes sure reduce() is imported from the functools module if reduce is
7 | used in that module.
8 | """
9 |
10 | from lib2to3 import fixer_base
11 | from lib2to3.fixer_util import touch_import
12 |
13 |
14 |
15 | class FixReduce(fixer_base.BaseFix):
16 |
17 | BM_compatible = True
18 | order = "pre"
19 |
20 | PATTERN = """
21 | power< 'reduce'
22 | trailer< '('
23 | arglist< (
24 | (not(argument) any ','
25 | not(argument) any) |
26 | (not(argument) any ','
27 | not(argument) any ','
28 | not(argument) any)
29 | ) >
30 | ')' >
31 | >
32 | """
33 |
34 | def transform(self, node, results):
35 | touch_import(u'functools', u'reduce', node)
36 |
--------------------------------------------------------------------------------
/NCalc/FunctionArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace NCalc
4 | {
5 | public class FunctionArgs : EventArgs
6 | {
7 |
8 | private object _result;
9 | public object Result
10 | {
11 | get { return _result; }
12 | set
13 | {
14 | _result = value;
15 | HasResult = true;
16 | }
17 | }
18 |
19 | public bool HasResult { get; set; }
20 |
21 | private Expression[] _parameters = new Expression[0];
22 |
23 | public Expression[] Parameters
24 | {
25 | get { return _parameters; }
26 | set { _parameters = value; }
27 | }
28 |
29 | public object[] EvaluateParameters()
30 | {
31 | var values = new object[_parameters.Length];
32 | for (int i = 0; i < values.Length; i++)
33 | {
34 | values[i] = _parameters[i].Evaluate();
35 | }
36 |
37 | return values;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/MenuExtensionManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Extension
19 | {
20 | public class MenuExtensionManager : GenericExtensionManager where T : MenuExtensionAttribute
21 | {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/json/tool.py:
--------------------------------------------------------------------------------
1 | r"""Command-line tool to validate and pretty-print JSON
2 |
3 | Usage::
4 |
5 | $ echo '{"json":"obj"}' | python -m json.tool
6 | {
7 | "json": "obj"
8 | }
9 | $ echo '{ 1.2:3.4}' | python -m json.tool
10 | Expecting property name: line 1 column 2 (char 2)
11 |
12 | """
13 | import sys
14 | import json
15 |
16 | def main():
17 | if len(sys.argv) == 1:
18 | infile = sys.stdin
19 | outfile = sys.stdout
20 | elif len(sys.argv) == 2:
21 | infile = open(sys.argv[1], 'rb')
22 | outfile = sys.stdout
23 | elif len(sys.argv) == 3:
24 | infile = open(sys.argv[1], 'rb')
25 | outfile = open(sys.argv[2], 'wb')
26 | else:
27 | raise SystemExit(sys.argv[0] + " [infile [outfile]]")
28 | try:
29 | obj = json.load(infile)
30 | except ValueError, e:
31 | raise SystemExit(e)
32 | json.dump(obj, outfile, sort_keys=True, indent=4)
33 | outfile.write('\n')
34 |
35 |
36 | if __name__ == '__main__':
37 | main()
38 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/HexConverterExtensionManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Extension
19 | {
20 | internal class HexConverterExtensionManager : MenuExtensionManager
21 | {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/NCalc/NCalc.tokens:
--------------------------------------------------------------------------------
1 | T__29=29
2 | T__28=28
3 | T__27=27
4 | T__26=26
5 | T__25=25
6 | T__24=24
7 | LETTER=20
8 | T__23=23
9 | FLOAT=7
10 | HEXINT=5
11 | ID=12
12 | HexDigit=16
13 | BININT=6
14 | NAME=13
15 | T__51=51
16 | T__52=52
17 | DIGIT=15
18 | T__50=50
19 | T__42=42
20 | INTEGER=4
21 | E=18
22 | T__43=43
23 | T__40=40
24 | T__41=41
25 | T__46=46
26 | T__47=47
27 | T__44=44
28 | T__45=45
29 | T__48=48
30 | T__49=49
31 | DATETIME=9
32 | TRUE=10
33 | T__30=30
34 | T__31=31
35 | T__32=32
36 | WS=22
37 | T__33=33
38 | T__34=34
39 | T__35=35
40 | T__36=36
41 | T__37=37
42 | T__38=38
43 | T__39=39
44 | UnicodeEscape=21
45 | BINDIGIT=17
46 | IDPART=14
47 | FALSE=11
48 | EscapeSequence=19
49 | STRING=8
50 | '!'=47
51 | '|'=29
52 | '>='=39
53 | '~'=49
54 | '=='=32
55 | '/'=45
56 | '>'=38
57 | '||'=25
58 | '&&'=27
59 | '='=33
60 | '<>'=35
61 | '+'=42
62 | ')'=51
63 | '^'=30
64 | '%'=46
65 | '>>'=41
66 | 'and'=28
67 | '<<'=40
68 | '?'=23
69 | '<='=37
70 | '!='=34
71 | '<'=36
72 | '('=50
73 | 'not'=48
74 | ':'=24
75 | 'or'=26
76 | '-'=43
77 | '*'=44
78 | ','=52
79 | '&'=31
80 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/csharp/index.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CANAPE/Nodes/NamespaceDoc.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Nodes
19 | {
20 | ///
21 | /// Classes in this namespace implement the nodes in a netgraph
22 | ///
23 | static class NamespaceDoc
24 | {
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CANAPE/Utils/NamespaceDoc.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Utils
19 | {
20 | ///
21 | /// Classes in this namespace implement some simple utilities
22 | ///
23 | static class NamespaceDoc
24 | {
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CANAPE.Gui/Extension/MainFormMenuExtensionManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Extension
19 | {
20 | internal class MainFormMenuExtensionManager : MenuExtensionManager
21 | {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CANAPE.Security/CertificateRequestDetails.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Security
23 | {
24 | class CertificateRequestDetails
25 | {
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/ScriptHighlightingExtensionManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Extension
19 | {
20 | public class ScriptHighlightingExtensionManager : GenericExtensionManager
21 | {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/xml/dom/NodeFilter.py:
--------------------------------------------------------------------------------
1 | # This is the Python mapping for interface NodeFilter from
2 | # DOM2-Traversal-Range. It contains only constants.
3 |
4 | class NodeFilter:
5 | """
6 | This is the DOM2 NodeFilter interface. It contains only constants.
7 | """
8 | FILTER_ACCEPT = 1
9 | FILTER_REJECT = 2
10 | FILTER_SKIP = 3
11 |
12 | SHOW_ALL = 0xFFFFFFFFL
13 | SHOW_ELEMENT = 0x00000001
14 | SHOW_ATTRIBUTE = 0x00000002
15 | SHOW_TEXT = 0x00000004
16 | SHOW_CDATA_SECTION = 0x00000008
17 | SHOW_ENTITY_REFERENCE = 0x00000010
18 | SHOW_ENTITY = 0x00000020
19 | SHOW_PROCESSING_INSTRUCTION = 0x00000040
20 | SHOW_COMMENT = 0x00000080
21 | SHOW_DOCUMENT = 0x00000100
22 | SHOW_DOCUMENT_TYPE = 0x00000200
23 | SHOW_DOCUMENT_FRAGMENT = 0x00000400
24 | SHOW_NOTATION = 0x00000800
25 |
26 | def acceptNode(self, node):
27 | raise NotImplementedError
28 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/PacketLogExtensionManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Extension
19 | {
20 | internal sealed class PacketLogExtensionManager :
21 | GenericExtensionManager
22 | {
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_zip.py:
--------------------------------------------------------------------------------
1 | """
2 | Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...)
3 | unless there exists a 'from future_builtins import zip' statement in the
4 | top-level namespace.
5 |
6 | We avoid the transformation if the zip() call is directly contained in
7 | iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:.
8 | """
9 |
10 | # Local imports
11 | from .. import fixer_base
12 | from ..fixer_util import Name, Call, in_special_context
13 |
14 | class FixZip(fixer_base.ConditionalFix):
15 |
16 | BM_compatible = True
17 | PATTERN = """
18 | power< 'zip' args=trailer< '(' [any] ')' >
19 | >
20 | """
21 |
22 | skip_on = "future_builtins.zip"
23 |
24 | def transform(self, node, results):
25 | if self.should_skip(node):
26 | return
27 |
28 | if in_special_context(node):
29 | return None
30 |
31 | new = node.clone()
32 | new.prefix = u""
33 | new = Call(Name(u"list"), [new])
34 | new.prefix = node.prefix
35 | return new
36 |
--------------------------------------------------------------------------------
/CANAPE/NodeFactories/NamespaceDoc.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.NodeFactories
19 | {
20 | ///
21 | /// Classes in this namespace implement factory objects for nodes in a net graph
22 | ///
23 | static class NamespaceDoc
24 | {
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CANAPE/DataFrames/NamespaceDoc.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.DataFrames
19 | {
20 | ///
21 | /// Classes in this namespace implement data frames which are the basic transfer mechanism in a net graph
22 | ///
23 | static class NamespaceDoc
24 | {
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/utf_32_le.py:
--------------------------------------------------------------------------------
1 | """
2 | Python 'utf-32-le' Codec
3 | """
4 | import codecs
5 |
6 | ### Codec APIs
7 |
8 | encode = codecs.utf_32_le_encode
9 |
10 | def decode(input, errors='strict'):
11 | return codecs.utf_32_le_decode(input, errors, True)
12 |
13 | class IncrementalEncoder(codecs.IncrementalEncoder):
14 | def encode(self, input, final=False):
15 | return codecs.utf_32_le_encode(input, self.errors)[0]
16 |
17 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
18 | _buffer_decode = codecs.utf_32_le_decode
19 |
20 | class StreamWriter(codecs.StreamWriter):
21 | encode = codecs.utf_32_le_encode
22 |
23 | class StreamReader(codecs.StreamReader):
24 | decode = codecs.utf_32_le_decode
25 |
26 | ### encodings module API
27 |
28 | def getregentry():
29 | return codecs.CodecInfo(
30 | name='utf-32-le',
31 | encode=encode,
32 | decode=decode,
33 | incrementalencoder=IncrementalEncoder,
34 | incrementaldecoder=IncrementalDecoder,
35 | streamreader=StreamReader,
36 | streamwriter=StreamWriter,
37 | )
38 |
--------------------------------------------------------------------------------
/CANAPE/DataAdapters/NamespaceDoc.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.DataAdapters
19 | {
20 | ///
21 | /// Classes in this namespace implement basic data adapters which allow data to flow in and out of net graphs
22 | ///
23 | static class NamespaceDoc
24 | {
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/this.py:
--------------------------------------------------------------------------------
1 | s = """Gur Mra bs Clguba, ol Gvz Crgref
2 |
3 | Ornhgvshy vf orggre guna htyl.
4 | Rkcyvpvg vf orggre guna vzcyvpvg.
5 | Fvzcyr vf orggre guna pbzcyrk.
6 | Pbzcyrk vf orggre guna pbzcyvpngrq.
7 | Syng vf orggre guna arfgrq.
8 | Fcnefr vf orggre guna qrafr.
9 | Ernqnovyvgl pbhagf.
10 | Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
11 | Nygubhtu cenpgvpnyvgl orngf chevgl.
12 | Reebef fubhyq arire cnff fvyragyl.
13 | Hayrff rkcyvpvgyl fvyraprq.
14 | Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
15 | Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
16 | Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
17 | Abj vf orggre guna arire.
18 | Nygubhtu arire vf bsgra orggre guna *evtug* abj.
19 | Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
20 | Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
21 | Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!"""
22 |
23 | d = {}
24 | for c in (65, 97):
25 | for i in range(26):
26 | d[chr(i+c)] = chr((i+13) % 26 + c)
27 |
28 | print "".join([d.get(c, c) for c in s])
29 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/utf_7.py:
--------------------------------------------------------------------------------
1 | """ Python 'utf-7' Codec
2 |
3 | Written by Brian Quinlan (brian@sweetapp.com).
4 | """
5 | import codecs
6 |
7 | ### Codec APIs
8 |
9 | encode = codecs.utf_7_encode
10 |
11 | def decode(input, errors='strict'):
12 | return codecs.utf_7_decode(input, errors, True)
13 |
14 | class IncrementalEncoder(codecs.IncrementalEncoder):
15 | def encode(self, input, final=False):
16 | return codecs.utf_7_encode(input, self.errors)[0]
17 |
18 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
19 | _buffer_decode = codecs.utf_7_decode
20 |
21 | class StreamWriter(codecs.StreamWriter):
22 | encode = codecs.utf_7_encode
23 |
24 | class StreamReader(codecs.StreamReader):
25 | decode = codecs.utf_7_decode
26 |
27 | ### encodings module API
28 |
29 | def getregentry():
30 | return codecs.CodecInfo(
31 | name='utf-7',
32 | encode=encode,
33 | decode=decode,
34 | incrementalencoder=IncrementalEncoder,
35 | incrementaldecoder=IncrementalDecoder,
36 | streamreader=StreamReader,
37 | streamwriter=StreamWriter,
38 | )
39 |
--------------------------------------------------------------------------------
/NCalc/Domain/BinaryExpression.cs:
--------------------------------------------------------------------------------
1 | namespace NCalc.Domain
2 | {
3 | public class BinaryExpression : LogicalExpression
4 | {
5 | public BinaryExpression(BinaryExpressionType type, LogicalExpression leftExpression, LogicalExpression rightExpression)
6 | {
7 | Type = type;
8 | LeftExpression = leftExpression;
9 | RightExpression = rightExpression;
10 | }
11 |
12 | public LogicalExpression LeftExpression { get; set; }
13 |
14 | public LogicalExpression RightExpression { get; set; }
15 |
16 | public BinaryExpressionType Type { get; set; }
17 |
18 | public override void Accept(LogicalExpressionVisitor visitor)
19 | {
20 | visitor.Visit(this);
21 | }
22 | }
23 |
24 | public enum BinaryExpressionType
25 | {
26 | And,
27 | Or,
28 | NotEqual,
29 | LesserOrEqual,
30 | GreaterOrEqual,
31 | Lesser,
32 | Greater,
33 | Equal,
34 | Minus,
35 | Plus,
36 | Modulo,
37 | Div,
38 | Times,
39 | BitwiseOr,
40 | BitwiseAnd,
41 | BitwiseXOr,
42 | LeftShift,
43 | RightShift,
44 | Unknown
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/email/mime/text.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2001-2006 Python Software Foundation
2 | # Author: Barry Warsaw
3 | # Contact: email-sig@python.org
4 |
5 | """Class representing text/* type MIME documents."""
6 |
7 | __all__ = ['MIMEText']
8 |
9 | from email.encoders import encode_7or8bit
10 | from email.mime.nonmultipart import MIMENonMultipart
11 |
12 |
13 |
14 | class MIMEText(MIMENonMultipart):
15 | """Class for generating text/* type MIME documents."""
16 |
17 | def __init__(self, _text, _subtype='plain', _charset='us-ascii'):
18 | """Create a text/* type MIME document.
19 |
20 | _text is the string for this message object.
21 |
22 | _subtype is the MIME sub content type, defaulting to "plain".
23 |
24 | _charset is the character set parameter added to the Content-Type
25 | header. This defaults to "us-ascii". Note that as a side-effect, the
26 | Content-Transfer-Encoding header will also be set.
27 | """
28 | MIMENonMultipart.__init__(self, 'text', _subtype,
29 | **{'charset': _charset})
30 | self.set_payload(_text, _charset)
31 |
--------------------------------------------------------------------------------
/CANAPE.Net.NamedPipes/NamedPipeProxyClient.cs:
--------------------------------------------------------------------------------
1 | using CANAPE.DataAdapters;
2 | using CANAPE.Net.Clients;
3 | using CANAPE.Net.Tokens;
4 | using CANAPE.Nodes;
5 | using CANAPE.Security;
6 | using CANAPE.Utils;
7 | using System;
8 | using System.IO.Pipes;
9 |
10 | namespace CANAPE.Net.NamedPipes
11 | {
12 | class NamedPipeProxyClient : ProxyClient
13 | {
14 | string _pipeName;
15 |
16 | public NamedPipeProxyClient(string pipeName)
17 | {
18 | _pipeName = pipeName;
19 | }
20 |
21 | public override IDataAdapter Connect(ProxyToken token, Logger logger, MetaDictionary meta, MetaDictionary globalMeta, PropertyBag properties, CredentialsManagerService credmgr)
22 | {
23 | return new StreamDataAdapter(new NamedPipeClientStream(".", _pipeName, PipeDirection.InOut));
24 | }
25 |
26 | public override CANAPE.DataAdapters.IDataAdapter Bind(ProxyToken token, Logger logger, MetaDictionary meta, MetaDictionary globalMeta, PropertyBag properties, CredentialsManagerService credmgr)
27 | {
28 | throw new NotImplementedException();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/HexInspectorExtensionManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Extension
23 | {
24 | internal class HexInspectorExtensionManager
25 | : GenericExtensionManager
26 | {
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/ParserSerializerExtensionManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Extension
23 | {
24 | sealed class ParserSerializerExtensionManager : MenuExtensionManager
25 | {
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CANAPE.Net.Protocols/Server/DynamicHttpDataServer.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.Utils;
18 |
19 | namespace CANAPE.Net.Protocols.Server
20 | {
21 | ///
22 | /// Base class for a dynamic HTTP server
23 | ///
24 | public abstract class DynamicHttpDataServer : BaseHttpDataServerRef
25 | {
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/xml/__init__.py:
--------------------------------------------------------------------------------
1 | """Core XML support for Python.
2 |
3 | This package contains four sub-packages:
4 |
5 | dom -- The W3C Document Object Model. This supports DOM Level 1 +
6 | Namespaces.
7 |
8 | parsers -- Python wrappers for XML parsers (currently only supports Expat).
9 |
10 | sax -- The Simple API for XML, developed by XML-Dev, led by David
11 | Megginson and ported to Python by Lars Marius Garshol. This
12 | supports the SAX 2 API.
13 |
14 | etree -- The ElementTree XML library. This is a subset of the full
15 | ElementTree XML release.
16 |
17 | """
18 |
19 |
20 | __all__ = ["dom", "parsers", "sax", "etree"]
21 |
22 | _MINIMUM_XMLPLUS_VERSION = (0, 8, 4)
23 |
24 |
25 | try:
26 | import _xmlplus
27 | except ImportError:
28 | pass
29 | else:
30 | try:
31 | v = _xmlplus.version_info
32 | except AttributeError:
33 | # _xmlplus is too old; ignore it
34 | pass
35 | else:
36 | if v >= _MINIMUM_XMLPLUS_VERSION:
37 | import sys
38 | _xmlplus.__path__.extend(__path__)
39 | sys.modules[__name__] = _xmlplus
40 | else:
41 | del v
42 |
--------------------------------------------------------------------------------
/CANAPE.Net.Protocols/Server/BaseHttpDataServer.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Net.Protocols.Server
19 | {
20 | ///
21 | /// Base HTTP server
22 | ///
23 | /// The configuration type
24 | public abstract class BaseHttpDataServer : BaseHttpDataServerRef where T : class, new()
25 | {
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_sys_exc.py:
--------------------------------------------------------------------------------
1 | """Fixer for sys.exc_{type, value, traceback}
2 |
3 | sys.exc_type -> sys.exc_info()[0]
4 | sys.exc_value -> sys.exc_info()[1]
5 | sys.exc_traceback -> sys.exc_info()[2]
6 | """
7 |
8 | # By Jeff Balogh and Benjamin Peterson
9 |
10 | # Local imports
11 | from .. import fixer_base
12 | from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms
13 |
14 | class FixSysExc(fixer_base.BaseFix):
15 | # This order matches the ordering of sys.exc_info().
16 | exc_info = [u"exc_type", u"exc_value", u"exc_traceback"]
17 | BM_compatible = True
18 | PATTERN = """
19 | power< 'sys' trailer< dot='.' attribute=(%s) > >
20 | """ % '|'.join("'%s'" % e for e in exc_info)
21 |
22 | def transform(self, node, results):
23 | sys_attr = results["attribute"][0]
24 | index = Number(self.exc_info.index(sys_attr.value))
25 |
26 | call = Call(Name(u"exc_info"), prefix=sys_attr.prefix)
27 | attr = Attr(Name(u"sys"), call)
28 | attr[1].children[0].prefix = results["dot"].prefix
29 | attr.append(Subscript(index))
30 | return Node(syms.power, attr, prefix=node.prefix)
31 |
--------------------------------------------------------------------------------
/CANAPE.Documents.ComPort/SerialPortProxyServerDocumentFactory.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.Extension;
18 | using CANAPE.Utils;
19 |
20 | namespace CANAPE.Documents.ComPort
21 | {
22 | [DocumentFactory("Serial Port Proxy"), LocalizedCategory("Serial Port")]
23 | public class SerialPortProxyServerDocumentFactory : DefaultDocumentFactory
24 | {
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_exec.py:
--------------------------------------------------------------------------------
1 | # Copyright 2006 Google, Inc. All Rights Reserved.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """Fixer for exec.
5 |
6 | This converts usages of the exec statement into calls to a built-in
7 | exec() function.
8 |
9 | exec code in ns1, ns2 -> exec(code, ns1, ns2)
10 | """
11 |
12 | # Local imports
13 | from .. import pytree
14 | from .. import fixer_base
15 | from ..fixer_util import Comma, Name, Call
16 |
17 |
18 | class FixExec(fixer_base.BaseFix):
19 | BM_compatible = True
20 |
21 | PATTERN = """
22 | exec_stmt< 'exec' a=any 'in' b=any [',' c=any] >
23 | |
24 | exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any >
25 | """
26 |
27 | def transform(self, node, results):
28 | assert results
29 | syms = self.syms
30 | a = results["a"]
31 | b = results.get("b")
32 | c = results.get("c")
33 | args = [a.clone()]
34 | args[0].prefix = ""
35 | if b is not None:
36 | args.extend([Comma(), b.clone()])
37 | if c is not None:
38 | args.extend([Comma(), c.clone()])
39 |
40 | return Call(Name(u"exec"), args, prefix=node.prefix)
41 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/utf_8.py:
--------------------------------------------------------------------------------
1 | """ Python 'utf-8' Codec
2 |
3 |
4 | Written by Marc-Andre Lemburg (mal@lemburg.com).
5 |
6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
7 |
8 | """
9 | import codecs
10 |
11 | ### Codec APIs
12 |
13 | encode = codecs.utf_8_encode
14 |
15 | def decode(input, errors='strict'):
16 | return codecs.utf_8_decode(input, errors, True)
17 |
18 | class IncrementalEncoder(codecs.IncrementalEncoder):
19 | def encode(self, input, final=False):
20 | return codecs.utf_8_encode(input, self.errors)[0]
21 |
22 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
23 | _buffer_decode = codecs.utf_8_decode
24 |
25 | class StreamWriter(codecs.StreamWriter):
26 | encode = codecs.utf_8_encode
27 |
28 | class StreamReader(codecs.StreamReader):
29 | decode = codecs.utf_8_decode
30 |
31 | ### encodings module API
32 |
33 | def getregentry():
34 | return codecs.CodecInfo(
35 | name='utf-8',
36 | encode=encode,
37 | decode=decode,
38 | incrementalencoder=IncrementalEncoder,
39 | incrementaldecoder=IncrementalDecoder,
40 | streamreader=StreamReader,
41 | streamwriter=StreamWriter,
42 | )
43 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/DocumentEditorManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System.Windows.Forms;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 |
21 | namespace CANAPE.Extension
22 | {
23 | ///
24 | /// Document editor manager
25 | ///
26 | public sealed class DocumentEditorManager : GenericExtensionManager
27 | {
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CANAPE.Documents/Extension/DocumentExtensionManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using CANAPE.Extension;
19 |
20 | namespace CANAPE.Documents.Extension
21 | {
22 | ///
23 | /// Document extension manager
24 | ///
25 | [Obsolete]
26 | public sealed class DocumentExtensionManager : GenericExtensionManager
27 | {
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/IPacketLogExtension.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System.Collections.Generic;
18 | using CANAPE.Documents.Net;
19 |
20 | namespace CANAPE.Extension
21 | {
22 | ///
23 | /// Interface for a packet log extension
24 | ///
25 | public interface IPacketLogExtension
26 | {
27 | void Run(LogPacketCollection packets, IEnumerable selectedIndices);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/DocumentFactoryManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Extension
23 | {
24 | ///
25 | /// Manager for document factories
26 | ///
27 | class DocumentFactoryManager : MenuExtensionManager
28 | {
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CANAPE.NodeLibrary/NodeLibraryClassCategory.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.NodeLibrary
19 | {
20 | ///
21 | /// Indicates the category of the node library class
22 | ///
23 | public enum NodeLibraryClassCategory
24 | {
25 | General,
26 | Parser,
27 | Fuzzer,
28 | Control,
29 | Server,
30 | Mutator,
31 | Endpoint,
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/BasePersistDynamicNode.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.Nodes;
18 |
19 | namespace CANAPE.Scripting
20 | {
21 | ///
22 | /// Base class for a persisting dynamic node
23 | ///
24 | /// The configuration type
25 | public abstract class BasePersistDynamicNode : PersistNodeImpl where T : class, new()
26 | {
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Be.Windows.Forms.HexBox/HexAnnotation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace Be.Windows.Forms
8 | {
9 | ///
10 | /// A annotation entry
11 | ///
12 | class HexAnnotation : IComparable
13 | {
14 | public long StartPosition { get; set; }
15 | public long EndPosition { get; set; }
16 | public Color ForeColor { get; set; }
17 | public Color BackColor { get; set; }
18 |
19 | ///
20 | /// Just sort by start position
21 | ///
22 | /// The other annotation
23 | /// The comparison
24 | public int CompareTo(HexAnnotation other)
25 | {
26 | return StartPosition.CompareTo(other.StartPosition);
27 | }
28 |
29 | public bool InAnnotation(long pos)
30 | {
31 | return (StartPosition <= pos) && (pos <= EndPosition);
32 | }
33 |
34 | public HexAnnotation()
35 | {
36 | ForeColor = Color.Black;
37 | BackColor = Color.White;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/CANAPE.Parser/Endian.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Parser
19 | {
20 | ///
21 | /// Enumeration to indicate endian
22 | ///
23 | public enum Endian
24 | {
25 | ///
26 | /// Little endian
27 | ///
28 | LittleEndian,
29 | ///
30 | /// Big endian
31 | ///
32 | BigEndian
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CANAPE.Parser/Members/IMemberReference.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Parser
23 | {
24 | ///
25 | /// Interface for objects which handle member references
26 | ///
27 | public interface IMemberReference
28 | {
29 | MemberEntryReference Reference { get; set; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/BasePersistDataEndpoint.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Scripting
19 | {
20 | ///
21 | /// Base persist data endpoint with a single config type
22 | ///
23 | /// The type of configuration
24 | public abstract class BasePersistDataEndpoint : BasePersistDataEndpointRef
25 | where T : class, new()
26 | {
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Controls/DocumentEditors/SourceHighlighters/CSharpHighlighter.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.Extension;
18 |
19 | namespace CANAPE.Controls.DocumentEditors.SourceHighlighters
20 | {
21 | [ScriptHighlightingAttribute]
22 | public class CSharpHighlighter : BaseHighlighter
23 | {
24 | public CSharpHighlighter()
25 | : base("csharp", "C#", "cs", null)
26 | {
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Forms/HistogramLogViewerForm.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System.Windows.Forms;
18 | using CANAPE.Nodes;
19 |
20 | namespace CANAPE.Forms
21 | {
22 | public partial class HistogramLogViewerForm : Form
23 | {
24 | public HistogramLogViewerForm(LogPacket[] packets)
25 | {
26 | InitializeComponent();
27 | histogramChartControl.SetPackets(packets);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/utf_16_be.py:
--------------------------------------------------------------------------------
1 | """ Python 'utf-16-be' Codec
2 |
3 |
4 | Written by Marc-Andre Lemburg (mal@lemburg.com).
5 |
6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
7 |
8 | """
9 | import codecs
10 |
11 | ### Codec APIs
12 |
13 | encode = codecs.utf_16_be_encode
14 |
15 | def decode(input, errors='strict'):
16 | return codecs.utf_16_be_decode(input, errors, True)
17 |
18 | class IncrementalEncoder(codecs.IncrementalEncoder):
19 | def encode(self, input, final=False):
20 | return codecs.utf_16_be_encode(input, self.errors)[0]
21 |
22 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
23 | _buffer_decode = codecs.utf_16_be_decode
24 |
25 | class StreamWriter(codecs.StreamWriter):
26 | encode = codecs.utf_16_be_encode
27 |
28 | class StreamReader(codecs.StreamReader):
29 | decode = codecs.utf_16_be_decode
30 |
31 | ### encodings module API
32 |
33 | def getregentry():
34 | return codecs.CodecInfo(
35 | name='utf-16-be',
36 | encode=encode,
37 | decode=decode,
38 | incrementalencoder=IncrementalEncoder,
39 | incrementaldecoder=IncrementalDecoder,
40 | streamreader=StreamReader,
41 | streamwriter=StreamWriter,
42 | )
43 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/utf_16_le.py:
--------------------------------------------------------------------------------
1 | """ Python 'utf-16-le' Codec
2 |
3 |
4 | Written by Marc-Andre Lemburg (mal@lemburg.com).
5 |
6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
7 |
8 | """
9 | import codecs
10 |
11 | ### Codec APIs
12 |
13 | encode = codecs.utf_16_le_encode
14 |
15 | def decode(input, errors='strict'):
16 | return codecs.utf_16_le_decode(input, errors, True)
17 |
18 | class IncrementalEncoder(codecs.IncrementalEncoder):
19 | def encode(self, input, final=False):
20 | return codecs.utf_16_le_encode(input, self.errors)[0]
21 |
22 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
23 | _buffer_decode = codecs.utf_16_le_decode
24 |
25 | class StreamWriter(codecs.StreamWriter):
26 | encode = codecs.utf_16_le_encode
27 |
28 | class StreamReader(codecs.StreamReader):
29 | decode = codecs.utf_16_le_decode
30 |
31 | ### encodings module API
32 |
33 | def getregentry():
34 | return codecs.CodecInfo(
35 | name='utf-16-le',
36 | encode=encode,
37 | decode=decode,
38 | incrementalencoder=IncrementalEncoder,
39 | incrementaldecoder=IncrementalDecoder,
40 | streamreader=StreamReader,
41 | streamwriter=StreamWriter,
42 | )
43 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/StreamDataEndpoint.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System.IO;
18 | using CANAPE.DataAdapters;
19 | using CANAPE.Nodes;
20 | using CANAPE.Utils;
21 |
22 | namespace CANAPE.Scripting
23 | {
24 | ///
25 | /// Base class for a data server which takes a binary stream
26 | ///
27 | public abstract class StreamDataEndpoint : PersistStreamDataEndpoint
28 | {
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/csharp/basicpipelinenode.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using CANAPE.DataFrames;
19 | using CANAPE.Nodes;
20 |
21 | class PipelineNode : BaseDynamicPipelineNode
22 | {
23 | // Called when a new frame is received
24 | protected override void OnInput(DataFrame frame)
25 | {
26 | LogInfo("Received {0}", frame);
27 | // Write frame to output
28 | WriteOutput(frame);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CANAPE.Parser/Members/IMemberReaderWriter.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System.CodeDom;
18 |
19 | namespace CANAPE.Parser
20 | {
21 | // Interface for objects which support direct reading and writing expressions
22 | public interface IMemberReaderWriter
23 | {
24 | CodeExpression GetReaderExpression(CodeExpression reader);
25 | CodeExpression GetWriterExpression(CodeExpression writer, CodeExpression obj);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/python/remutator.py:
--------------------------------------------------------------------------------
1 | # This pulls in the canape library namespaces
2 | import CANAPE.Nodes
3 | import CANAPE.DataFrames
4 | import re
5 |
6 | # Simple pipeline node to mutate based on a regular expression
7 | class ReMutatorNode(CANAPE.Nodes.BasePipelineNode):
8 |
9 | # Called when a new frame has arrived
10 | def OnInput(self, frame):
11 |
12 | # Get a replacement string from the graph, if set
13 | replacement = self.Graph.GetProperty("replacement")
14 | if replacement is None:
15 | # Get the string from the node
16 | replacement = self.GetProperty("replacement")
17 | if replacement is None:
18 | # Nothing available so default
19 | replacement = "Goodbye"
20 |
21 | # Get per graph value (there is also GlobalMeta which is per service)
22 | count = self.Graph.Meta.IncrementCounter("count", 1, 1)
23 |
24 | # Do a simple regex sub to change Hello to replacement
25 | s = re.sub("Hello", replacement * count, frame.ToByteString())
26 |
27 | # Create a new data frame with the contents of the string
28 | self.WriteOutput(CANAPE.DataFrames.DataFrame(s))
29 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Extension/StringConverterExtensionManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Extension
23 | {
24 | ///
25 | /// Manager for string converters
26 | ///
27 | sealed class StringConverterExtensionManager : MenuExtensionManager
28 | {
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Forms/MetaEditorForm.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System.Windows.Forms;
18 | using CANAPE.Controls;
19 | using CANAPE.Documents;
20 |
21 | namespace CANAPE.Forms
22 | {
23 | public partial class MetaEditorForm : Form
24 | {
25 | public MetaEditorForm()
26 | {
27 |
28 | InitializeComponent();
29 | metaEditorControl.Meta = CANAPEProject.CurrentProject.GlobalMeta;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/CANAPE.Security/ICredentialObject.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Security
19 | {
20 | ///
21 | /// An interface implemented by any credential object
22 | ///
23 | public interface ICredentialObject
24 | {
25 | ///
26 | /// 'Get the principal name
27 | ///
28 | /// The name of the principal
29 | string GetPrincipalName();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Controls/DocumentEditors/SourceHighlighters/PythonHighlighter.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.Extension;
18 |
19 | namespace CANAPE.Controls.DocumentEditors.SourceHighlighters
20 | {
21 | [ScriptHighlighting]
22 | public class PythonHighlighter : BaseHighlighter
23 | {
24 | public PythonHighlighter()
25 | : base("python", "Python", "py", Properties.Resources.PythonSyntaxHighlighting)
26 | {
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CANAPE.Net/Tokens/FullHttpProxyToken.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.DataAdapters;
18 | using CANAPE.Net.Protocols.Parser;
19 |
20 | namespace CANAPE.Net.Tokens
21 | {
22 | internal class FullHttpProxyToken : IpProxyToken
23 | {
24 | public FullHttpProxyToken(string hostname, int port)
25 | : base(null, hostname, port, IpClientType.Tcp, false)
26 | {
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Forms/BinaryFrameDiffForm.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System.Windows.Forms;
18 | using CANAPE.Controls;
19 | using CANAPE.DataFrames;
20 |
21 | namespace CANAPE.Forms
22 | {
23 | public partial class BinaryFrameDiffForm : Form
24 | {
25 | public BinaryFrameDiffForm(DataNode left, DataNode right)
26 | {
27 |
28 | InitializeComponent();
29 | baseDiffControl.SetData(left, right);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/CANAPE.Documents/Net/HttpProxyDocument.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using CANAPE.Net;
19 | using CANAPE.Net.Layers;
20 | using CANAPE.Net.Servers;
21 | using CANAPE.Utils;
22 |
23 | namespace CANAPE.Documents.Net
24 | {
25 | ///
26 | /// Document representing a HTTP proxy, just an alias for FullHttpProxyDocument
27 | ///
28 | [Serializable]
29 | public class HttpProxyDocument : FullHttpProxyDocument
30 | {
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/CANAPE.Documents/Extension/NetworkLayerFactoryManager.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.Documents.Net.Factories;
18 | using CANAPE.Extension;
19 | using CANAPE.Net.Layers;
20 |
21 | namespace CANAPE.Documents.Extension
22 | {
23 | ///
24 | /// Network layer factory manager
25 | ///
26 | public sealed class NetworkLayerFactoryManager
27 | : GenericExtensionManager
28 | {
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CANAPE/Utils/INodeInitializer.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.DataFrames;
18 |
19 | namespace CANAPE.Utils
20 | {
21 | ///
22 | /// An interface to populate an object from a data node
23 | ///
24 | public interface INodeInitializer
25 | {
26 | ///
27 | /// Populate object from node
28 | ///
29 | /// The node
30 | void FromNode(DataNode node);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/CANAPE.Documents.ComPort/SerialPortServerDocumentFactory.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 | using CANAPE.Extension;
22 | using CANAPE.Utils;
23 |
24 | namespace CANAPE.Documents.ComPort
25 | {
26 | [DocumentFactory("Serial Port Server"), LocalizedCategory("Serial Port")]
27 | public class SerialPortServerDocumentFactory : DefaultDocumentFactory
28 | {
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_ws_comma.py:
--------------------------------------------------------------------------------
1 | """Fixer that changes 'a ,b' into 'a, b'.
2 |
3 | This also changes '{a :b}' into '{a: b}', but does not touch other
4 | uses of colons. It does not touch other uses of whitespace.
5 |
6 | """
7 |
8 | from .. import pytree
9 | from ..pgen2 import token
10 | from .. import fixer_base
11 |
12 | class FixWsComma(fixer_base.BaseFix):
13 |
14 | explicit = True # The user must ask for this fixers
15 |
16 | PATTERN = """
17 | any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]>
18 | """
19 |
20 | COMMA = pytree.Leaf(token.COMMA, u",")
21 | COLON = pytree.Leaf(token.COLON, u":")
22 | SEPS = (COMMA, COLON)
23 |
24 | def transform(self, node, results):
25 | new = node.clone()
26 | comma = False
27 | for child in new.children:
28 | if child in self.SEPS:
29 | prefix = child.prefix
30 | if prefix.isspace() and u"\n" not in prefix:
31 | child.prefix = u""
32 | comma = True
33 | else:
34 | if comma:
35 | prefix = child.prefix
36 | if not prefix:
37 | child.prefix = u" "
38 | comma = False
39 | return new
40 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | CANAPE Network Testing Tool
2 | Copyright (C) 2014 Context Information Security
3 | Originally developed by James Forshaw
4 |
5 | This is the main code for the CANAPE network testing tool.
6 |
7 | It is licensed under GPLv3. Note some other parts of the solution are
8 | licensed under different licenses, see other_licenses.txt for details.
9 |
10 | Building:
11 |
12 | The project has been tested in Visual Studio 2012 and 2013, it should just
13 | load up and you can build directly from the GUI
14 |
15 | If you want to build the help file you need to install Sandcastle Help
16 | File Builder from https://shfb.codeplex.com/ and build the canape_doc.shfbproj
17 | project.
18 |
19 | The installer can be built if necessary from CANAPEInstaller with the WiX
20 | toolkit.
21 |
22 | Security Warning:
23 |
24 | The projects CANAPE creates can contain dangerous data such as full privileged
25 | scripts which can be executed by just opening a project. Do not open projects
26 | from untrusted sources, ever! I've modified the project loader to do it's
27 | best to prevent serialization issues but you should consider the file format
28 | to be executable because of the script code.
29 |
30 | Thanks to Graham Sutherland for making me actually bother to warn people and
31 | at least attempt to fix it.
32 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Controls/IDiffWindow.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.Utils;
18 |
19 | namespace CANAPE.Controls
20 | {
21 | internal enum DiffMode
22 | {
23 | Split,
24 | Merged,
25 | }
26 |
27 | ///
28 | /// An interface which represents a difference window
29 | ///
30 | internal interface IDiffWindow
31 | {
32 | DiffMode Mode { get; set; }
33 | void SetDiff(int index);
34 | int DiffCount { get; }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/CANAPE/Parser/IChildObject.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Parser
23 | {
24 | ///
25 | /// An interface which indicates an object can have a parent
26 | ///
27 | public interface IChildObject
28 | {
29 | ///
30 | /// Get or set the parent object
31 | ///
32 | object Parent { get; set; }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Controls/IReadOnlyControl.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Controls
23 | {
24 | ///
25 | /// An interface to make a control read only
26 | ///
27 | public interface IReadOnlyControl
28 | {
29 | ///
30 | /// Get or set read only flag
31 | ///
32 | bool ReadOnly { get; set; }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/pygram.py:
--------------------------------------------------------------------------------
1 | # Copyright 2006 Google, Inc. All Rights Reserved.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """Export the Python grammar and symbols."""
5 |
6 | # Python imports
7 | import os
8 |
9 | # Local imports
10 | from .pgen2 import token
11 | from .pgen2 import driver
12 | from . import pytree
13 |
14 | # The grammar file
15 | _GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), "Grammar.txt")
16 | _PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__),
17 | "PatternGrammar.txt")
18 |
19 |
20 | class Symbols(object):
21 |
22 | def __init__(self, grammar):
23 | """Initializer.
24 |
25 | Creates an attribute for each grammar symbol (nonterminal),
26 | whose value is the symbol's type (an int >= 256).
27 | """
28 | for name, symbol in grammar.symbol2number.iteritems():
29 | setattr(self, name, symbol)
30 |
31 |
32 | python_grammar = driver.load_grammar(_GRAMMAR_FILE)
33 |
34 | python_symbols = Symbols(python_grammar)
35 |
36 | python_grammar_no_print_statement = python_grammar.copy()
37 | del python_grammar_no_print_statement.keywords["print"]
38 |
39 | pattern_grammar = driver.load_grammar(_PATTERN_GRAMMAR_FILE)
40 | pattern_symbols = Symbols(pattern_grammar)
41 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/dircache.py:
--------------------------------------------------------------------------------
1 | """Read and cache directory listings.
2 |
3 | The listdir() routine returns a sorted list of the files in a directory,
4 | using a cache to avoid reading the directory more often than necessary.
5 | The annotate() routine appends slashes to directories."""
6 | from warnings import warnpy3k
7 | warnpy3k("the dircache module has been removed in Python 3.0", stacklevel=2)
8 | del warnpy3k
9 |
10 | import os
11 |
12 | __all__ = ["listdir", "opendir", "annotate", "reset"]
13 |
14 | cache = {}
15 |
16 | def reset():
17 | """Reset the cache completely."""
18 | global cache
19 | cache = {}
20 |
21 | def listdir(path):
22 | """List directory contents, using cache."""
23 | try:
24 | cached_mtime, list = cache[path]
25 | del cache[path]
26 | except KeyError:
27 | cached_mtime, list = -1, []
28 | mtime = os.stat(path).st_mtime
29 | if mtime != cached_mtime:
30 | list = os.listdir(path)
31 | list.sort()
32 | cache[path] = mtime, list
33 | return list
34 |
35 | opendir = listdir # XXX backward compatibility
36 |
37 | def annotate(head, list):
38 | """Add '/' suffixes to directories."""
39 | for i in range(len(list)):
40 | if os.path.isdir(os.path.join(head, list[i])):
41 | list[i] = list[i] + '/'
42 |
--------------------------------------------------------------------------------
/CANAPE.Parser/Members/IMemberContainer.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Parser
23 | {
24 | ///
25 | /// Interface for a member container
26 | ///
27 | public interface IMemberContainer
28 | {
29 | ///
30 | /// The base entry contained in this object
31 | ///
32 | MemberEntry BaseEntry { get; }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/python/index.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/IScriptedNode.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Scripting
23 | {
24 | ///
25 | /// An interface which allows access to the a node's script
26 | ///
27 | public interface IScriptedNode
28 | {
29 | ///
30 | /// Get the script container for this node
31 | ///
32 | DynamicScriptContainer Script { get; }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/IRunScript.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Scripting
19 | {
20 | ///
21 | /// An interface which determines if a class can be executed
22 | ///
23 | public interface IRunScript
24 | {
25 | ///
26 | /// Execute some code on the class
27 | ///
28 | /// Any arguments passed from the caller
29 | /// The result if needed
30 | dynamic Run(dynamic[] args);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/lib2to3/fixes/fix_callable.py:
--------------------------------------------------------------------------------
1 | # Copyright 2007 Google, Inc. All Rights Reserved.
2 | # Licensed to PSF under a Contributor Agreement.
3 |
4 | """Fixer for callable().
5 |
6 | This converts callable(obj) into isinstance(obj, collections.Callable), adding a
7 | collections import if needed."""
8 |
9 | # Local imports
10 | from lib2to3 import fixer_base
11 | from lib2to3.fixer_util import Call, Name, String, Attr, touch_import
12 |
13 | class FixCallable(fixer_base.BaseFix):
14 | BM_compatible = True
15 |
16 | order = "pre"
17 |
18 | # Ignore callable(*args) or use of keywords.
19 | # Either could be a hint that the builtin callable() is not being used.
20 | PATTERN = """
21 | power< 'callable'
22 | trailer< lpar='('
23 | ( not(arglist | argument) func=any
24 | | func=arglist<(not argument) any ','> )
25 | rpar=')' >
26 | after=any*
27 | >
28 | """
29 |
30 | def transform(self, node, results):
31 | func = results['func']
32 |
33 | touch_import(None, u'collections', node=node)
34 |
35 | args = [func.clone(), String(u', ')]
36 | args.extend(Attr(Name(u'collections'), Name(u'Callable')))
37 | return Call(Name(u'isinstance'), args, prefix=node.prefix)
38 |
--------------------------------------------------------------------------------
/CANAPE.Net/Nodes/LayerSectionGraphDirection.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Nodes
19 | {
20 | ///
21 | /// Indicate of the direction of flow in a layer section node
22 | ///
23 | public enum LayerSectionGraphDirection
24 | {
25 | ///
26 | /// Go from server to client
27 | ///
28 | ServerToClient,
29 |
30 | ///
31 | /// Go from client to server
32 | ///
33 | ClientToServer
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/LogViewer/LogViewerForm.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Windows.Forms;
19 | using CANAPE.Nodes;
20 | using CANAPE.Utils;
21 | using System.Collections.Generic;
22 |
23 | namespace LogViewer
24 | {
25 | public partial class LogViewerForm : Form
26 | {
27 | public LogViewerForm()
28 | {
29 | InitializeComponent();
30 | }
31 |
32 | private void exitToolStripMenuItem_Click(object sender, EventArgs e)
33 | {
34 | Application.Exit();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/LogViewer/Program.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Windows.Forms;
19 |
20 | namespace LogViewer
21 | {
22 | static class Program
23 | {
24 | ///
25 | /// The main entry point for the application.
26 | ///
27 | [STAThread]
28 | static void Main()
29 | {
30 | Application.EnableVisualStyles();
31 | Application.SetCompatibleTextRenderingDefault(false);
32 | Application.Run(new LogViewerForm());
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CANAPE/Utils/INodeConverter.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.DataFrames;
18 |
19 | namespace CANAPE.Utils
20 | {
21 | ///
22 | /// Interface to convert an object to a node
23 | ///
24 | public interface INodeConverter
25 | {
26 | ///
27 | /// Convert object to a data node
28 | ///
29 | /// The name of the resulting node
30 | /// The data node
31 | DataNode ToNode(string name);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CANAPE.Net/Nodes/LayerSectionNodeDefaultMode.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Nodes
19 | {
20 | ///
21 | /// The default mode for the layer section when encountering a frame it doesn't know about
22 | ///
23 | public enum LayerSectionNodeDefaultMode
24 | {
25 | ///
26 | /// Pass the frame on to the layers output
27 | ///
28 | PassFrame,
29 |
30 | ///
31 | /// Drop the frame
32 | ///
33 | DropFrame
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CANAPE.Parser/NameChangedEventArgs.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Text;
21 |
22 | namespace CANAPE.Parser
23 | {
24 | public class NameChangedEventArgs : EventArgs
25 | {
26 | public string OldName { get; private set; }
27 | public string NewName { get; private set; }
28 |
29 | public NameChangedEventArgs(string oldName, string newName)
30 | {
31 | OldName = oldName;
32 | NewName = newName;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/IPersistDynamicNode.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using CANAPE.Nodes;
19 | using CANAPE.Utils;
20 |
21 | namespace CANAPE.Scripting
22 | {
23 | ///
24 | /// Interface to persist a dynamic node's state if required
25 | ///
26 | /// This is now obselete, but left for back compat purposes, should use CANAPE.Nodes.IPersistNode instead
27 | [Obsolete("Use CANAPE.Nodes.IPersistNode instead of this")]
28 | public interface IPersistDynamicNode : IPersistNode
29 | {
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Controls/HexEditorControlConfig.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Drawing;
20 | using System.Linq;
21 | using System.Text;
22 |
23 | namespace CANAPE.Controls
24 | {
25 | ///
26 | /// Hex editor configuration
27 | ///
28 | [Serializable]
29 | public class HexEditorControlConfig
30 | {
31 | ///
32 | /// Default font for hex editor editor
33 | ///
34 | public Font DefaultFont { get; set; }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/CANAPE.Net/DataAdapters/IpBoundDataAdapter.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.Linq;
20 | using System.Net;
21 | using System.Text;
22 |
23 | namespace CANAPE.Net.DataAdapters
24 | {
25 | ///
26 | /// Data adapter bound to an IP address
27 | ///
28 | public abstract class IpBoundDataAdapter : BoundDataAdapter
29 | {
30 | ///
31 | /// The IP endpoint
32 | ///
33 | public abstract IPEndPoint Endpoint { get; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CANAPE.Security/ICertificateBuilder.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Security.Cryptography.X509Certificates;
19 |
20 | namespace CANAPE.Security.Cryptography.X509Certificates
21 | {
22 | internal interface ICertificateBuilder
23 | {
24 | X509Certificate2 CreateCert(X509Certificate2 issuer, X500DistinguishedName subjectName,
25 | byte[] serialNumber, bool signature, int keySize, CertificateHashAlgorithm hashAlgorithm,
26 | DateTime notBefore, DateTime notAfter, X509ExtensionCollection extensions);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/CANAPE.Parser/Members/PrimitiveMemberEntryFormat.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Parser
19 | {
20 | ///
21 | /// Display format for primitive members
22 | ///
23 | public enum PrimitiveMemberEntryFormat
24 | {
25 | ///
26 | /// Default formatting
27 | ///
28 | Default,
29 | ///
30 | /// Decimal
31 | ///
32 | Decimal,
33 | ///
34 | /// Hexadecimal
35 | ///
36 | Hexadecimal,
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/IDataParser.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using CANAPE.DataFrames;
18 | using CANAPE.Utils;
19 |
20 | namespace CANAPE.Scripting
21 | {
22 | ///
23 | /// Base interface for all parsers
24 | ///
25 | public interface IDataParser
26 | {
27 | ///
28 | /// Convert the datakey to a text string
29 | ///
30 | ///
31 | ///
32 | ///
33 | string ToDisplayString(DataKey root, Logger logger);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CANAPE/NodeFactories/ClientEndpointFactory.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 |
19 | namespace CANAPE.NodeFactories
20 | {
21 | ///
22 | /// Factory for client node
23 | ///
24 | public class ClientEndpointFactory : PipelineEndpointFactory
25 | {
26 | ///
27 | ///
28 | ///
29 | ///
30 | ///
31 | public ClientEndpointFactory(string label, Guid guid)
32 | : base(label, guid)
33 | {
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/CANAPE.Gui/Extension/IMainFormMenuExtension.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System.Windows.Forms;
18 | using CANAPE.Forms;
19 |
20 | namespace CANAPE.Extension
21 | {
22 | ///
23 | /// Interface for a main form menu extension
24 | ///
25 | public interface IMainFormMenuExtension
26 | {
27 | ///
28 | /// Execute the main for menu extension
29 | ///
30 | ///
31 | ///
32 | void Execute(MainForm mainForm, ToolStripMenuItem menu);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/unicode_escape.py:
--------------------------------------------------------------------------------
1 | """ Python 'unicode-escape' Codec
2 |
3 |
4 | Written by Marc-Andre Lemburg (mal@lemburg.com).
5 |
6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
7 |
8 | """
9 | import codecs
10 |
11 | ### Codec APIs
12 |
13 | class Codec(codecs.Codec):
14 |
15 | # Note: Binding these as C functions will result in the class not
16 | # converting them to methods. This is intended.
17 | encode = codecs.unicode_escape_encode
18 | decode = codecs.unicode_escape_decode
19 |
20 | class IncrementalEncoder(codecs.IncrementalEncoder):
21 | def encode(self, input, final=False):
22 | return codecs.unicode_escape_encode(input, self.errors)[0]
23 |
24 | class IncrementalDecoder(codecs.IncrementalDecoder):
25 | def decode(self, input, final=False):
26 | return codecs.unicode_escape_decode(input, self.errors)[0]
27 |
28 | class StreamWriter(Codec,codecs.StreamWriter):
29 | pass
30 |
31 | class StreamReader(Codec,codecs.StreamReader):
32 | pass
33 |
34 | ### encodings module API
35 |
36 | def getregentry():
37 | return codecs.CodecInfo(
38 | name='unicode-escape',
39 | encode=Codec.encode,
40 | decode=Codec.decode,
41 | incrementalencoder=IncrementalEncoder,
42 | incrementaldecoder=IncrementalDecoder,
43 | streamwriter=StreamWriter,
44 | streamreader=StreamReader,
45 | )
46 |
--------------------------------------------------------------------------------
/CANAPE.Controls/Forms/ObjectEditorForm.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using System.Collections.Generic;
19 | using System.ComponentModel;
20 | using System.Data;
21 | using System.Drawing;
22 | using System.Linq;
23 | using System.Text;
24 | using System.Windows.Forms;
25 | using CANAPE.Controls;
26 |
27 | namespace CANAPE.Forms
28 | {
29 | public partial class ObjectEditorForm : Form
30 | {
31 | public ObjectEditorForm(object editObject)
32 | {
33 | InitializeComponent();
34 | propertyGrid.SelectedObject = editObject;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/CANAPE/NodeFactories/ServerEndpointFactory.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | using System;
19 | namespace CANAPE.NodeFactories
20 | {
21 | ///
22 | /// Node factory for a server endpoint
23 | ///
24 | public class ServerEndpointFactory : PipelineEndpointFactory
25 | {
26 | ///
27 | ///
28 | ///
29 | ///
30 | ///
31 | public ServerEndpointFactory(string label, Guid guid)
32 | : base(label, guid)
33 | {
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/unicode_internal.py:
--------------------------------------------------------------------------------
1 | """ Python 'unicode-internal' Codec
2 |
3 |
4 | Written by Marc-Andre Lemburg (mal@lemburg.com).
5 |
6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
7 |
8 | """
9 | import codecs
10 |
11 | ### Codec APIs
12 |
13 | class Codec(codecs.Codec):
14 |
15 | # Note: Binding these as C functions will result in the class not
16 | # converting them to methods. This is intended.
17 | encode = codecs.unicode_internal_encode
18 | decode = codecs.unicode_internal_decode
19 |
20 | class IncrementalEncoder(codecs.IncrementalEncoder):
21 | def encode(self, input, final=False):
22 | return codecs.unicode_internal_encode(input, self.errors)[0]
23 |
24 | class IncrementalDecoder(codecs.IncrementalDecoder):
25 | def decode(self, input, final=False):
26 | return codecs.unicode_internal_decode(input, self.errors)[0]
27 |
28 | class StreamWriter(Codec,codecs.StreamWriter):
29 | pass
30 |
31 | class StreamReader(Codec,codecs.StreamReader):
32 | pass
33 |
34 | ### encodings module API
35 |
36 | def getregentry():
37 | return codecs.CodecInfo(
38 | name='unicode-internal',
39 | encode=Codec.encode,
40 | decode=Codec.decode,
41 | incrementalencoder=IncrementalEncoder,
42 | incrementaldecoder=IncrementalDecoder,
43 | streamwriter=StreamWriter,
44 | streamreader=StreamReader,
45 | )
46 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Templates/python/xorlayer.py:
--------------------------------------------------------------------------------
1 | # This pulls in the canape library namespaces
2 | import CANAPE.Nodes
3 | import CANAPE.DataFrames
4 | import CANAPE.Net.Layers;
5 |
6 | def XorFrame(frame, xorValue):
7 | data = frame.ToArray()
8 | for i in range(len(data)):
9 | data[i] = data[i] ^ xorValue
10 |
11 | return CANAPE.DataFrames.DataFrame(data)
12 |
13 | # Simple example script to implement a layer which xor's bytes with a known value
14 | class XorNetworkLayer(CANAPE.Net.Layers.DynamicNetworkLayer):
15 |
16 | # This function is a generator, yield each frame you want
17 | def ReadClientFrames(self, client):
18 | self.Logger.LogInfo("Starting to read client frames")
19 | frame = client.Read()
20 | while frame is not None:
21 | yield XorFrame(frame, 42)
22 | frame = client.Read()
23 |
24 | # This function is a generator, yield each frame you want
25 | def ReadServerFrames(self, server):
26 | self.Logger.LogInfo("Starting to read server frames")
27 | frame = server.Read()
28 | while frame is not None:
29 | yield XorFrame(frame, 88)
30 | frame = server.Read()
31 |
32 | def WriteClientFrame(self, client, frame):
33 | client.Write(XorFrame(frame, 88))
34 |
35 | def WriteServerFrame(self, server, frame):
36 | server.Write(XorFrame(frame, 42))
--------------------------------------------------------------------------------
/CANAPE/Nodes/SwitchNodeSelectionMode.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
18 | namespace CANAPE.Nodes
19 | {
20 | ///
21 | /// Enumeration to determine the way a switch node selects paths
22 | ///
23 | public enum SwitchNodeSelectionMode
24 | {
25 | ///
26 | /// Matches exact names
27 | ///
28 | ExactMatch,
29 | ///
30 | /// Matches using a glob
31 | ///
32 | GlobMatch,
33 | ///
34 | /// Matches on a regex
35 | ///
36 | RegexMatch,
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/email/mime/application.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2001-2006 Python Software Foundation
2 | # Author: Keith Dart
3 | # Contact: email-sig@python.org
4 |
5 | """Class representing application/* type MIME documents."""
6 |
7 | __all__ = ["MIMEApplication"]
8 |
9 | from email import encoders
10 | from email.mime.nonmultipart import MIMENonMultipart
11 |
12 |
13 | class MIMEApplication(MIMENonMultipart):
14 | """Class for generating application/* MIME documents."""
15 |
16 | def __init__(self, _data, _subtype='octet-stream',
17 | _encoder=encoders.encode_base64, **_params):
18 | """Create an application/* type MIME document.
19 |
20 | _data is a string containing the raw application data.
21 |
22 | _subtype is the MIME content type subtype, defaulting to
23 | 'octet-stream'.
24 |
25 | _encoder is a function which will perform the actual encoding for
26 | transport of the application data, defaulting to base64 encoding.
27 |
28 | Any additional keyword arguments are passed to the base class
29 | constructor, which turns them into parameters on the Content-Type
30 | header.
31 | """
32 | if _subtype is None:
33 | raise TypeError('Invalid application MIME subtype')
34 | MIMENonMultipart.__init__(self, 'application', _subtype, **_params)
35 | self.set_payload(_data)
36 | _encoder(self)
37 |
--------------------------------------------------------------------------------
/CANAPE.Parser/DataValueContainer.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 |
19 | namespace CANAPE.Parser
20 | {
21 | ///
22 | /// A class to container a data value and assign a specific class
23 | /// type to it
24 | ///
25 | [Serializable]
26 | public class DataValueContainer where T : class
27 | {
28 | ///
29 | /// The value of the data
30 | ///
31 | public T Value { get; set; }
32 |
33 | ///
34 | /// The class of the data
35 | ///
36 | public Guid Class { get; set; }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/mbcs.py:
--------------------------------------------------------------------------------
1 | """ Python 'mbcs' Codec for Windows
2 |
3 |
4 | Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
5 | which was written by Marc-Andre Lemburg (mal@lemburg.com).
6 |
7 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
8 |
9 | """
10 | # Import them explicitly to cause an ImportError
11 | # on non-Windows systems
12 | from codecs import mbcs_encode, mbcs_decode
13 | # for IncrementalDecoder, IncrementalEncoder, ...
14 | import codecs
15 |
16 | ### Codec APIs
17 |
18 | encode = mbcs_encode
19 |
20 | def decode(input, errors='strict'):
21 | return mbcs_decode(input, errors, True)
22 |
23 | class IncrementalEncoder(codecs.IncrementalEncoder):
24 | def encode(self, input, final=False):
25 | return mbcs_encode(input, self.errors)[0]
26 |
27 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
28 | _buffer_decode = mbcs_decode
29 |
30 | class StreamWriter(codecs.StreamWriter):
31 | encode = mbcs_encode
32 |
33 | class StreamReader(codecs.StreamReader):
34 | decode = mbcs_decode
35 |
36 | ### encodings module API
37 |
38 | def getregentry():
39 | return codecs.CodecInfo(
40 | name='mbcs',
41 | encode=encode,
42 | decode=decode,
43 | incrementalencoder=IncrementalEncoder,
44 | incrementaldecoder=IncrementalDecoder,
45 | streamreader=StreamReader,
46 | streamwriter=StreamWriter,
47 | )
48 |
--------------------------------------------------------------------------------
/CANAPE.Scripting/Lib/encodings/raw_unicode_escape.py:
--------------------------------------------------------------------------------
1 | """ Python 'raw-unicode-escape' Codec
2 |
3 |
4 | Written by Marc-Andre Lemburg (mal@lemburg.com).
5 |
6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
7 |
8 | """
9 | import codecs
10 |
11 | ### Codec APIs
12 |
13 | class Codec(codecs.Codec):
14 |
15 | # Note: Binding these as C functions will result in the class not
16 | # converting them to methods. This is intended.
17 | encode = codecs.raw_unicode_escape_encode
18 | decode = codecs.raw_unicode_escape_decode
19 |
20 | class IncrementalEncoder(codecs.IncrementalEncoder):
21 | def encode(self, input, final=False):
22 | return codecs.raw_unicode_escape_encode(input, self.errors)[0]
23 |
24 | class IncrementalDecoder(codecs.IncrementalDecoder):
25 | def decode(self, input, final=False):
26 | return codecs.raw_unicode_escape_decode(input, self.errors)[0]
27 |
28 | class StreamWriter(Codec,codecs.StreamWriter):
29 | pass
30 |
31 | class StreamReader(Codec,codecs.StreamReader):
32 | pass
33 |
34 | ### encodings module API
35 |
36 | def getregentry():
37 | return codecs.CodecInfo(
38 | name='raw-unicode-escape',
39 | encode=Codec.encode,
40 | decode=Codec.decode,
41 | incrementalencoder=IncrementalEncoder,
42 | incrementaldecoder=IncrementalDecoder,
43 | streamwriter=StreamWriter,
44 | streamreader=StreamReader,
45 | )
46 |
--------------------------------------------------------------------------------
/CANAPE.Documents/Net/Factories/IProxyListenerFactory.cs:
--------------------------------------------------------------------------------
1 | // CANAPE Network Testing Tool
2 | // Copyright (C) 2014 Context Information Security
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | using System;
18 | using CANAPE.Net.Listeners;
19 | using CANAPE.Utils;
20 |
21 | namespace CANAPE.Documents.Net.Factories
22 | {
23 | ///
24 | /// Factory for creating a listener
25 | ///
26 | public interface IProxyListenerFactory : ICloneable
27 | {
28 | ///
29 | /// Create the network listener
30 | ///
31 | /// The logger
32 | /// The new network listener
33 | INetworkListener Create(Logger logger);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------