├── .ObfuscationTests
├── CrackMe-astro.exe
└── CrackMe.exe
├── AfterKoi
├── AfterKoi.csproj
├── LocalToField.cs
├── Properties
│ └── AssemblyInfo.cs
├── RandomGenerator.cs
└── obj
│ └── Debug
│ ├── .NETFramework,Version=v4.7.2.AssemblyAttributes.cs
│ ├── AfterKoi.csproj.AssemblyReference.cache
│ ├── DesignTimeResolveAssemblyReferences.cache
│ └── DesignTimeResolveAssemblyReferencesInput.cache
├── Assets
├── astro.ico
├── astro.png
└── banner.png
├── AstroNet.sln
├── AstroNet
├── App.config
├── AstroNet.csproj
├── AstroNet.csproj.user
├── KVM
│ ├── InitializePhase.cs
│ ├── KVMTask.cs
│ ├── ModuleWriterListener.cs
│ ├── ModuleWriterListenerEventArgs.cs
│ ├── NativeEraser.cs
│ ├── NativeEraserNew.cs
│ ├── SafeAnalyzer.cs
│ └── Utils.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── Protections
│ ├── Anti
│ │ ├── Anti Debug.cs
│ │ ├── Anti Dump.cs
│ │ ├── Anti Tamper.cs
│ │ ├── AntiDe4dot.cs
│ │ ├── Antimanything.cs
│ │ └── Runtime
│ │ │ ├── AntiDebug.Safe.cs
│ │ │ ├── AntiDumpRun.cs
│ │ │ ├── EOFAntiTamper.cs
│ │ │ └── SelfDeleteClass.cs
│ ├── Arithmetic
│ │ ├── AddMaths.cs
│ │ ├── Arithmetic.cs
│ │ ├── ArithmeticEmulator.cs
│ │ ├── ArithmeticTypes.cs
│ │ ├── ArithmeticVT.cs
│ │ ├── Functions
│ │ │ ├── Add.cs
│ │ │ ├── Div.cs
│ │ │ ├── Maths
│ │ │ │ ├── Abs.cs
│ │ │ │ ├── Ceiling.cs
│ │ │ │ ├── Cos.cs
│ │ │ │ ├── Floor.cs
│ │ │ │ ├── Log.cs
│ │ │ │ ├── Log10.cs
│ │ │ │ ├── Round.cs
│ │ │ │ ├── Sin.cs
│ │ │ │ ├── Sqrt.cs
│ │ │ │ ├── Tan.cs
│ │ │ │ ├── Tanh.cs
│ │ │ │ └── Truncate.cs
│ │ │ ├── Mul.cs
│ │ │ ├── Sub.cs
│ │ │ └── Xor.cs
│ │ ├── Generator
│ │ │ └── Generator.cs
│ │ ├── Token.cs
│ │ ├── Utils
│ │ │ └── ArithmeticUtils.cs
│ │ ├── Value.cs
│ │ └── iFunction.cs
│ ├── Attribute.cs
│ ├── Base64.cs
│ ├── ConstantMelting.cs
│ ├── CtrlFlow.cs
│ ├── LocalToField.cs
│ ├── Other
│ │ ├── Calli.cs
│ │ ├── StackUnfConfusion.cs
│ │ └── Watermark.cs
│ ├── ProxyINT.cs
│ ├── ProxyMeth.cs
│ ├── ProxyString.cs
│ ├── RemoveNamespace.cs
│ ├── Rename.cs
│ ├── StringEnc.cs
│ └── Virtualization.cs
├── Services
│ ├── ConsoleLogger.cs
│ ├── InitMemory.cs
│ ├── InjectHelper.cs
│ ├── RandomGenerator.cs
│ └── WriterMemory.cs
├── astro.ico
├── bin
│ ├── Debug
│ │ ├── Astro_Renewed.exe
│ │ ├── Astro_Renewed.exe.config
│ │ ├── Astro_Renewed.pdb
│ │ ├── KoiVM.Console.dll
│ │ ├── KoiVM.Console.pdb
│ │ ├── KoiVM.dll
│ │ ├── KoiVM.pdb
│ │ ├── dnlib.dll
│ │ ├── dnlib.xml
│ │ └── dnlibOld.dll
│ └── Release
│ │ ├── Astro_Renewed.exe
│ │ ├── Astro_Renewed.exe.config
│ │ ├── Astro_Renewed.pdb
│ │ ├── AutoMapper.dll
│ │ ├── AutoMapper.xml
│ │ └── dnlib.dll
└── obj
│ ├── Debug
│ ├── .NETFramework,Version=v4.7.2.AssemblyAttributes.cs
│ ├── AstroNet.csproj.AssemblyReference.cache
│ ├── AstroNet.csproj.CopyComplete
│ ├── AstroNet.csproj.CoreCompileInputs.cache
│ ├── AstroNet.csproj.FileListAbsolute.txt
│ ├── Astro_Renewed.csproj.AssemblyReference.cache
│ ├── Astro_Renewed.csproj.CopyComplete
│ ├── Astro_Renewed.csproj.CoreCompileInputs.cache
│ ├── Astro_Renewed.csproj.FileListAbsolute.txt
│ ├── Astro_Renewed.exe
│ ├── Astro_Renewed.pdb
│ ├── DesignTimeResolveAssemblyReferences.cache
│ └── DesignTimeResolveAssemblyReferencesInput.cache
│ └── Release
│ ├── .NETFramework,Version=v4.7.2.AssemblyAttributes.cs
│ ├── AstroNet.csproj.CopyComplete
│ ├── AstroNet.csproj.CoreCompileInputs.cache
│ ├── AstroNet.csproj.FileListAbsolute.txt
│ ├── Astro_Renewed.exe
│ ├── Astro_Renewed.pdb
│ └── DesignTimeResolveAssemblyReferencesInput.cache
├── Bin
├── #README.txt
├── AstroNet.exe
├── AstroNet.exe.config
├── AstroNet.pdb
├── Astro_Renewed.exe
├── Astro_Renewed.exe.config
├── Astro_Renewed.pdb
├── KoiVM.dll
├── KoiVM.pdb
├── R.dll
├── Runtime.dll
├── Runtime.pdb
└── dnlibOld.dll
├── KoiVM.Console
├── KVM
│ ├── InitializePhase.cs
│ ├── KVMTask.cs
│ ├── ModuleWriterListener.cs
│ ├── ModuleWriterListenerEventArgs.cs
│ ├── NativeEraser.cs
│ ├── NativeEraserNew.cs
│ ├── SafeAnalyzer.cs
│ └── Utils.cs
├── KoiVM.Console.csproj
├── Properties
│ └── AssemblyInfo.cs
└── obj
│ └── Debug
│ ├── .NETFramework,Version=v4.0.AssemblyAttributes.cs
│ ├── .NETFramework,Version=v4.7.2.AssemblyAttributes.cs
│ ├── DesignTimeResolveAssemblyReferences.cache
│ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ ├── KoiVM.Console.csproj.AssemblyReference.cache
│ ├── KoiVM.Console.csproj.CopyComplete
│ ├── KoiVM.Console.csproj.CoreCompileInputs.cache
│ ├── KoiVM.Console.csproj.FileListAbsolute.txt
│ ├── KoiVM.Console.dll
│ └── KoiVM.Console.pdb
├── KoiVM.GUI
├── App.config
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── KoiVM.GUI.csproj
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── obj
│ └── Debug
│ │ ├── .NETFramework,Version=v4.7.2.AssemblyAttributes.cs
│ │ ├── AndyLarkinsProtector.csproj.AssemblyReference.cache
│ │ ├── AndyLarkinsProtector.csproj.CopyComplete
│ │ ├── AndyLarkinsProtector.csproj.CoreCompileInputs.cache
│ │ ├── AndyLarkinsProtector.csproj.FileListAbsolute.txt
│ │ ├── AndyLarkinsProtector.csproj.GenerateResource.cache
│ │ ├── AstroNet.Form1.resources
│ │ ├── AstroNet.Properties.Resources.resources
│ │ ├── AstroNet.csproj.AssemblyReference.cache
│ │ ├── AstroNet.csproj.CopyComplete
│ │ ├── AstroNet.csproj.CoreCompileInputs.cache
│ │ ├── AstroNet.csproj.FileListAbsolute.txt
│ │ ├── AstroNet.csproj.GenerateResource.cache
│ │ ├── AstroNet.exe
│ │ ├── AstroNet.pdb
│ │ ├── DesignTimeResolveAssemblyReferences.cache
│ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ ├── KoiVM.GUI.csproj.AssemblyReference.cache
│ │ ├── KoiVM.GUI.csproj.CopyComplete
│ │ ├── KoiVM.GUI.csproj.CoreCompileInputs.cache
│ │ ├── KoiVM.GUI.csproj.FileListAbsolute.txt
│ │ ├── KoiVM.GUI.csproj.GenerateResource.cache
│ │ └── TempPE
│ │ └── Properties.Resources.Designer.cs.dll
└── solar-system.ico
├── KoiVM.Runtime
├── AstroNet.cs
├── Data
│ ├── OpCodeMap.cs
│ ├── VCallMap.cs
│ ├── VMData.cs
│ ├── VMDataInitializer.cs
│ ├── VMExportInfo.cs
│ └── VMFuncSig.cs
├── Dynamic
│ └── Constants.cs
├── Execution
│ ├── EHFrame.cs
│ ├── EHState.cs
│ ├── ExecutionState.cs
│ ├── FieldRef.cs
│ ├── IReference.cs
│ ├── Internal
│ │ ├── ArrayStoreHelpers.cs
│ │ ├── DirectCall.cs
│ │ ├── EHHelper.cs
│ │ ├── SizeOfHelper.cs
│ │ ├── TypedReferenceHelpers.cs
│ │ ├── Unverifier.cs
│ │ ├── VMTrampoline.cs
│ │ └── ValueTypeBox.cs
│ ├── PointerRef.cs
│ ├── PointerType.cs
│ ├── StackRef.cs
│ ├── TypedRef.cs
│ ├── TypedRefPtr.cs
│ ├── VMContext.cs
│ ├── VMDispatcher.cs
│ ├── VMSlot.cs
│ └── VMStack.cs
├── OpCodes
│ ├── Add.cs
│ ├── Call.cs
│ ├── Cmp.cs
│ ├── Div.cs
│ ├── FConv.cs
│ ├── IConv.cs
│ ├── IOpCode.cs
│ ├── Jmp.cs
│ ├── Leave.cs
│ ├── Lind.cs
│ ├── Mul.cs
│ ├── Nop.cs
│ ├── Nor.cs
│ ├── Pop.cs
│ ├── Push.cs
│ ├── Rem.cs
│ ├── Ret.cs
│ ├── Shl.cs
│ ├── Shr.cs
│ ├── Sind.cs
│ ├── Sub.cs
│ ├── Sx.cs
│ ├── Try.cs
│ └── Vcall.cs
├── Platform.cs
├── Properties
│ └── AssemblyInfo.cs
├── Runtime.csproj
├── Utils.cs
├── VCalls
│ ├── Box.cs
│ ├── Cast.cs
│ ├── Ckfinite.cs
│ ├── Ckoverflow.cs
│ ├── Ecall.cs
│ ├── Exit.cs
│ ├── IVCall.cs
│ ├── Initobj.cs
│ ├── Ldfld.cs
│ ├── Ldftn.cs
│ ├── Localloc.cs
│ ├── Rangechk.cs
│ ├── Sizeof.cs
│ ├── Stfld.cs
│ ├── Throw.cs
│ ├── Token.cs
│ └── Unbox.cs
├── VMInstance.cs
└── obj
│ └── Debug
│ ├── .NETFramework,Version=v4.6.1.AssemblyAttributes.cs
│ ├── DesignTimeResolveAssemblyReferences.cache
│ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ ├── KoiVM.Runtime.csproj.CoreCompileInputs.cache
│ ├── KoiVM.Runtime.csproj.FileListAbsolute.txt
│ ├── KoiVM.Runtime.csprojAssemblyReference.cache
│ ├── Runtime.csproj.AssemblyReference.cache
│ ├── Runtime.csproj.CoreCompileInputs.cache
│ ├── Runtime.csproj.FileListAbsolute.txt
│ ├── Runtime.csprojAssemblyReference.cache
│ ├── Runtime.dll
│ └── Runtime.pdb
├── KoiVM
├── AST
│ ├── ASTConstant.cs
│ ├── ASTExpression.cs
│ ├── ASTNode.cs
│ ├── ASTType.cs
│ ├── ASTVariable.cs
│ ├── IL
│ │ ├── IHasOffset.cs
│ │ ├── IILOperand.cs
│ │ ├── ILBlock.cs
│ │ ├── ILDataTarget.cs
│ │ ├── ILImmediate.cs
│ │ ├── ILInstrList.cs
│ │ ├── ILInstruction.cs
│ │ ├── ILJumpTable.cs
│ │ ├── ILJumpTarget.cs
│ │ ├── ILMethodTarget.cs
│ │ ├── ILRegister.cs
│ │ └── ILRelReference.cs
│ ├── ILAST
│ │ ├── IILASTNode.cs
│ │ ├── IILASTStatement.cs
│ │ ├── ILASTAssignment.cs
│ │ ├── ILASTExpression.cs
│ │ ├── ILASTPhi.cs
│ │ ├── ILASTTree.cs
│ │ ├── ILASTVariable.cs
│ │ └── ILASTVariableType.cs
│ ├── IR
│ │ ├── IIROperand.cs
│ │ ├── IRBlockTarget.cs
│ │ ├── IRConstant.cs
│ │ ├── IRDataTarget.cs
│ │ ├── IRInstrList.cs
│ │ ├── IRInstruction.cs
│ │ ├── IRJumpTable.cs
│ │ ├── IRMetaTarget.cs
│ │ ├── IRPointer.cs
│ │ ├── IRRegister.cs
│ │ ├── IRVariable.cs
│ │ └── IRVariableType.cs
│ ├── InstrAnnotation.cs
│ └── TypeInference.cs
├── CFG
│ ├── BasicBlock.cs
│ ├── BlockFlags.cs
│ ├── BlockParser.cs
│ ├── CILInstrList.cs
│ ├── IBasicBlock.cs
│ ├── ScopeBlock.cs
│ └── ScopeType.cs
├── GenericInstantiation.cs
├── ILAST
│ ├── ILASTBuilder.cs
│ ├── ILASTTransformer.cs
│ ├── ITransformationHandler.cs
│ └── Transformation
│ │ ├── ArrayTransform.cs
│ │ ├── BranchTransform.cs
│ │ ├── ILASTTypeInference.cs
│ │ ├── IndirectTransform.cs
│ │ ├── NullTransform.cs
│ │ ├── StringTransform.cs
│ │ └── VariableInlining.cs
├── IVMSettings.cs
├── KoiVM.csproj
├── MethodVirtualizer.cs
├── Obfuscation.cs
├── Properties
│ └── AssemblyInfo.cs
├── Protections
│ └── SMC
│ │ ├── SMCBlock.cs
│ │ ├── SMCILTransform.cs
│ │ └── SMCIRTransform.cs
├── RT
│ ├── BasicBlockChunk.cs
│ ├── BasicBlockSerializer.cs
│ ├── BinaryChunk.cs
│ ├── DbgWriter.cs
│ ├── HeaderChunk.cs
│ ├── IKoiChunk.cs
│ ├── JumpTableChunk.cs
│ ├── KoiHeap.cs
│ ├── Mutation
│ │ ├── MethodPatcher.cs
│ │ ├── RTConstants.cs
│ │ ├── RTMap.cs
│ │ ├── Renamer.cs
│ │ ├── RuntimeHelpers.cs
│ │ ├── RuntimeMutator.cs
│ │ └── RuntimePatcher.cs
│ └── VMRuntime.cs
├── Scanner.cs
├── Utils.cs
├── VM
│ ├── Descriptors
│ │ ├── ArchDescriptor.cs
│ │ ├── DataDescriptor.cs
│ │ ├── FlagDescriptor.cs
│ │ ├── OpCodeDescriptor.cs
│ │ ├── RTFlagDescriptor.cs
│ │ ├── RegisterDescriptor.cs
│ │ ├── RuntimeDescriptor.cs
│ │ ├── VCallOpsDescriptor.cs
│ │ ├── VMCallDescriptor.cs
│ │ └── VMDescriptor.cs
│ ├── FuncSig.cs
│ ├── VMCalls.cs
│ ├── VMFlags.cs
│ ├── VMMethodInfo.cs
│ └── VMRegisters.cs
├── VMIL
│ ├── ILOpCode.cs
│ ├── ILPostTransformer.cs
│ ├── ILTransformer.cs
│ ├── ILTranslator.cs
│ ├── IPostTransform.cs
│ ├── ITransform.cs
│ ├── ITranslationHandler.cs
│ ├── Transforms
│ │ ├── BlockKeyTransform.cs
│ │ ├── EntryExitTransform.cs
│ │ ├── FixMethodRefTransform.cs
│ │ ├── ReferenceOffsetTransform.cs
│ │ ├── SaveInfoTransform.cs
│ │ └── SaveRegistersTransform.cs
│ ├── Translation
│ │ ├── ArithmeticLogicHandler.cs
│ │ ├── BranchHandlers.cs
│ │ ├── EHHandlers.cs
│ │ ├── InvocationHandlers.cs
│ │ ├── MemoryHandlers.cs
│ │ ├── MiscHandlers.cs
│ │ └── PseudoHandlers.cs
│ └── TranslationHelpers.cs
├── VMIR
│ ├── Compiler
│ │ ├── IRAnalyzer.cs
│ │ ├── IRCompiler.cs
│ │ ├── IRCompilerAssemblyFinder.cs
│ │ ├── IRConstants.cs
│ │ ├── IRParser.cs
│ │ └── IRTokenizer.cs
│ ├── IRContext.cs
│ ├── IROpCode.cs
│ ├── IRTransformer.cs
│ ├── IRTranslator.cs
│ ├── ITransform.cs
│ ├── ITranslationHandler.cs
│ ├── RegAlloc
│ │ ├── BlockLiveness.cs
│ │ ├── LivenessAnalysis.cs
│ │ └── RegisterAllocator.cs
│ ├── Transforms
│ │ ├── ConstantTypePromotionTransform.cs
│ │ ├── EHTransform.cs
│ │ ├── GetSetFlagTransform.cs
│ │ ├── GuardBlockTransform.cs
│ │ ├── InitLocalTransform.cs
│ │ ├── InvokeTransform.cs
│ │ ├── LeaTransform.cs
│ │ ├── LogicTransform.cs
│ │ ├── MarkReturnRegTransform.cs
│ │ ├── MetadataTransform.cs
│ │ ├── RegisterAllocationTransform.cs
│ │ └── StackFrameTransform.cs
│ ├── Translation
│ │ ├── BoxHandlers.cs
│ │ ├── BranchHandlers.cs
│ │ ├── CastHandlers.cs
│ │ ├── CompareHandlers.cs
│ │ ├── ConstantHandlers.cs
│ │ ├── ConvHandlers.cs
│ │ ├── ConvOvfHandlers.cs
│ │ ├── ConvOvfUnHandlers.cs
│ │ ├── EHHandlers.cs
│ │ ├── FieldHandlers.cs
│ │ ├── FnPtrHandlers.cs
│ │ ├── InvokeHandlers.cs
│ │ ├── LocalHandlers.cs
│ │ ├── LogicHandlers.cs
│ │ ├── MiscHandlers.cs
│ │ ├── NumericHandlers.cs
│ │ ├── ParameterHandlers.cs
│ │ └── PointerHandlers.cs
│ └── TranslationHelpers.cs
├── Virtualizer.cs
├── VisitFunc.cs
├── Watermark.cs
└── obj
│ └── Debug
│ ├── .NETFramework,Version=v4.0.AssemblyAttributes.cs
│ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ ├── KoiVM.csproj.AssemblyReference.cache
│ ├── KoiVM.csproj.CopyComplete
│ ├── KoiVM.csproj.CoreCompileInputs.cache
│ ├── KoiVM.csproj.FileListAbsolute.txt
│ ├── KoiVM.dll
│ └── KoiVM.pdb
├── LICENSE
├── README.md
├── References
└── dnlibOld.dll
├── VM.Core
├── ByteEncryption
│ ├── ByteEncryption.cs
│ ├── ByteGetter.cs
│ └── Process.cs
├── Injection
│ ├── InjectHelper.cs
│ ├── InjectInitialise.cs
│ ├── InjectMethods.cs
│ └── Resource.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Protection
│ ├── ConvertToBytes.cs
│ ├── MethodData.cs
│ └── MethodProccesor.cs
├── Protector.cs
├── Resources
│ ├── ConversionBack.dll
│ ├── NativeEncoderx64.dll
│ ├── NativeEncoderx86.dll
│ └── XorMethod.bin
├── VM.Core.csproj
└── obj
│ ├── Debug
│ ├── .NETFramework,Version=v4.0.AssemblyAttributes.cs
│ ├── .NETFramework,Version=v4.7.2.AssemblyAttributes.cs
│ ├── Core.Properties.Resources.resources
│ ├── Core.csproj.AssemblyReference.cache
│ ├── Core.csproj.CopyComplete
│ ├── Core.csproj.CoreCompileInputs.cache
│ ├── Core.csproj.FileListAbsolute.txt
│ ├── Core.csproj.GenerateResource.cache
│ ├── Core.csprojAssemblyReference.cache
│ ├── Core.csprojResolveAssemblyReference.cache
│ ├── Core.dll
│ ├── Core.pdb
│ ├── CoreCompileInputs.cache
│ ├── DesignTimeResolveAssemblyReferences.cache
│ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ ├── TempPE
│ │ └── Properties.Resources.Designer.cs.dll
│ ├── VM.Core.csproj.AssemblyReference.cache
│ ├── VM.Core.csproj.CopyComplete
│ ├── VM.Core.csproj.CoreCompileInputs.cache
│ ├── VM.Core.csproj.FileListAbsolute.txt
│ └── VM.Core.csproj.GenerateResource.cache
│ └── Release
│ ├── CoreCompileInputs.cache
│ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ └── TempPE
│ └── Properties.Resources.Designer.cs.dll
├── VM.Runtime
├── ConvertBack.cs
├── Embed.cs
├── ExceptionHandlers
│ ├── ExceptionHandlerClass.cs
│ └── FixedExceptionHandlerClass.cs
├── Initialize.cs
├── OpCodes
│ ├── Add.cs
│ ├── All.cs
│ ├── Base.cs
│ ├── Br.cs
│ ├── Brfalse.cs
│ ├── Brtrue.cs
│ ├── Call.cs
│ ├── Callvirt.cs
│ ├── Ceq.cs
│ ├── Clt.cs
│ ├── ConvI4.cs
│ ├── ConvU1.cs
│ ├── Ldarg.cs
│ ├── Ldc.cs
│ ├── LdelemU1.cs
│ ├── Ldlen.cs
│ ├── Ldloc.cs
│ ├── Ldnull.cs
│ ├── Ldstr.cs
│ ├── NewArr.cs
│ ├── NewObj.cs
│ ├── Nop.cs
│ ├── Pop.cs
│ ├── Rem.cs
│ ├── StelemI1.cs
│ ├── Stloc.cs
│ ├── ValueStack.cs
│ └── Xor.cs
├── Properties
│ └── AssemblyInfo.cs
├── VM.Runtime.csproj
└── obj
│ ├── Debug
│ ├── .NETFramework,Version=v4.7.2.AssemblyAttributes.cs
│ ├── CoreCompileInputs.cache
│ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ ├── Runtime.csproj.CoreCompileInputs.cache
│ ├── Runtime.csproj.FileListAbsolute.txt
│ ├── Runtime.csprojResolveAssemblyReference.cache
│ ├── Runtime.dll
│ ├── Runtime.pdb
│ ├── VM.Runtime.csproj.CoreCompileInputs.cache
│ └── VM.Runtime.csproj.FileListAbsolute.txt
│ └── Release
│ ├── CoreCompileInputs.cache
│ └── DesignTimeResolveAssemblyReferencesInput.cache
└── dnlib
├── DotNet
├── AccessChecker.cs
├── AllTypesHelper.cs
├── AssemblyAttributes.cs
├── AssemblyDef.cs
├── AssemblyHash.cs
├── AssemblyHashAlgorithm.cs
├── AssemblyNameComparer.cs
├── AssemblyNameInfo.cs
├── AssemblyRef.cs
├── AssemblyResolver.cs
├── CallingConvention.cs
├── CallingConventionSig.cs
├── ClassLayout.cs
├── Constant.cs
├── CorLibTypes.cs
├── CustomAttribute.cs
├── CustomAttributeCollection.cs
├── CustomAttributeReader.cs
├── DeclSecurity.cs
├── DeclSecurityReader.cs
├── ElementType.cs
├── Emit
│ ├── Code.cs
│ ├── DynamicMethodBodyReader.cs
│ ├── ExceptionHandler.cs
│ ├── ExceptionHandlerType.cs
│ ├── Extensions.cs
│ ├── FlowControl.cs
│ ├── Instruction.cs
│ ├── InstructionPrinter.cs
│ ├── InvalidMethodException.cs
│ ├── LocalList.cs
│ ├── MethodBody.cs
│ ├── MethodBodyReader.cs
│ ├── MethodBodyReaderBase.cs
│ ├── MethodTableToTypeConverter.cs
│ ├── MethodUtils.cs
│ ├── OpCode.cs
│ ├── OpCodeType.cs
│ ├── OpCodes.cs
│ ├── OperandType.cs
│ └── StackBehaviour.cs
├── EventAttributes.cs
├── EventDef.cs
├── ExportedType.cs
├── Extensions.cs
├── FieldAttributes.cs
├── FieldDef.cs
├── FileAttributes.cs
├── FileDef.cs
├── FrameworkRedirect.cs
├── FullNameCreator.cs
├── GenericArguments.cs
├── GenericParam.cs
├── GenericParamAttributes.cs
├── GenericParamConstraint.cs
├── GenericParamContext.cs
├── IAssemblyResolver.cs
├── ICodedToken.cs
├── ICorLibTypes.cs
├── ICustomAttribute.cs
├── IDecrypters.cs
├── ILogger.cs
├── IResolver.cs
├── ITokenResolver.cs
├── IType.cs
├── ITypeDefFinder.cs
├── IVariable.cs
├── ImplMap.cs
├── Importer.cs
├── InterfaceImpl.cs
├── MD
│ ├── BlobStream.cs
│ ├── CodedToken.cs
│ ├── ColumnInfo.cs
│ ├── ColumnSize.cs
│ ├── ComImageFlags.cs
│ ├── CompressedMetaData.cs
│ ├── DotNetStream.cs
│ ├── DotNetTableSizes.cs
│ ├── ENCMetaData.cs
│ ├── GuidStream.cs
│ ├── HeapType.cs
│ ├── HotHeapStream.cs
│ ├── HotHeapVersion.cs
│ ├── HotStream.cs
│ ├── HotTableStream.cs
│ ├── IMetaData.cs
│ ├── IRowReaders.cs
│ ├── ImageCor20Header.cs
│ ├── MDHeaderRuntimeVersion.cs
│ ├── MDStreamFlags.cs
│ ├── MDTable.cs
│ ├── MetaData.cs
│ ├── MetaDataCreator.cs
│ ├── MetaDataHeader.cs
│ ├── RawRowEqualityComparer.cs
│ ├── RawTableRows.cs
│ ├── RidList.cs
│ ├── StorageFlags.cs
│ ├── StreamHeader.cs
│ ├── StringsStream.cs
│ ├── Table.cs
│ ├── TableInfo.cs
│ ├── TablesStream.cs
│ ├── TablesStream_Read.cs
│ └── USStream.cs
├── MDToken.cs
├── ManifestResource.cs
├── ManifestResourceAttributes.cs
├── MarshalBlobReader.cs
├── MarshalType.cs
├── MemberFinder.cs
├── MemberMDInitializer.cs
├── MemberRef.cs
├── MethodAttributes.cs
├── MethodDef.cs
├── MethodImplAttributes.cs
├── MethodOverride.cs
├── MethodSemanticsAttributes.cs
├── MethodSpec.cs
├── ModuleContext.cs
├── ModuleCreationOptions.cs
├── ModuleDef.cs
├── ModuleDefMD.cs
├── ModuleKind.cs
├── ModuleLoader.cs
├── ModuleRef.cs
├── NativeType.cs
├── NullResolver.cs
├── PInvokeAttributes.cs
├── ParamAttributes.cs
├── ParamDef.cs
├── ParameterList.cs
├── Pdb
│ ├── Dss
│ │ ├── ComInterfaces.cs
│ │ ├── ImageStreamIStream.cs
│ │ ├── MDEmitter.cs
│ │ ├── PinnedMetaData.cs
│ │ ├── StreamIStream.cs
│ │ ├── SymbolDocument.cs
│ │ ├── SymbolDocumentWriter.cs
│ │ ├── SymbolMethod.cs
│ │ ├── SymbolNamespace.cs
│ │ ├── SymbolReader.cs
│ │ ├── SymbolReaderCreator.cs
│ │ ├── SymbolScope.cs
│ │ ├── SymbolVariable.cs
│ │ ├── SymbolWriter.cs
│ │ └── SymbolWriterCreator.cs
│ ├── ISymbolWriter2.cs
│ ├── Managed
│ │ ├── DbiDocument.cs
│ │ ├── DbiFunction.cs
│ │ ├── DbiModule.cs
│ │ ├── DbiNamespace.cs
│ │ ├── DbiScope.cs
│ │ ├── DbiSourceLine.cs
│ │ ├── DbiVariable.cs
│ │ ├── ModuleStreamType.cs
│ │ ├── MsfStream.cs
│ │ ├── PdbAddress.cs
│ │ ├── PdbException.cs
│ │ ├── PdbReader.cs
│ │ ├── SymbolReaderCreator.cs
│ │ └── SymbolType.cs
│ ├── PdbDocument.cs
│ ├── PdbImplType.cs
│ ├── PdbScope.cs
│ ├── PdbState.cs
│ ├── PdbWriter.cs
│ ├── SequencePoint.cs
│ ├── SymbolReaderCreator.cs
│ └── SymbolWriterCreator.cs
├── PropertyAttributes.cs
├── PropertyDef.cs
├── PublicKey.cs
├── PublicKeyBase.cs
├── PublicKeyToken.cs
├── RecursionCounter.cs
├── ReflectionExtensions.cs
├── ResolveException.cs
├── Resolver.cs
├── Resource.cs
├── ResourceCollection.cs
├── Resources
│ ├── BuiltInResourceData.cs
│ ├── IResourceData.cs
│ ├── ResourceDataCreator.cs
│ ├── ResourceElement.cs
│ ├── ResourceElementSet.cs
│ ├── ResourceReader.cs
│ ├── ResourceTypeCode.cs
│ ├── ResourceWriter.cs
│ ├── UserResourceData.cs
│ └── UserResourceType.cs
├── SecurityAction.cs
├── SecurityAttribute.cs
├── SerializationType.cs
├── SigComparer.cs
├── SignatureReader.cs
├── StandAloneSig.cs
├── StrongNameKey.cs
├── StrongNameSigner.cs
├── TIAHelper.cs
├── TypeAttributes.cs
├── TypeDef.cs
├── TypeDefFinder.cs
├── TypeHelper.cs
├── TypeNameParser.cs
├── TypeRef.cs
├── TypeSig.cs
├── TypeSpec.cs
├── UTF8String.cs
├── Utils.cs
├── VTableFixups.cs
├── VariantType.cs
├── WinMDHelpers.cs
├── WinMDStatus.cs
└── Writer
│ ├── BinaryReaderChunk.cs
│ ├── BlobHeap.cs
│ ├── ByteArrayChunk.cs
│ ├── ChunkList.cs
│ ├── ChunkListBase.cs
│ ├── CustomAttributeWriter.cs
│ ├── DebugDirectory.cs
│ ├── DeclSecurityWriter.cs
│ ├── Extensions.cs
│ ├── GuidHeap.cs
│ ├── HeapBase.cs
│ ├── HotHeap.cs
│ ├── HotPool.cs
│ ├── HotTable.cs
│ ├── IChunk.cs
│ ├── IHeap.cs
│ ├── IMetaDataListener.cs
│ ├── IModuleWriterListener.cs
│ ├── IOffsetHeap.cs
│ ├── IWriterError.cs
│ ├── ImageCor20Header.cs
│ ├── ImportAddressTable.cs
│ ├── ImportDirectory.cs
│ ├── MDTable.cs
│ ├── MDTableWriter.cs
│ ├── MarshalBlobWriter.cs
│ ├── MaxStackCalculator.cs
│ ├── MetaData.cs
│ ├── MetaDataHeader.cs
│ ├── MethodBody.cs
│ ├── MethodBodyChunks.cs
│ ├── MethodBodyWriter.cs
│ ├── MethodBodyWriterBase.cs
│ ├── ModuleWriter.cs
│ ├── ModuleWriterBase.cs
│ ├── ModuleWriterException.cs
│ ├── NativeModuleWriter.cs
│ ├── NetResources.cs
│ ├── NormalMetaData.cs
│ ├── PEHeaders.cs
│ ├── PESection.cs
│ ├── PreserveTokensMetaData.cs
│ ├── RelocDirectory.cs
│ ├── SectionSizes.cs
│ ├── SignatureWriter.cs
│ ├── StartupStub.cs
│ ├── StringsHeap.cs
│ ├── StrongNameSignature.cs
│ ├── TablesHeap.cs
│ ├── USHeap.cs
│ ├── UniqueChunkList.cs
│ ├── Win32ResourcesChunk.cs
│ └── WriterUtils.cs
├── ExtensionAttribute.cs
├── HandleProcessCorruptedStateExceptionsAttribute.cs
├── IO
├── BinaryReaderStream.cs
├── FileOffset.cs
├── FileSection.cs
├── IBinaryReader.cs
├── IFileSection.cs
├── IImageStream.cs
├── IImageStreamCreator.cs
├── IOExtensions.cs
├── ImageStreamCreator.cs
├── MemoryImageStream.cs
├── MemoryMappedFileStreamCreator.cs
├── MemoryStreamCreator.cs
├── UnmanagedMemoryImageStream.cs
└── UnmanagedMemoryStreamCreator.cs
├── PE
├── Characteristics.cs
├── DllCharacteristics.cs
├── IImageOptionalHeader.cs
├── IPEImage.cs
├── IPEType.cs
├── ImageDataDirectory.cs
├── ImageDosHeader.cs
├── ImageFileHeader.cs
├── ImageNTHeaders.cs
├── ImageOptionalHeader32.cs
├── ImageOptionalHeader64.cs
├── ImageSectionHeader.cs
├── Machine.cs
├── PEExtensions.cs
├── PEImage.cs
├── PEInfo.cs
├── RVA.cs
└── Subsystem.cs
├── Properties
└── AssemblyInfo.cs
├── Settings.cs
├── Threading
├── Extensions.cs
├── ICancellationToken.cs
├── IThreadSafeList.cs
├── Lock.cs
├── ThreadSafeListCreator.cs
└── ThreadSafeListWrapper.cs
├── Utils
├── Extensions.cs
├── ILazyList.cs
├── LazyList.cs
├── MFunc.cs
├── SimpleLazyList.cs
└── UserValue.cs
├── W32Resources
├── ResourceData.cs
├── ResourceDirectory.cs
├── ResourceDirectoryEntry.cs
├── ResourceName.cs
└── Win32Resources.cs
├── dnlib.csproj
└── obj
├── Debug
├── DesignTimeResolveAssemblyReferencesInput.cache
├── dnlib.csproj.CoreCompileInputs.cache
├── dnlib.csproj.FileListAbsolute.txt
├── dnlib.csprojAssemblyReference.cache
├── dnlib.dll
└── dnlib.pdb
└── Debug_ThreadSafe
├── DesignTimeResolveAssemblyReferencesInput.cache
├── dnlib.csproj.CoreCompileInputs.cache
├── dnlib.csproj.FileListAbsolute.txt
├── dnlib.dll
└── dnlib.pdb
/.ObfuscationTests/CrackMe-astro.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/.ObfuscationTests/CrackMe-astro.exe
--------------------------------------------------------------------------------
/.ObfuscationTests/CrackMe.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/.ObfuscationTests/CrackMe.exe
--------------------------------------------------------------------------------
/AfterKoi/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
5 |
--------------------------------------------------------------------------------
/AfterKoi/obj/Debug/AfterKoi.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
1 | MBRSC
--------------------------------------------------------------------------------
/AfterKoi/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AfterKoi/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/AfterKoi/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AfterKoi/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/Assets/astro.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Assets/astro.ico
--------------------------------------------------------------------------------
/Assets/astro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Assets/astro.png
--------------------------------------------------------------------------------
/Assets/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Assets/banner.png
--------------------------------------------------------------------------------
/AstroNet/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AstroNet/AstroNet.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ProjectFiles
5 | publish\
6 |
7 |
8 |
9 |
10 |
11 | en-US
12 | false
13 |
14 |
--------------------------------------------------------------------------------
/AstroNet/KVM/ModuleWriterListener.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 | using dnlib.DotNet.Writer;
3 | using System;
4 |
5 | namespace KVM
6 | {
7 | public class ModuleWriterListener : IModuleWriterListener
8 | {
9 | void IModuleWriterListener.OnWriterEvent(ModuleWriterBase writer, ModuleWriterEvent evt)
10 | {
11 | //bool flag = evt == ModuleWriterEvent.PESectionsCreated;
12 | //if (flag)
13 | //{
14 | // // NativeEraserNew.Erase(writer as NativeModuleWriter, writer.Module as ModuleDefMD); // Don't use
15 | // NativeEraser.Erase(writer as NativeModuleWriter, writer.Module as ModuleDefMD);
16 | //}
17 | bool flag2 = this.OnWriterEvent != null;
18 | if (flag2)
19 | {
20 | this.OnWriterEvent(writer, new ModuleWriterListenerEventArgs(evt));
21 | }
22 | }
23 |
24 | public event EventHandler OnWriterEvent;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/AstroNet/KVM/ModuleWriterListenerEventArgs.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet.Writer;
2 | using System;
3 |
4 | namespace KVM
5 | {
6 | public class ModuleWriterListenerEventArgs : EventArgs
7 | {
8 | public ModuleWriterListenerEventArgs(ModuleWriterEvent evt)
9 | {
10 | this.WriterEvent = evt;
11 | }
12 |
13 | public ModuleWriterEvent WriterEvent { get; private set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/AstroNet/KVM/SafeAnalyzer.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace KoiVM
9 | {
10 | public class SafeAnalyzer
11 | {
12 | public static bool CanObfuscate(MethodDef item)
13 | {
14 | if (item.IsRuntimeSpecialName)
15 | return false;
16 | if (item.IsConstructor || item.IsStaticConstructor)
17 | return false;
18 | if (item.DeclaringType.IsForwarder)
19 | return false;
20 | if (!item.HasBody)
21 | return false;
22 | if (!item.Body.HasInstructions)
23 | return false;
24 | if (item.FullName.Contains(".My")) //VB.NET
25 | return false;
26 | if (item.DeclaringType.IsGlobalModuleType)
27 | return false;
28 | if (item.FullName.Contains(""))
29 | return false;
30 | return true;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/AstroNet/Protections/Anti/Anti Dump.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 | using dnlib.DotNet.Emit;
3 | using Astro_Renewed.Protections.Anti.Runtime;
4 | using Astro_Renewed.Services;
5 | using System.Linq;
6 |
7 | namespace Astro_Renewed.Protections.Anti
8 | {
9 | internal class AntiDump
10 | {
11 | public static void Execute(ModuleDef mod)
12 | {
13 | var typeModule = ModuleDefMD.Load(typeof(AntiDumpRun).Module);
14 | var cctor = mod.GlobalType.FindOrCreateStaticConstructor();
15 | var typeDef = typeModule.ResolveTypeDef(MDToken.ToRID(typeof(AntiDumpRun).MetadataToken));
16 | var members = Inject_Helper.InjectHelper.Inject(typeDef, mod.GlobalType, mod);
17 | var init = (MethodDef)members.Single(method => method.Name == "Initialize");
18 | cctor.Body.Instructions.Insert(0, Instruction.Create(OpCodes.Call, init));
19 | foreach (var md in mod.GlobalType.Methods)
20 | {
21 | if (md.Name != ".ctor") continue;
22 | mod.GlobalType.Remove(md);
23 | break;
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Anti/AntiDe4dot.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 |
3 | namespace Astro_Renewed.Protections.Anti
4 | {
5 | internal class AntiDe4dot
6 | {
7 | public static void Execute(AssemblyDef mod)
8 | {
9 | foreach (var module in mod.Modules)
10 | {
11 | var interfaceM = new InterfaceImplUser(module.GlobalType);
12 | for (var i = 0; i < 1; i++)
13 | {
14 | var typeDef1 = new TypeDefUser(string.Empty, $"Form{i}", module.CorLibTypes.GetTypeRef("System", "Attribute"));
15 | var interface1 = new InterfaceImplUser(typeDef1);
16 | module.Types.Add(typeDef1);
17 | typeDef1.Interfaces.Add(interface1);
18 | typeDef1.Interfaces.Add(interfaceM);
19 | }
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Anti/Runtime/EOFAntiTamper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Security.Cryptography;
4 |
5 | namespace Astro_Renewed.Protections.Anti.Runtime
6 | {
7 | internal class EofAntiTamper
8 | {
9 | private static void Initializer()
10 | {
11 | var assemblyLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
12 | var stream = new StreamReader(assemblyLocation).BaseStream;
13 | var reader = new BinaryReader(stream);
14 | var newSha256 = BitConverter.ToString(SHA256.Create().ComputeHash(reader.ReadBytes(File.ReadAllBytes(assemblyLocation).Length - 32)));
15 | stream.Seek(-32, SeekOrigin.End);
16 | var realSha256 = BitConverter.ToString(reader.ReadBytes(32));
17 | if (newSha256 != realSha256)
18 | throw new BadImageFormatException();
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/ArithmeticTypes.cs:
--------------------------------------------------------------------------------
1 | namespace Astro_Renewed.Protections.Arithmetic
2 | {
3 | public enum ArithmeticTypes
4 | {
5 | Add, // +
6 | Sub, // -
7 | Div, // /
8 | Mul, // *
9 | Xor, // ^
10 | Abs, // -1
11 | Log, //
12 | Log10,
13 | Sin,
14 | Cos,
15 | Round,
16 | Sqrt,
17 | Ceiling,
18 | Floor,
19 | Tan,
20 | Tanh,
21 | Truncate
22 | }
23 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/ArithmeticVT.cs:
--------------------------------------------------------------------------------
1 | namespace Astro_Renewed.Protections.Arithmetic
2 | {
3 | public class ArithmeticVt
4 | {
5 | private readonly Value _value;
6 | private readonly Token _token;
7 | private readonly ArithmeticTypes _arithmeticTypes;
8 |
9 | public ArithmeticVt(Value value, Token token, ArithmeticTypes arithmeticTypes)
10 | {
11 | _value = value;
12 | _token = token;
13 | _arithmeticTypes = arithmeticTypes;
14 | }
15 |
16 | public Value GetValue() => _value;
17 |
18 | public Token GetToken() => _token;
19 |
20 | public ArithmeticTypes GetArithmetic() => _arithmeticTypes;
21 | }
22 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Add.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 |
5 | namespace Astro_Renewed.Protections.Arithmetic.Functions
6 | {
7 | public class Add : Function
8 | {
9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Add;
10 |
11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
12 | {
13 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
14 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
15 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Add), ArithmeticTypes);
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Div.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 |
5 | namespace Astro_Renewed.Protections.Arithmetic.Functions
6 | {
7 | public class Div : Function
8 | {
9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Div;
10 |
11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
12 | {
13 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
14 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
15 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Div), ArithmeticTypes);
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Maths/Abs.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using System.Collections.Generic;
5 |
6 | namespace Astro_Renewed.Protections.Arithmetic.Functions.Maths
7 | {
8 | public class Abs : Function
9 | {
10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Abs;
11 |
12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
13 | {
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub };
16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Maths/Cos.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using System.Collections.Generic;
5 |
6 | namespace Astro_Renewed.Protections.Arithmetic.Functions.Maths
7 | {
8 | public class Cos : Function
9 | {
10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Cos;
11 |
12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
13 | {
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub };
16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Maths/Floor.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using System.Collections.Generic;
5 |
6 | namespace Astro_Renewed.Protections.Arithmetic.Functions.Maths
7 | {
8 | public class Floor : Function
9 | {
10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Floor;
11 |
12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
13 | {
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub };
16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Maths/Log.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using System.Collections.Generic;
5 |
6 | namespace Astro_Renewed.Protections.Arithmetic.Functions.Maths
7 | {
8 | public class Log : Function
9 | {
10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Log;
11 |
12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
13 | {
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub };
16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Maths/Log10.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using System.Collections.Generic;
5 |
6 | namespace Astro_Renewed.Protections.Arithmetic.Functions.Maths
7 | {
8 | public class Log10 : Function
9 | {
10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Log10;
11 |
12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
13 | {
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub };
16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Maths/Sin.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using System.Collections.Generic;
5 |
6 | namespace Astro_Renewed.Protections.Arithmetic.Functions.Maths
7 | {
8 | public class Sin : Function
9 | {
10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Sin;
11 |
12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
13 | {
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub };
16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Maths/Sqrt.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using System.Collections.Generic;
5 |
6 | namespace Astro_Renewed.Protections.Arithmetic.Functions.Maths
7 | {
8 | public class Sqrt : Function
9 | {
10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Sqrt;
11 |
12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
13 | {
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub };
16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Maths/Tan.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using System.Collections.Generic;
5 |
6 | namespace Astro_Renewed.Protections.Arithmetic.Functions.Maths
7 | {
8 | public class Tan : Function
9 | {
10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Tan;
11 |
12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
13 | {
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub };
16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Maths/Tanh.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using System.Collections.Generic;
5 |
6 | namespace Astro_Renewed.Protections.Arithmetic.Functions.Maths
7 | {
8 | public class Tanh : Function
9 | {
10 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Tanh;
11 |
12 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
13 | {
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticTypes = new List { ArithmeticTypes.Add, ArithmeticTypes.Sub };
16 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
17 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(arithmeticTypes), arithmeticEmulator.GetY()), new Token(ArithmeticUtils.GetOpCode(arithmeticEmulator.GetType), module.Import(ArithmeticUtils.GetMethod(ArithmeticTypes))), ArithmeticTypes);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Mul.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 |
5 | namespace Astro_Renewed.Protections.Arithmetic.Functions
6 | {
7 | public class Mul : Function
8 | {
9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Mul;
10 |
11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
12 | {
13 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
14 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
15 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Mul), ArithmeticTypes);
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Sub.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 |
5 | namespace Astro_Renewed.Protections.Arithmetic.Functions
6 | {
7 | public class Sub : Function
8 | {
9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Sub;
10 |
11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
12 | {
13 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
14 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), ArithmeticUtils.GetY(instruction.GetLdcI4Value()), ArithmeticTypes);
15 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Sub), ArithmeticTypes);
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Functions/Xor.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Protections.Arithmetic.Utils;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 |
5 | namespace Astro_Renewed.Protections.Arithmetic.Functions
6 | {
7 | public class Xor : Function
8 | {
9 | public virtual ArithmeticTypes ArithmeticTypes => ArithmeticTypes.Xor;
10 |
11 | public override ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module)
12 | {
13 | var generator = new Generator.Generator();
14 | if (!ArithmeticUtils.CheckArithmetic(instruction)) return null;
15 | var arithmeticEmulator = new ArithmeticEmulator(instruction.GetLdcI4Value(), generator.Next(), ArithmeticTypes);
16 | return new ArithmeticVt(new Value(arithmeticEmulator.GetValue(), arithmeticEmulator.GetY()), new Token(OpCodes.Xor), ArithmeticTypes);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Generator/Generator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Astro_Renewed.Protections.Arithmetic.Generator
4 | {
5 | public class Generator
6 | {
7 | private readonly Random _random;
8 |
9 | public Generator()
10 | {
11 | _random = new Random(Guid.NewGuid().GetHashCode());
12 | }
13 |
14 | public int Next()
15 | {
16 | return _random.Next(int.MaxValue);
17 | }
18 |
19 | public int Next(int value)
20 | {
21 | return _random.Next(value);
22 | }
23 |
24 | public int Next(int min, int max)
25 | {
26 | return _random.Next(min, max);
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Token.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet.Emit;
2 |
3 | namespace Astro_Renewed.Protections.Arithmetic
4 | {
5 | public class Token
6 | {
7 | private readonly OpCode _opCode;
8 | private readonly object _operand;
9 |
10 | public Token(OpCode opCode, object operand)
11 | {
12 | _opCode = opCode;
13 | _operand = operand;
14 | }
15 |
16 | public Token(OpCode opCode)
17 | {
18 | _opCode = opCode;
19 | _operand = null;
20 | }
21 |
22 | public OpCode GetOpCode() => _opCode;
23 |
24 | public object GetOperand() => _operand;
25 | }
26 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/Value.cs:
--------------------------------------------------------------------------------
1 | namespace Astro_Renewed.Protections.Arithmetic
2 | {
3 | public class Value
4 | {
5 | private readonly double _x;
6 | private readonly double _y;
7 |
8 | public Value(double x, double y)
9 | {
10 | _x = x;
11 | _y = y;
12 | }
13 |
14 | public double GetX() => _x;
15 |
16 | public double GetY() => _y;
17 | }
18 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/Arithmetic/iFunction.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 | using dnlib.DotNet.Emit;
3 |
4 | namespace Astro_Renewed.Protections.Arithmetic
5 | {
6 | public abstract class Function
7 | {
8 | public abstract ArithmeticVt Arithmetic(Instruction instruction, ModuleDef module);
9 | }
10 | }
--------------------------------------------------------------------------------
/AstroNet/Protections/RemoveNamespace.cs:
--------------------------------------------------------------------------------
1 | using Astro_Renewed.Services;
2 | using dnlib.DotNet;
3 |
4 | namespace Astro_Renewed.Protections
5 | {
6 | class RemoveNamespace
7 | {
8 | public static void Execute(ModuleDefMD module)
9 | {
10 | foreach (TypeDef type in module.Types)
11 | {
12 | type.Namespace = "";
13 | }
14 | Services.ConsoleLogger.Log("Processing \"Remove Namespace\" protection.");
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/AstroNet/Protections/Virtualization.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 | using System.Collections.Generic;
3 | using KVM;
4 |
5 | namespace Astro_Renewed.Protections
6 | {
7 | class Virtualization
8 | {
9 | public static void Execute(ModuleDefMD module, string outPath, List mList)
10 | {
11 | Services.ConsoleLogger.Log("Processing \"Virtualization\" protection.");
12 | new KVMTask().Exceute(module, outPath, "", null, mList);
13 | //Core.Protector.Protect(module);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/AstroNet/Services/InitMemory.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 |
3 | namespace Astro_Renewed.Services
4 | {
5 | class InitMemory
6 | {
7 | public static MethodDef Init;
8 | public static MethodDef Init2;
9 | public static MethodDef Init3;
10 | public static MethodDef Init4;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/AstroNet/Services/WriterMemory.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 |
3 | namespace Astro_Renewed.Services
4 | {
5 | class WriterMemory
6 | {
7 | public static ModuleDef Init;
8 | public static ModuleDef Init2;
9 | public static ModuleDef Init3;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/AstroNet/astro.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/astro.ico
--------------------------------------------------------------------------------
/AstroNet/bin/Debug/Astro_Renewed.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Debug/Astro_Renewed.exe
--------------------------------------------------------------------------------
/AstroNet/bin/Debug/Astro_Renewed.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AstroNet/bin/Debug/Astro_Renewed.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Debug/Astro_Renewed.pdb
--------------------------------------------------------------------------------
/AstroNet/bin/Debug/KoiVM.Console.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Debug/KoiVM.Console.dll
--------------------------------------------------------------------------------
/AstroNet/bin/Debug/KoiVM.Console.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Debug/KoiVM.Console.pdb
--------------------------------------------------------------------------------
/AstroNet/bin/Debug/KoiVM.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Debug/KoiVM.dll
--------------------------------------------------------------------------------
/AstroNet/bin/Debug/KoiVM.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Debug/KoiVM.pdb
--------------------------------------------------------------------------------
/AstroNet/bin/Debug/dnlib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Debug/dnlib.dll
--------------------------------------------------------------------------------
/AstroNet/bin/Debug/dnlibOld.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Debug/dnlibOld.dll
--------------------------------------------------------------------------------
/AstroNet/bin/Release/Astro_Renewed.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Release/Astro_Renewed.exe
--------------------------------------------------------------------------------
/AstroNet/bin/Release/Astro_Renewed.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AstroNet/bin/Release/Astro_Renewed.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Release/Astro_Renewed.pdb
--------------------------------------------------------------------------------
/AstroNet/bin/Release/AutoMapper.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Release/AutoMapper.dll
--------------------------------------------------------------------------------
/AstroNet/bin/Release/dnlib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/bin/Release/dnlib.dll
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
5 |
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/AstroNet.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Debug/AstroNet.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/AstroNet.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Debug/AstroNet.csproj.CopyComplete
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/AstroNet.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | e525ecc971016d6a49bde0b16f998c0cab37c14d
2 |
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/AstroNet.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Bin\Astro_Renewed.exe.config
2 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Bin\Astro_Renewed.exe
3 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Bin\Astro_Renewed.pdb
4 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\AstroNet\obj\Debug\AstroNet.csproj.AssemblyReference.cache
5 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\AstroNet\obj\Debug\AstroNet.csproj.CoreCompileInputs.cache
6 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\AstroNet\obj\Debug\AstroNet.csproj.CopyComplete
7 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\AstroNet\obj\Debug\Astro_Renewed.exe
8 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\AstroNet\obj\Debug\Astro_Renewed.pdb
9 |
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/Astro_Renewed.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Debug/Astro_Renewed.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/Astro_Renewed.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Debug/Astro_Renewed.csproj.CopyComplete
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/Astro_Renewed.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 88e89c8dbde2ffa7faee25544f4ac8f96b6d3d65
2 |
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/Astro_Renewed.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Debug/Astro_Renewed.exe
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/Astro_Renewed.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Debug/Astro_Renewed.pdb
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/AstroNet/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/AstroNet/obj/Release/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
5 |
--------------------------------------------------------------------------------
/AstroNet/obj/Release/AstroNet.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Release/AstroNet.csproj.CopyComplete
--------------------------------------------------------------------------------
/AstroNet/obj/Release/AstroNet.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 36fa6081a009e888dec145e9d050899a260c82c1
2 |
--------------------------------------------------------------------------------
/AstroNet/obj/Release/Astro_Renewed.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Release/Astro_Renewed.exe
--------------------------------------------------------------------------------
/AstroNet/obj/Release/Astro_Renewed.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Release/Astro_Renewed.pdb
--------------------------------------------------------------------------------
/AstroNet/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/AstroNet/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/Bin/#README.txt:
--------------------------------------------------------------------------------
1 | Made by LockT#2434
2 | github.com/lckt0
3 | - - - - - - - - - - -
4 | Main exe file: Astro_Renewed.exe
5 | - - - - - - - - - - -
6 | How can I use this?
7 | 1. Open Astro_Renewed.exe
8 | 2. Drag and drop your exe file to cmd window.
9 | 3. Press enter and wait for "Finished" text.
10 | 4. Done! Enjoy your program.
--------------------------------------------------------------------------------
/Bin/AstroNet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/AstroNet.exe
--------------------------------------------------------------------------------
/Bin/AstroNet.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Bin/AstroNet.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/AstroNet.pdb
--------------------------------------------------------------------------------
/Bin/Astro_Renewed.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/Astro_Renewed.exe
--------------------------------------------------------------------------------
/Bin/Astro_Renewed.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Bin/Astro_Renewed.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/Astro_Renewed.pdb
--------------------------------------------------------------------------------
/Bin/KoiVM.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/KoiVM.dll
--------------------------------------------------------------------------------
/Bin/KoiVM.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/KoiVM.pdb
--------------------------------------------------------------------------------
/Bin/R.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/R.dll
--------------------------------------------------------------------------------
/Bin/Runtime.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/Runtime.dll
--------------------------------------------------------------------------------
/Bin/Runtime.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/Runtime.pdb
--------------------------------------------------------------------------------
/Bin/dnlibOld.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/Bin/dnlibOld.dll
--------------------------------------------------------------------------------
/KoiVM.Console/KVM/ModuleWriterListener.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 | using dnlib.DotNet.Writer;
3 | using System;
4 |
5 | namespace KVM
6 | {
7 | public class ModuleWriterListener : IModuleWriterListener
8 | {
9 | void IModuleWriterListener.OnWriterEvent(ModuleWriterBase writer, ModuleWriterEvent evt)
10 | {
11 | //bool flag = evt == ModuleWriterEvent.PESectionsCreated;
12 | //if (flag)
13 | //{
14 | // // NativeEraserNew.Erase(writer as NativeModuleWriter, writer.Module as ModuleDefMD); // Don't use
15 | // NativeEraser.Erase(writer as NativeModuleWriter, writer.Module as ModuleDefMD);
16 | //}
17 | bool flag2 = this.OnWriterEvent != null;
18 | if (flag2)
19 | {
20 | this.OnWriterEvent(writer, new ModuleWriterListenerEventArgs(evt));
21 | }
22 | }
23 |
24 | public event EventHandler OnWriterEvent;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/KoiVM.Console/KVM/ModuleWriterListenerEventArgs.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet.Writer;
2 | using System;
3 |
4 | namespace KVM
5 | {
6 | public class ModuleWriterListenerEventArgs : EventArgs
7 | {
8 | public ModuleWriterListenerEventArgs(ModuleWriterEvent evt)
9 | {
10 | this.WriterEvent = evt;
11 | }
12 |
13 | public ModuleWriterEvent WriterEvent { get; private set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/KoiVM.Console/KVM/SafeAnalyzer.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace KoiVM
9 | {
10 | public class SafeAnalyzer
11 | {
12 | public static bool CanObfuscate(MethodDef item)
13 | {
14 | if (item.IsRuntimeSpecialName)
15 | return false;
16 | if (item.IsConstructor || item.IsStaticConstructor)
17 | return false;
18 | if (item.DeclaringType.IsForwarder)
19 | return false;
20 | if (!item.HasBody)
21 | return false;
22 | if (!item.Body.HasInstructions)
23 | return false;
24 | if (item.FullName.Contains(".My")) //VB.NET
25 | return false;
26 | if (item.DeclaringType.IsGlobalModuleType)
27 | return false;
28 | if (item.FullName.Contains(""))
29 | return false;
30 | return true;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/KoiVM.Console/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | [assembly: AssemblyTitle("KoiVM.Console")]
5 | [assembly: AssemblyDescription("KoiVM Console")]
6 |
--------------------------------------------------------------------------------
/KoiVM.Console/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
5 |
--------------------------------------------------------------------------------
/KoiVM.Console/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
5 |
--------------------------------------------------------------------------------
/KoiVM.Console/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Console/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/KoiVM.Console/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Console/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/KoiVM.Console/obj/Debug/KoiVM.Console.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Console/obj/Debug/KoiVM.Console.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/KoiVM.Console/obj/Debug/KoiVM.Console.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Console/obj/Debug/KoiVM.Console.csproj.CopyComplete
--------------------------------------------------------------------------------
/KoiVM.Console/obj/Debug/KoiVM.Console.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 328e3ff1189b5a3157b4c9f08ffccc6f84e1f5f6
2 |
--------------------------------------------------------------------------------
/KoiVM.Console/obj/Debug/KoiVM.Console.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Console/obj/Debug/KoiVM.Console.dll
--------------------------------------------------------------------------------
/KoiVM.Console/obj/Debug/KoiVM.Console.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Console/obj/Debug/KoiVM.Console.pdb
--------------------------------------------------------------------------------
/KoiVM.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/KoiVM.GUI/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace AstroNet
8 | {
9 | static class Program
10 | {
11 |
12 | [STAThread]
13 | static void Main()
14 | {
15 | Application.EnableVisualStyles();
16 | Application.SetCompatibleTextRenderingDefault(false);
17 | Application.Run(new Form1());
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/KoiVM.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
5 |
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AndyLarkinsProtector.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
1 | MBRSC
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AndyLarkinsProtector.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/AndyLarkinsProtector.csproj.CopyComplete
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AndyLarkinsProtector.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 5def72ded633e8034d4772b6da1883429ac4ee23
2 |
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AndyLarkinsProtector.csproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/AndyLarkinsProtector.csproj.GenerateResource.cache
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AstroNet.Form1.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/AstroNet.Form1.resources
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AstroNet.Properties.Resources.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/AstroNet.Properties.Resources.resources
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AstroNet.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
1 | MBRSC
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AstroNet.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/AstroNet.csproj.CopyComplete
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AstroNet.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | ed0671a60ae8d01d128902104403d54454197983
2 |
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AstroNet.csproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/AstroNet.csproj.GenerateResource.cache
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AstroNet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/AstroNet.exe
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/AstroNet.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/AstroNet.pdb
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/KoiVM.GUI.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/KoiVM.GUI.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/KoiVM.GUI.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/KoiVM.GUI.csproj.CopyComplete
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/KoiVM.GUI.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 2070477dafd6087da0c0c46e551a03845796a3c2
2 |
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/KoiVM.GUI.csproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/KoiVM.GUI.csproj.GenerateResource.cache
--------------------------------------------------------------------------------
/KoiVM.GUI/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll
--------------------------------------------------------------------------------
/KoiVM.GUI/solar-system.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.GUI/solar-system.ico
--------------------------------------------------------------------------------
/KoiVM.Runtime/Data/OpCodeMap.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Runtime.OpCodes;
4 |
5 | namespace Runtime.Data {
6 | internal static class OpCodeMap {
7 | static readonly Dictionary opCodes;
8 |
9 | static OpCodeMap() {
10 | opCodes = new Dictionary();
11 | foreach (var type in typeof(OpCodeMap).Assembly.GetTypes()) {
12 | if (typeof(IOpCode).IsAssignableFrom(type) && !type.IsAbstract) {
13 | var opCode = (IOpCode)Activator.CreateInstance(type);
14 | opCodes[opCode.Code] = opCode;
15 | }
16 | }
17 | }
18 |
19 | public static IOpCode Lookup(byte code) {
20 | return opCodes[code];
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Data/VCallMap.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Runtime.VCalls;
4 |
5 | namespace Runtime.Data {
6 | internal static class VCallMap {
7 | static readonly Dictionary vCalls;
8 |
9 | static VCallMap() {
10 | vCalls = new Dictionary();
11 | foreach (var type in typeof(VCallMap).Assembly.GetTypes()) {
12 | if (typeof(IVCall).IsAssignableFrom(type) && !type.IsAbstract) {
13 | var vCall = (IVCall)Activator.CreateInstance(type);
14 | vCalls[vCall.Code] = vCall;
15 | }
16 | }
17 | }
18 |
19 | public static IVCall Lookup(byte code) {
20 | return vCalls[code];
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Data/VMExportInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace Runtime.Data {
5 | internal struct VMExportInfo {
6 | public unsafe VMExportInfo(ref byte* ptr, Module module) {
7 | CodeOffset = *(uint*)ptr;
8 | ptr += 4;
9 | if (CodeOffset != 0) {
10 | EntryKey = *(uint*)ptr;
11 | ptr += 4;
12 | }
13 | else
14 | EntryKey = 0;
15 | Signature = new VMFuncSig(ref ptr, module);
16 | }
17 |
18 | public readonly uint CodeOffset;
19 | public readonly uint EntryKey;
20 | public readonly VMFuncSig Signature;
21 | }
22 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/EHFrame.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Runtime.Execution {
4 | internal struct EHFrame {
5 | public byte EHType;
6 | public ulong FilterAddr;
7 | public ulong HandlerAddr;
8 | public Type CatchType;
9 |
10 | public VMSlot BP;
11 | public VMSlot SP;
12 | }
13 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/EHState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Runtime.Execution {
4 | internal class EHState {
5 | public enum EHProcess {
6 | Searching, // Search for handler, filter are executed
7 | Unwinding // Unwind the stack, fault/finally are executed
8 | }
9 |
10 | public EHProcess CurrentProcess;
11 | public object ExceptionObj;
12 | public VMSlot OldBP;
13 | public VMSlot OldSP;
14 | public int? CurrentFrame;
15 | public int? HandlerFrame;
16 | }
17 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/ExecutionState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Runtime.Execution {
4 | internal enum ExecutionState {
5 | Next,
6 | Exit,
7 | Throw,
8 | Rethrow
9 | }
10 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/IReference.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Runtime.Execution {
4 | internal interface IReference {
5 | VMSlot GetValue(VMContext ctx, PointerType type);
6 | void SetValue(VMContext ctx, VMSlot slot, PointerType type);
7 | IReference Add(uint value);
8 | IReference Add(ulong value);
9 |
10 | void ToTypedReference(VMContext ctx, TypedRefPtr typedRef, Type type);
11 | }
12 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/Internal/SizeOfHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Reflection.Emit;
4 |
5 | namespace Runtime.Execution.Internal {
6 | internal class SizeOfHelper {
7 | static Hashtable sizes = new Hashtable();
8 |
9 | public static int SizeOf(Type type) {
10 | var size = sizes[type];
11 | if (size == null) {
12 | lock (sizes) {
13 | size = sizes[type];
14 | if (size == null) {
15 | size = GetSize(type);
16 | sizes[type] = size;
17 | }
18 | }
19 | }
20 | return (int)size;
21 | }
22 |
23 | static int GetSize(Type type) {
24 | var dm = new DynamicMethod("", typeof(int), Type.EmptyTypes, Unverifier.Module, true);
25 | var gen = dm.GetILGenerator();
26 |
27 | gen.Emit(System.Reflection.Emit.OpCodes.Sizeof, type);
28 | gen.Emit(System.Reflection.Emit.OpCodes.Ret);
29 |
30 | return (int)dm.Invoke(null, null);
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/Internal/Unverifier.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Reflection.Emit;
4 | using System.Security.Permissions;
5 |
6 | namespace Runtime.Execution.Internal {
7 | internal static class Unverifier {
8 | public static readonly Module Module;
9 |
10 | static Unverifier() {
11 | var asm = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("Fish"), AssemblyBuilderAccess.Run);
12 | var mod = asm.DefineDynamicModule("Fish");
13 | CustomAttributeBuilder att =
14 | new CustomAttributeBuilder(typeof(SecurityPermissionAttribute).GetConstructor(new[] { typeof(SecurityAction) }),
15 | new object[] { SecurityAction.Assert },
16 | new[] { typeof(SecurityPermissionAttribute).GetProperty("SkipVerification") },
17 | new object[] { true });
18 | mod.SetCustomAttribute(att);
19 | Module = mod.DefineType(" ").CreateType().Module;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/PointerRef.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Execution.Internal;
3 |
4 | namespace Runtime.Execution {
5 | internal unsafe class PointerRef : IReference {
6 | // Only for typed reference use
7 |
8 | void* ptr;
9 |
10 | public PointerRef(void* ptr) {
11 | this.ptr = ptr;
12 | }
13 |
14 | public VMSlot GetValue(VMContext ctx, PointerType type) {
15 | throw new NotSupportedException();
16 | }
17 |
18 | public void SetValue(VMContext ctx, VMSlot slot, PointerType type) {
19 | throw new NotSupportedException();
20 | }
21 |
22 | public IReference Add(uint value) {
23 | throw new NotSupportedException();
24 | }
25 |
26 | public IReference Add(ulong value) {
27 | throw new NotSupportedException();
28 | }
29 |
30 | public void ToTypedReference(VMContext ctx, TypedRefPtr typedRef, Type type) {
31 | TypedReferenceHelpers.MakeTypedRef(ptr, typedRef, type);
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/PointerType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Runtime.Execution {
4 | internal enum PointerType {
5 | BYTE,
6 | WORD,
7 | DWORD,
8 | QWORD,
9 | OBJECT
10 | }
11 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/TypedRefPtr.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Runtime.Execution {
4 | internal unsafe struct TypedRefPtr {
5 | public void* ptr;
6 |
7 | public static implicit operator TypedRefPtr(void* ptr) {
8 | return new TypedRefPtr { ptr = ptr };
9 | }
10 |
11 | public static implicit operator void*(TypedRefPtr ptr) {
12 | return ptr.ptr;
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Execution/VMContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Runtime.Dynamic;
4 |
5 | namespace Runtime.Execution {
6 | internal class VMContext {
7 | const int NumRegisters = 16;
8 |
9 | public readonly VMSlot[] Registers = new VMSlot[16];
10 | public readonly VMStack Stack = new VMStack();
11 | public readonly VMInstance Instance;
12 | public readonly List EHStack = new List();
13 | public readonly List EHStates = new List();
14 |
15 | public VMContext(VMInstance inst) {
16 | Instance = inst;
17 | }
18 |
19 | public unsafe byte ReadByte() {
20 | var key = Registers[Constants.REG_K1].U4;
21 | var ip = (byte*)Registers[Constants.REG_IP].U8++;
22 | byte b = (byte)(*ip ^ key);
23 | key = key * 7 + b;
24 | Registers[Constants.REG_K1].U4 = key;
25 | return b;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/OpCodes/Call.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.OpCodes {
6 | internal class Call : IOpCode {
7 | public byte Code {
8 | get { return Constants.OP_CALL; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var slot = ctx.Stack[sp];
14 | ctx.Stack[sp] = ctx.Registers[Constants.REG_IP];
15 | ctx.Registers[Constants.REG_IP].U8 = slot.U8;
16 | state = ExecutionState.Next;
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/OpCodes/IOpCode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Execution;
3 |
4 | namespace Runtime.OpCodes {
5 | internal interface IOpCode {
6 | byte Code { get; }
7 | void Run(VMContext ctx, out ExecutionState state);
8 | }
9 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/OpCodes/Leave.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.OpCodes {
6 | internal class Leave : IOpCode {
7 | public byte Code {
8 | get { return Constants.OP_LEAVE; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var handler = ctx.Stack[sp--].U8;
14 |
15 | var frameIndex = ctx.EHStack.Count - 1;
16 | var frame = ctx.EHStack[frameIndex];
17 |
18 | if (frame.HandlerAddr != handler)
19 | throw new InvalidProgramException();
20 | ctx.EHStack.RemoveAt(frameIndex);
21 |
22 | if (frame.EHType == Constants.EH_FINALLY) {
23 | ctx.Stack[++sp] = ctx.Registers[Constants.REG_IP];
24 | ctx.Registers[Constants.REG_K1].U1 = 0;
25 | ctx.Registers[Constants.REG_IP].U8 = frame.HandlerAddr;
26 | }
27 |
28 | ctx.Stack.SetTopPosition(sp);
29 | ctx.Registers[Constants.REG_SP].U4 = sp;
30 |
31 | state = ExecutionState.Next;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/OpCodes/Nop.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.OpCodes {
6 | internal class Nop : IOpCode {
7 | public byte Code {
8 | get { return Constants.OP_NOP; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | state = ExecutionState.Next;
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/OpCodes/Pop.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.OpCodes {
6 | internal class Pop : IOpCode {
7 | public byte Code {
8 | get { return Constants.OP_POP; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var slot = ctx.Stack[sp];
14 | ctx.Stack.SetTopPosition(--sp);
15 | ctx.Registers[Constants.REG_SP].U4 = sp;
16 |
17 | var regId = ctx.ReadByte();
18 | if ((regId == Constants.REG_SP || regId == Constants.REG_BP) && slot.O is StackRef)
19 | ctx.Registers[regId] = new VMSlot { U4 = ((StackRef)slot.O).StackPos };
20 | else
21 | ctx.Registers[regId] = slot;
22 | state = ExecutionState.Next;
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/OpCodes/Ret.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.OpCodes {
6 | internal class Ret : IOpCode {
7 | public byte Code {
8 | get { return Constants.OPX_RET; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var slot = ctx.Stack[sp];
14 | ctx.Stack.SetTopPosition(--sp);
15 | ctx.Registers[Constants.REG_SP].U4 = sp;
16 |
17 | ctx.Registers[Constants.REG_IP].U8 = slot.U8;
18 | state = ExecutionState.Next;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/OpCodes/Try.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.OpCodes {
6 | internal class Try : IOpCode {
7 | public byte Code {
8 | get { return Constants.OP_TRY; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var type = ctx.Stack[sp--].U1;
14 |
15 | var frame = new EHFrame();
16 | frame.EHType = type;
17 | if (type == Constants.EH_CATCH) {
18 | frame.CatchType = (Type)ctx.Instance.Data.LookupReference(ctx.Stack[sp--].U4);
19 | }
20 | else if (type == Constants.EH_FILTER) {
21 | frame.FilterAddr = ctx.Stack[sp--].U8;
22 | }
23 | frame.HandlerAddr = ctx.Stack[sp--].U8;
24 |
25 | ctx.Stack.SetTopPosition(sp);
26 | ctx.Registers[Constants.REG_SP].U4 = sp;
27 |
28 | frame.BP = ctx.Registers[Constants.REG_BP];
29 | frame.SP = ctx.Registers[Constants.REG_SP];
30 | ctx.EHStack.Add(frame);
31 |
32 | state = ExecutionState.Next;
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/OpCodes/Vcall.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Data;
3 | using Runtime.Dynamic;
4 | using Runtime.Execution;
5 |
6 | namespace Runtime.OpCodes {
7 | internal class Vcall : IOpCode {
8 | public byte Code {
9 | get { return Constants.OP_VCALL; }
10 | }
11 |
12 | public void Run(VMContext ctx, out ExecutionState state) {
13 | var sp = ctx.Registers[Constants.REG_SP].U4;
14 | var slot = ctx.Stack[sp];
15 | ctx.Stack.SetTopPosition(--sp);
16 | ctx.Registers[Constants.REG_SP].U4 = sp;
17 |
18 | var vCall = VCallMap.Lookup(slot.U1);
19 | vCall.Run(ctx, out state);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Platform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Runtime {
4 | internal static class Platform {
5 | public static readonly bool x64 = (IntPtr.Size == 8);
6 | public static readonly bool LittleEndian = BitConverter.IsLittleEndian;
7 | }
8 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | [assembly: AssemblyTitle("KoiVM Runtime")]
5 | [assembly: AssemblyDescription("KoiVM runtime library")]
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Box.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using Runtime.Dynamic;
4 | using Runtime.Execution;
5 |
6 | namespace Runtime.VCalls {
7 | internal class Box : IVCall {
8 | public byte Code {
9 | get { return Constants.VCALL_BOX; }
10 | }
11 |
12 | public void Run(VMContext ctx, out ExecutionState state) {
13 | var sp = ctx.Registers[Constants.REG_SP].U4;
14 | var typeSlot = ctx.Stack[sp--];
15 | var valSlot = ctx.Stack[sp];
16 |
17 | var valType = (Type)ctx.Instance.Data.LookupReference(typeSlot.U4);
18 | if (Type.GetTypeCode(valType) == TypeCode.String && valSlot.O == null)
19 | valSlot.O = ctx.Instance.Data.LookupString(valSlot.U4);
20 | else {
21 | Debug.Assert(valType.IsValueType);
22 | valSlot.O = valSlot.ToObject(valType);
23 | }
24 | ctx.Stack[sp] = valSlot;
25 |
26 | ctx.Stack.SetTopPosition(sp);
27 | ctx.Registers[Constants.REG_SP].U4 = sp;
28 | state = ExecutionState.Next;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Cast.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.VCalls {
6 | internal class Cast : IVCall {
7 | public byte Code {
8 | get { return Constants.VCALL_CAST; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var typeSlot = ctx.Stack[sp--];
14 | var valSlot = ctx.Stack[sp];
15 |
16 | bool castclass = (typeSlot.U4 & 0x80000000) != 0;
17 | var castType = (Type)ctx.Instance.Data.LookupReference(typeSlot.U4 & ~0x80000000);
18 | if (Type.GetTypeCode(castType) == TypeCode.String && valSlot.O == null)
19 | valSlot.O = ctx.Instance.Data.LookupString(valSlot.U4);
20 | else if (valSlot.O == null)
21 | valSlot.O = null;
22 | else if (!castType.IsInstanceOfType(valSlot.O)) {
23 | valSlot.O = null;
24 | if (castclass)
25 | throw new InvalidCastException();
26 | }
27 | ctx.Stack[sp] = valSlot;
28 |
29 | ctx.Stack.SetTopPosition(sp);
30 | ctx.Registers[Constants.REG_SP].U4 = sp;
31 | state = ExecutionState.Next;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Ckfinite.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.VCalls {
6 | internal class Ckfinite : IVCall {
7 | public byte Code {
8 | get { return Constants.VCALL_CKFINITE; }
9 | }
10 |
11 | public unsafe void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var valueSlot = ctx.Stack[sp--];
14 |
15 | var fl = ctx.Registers[Constants.REG_FL].U1;
16 | if ((fl & Constants.FL_UNSIGNED) != 0) {
17 | float v = valueSlot.R4;
18 | if (float.IsNaN(v) || float.IsInfinity(v))
19 | throw new ArithmeticException();
20 | }
21 | else {
22 | double v = valueSlot.R8;
23 | if (double.IsNaN(v) || double.IsInfinity(v))
24 | throw new ArithmeticException();
25 | }
26 |
27 | ctx.Stack.SetTopPosition(sp);
28 | ctx.Registers[Constants.REG_SP].U4 = sp;
29 | state = ExecutionState.Next;
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Ckoverflow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.VCalls {
6 | internal class Ckoverflow : IVCall {
7 | public byte Code {
8 | get { return Constants.VCALL_CKOVERFLOW; }
9 | }
10 |
11 | public unsafe void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var fSlot = ctx.Stack[sp--];
14 |
15 | if (fSlot.U4 != 0)
16 | throw new OverflowException();
17 |
18 | ctx.Stack.SetTopPosition(sp);
19 | ctx.Registers[Constants.REG_SP].U4 = sp;
20 | state = ExecutionState.Next;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Exit.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.VCalls {
6 | internal class Exit : IVCall {
7 | public byte Code {
8 | get { return Constants.VCALL_EXIT; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | state = ExecutionState.Exit;
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/IVCall.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Execution;
3 |
4 | namespace Runtime.VCalls {
5 | internal interface IVCall {
6 | byte Code { get; }
7 | void Run(VMContext ctx, out ExecutionState state);
8 | }
9 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Localloc.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.VCalls {
6 | internal class Localloc : IVCall {
7 | public byte Code {
8 | get { return Constants.VCALL_LOCALLOC; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var bp = ctx.Registers[Constants.REG_BP].U4;
14 | var size = ctx.Stack[sp].U4;
15 | ctx.Stack[sp] = new VMSlot {
16 | U8 = (ulong)ctx.Stack.Localloc(bp, size)
17 | };
18 |
19 | state = ExecutionState.Next;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Rangechk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.VCalls {
6 | internal class Rangechk : IVCall {
7 | public byte Code {
8 | get { return Constants.VCALL_RANGECHK; }
9 | }
10 |
11 | public unsafe void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var valueSlot = ctx.Stack[sp--];
14 | var maxSlot = ctx.Stack[sp--];
15 | var minSlot = ctx.Stack[sp];
16 |
17 | valueSlot.U8 = ((long)valueSlot.U8 > (long)maxSlot.U8 || (long)valueSlot.U8 < (long)minSlot.U8) ? 1u : 0;
18 |
19 | ctx.Stack[sp] = valueSlot;
20 |
21 | ctx.Stack.SetTopPosition(sp);
22 | ctx.Registers[Constants.REG_SP].U4 = sp;
23 | state = ExecutionState.Next;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Sizeof.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 | using Runtime.Execution.Internal;
5 |
6 | namespace Runtime.VCalls {
7 | internal class Sizeof : IVCall {
8 | public byte Code {
9 | get { return Constants.VCALL_SIZEOF; }
10 | }
11 |
12 | public void Run(VMContext ctx, out ExecutionState state) {
13 | var sp = ctx.Registers[Constants.REG_SP].U4;
14 | var bp = ctx.Registers[Constants.REG_BP].U4;
15 | var type = (Type)ctx.Instance.Data.LookupReference(ctx.Stack[sp].U4);
16 | ctx.Stack[sp] = new VMSlot {
17 | U4 = (uint)SizeOfHelper.SizeOf(type)
18 | };
19 |
20 | state = ExecutionState.Next;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Throw.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Runtime.Dynamic;
3 | using Runtime.Execution;
4 |
5 | namespace Runtime.VCalls {
6 | internal class Throw : IVCall {
7 | public byte Code {
8 | get { return Constants.VCALL_THROW; }
9 | }
10 |
11 | public void Run(VMContext ctx, out ExecutionState state) {
12 | var sp = ctx.Registers[Constants.REG_SP].U4;
13 | var type = ctx.Stack[sp--].U4;
14 | ctx.Registers[Constants.REG_SP].U4 = sp;
15 | if (type == 1)
16 | state = ExecutionState.Rethrow;
17 | else
18 | state = ExecutionState.Throw;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/VCalls/Token.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using Runtime.Dynamic;
4 | using Runtime.Execution;
5 | using Runtime.Execution.Internal;
6 |
7 | namespace Runtime.VCalls {
8 | internal class Token : IVCall {
9 | public byte Code {
10 | get { return Constants.VCALL_TOKEN; }
11 | }
12 |
13 | public void Run(VMContext ctx, out ExecutionState state) {
14 | var sp = ctx.Registers[Constants.REG_SP].U4;
15 | var typeSlot = ctx.Stack[sp];
16 |
17 | var reference = ctx.Instance.Data.LookupReference(typeSlot.U4);
18 | if (reference is Type)
19 | typeSlot.O = ValueTypeBox.Box(((Type)reference).TypeHandle, typeof(RuntimeTypeHandle));
20 | else if (reference is MethodBase)
21 | typeSlot.O = ValueTypeBox.Box(((MethodBase)reference).MethodHandle, typeof(RuntimeMethodHandle));
22 | else if (reference is FieldInfo)
23 | typeSlot.O = ValueTypeBox.Box(((FieldInfo)reference).FieldHandle, typeof(RuntimeFieldHandle));
24 | ctx.Stack[sp] = typeSlot;
25 |
26 | state = ExecutionState.Next;
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/.NETFramework,Version=v4.6.1.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
5 |
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Runtime/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Runtime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/KoiVM.Runtime.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | b69cbec917433cd61ccacf3165e3a8de2a0d6673
2 |
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/KoiVM.Runtime.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Users\admin\Desktop\personal coding\KoiVM-1-master\KoiVM.Runtime\bin\Debug\KoiVM.Runtime.dll
2 | C:\Users\admin\Desktop\personal coding\KoiVM-1-master\KoiVM.Runtime\bin\Debug\KoiVM.Runtime.pdb
3 | C:\Users\admin\Desktop\personal coding\KoiVM-1-master\KoiVM.Runtime\obj\Debug\KoiVM.Runtime.csprojAssemblyReference.cache
4 | C:\Users\admin\Desktop\personal coding\KoiVM-1-master\KoiVM.Runtime\obj\Debug\KoiVM.Runtime.csproj.CoreCompileInputs.cache
5 | C:\Users\admin\Desktop\personal coding\KoiVM-1-master\KoiVM.Runtime\obj\Debug\KoiVM.Runtime.dll
6 | C:\Users\admin\Desktop\personal coding\KoiVM-1-master\KoiVM.Runtime\obj\Debug\KoiVM.Runtime.pdb
7 | C:\Users\admin\Desktop\personal coding\KoiVM-1-master\bin\KoiVM.Runtime.dll
8 | C:\Users\admin\Desktop\personal coding\KoiVM-1-master\bin\KoiVM.Runtime.pdb
9 |
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/KoiVM.Runtime.csprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Runtime/obj/Debug/KoiVM.Runtime.csprojAssemblyReference.cache
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/Runtime.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Runtime/obj/Debug/Runtime.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/Runtime.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 2895be5efc65d52df2359191b87849aa715cb5e1
2 |
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/Runtime.csprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Runtime/obj/Debug/Runtime.csprojAssemblyReference.cache
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/Runtime.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Runtime/obj/Debug/Runtime.dll
--------------------------------------------------------------------------------
/KoiVM.Runtime/obj/Debug/Runtime.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM.Runtime/obj/Debug/Runtime.pdb
--------------------------------------------------------------------------------
/KoiVM/AST/ASTExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST {
4 | public abstract class ASTExpression : ASTNode {
5 | public ASTType? Type { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/KoiVM/AST/ASTNode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST {
4 | public abstract class ASTNode {
5 | }
6 | }
--------------------------------------------------------------------------------
/KoiVM/AST/ASTType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace KoiVM.AST {
5 | [Obfuscation(Exclude = false, ApplyToMembers = false, Feature = "+rename(forceRen=true);")]
6 | public enum ASTType {
7 | I4,
8 | I8,
9 | R4,
10 | R8,
11 | O,
12 | Ptr,
13 | ByRef
14 | }
15 | }
--------------------------------------------------------------------------------
/KoiVM/AST/ASTVariable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST {
4 | public class ASTVariable {
5 | public ASTType Type { get; set; }
6 | public string Name { get; set; }
7 |
8 | public override string ToString() {
9 | return Name;
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/IHasOffset.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.IL {
4 | public interface IHasOffset {
5 | uint Offset { get; }
6 | }
7 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/IILOperand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.IL {
4 | public interface IILOperand {
5 | }
6 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/ILBlock.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet;
3 | using KoiVM.CFG;
4 | using KoiVM.RT;
5 |
6 | namespace KoiVM.AST.IL {
7 | public class ILBlock : BasicBlock {
8 | public ILBlock(int id, ILInstrList content)
9 | : base(id, content) {
10 | }
11 |
12 | public virtual IKoiChunk CreateChunk(VMRuntime rt, MethodDef method) {
13 | return new BasicBlockChunk(rt, method, this);
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/ILDataTarget.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.RT;
3 |
4 | namespace KoiVM.AST.IL {
5 | public class ILDataTarget : IILOperand, IHasOffset {
6 | public ILDataTarget(BinaryChunk target) {
7 | Target = target;
8 | }
9 |
10 | public BinaryChunk Target { get; set; }
11 | public string Name { get; set; }
12 |
13 | public uint Offset {
14 | get { return Target.Offset; }
15 | }
16 |
17 | public override string ToString() {
18 | return Name;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/ILImmediate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.IL {
4 | public class ILImmediate : ASTConstant, IILOperand {
5 | public static ILImmediate Create(object value, ASTType type) {
6 | return new ILImmediate {
7 | Value = value,
8 | Type = type
9 | };
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/ILInstrList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace KoiVM.AST.IL {
5 | public class ILInstrList : List {
6 | public override string ToString() {
7 | return string.Join(Environment.NewLine, this);
8 | }
9 |
10 | public void VisitInstrs(VisitFunc visitFunc, T arg) {
11 | for (int i = 0; i < Count; i++)
12 | visitFunc(this, this[i], ref i, arg);
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/ILJumpTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.CFG;
3 | using KoiVM.RT;
4 |
5 | namespace KoiVM.AST.IL {
6 | public class ILJumpTable : IILOperand, IHasOffset {
7 | public ILJumpTable(IBasicBlock[] targets) {
8 | Targets = targets;
9 | Chunk = new JumpTableChunk(this);
10 | }
11 |
12 | public JumpTableChunk Chunk { get; private set; }
13 | public ILInstruction RelativeBase { get; set; }
14 | public IBasicBlock[] Targets { get; set; }
15 |
16 | public uint Offset {
17 | get { return Chunk.Offset; }
18 | }
19 |
20 | public override string ToString() {
21 | return string.Format("[..{0}..]", Targets.Length);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/ILJumpTarget.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.CFG;
3 |
4 | namespace KoiVM.AST.IL {
5 | public class ILBlockTarget : IILOperand, IHasOffset {
6 | public ILBlockTarget(IBasicBlock target) {
7 | Target = target;
8 | }
9 |
10 | public IBasicBlock Target { get; set; }
11 |
12 | public uint Offset {
13 | get { return ((ILBlock)Target).Content[0].Offset; }
14 | }
15 |
16 | public override string ToString() {
17 | return string.Format("Block_{0:x2}", Target.Id);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/ILMethodTarget.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet;
3 | using KoiVM.RT;
4 |
5 | namespace KoiVM.AST.IL {
6 | public class ILMethodTarget : IILOperand, IHasOffset {
7 | ILBlock methodEntry;
8 |
9 | public ILMethodTarget(MethodDef target) {
10 | Target = target;
11 | }
12 |
13 | public MethodDef Target { get; set; }
14 |
15 | public void Resolve(VMRuntime runtime) {
16 | runtime.LookupMethod(Target, out methodEntry);
17 | }
18 |
19 | public uint Offset {
20 | get { return methodEntry == null ? 0 : methodEntry.Content[0].Offset; }
21 | }
22 |
23 | public override string ToString() {
24 | return Target.ToString();
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IL/ILRelReference.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.RT;
3 |
4 | namespace KoiVM.AST.IL {
5 | public class ILRelReference : IILOperand {
6 | public ILRelReference(IHasOffset target, IHasOffset relBase) {
7 | Target = target;
8 | Base = relBase;
9 | }
10 |
11 | public IHasOffset Target { get; set; }
12 | public IHasOffset Base { get; set; }
13 |
14 | public virtual uint Resolve(VMRuntime runtime) {
15 | var relBase = Base.Offset;
16 | if (Base is ILInstruction)
17 | relBase += runtime.serializer.ComputeLength((ILInstruction)Base);
18 | return Target.Offset - relBase;
19 | }
20 |
21 | public override string ToString() {
22 | return string.Format("[{0:x8}:{1:x8}]", Base.Offset, Target.Offset);
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/KoiVM/AST/ILAST/IILASTNode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.ILAST {
4 | public interface IILASTNode {
5 | ASTType? Type { get; }
6 | }
7 | }
--------------------------------------------------------------------------------
/KoiVM/AST/ILAST/IILASTStatement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.ILAST {
4 | public interface IILASTStatement {
5 | }
6 | }
--------------------------------------------------------------------------------
/KoiVM/AST/ILAST/ILASTAssignment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.ILAST {
4 | public class ILASTAssignment : ASTNode, IILASTStatement {
5 | public ILASTVariable Variable { get; set; }
6 | public ILASTExpression Value { get; set; }
7 |
8 | public override string ToString() {
9 | return string.Format("{0} = {1}", Variable, Value);
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/KoiVM/AST/ILAST/ILASTPhi.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 |
4 | namespace KoiVM.AST.ILAST {
5 | public class ILASTPhi : ASTNode, IILASTStatement {
6 | public ILASTVariable Variable { get; set; }
7 | public ILASTVariable[] SourceVariables { get; set; }
8 |
9 | public override string ToString() {
10 | var ret = new StringBuilder();
11 | ret.AppendFormat("{0} = [", Variable);
12 | for (int i = 0; i < SourceVariables.Length; i++) {
13 | if (i != 0)
14 | ret.Append(", ");
15 | ret.Append(SourceVariables[i]);
16 | }
17 | ret.Append("]");
18 | return ret.ToString();
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/KoiVM/AST/ILAST/ILASTVariable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.ILAST {
4 | public class ILASTVariable : ASTVariable, IILASTNode {
5 | ASTType? IILASTNode.Type {
6 | get { return base.Type; }
7 | }
8 |
9 | public ILASTVariableType VariableType { get; set; }
10 | public object Annotation { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/KoiVM/AST/ILAST/ILASTVariableType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.ILAST {
4 | public enum ILASTVariableType {
5 | StackVar,
6 | ExceptionVar,
7 | FilterVar,
8 | PhiVar
9 | }
10 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IR/IIROperand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.IR {
4 | public interface IIROperand {
5 | ASTType Type { get; }
6 | }
7 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IR/IRBlockTarget.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.CFG;
3 |
4 | namespace KoiVM.AST.IR {
5 | public class IRBlockTarget : IIROperand {
6 | public IRBlockTarget(IBasicBlock target) {
7 | Target = target;
8 | }
9 |
10 | public IBasicBlock Target { get; set; }
11 |
12 | public ASTType Type {
13 | get { return ASTType.Ptr; }
14 | }
15 |
16 | public override string ToString() {
17 | return string.Format("Block_{0:x2}", Target.Id);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IR/IRDataTarget.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.RT;
3 |
4 | namespace KoiVM.AST.IR {
5 | public class IRDataTarget : IIROperand {
6 | public IRDataTarget(BinaryChunk target) {
7 | Target = target;
8 | }
9 |
10 | public BinaryChunk Target { get; set; }
11 | public string Name { get; set; }
12 |
13 | public ASTType Type {
14 | get { return ASTType.Ptr; }
15 | }
16 |
17 | public override string ToString() {
18 | return Name;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IR/IRInstrList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace KoiVM.AST.IR {
5 | public class IRInstrList : List {
6 | public override string ToString() {
7 | return string.Join(Environment.NewLine, this);
8 | }
9 |
10 | public void VisitInstrs(VisitFunc visitFunc, T arg) {
11 | for (int i = 0; i < Count; i++)
12 | visitFunc(this, this[i], ref i, arg);
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IR/IRJumpTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.CFG;
3 |
4 | namespace KoiVM.AST.IR {
5 | public class IRJumpTable : IIROperand {
6 | public IRJumpTable(IBasicBlock[] targets) {
7 | Targets = targets;
8 | }
9 |
10 | public IBasicBlock[] Targets { get; set; }
11 |
12 | public ASTType Type {
13 | get { return ASTType.Ptr; }
14 | }
15 |
16 | public override string ToString() {
17 | return string.Format("[..{0}..]", Targets.Length);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IR/IRMetaTarget.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.IR {
4 | public class IRMetaTarget : IIROperand {
5 | public IRMetaTarget(object mdItem) {
6 | MetadataItem = mdItem;
7 | }
8 |
9 | public object MetadataItem { get; set; }
10 | public bool LateResolve { get; set; }
11 |
12 | public ASTType Type {
13 | get { return ASTType.Ptr; }
14 | }
15 |
16 | public override string ToString() {
17 | return MetadataItem.ToString();
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IR/IRPointer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.IR {
4 | public class IRPointer : IIROperand {
5 | public IRRegister Register { get; set; }
6 | public int Offset { get; set; }
7 |
8 | public IRVariable SourceVariable { get; set; }
9 | public ASTType Type { get; set; }
10 |
11 | public override string ToString() {
12 | string prefix = Type.ToString();
13 | string offsetStr = "";
14 | if (Offset > 0)
15 | offsetStr = string.Format(" + {0:x}h", Offset);
16 | else if (Offset < 0)
17 | offsetStr = string.Format(" - {0:x}h", -Offset);
18 | return string.Format("{0}:[{1}{2}]", prefix, Register, offsetStr);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IR/IRVariable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet;
3 |
4 | namespace KoiVM.AST.IR {
5 | public class IRVariable : ASTVariable, IIROperand {
6 | public IRVariableType VariableType { get; set; }
7 | public TypeSig RawType { get; set; }
8 | public int Id { get; set; }
9 | public object Annotation { get; set; }
10 |
11 | public override string ToString() {
12 | return string.Format("{0}:{1}", Name, Type);
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/KoiVM/AST/IR/IRVariableType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.AST.IR {
4 | public enum IRVariableType {
5 | VirtualRegister,
6 | Local,
7 | Argument,
8 | ExceptionObj
9 | }
10 | }
--------------------------------------------------------------------------------
/KoiVM/CFG/BlockFlags.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.CFG {
4 | [Flags]
5 | public enum BlockFlags {
6 | Normal = 0,
7 | ExitEHLeave = 1,
8 | ExitEHReturn = 2
9 | }
10 | }
--------------------------------------------------------------------------------
/KoiVM/CFG/CILInstrList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using dnlib.DotNet.Emit;
4 |
5 | namespace KoiVM.CFG {
6 | public class CILInstrList : List {
7 | public override string ToString() {
8 | return string.Join(Environment.NewLine, this);
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/KoiVM/CFG/IBasicBlock.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace KoiVM.CFG {
5 | public interface IBasicBlock {
6 | int Id { get; }
7 | object Content { get; }
8 | BlockFlags Flags { get; set; }
9 | IEnumerable Sources { get; }
10 | IEnumerable Targets { get; }
11 | }
12 | }
--------------------------------------------------------------------------------
/KoiVM/CFG/ScopeType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.CFG {
4 | public enum ScopeType {
5 | None,
6 | Try,
7 | Filter,
8 | Handler
9 | }
10 | }
--------------------------------------------------------------------------------
/KoiVM/ILAST/ITransformationHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.ILAST {
4 | public interface ITransformationHandler {
5 | void Initialize(ILASTTransformer tr);
6 | void Transform(ILASTTransformer tr);
7 | }
8 | }
--------------------------------------------------------------------------------
/KoiVM/ILAST/Transformation/NullTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet.Emit;
3 | using KoiVM.AST.ILAST;
4 |
5 | namespace KoiVM.ILAST.Transformation {
6 | public class NullTransform : ITransformationHandler {
7 | public void Initialize(ILASTTransformer tr) {
8 | }
9 |
10 | public void Transform(ILASTTransformer tr) {
11 | tr.Tree.TraverseTree(Transform, tr);
12 | }
13 |
14 | static void Transform(ILASTExpression expr, ILASTTransformer tr) {
15 | if (expr.ILCode != Code.Ldnull)
16 | return;
17 |
18 | expr.ILCode = Code.Ldc_I4;
19 | expr.Operand = 0;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/KoiVM/ILAST/Transformation/StringTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet;
3 | using dnlib.DotNet.Emit;
4 | using KoiVM.AST.ILAST;
5 |
6 | namespace KoiVM.ILAST.Transformation {
7 | public class StringTransform : ITransformationHandler {
8 | public void Initialize(ILASTTransformer tr) {
9 | }
10 |
11 | public void Transform(ILASTTransformer tr) {
12 | tr.Tree.TraverseTree(Transform, tr);
13 | }
14 |
15 | static void Transform(ILASTExpression expr, ILASTTransformer tr) {
16 | if (expr.ILCode != Code.Ldstr)
17 | return;
18 |
19 | var operand = (string)expr.Operand;
20 | expr.ILCode = Code.Box;
21 | expr.Operand = tr.Method.Module.CorLibTypes.String.ToTypeDefOrRef();
22 | expr.Arguments = new IILASTNode[] {
23 | new ILASTExpression {
24 | ILCode = Code.Ldc_I4,
25 | Operand = (int)tr.VM.Data.GetId(operand),
26 | Arguments = new IILASTNode[0]
27 | }
28 | };
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/KoiVM/IVMSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet;
3 |
4 | namespace KoiVM {
5 | public interface IVMSettings {
6 | int Seed { get; }
7 | bool IsDebug { get; }
8 | bool ExportDbgInfo { get; }
9 | bool DoStackWalk { get; }
10 | bool IsVirtualized(MethodDef method);
11 | bool IsExported(MethodDef method);
12 | }
13 | }
--------------------------------------------------------------------------------
/KoiVM/Obfuscation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | [assembly: Obfuscation(Exclude = false, Feature = "koi(dbgInfo=true,rtName=kiRT)", ApplyToMembers = false)]
5 |
6 | [assembly: Obfuscation(Exclude = false, Feature =
7 | "preset(aggressive);+constants(mode=dynamic,decoderCount=10,cfg=true);" +
8 | "+ctrl flow(predicate=expression,intensity=100);+rename(renPublic=true,mode=sequential);" +
9 | "+ref proxy(mode=strong,encoding=expression,typeErasure=true);" +
10 | "+resources(mode=dynamic);"
11 | #if DEBUG
12 | + "-anti debug;-rename;"
13 | #endif
14 | )]
--------------------------------------------------------------------------------
/KoiVM/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | [assembly: AssemblyTitle("KoiVM virtualizer")]
5 | [assembly: AssemblyDescription("KoiVM virtualizer")]
--------------------------------------------------------------------------------
/KoiVM/RT/BinaryChunk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.RT {
4 | public class BinaryChunk : IKoiChunk {
5 | public BinaryChunk(byte[] data) {
6 | Data = data;
7 | }
8 |
9 | public byte[] Data { get; private set; }
10 | public uint Offset { get; private set; }
11 |
12 | public EventHandler OffsetComputed;
13 |
14 | uint IKoiChunk.Length {
15 | get { return (uint)Data.Length; }
16 | }
17 |
18 | void IKoiChunk.OnOffsetComputed(uint offset) {
19 | if (OffsetComputed != null)
20 | OffsetComputed(this, new OffsetComputeEventArgs(offset));
21 | Offset = offset;
22 | }
23 |
24 | byte[] IKoiChunk.GetData() {
25 | return Data;
26 | }
27 | }
28 |
29 | public class OffsetComputeEventArgs : EventArgs {
30 | internal OffsetComputeEventArgs(uint offset) {
31 | Offset = offset;
32 | }
33 |
34 | public uint Offset { get; private set; }
35 | }
36 | }
--------------------------------------------------------------------------------
/KoiVM/RT/IKoiChunk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.RT {
4 | public interface IKoiChunk {
5 | uint Length { get; }
6 |
7 | void OnOffsetComputed(uint offset);
8 | byte[] GetData();
9 | }
10 | }
--------------------------------------------------------------------------------
/KoiVM/RT/KoiHeap.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using dnlib.DotNet.Writer;
5 |
6 | namespace KoiVM.RT {
7 | internal class KoiHeap : HeapBase {
8 | List chunks = new List();
9 | uint currentLen;
10 |
11 | public uint AddChunk(byte[] chunk) {
12 | uint offset = currentLen;
13 | chunks.Add(chunk);
14 | currentLen += (uint)chunk.Length;
15 | return offset;
16 | }
17 |
18 | public override string Name {
19 | get { return "#AstroNet"; }
20 | }
21 |
22 | public override uint GetRawLength() {
23 | return currentLen;
24 | }
25 |
26 | protected override void WriteToImpl(BinaryWriter writer) {
27 | foreach (var chunk in chunks)
28 | writer.Write(chunk);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/KoiVM/VM/Descriptors/ArchDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.VM {
4 | public class ArchDescriptor {
5 | public ArchDescriptor(Random random) {
6 | OpCodes = new OpCodeDescriptor(random);
7 | Flags = new FlagDescriptor(random);
8 | Registers = new RegisterDescriptor(random);
9 | }
10 |
11 | public OpCodeDescriptor OpCodes { get; private set; }
12 | public FlagDescriptor Flags { get; private set; }
13 | public RegisterDescriptor Registers { get; private set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/KoiVM/VM/Descriptors/FlagDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace KoiVM.VM {
5 | public class FlagDescriptor {
6 | int[] flagOrder = Enumerable.Range(0, (int)VMFlags.Max).ToArray();
7 |
8 | public FlagDescriptor(Random random) {
9 | random.Shuffle(flagOrder);
10 | }
11 |
12 | public int this[VMFlags flag] {
13 | get { return flagOrder[(int)flag]; }
14 | }
15 |
16 | public int OVERFLOW {
17 | get { return flagOrder[0]; }
18 | }
19 |
20 | public int CARRY {
21 | get { return flagOrder[1]; }
22 | }
23 |
24 | public int ZERO {
25 | get { return flagOrder[2]; }
26 | }
27 |
28 | public int SIGN {
29 | get { return flagOrder[3]; }
30 | }
31 |
32 | public int UNSIGNED {
33 | get { return flagOrder[4]; }
34 | }
35 |
36 | public int BEHAV1 {
37 | get { return flagOrder[5]; }
38 | }
39 |
40 | public int BEHAV2 {
41 | get { return flagOrder[6]; }
42 | }
43 |
44 | public int BEHAV3 {
45 | get { return flagOrder[7]; }
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/KoiVM/VM/Descriptors/OpCodeDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using KoiVM.VMIL;
4 |
5 | namespace KoiVM.VM {
6 | public class OpCodeDescriptor {
7 | byte[] opCodeOrder = Enumerable.Range(0, 256).Select(x => (byte)x).ToArray();
8 |
9 | public OpCodeDescriptor(Random random) {
10 | random.Shuffle(opCodeOrder);
11 | }
12 |
13 | public byte this[ILOpCode opCode] {
14 | get { return opCodeOrder[(int)opCode]; }
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/KoiVM/VM/Descriptors/RTFlagDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace KoiVM.VM {
5 | public class RTFlagDescriptor {
6 | byte[] flagOrder = Enumerable.Range(1, 7).Select(x => (byte)x).ToArray();
7 | byte[] ehOrder = Enumerable.Range(0, 4).Select(x => (byte)x).ToArray();
8 |
9 | public RTFlagDescriptor(Random random) {
10 | random.Shuffle(flagOrder);
11 | random.Shuffle(ehOrder);
12 | }
13 |
14 | public byte INSTANCE {
15 | get { return flagOrder[0]; }
16 | }
17 |
18 | public byte EH_CATCH {
19 | get { return ehOrder[0]; }
20 | }
21 |
22 | public byte EH_FILTER {
23 | get { return ehOrder[1]; }
24 | }
25 |
26 | public byte EH_FAULT {
27 | get { return ehOrder[2]; }
28 | }
29 |
30 | public byte EH_FINALLY {
31 | get { return ehOrder[3]; }
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/KoiVM/VM/Descriptors/RegisterDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace KoiVM.VM {
5 | public class RegisterDescriptor {
6 | byte[] regOrder = Enumerable.Range(0, (int)VMRegisters.Max).Select(x => (byte)x).ToArray();
7 |
8 | public RegisterDescriptor(Random random) {
9 | random.Shuffle(regOrder);
10 | }
11 |
12 | public byte this[VMRegisters reg] {
13 | get { return regOrder[(int)reg]; }
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/KoiVM/VM/Descriptors/RuntimeDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.VM {
4 | public class RuntimeDescriptor {
5 | public RuntimeDescriptor(Random random) {
6 | VMCall = new VMCallDescriptor(random);
7 | VCallOps = new VCallOpsDescriptor(random);
8 | RTFlags = new RTFlagDescriptor(random);
9 | }
10 |
11 | public VMCallDescriptor VMCall { get; private set; }
12 | public VCallOpsDescriptor VCallOps { get; private set; }
13 | public RTFlagDescriptor RTFlags { get; private set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/KoiVM/VM/Descriptors/VCallOpsDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.VM {
4 | public class VCallOpsDescriptor {
5 | uint[] ecallOrder = { 0, 1, 2, 3 };
6 |
7 | public VCallOpsDescriptor(Random random) {
8 | random.Shuffle(ecallOrder);
9 | }
10 |
11 | public uint ECALL_CALL {
12 | get { return ecallOrder[0]; }
13 | }
14 |
15 | public uint ECALL_CALLVIRT {
16 | get { return ecallOrder[1]; }
17 | }
18 |
19 | public uint ECALL_NEWOBJ {
20 | get { return ecallOrder[2]; }
21 | }
22 |
23 | public uint ECALL_CALLVIRT_CONSTRAINED {
24 | get { return ecallOrder[3]; }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/VM/Descriptors/VMDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.VM {
4 | public class VMDescriptor {
5 | public VMDescriptor(IVMSettings settings) {
6 | Random = new Random(settings.Seed);
7 | Settings = settings;
8 | Architecture = new ArchDescriptor(Random);
9 | Runtime = new RuntimeDescriptor(Random);
10 | Data = new DataDescriptor(Random);
11 | }
12 |
13 | public Random Random { get; private set; }
14 | public IVMSettings Settings { get; private set; }
15 | public ArchDescriptor Architecture { get; private set; }
16 | public RuntimeDescriptor Runtime { get; private set; }
17 | public DataDescriptor Data { get; private set; }
18 |
19 | public void ResetData() {
20 | Data = new DataDescriptor(Random);
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/KoiVM/VM/FuncSig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet;
3 |
4 | namespace KoiVM.VM {
5 | public class FuncSig {
6 | public byte Flags;
7 | public ITypeDefOrRef[] ParamSigs;
8 | public ITypeDefOrRef RetType;
9 |
10 | public override int GetHashCode() {
11 | var comparer = new SigComparer();
12 | int hashCode = Flags;
13 | foreach (var param in ParamSigs)
14 | hashCode = (hashCode * 7) + comparer.GetHashCode(param);
15 | return (hashCode * 7) + comparer.GetHashCode(RetType);
16 | }
17 |
18 | public override bool Equals(object obj) {
19 | var other = obj as FuncSig;
20 | if (other == null || other.Flags != Flags)
21 | return false;
22 |
23 | if (other.ParamSigs.Length != ParamSigs.Length)
24 | return false;
25 | var comparer = new SigComparer();
26 | for (int i = 0; i < ParamSigs.Length; i++) {
27 | if (!comparer.Equals(ParamSigs[i], other.ParamSigs[i]))
28 | return false;
29 | }
30 | if (!comparer.Equals(RetType, other.RetType))
31 | return false;
32 | return true;
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/KoiVM/VM/VMCalls.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace KoiVM.VM {
5 | [Obfuscation(Exclude = false, ApplyToMembers = false, Feature = "+rename(forceRen=true);")]
6 | public enum VMCalls {
7 | EXIT = 0,
8 | BREAK = 1,
9 | ECALL = 2,
10 | CAST = 3,
11 | CKFINITE = 4,
12 | CKOVERFLOW = 5,
13 | RANGECHK = 6,
14 | INITOBJ = 7,
15 | LDFLD = 8,
16 | LDFTN = 9,
17 | TOKEN = 10,
18 | THROW = 11,
19 | SIZEOF = 12,
20 | STFLD = 13,
21 | BOX = 14,
22 | UNBOX = 15,
23 | LOCALLOC = 16,
24 |
25 | Max
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/VM/VMFlags.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace KoiVM.VM {
5 | [Obfuscation(Exclude = false, ApplyToMembers = false, Feature = "+rename(forceRen=true);")]
6 | public enum VMFlags {
7 | OVERFLOW = 0,
8 | CARRY = 1,
9 | ZERO = 2,
10 | SIGN = 3,
11 | UNSIGNED = 4,
12 | BEHAV1 = 5,
13 | BEHAV2 = 6,
14 | BEHAV3 = 7,
15 |
16 | Max
17 | }
18 | }
--------------------------------------------------------------------------------
/KoiVM/VM/VMMethodInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using KoiVM.CFG;
4 |
5 | namespace KoiVM.VM {
6 | public class VMMethodInfo {
7 | public VMMethodInfo() {
8 | BlockKeys = new Dictionary();
9 | UsedRegister = new HashSet();
10 | }
11 |
12 | public ScopeBlock RootScope;
13 | public readonly Dictionary BlockKeys;
14 | public readonly HashSet UsedRegister;
15 | public byte EntryKey;
16 | public byte ExitKey;
17 | }
18 |
19 | public struct VMBlockKey {
20 | public byte EntryKey;
21 | public byte ExitKey;
22 | }
23 | }
--------------------------------------------------------------------------------
/KoiVM/VM/VMRegisters.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace KoiVM.VM {
5 | [Obfuscation(Exclude = false, ApplyToMembers = false, Feature = "+rename(forceRen=true);")]
6 | public enum VMRegisters {
7 | R0 = 0,
8 | R1 = 1,
9 | R2 = 2,
10 | R3 = 3,
11 | R4 = 4,
12 | R5 = 5,
13 | R6 = 6,
14 | R7 = 7,
15 |
16 | BP = 8,
17 | SP = 9,
18 | IP = 10,
19 | FL = 11,
20 | K1 = 12,
21 | K2 = 13,
22 | M1 = 14,
23 | M2 = 15,
24 |
25 | Max
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/IPostTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.VMIL {
4 | public interface IPostTransform {
5 | void Initialize(ILPostTransformer tr);
6 | void Transform(ILPostTransformer tr);
7 | }
8 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/ITransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.VMIL {
4 | public interface ITransform {
5 | void Initialize(ILTransformer tr);
6 | void Transform(ILTransformer tr);
7 | }
8 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/ITranslationHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST.IR;
3 | using KoiVM.VMIR;
4 |
5 | namespace KoiVM.VMIL {
6 | public interface ITranslationHandler {
7 | IROpCode IRCode { get; }
8 | void Translate(IRInstruction instr, ILTranslator tr);
9 | }
10 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/Transforms/EntryExitTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST.IL;
3 |
4 | namespace KoiVM.VMIL.Transforms {
5 | public class EntryExitTransform : ITransform {
6 | public void Initialize(ILTransformer tr) {
7 | }
8 |
9 | public void Transform(ILTransformer tr) {
10 | tr.Instructions.VisitInstrs(VisitInstr, tr);
11 | }
12 |
13 | void VisitInstr(ILInstrList instrs, ILInstruction instr, ref int index, ILTransformer tr) {
14 | if (instr.OpCode == ILOpCode.__ENTRY) {
15 | instrs.RemoveAt(index);
16 | index--;
17 | }
18 | else if (instr.OpCode == ILOpCode.__EXIT) {
19 | instrs[index] = new ILInstruction(ILOpCode.RET, null, instr);
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/Transforms/FixMethodRefTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using KoiVM.AST.IL;
4 | using KoiVM.VM;
5 |
6 | namespace KoiVM.VMIL.Transforms {
7 | public class FixMethodRefTransform : IPostTransform {
8 | HashSet saveRegs;
9 |
10 | public void Initialize(ILPostTransformer tr) {
11 | saveRegs = tr.Runtime.Descriptor.Data.LookupInfo(tr.Method).UsedRegister;
12 | }
13 |
14 | public void Transform(ILPostTransformer tr) {
15 | tr.Instructions.VisitInstrs(VisitInstr, tr);
16 | }
17 |
18 | void VisitInstr(ILInstrList instrs, ILInstruction instr, ref int index, ILPostTransformer tr) {
19 | var rel = instr.Operand as ILRelReference;
20 | if (rel == null)
21 | return;
22 |
23 | var methodRef = rel.Target as ILMethodTarget;
24 | if (methodRef == null)
25 | return;
26 |
27 | methodRef.Resolve(tr.Runtime);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/Transforms/ReferenceOffsetTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST.IL;
3 |
4 | namespace KoiVM.VMIL.Transforms {
5 | public class ReferenceOffsetTransform : ITransform {
6 | public void Initialize(ILTransformer tr) {
7 | }
8 |
9 | public void Transform(ILTransformer tr) {
10 | tr.Instructions.VisitInstrs(VisitInstr, tr);
11 | }
12 |
13 | void VisitInstr(ILInstrList instrs, ILInstruction instr, ref int index, ILTransformer tr) {
14 | if (instr.OpCode == ILOpCode.PUSHI_DWORD && instr.Operand is IHasOffset) {
15 | var relBase = new ILInstruction(ILOpCode.PUSHR_QWORD, ILRegister.IP, instr);
16 | instr.OpCode = ILOpCode.PUSHI_DWORD;
17 | instr.Operand = new ILRelReference((IHasOffset)instr.Operand, relBase);
18 |
19 | instrs.Replace(index, new[] {
20 | relBase,
21 | instr,
22 | new ILInstruction(ILOpCode.ADD_QWORD, null, instr)
23 | });
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/Transforms/SaveInfoTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST.IL;
3 | using KoiVM.VM;
4 |
5 | namespace KoiVM.VMIL.Transforms {
6 | public class SaveInfoTransform : ITransform {
7 | VMMethodInfo methodInfo;
8 |
9 | public void Initialize(ILTransformer tr) {
10 | methodInfo = tr.VM.Data.LookupInfo(tr.Method);
11 | methodInfo.RootScope = tr.RootScope;
12 | tr.VM.Data.SetInfo(tr.Method, methodInfo);
13 | }
14 |
15 | public void Transform(ILTransformer tr) {
16 | tr.Instructions.VisitInstrs(VisitInstr, tr);
17 | }
18 |
19 | void VisitInstr(ILInstrList instrs, ILInstruction instr, ref int index, ILTransformer tr) {
20 | if (instr.Operand is ILRegister) {
21 | var reg = ((ILRegister)instr.Operand).Register;
22 | if (reg.IsGPR())
23 | methodInfo.UsedRegister.Add(reg);
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/Translation/EHHandlers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST.IL;
3 | using KoiVM.AST.IR;
4 | using KoiVM.VMIR;
5 |
6 | namespace KoiVM.VMIL.Translation {
7 | public class TryHandler : ITranslationHandler {
8 | public IROpCode IRCode {
9 | get { return IROpCode.TRY; }
10 | }
11 |
12 | public void Translate(IRInstruction instr, ILTranslator tr) {
13 | if (instr.Operand2 != null)
14 | tr.PushOperand(instr.Operand2);
15 | tr.PushOperand(instr.Operand1);
16 | tr.Instructions.Add(new ILInstruction(ILOpCode.TRY) { Annotation = instr.Annotation });
17 | }
18 | }
19 |
20 | public class LeaveHandler : ITranslationHandler {
21 | public IROpCode IRCode {
22 | get { return IROpCode.LEAVE; }
23 | }
24 |
25 | public void Translate(IRInstruction instr, ILTranslator tr) {
26 | tr.PushOperand(instr.Operand1);
27 | tr.Instructions.Add(new ILInstruction(ILOpCode.LEAVE) { Annotation = instr.Annotation });
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/Translation/InvocationHandlers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST.IL;
3 | using KoiVM.AST.IR;
4 | using KoiVM.VMIR;
5 |
6 | namespace KoiVM.VMIL.Translation {
7 | public class CallHandler : ITranslationHandler {
8 | public IROpCode IRCode {
9 | get { return IROpCode.CALL; }
10 | }
11 |
12 | public void Translate(IRInstruction instr, ILTranslator tr) {
13 | tr.PushOperand(instr.Operand1);
14 | tr.Instructions.Add(new ILInstruction(ILOpCode.CALL) { Annotation = instr.Annotation });
15 | }
16 | }
17 |
18 | public class RetHandler : ITranslationHandler {
19 | public IROpCode IRCode {
20 | get { return IROpCode.RET; }
21 | }
22 |
23 | public void Translate(IRInstruction instr, ILTranslator tr) {
24 | tr.Instructions.Add(new ILInstruction(ILOpCode.RET));
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/Translation/MemoryHandlers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST.IR;
3 | using KoiVM.VMIR;
4 |
5 | namespace KoiVM.VMIL.Translation {
6 | public class PushHandler : ITranslationHandler {
7 | public IROpCode IRCode {
8 | get { return IROpCode.PUSH; }
9 | }
10 |
11 | public void Translate(IRInstruction instr, ILTranslator tr) {
12 | tr.PushOperand(instr.Operand1);
13 | }
14 | }
15 |
16 | public class PopHandler : ITranslationHandler {
17 | public IROpCode IRCode {
18 | get { return IROpCode.POP; }
19 | }
20 |
21 | public void Translate(IRInstruction instr, ILTranslator tr) {
22 | tr.PopOperand(instr.Operand1);
23 | }
24 | }
25 |
26 | public class MovHandler : ITranslationHandler {
27 | public IROpCode IRCode {
28 | get { return IROpCode.MOV; }
29 | }
30 |
31 | public void Translate(IRInstruction instr, ILTranslator tr) {
32 | tr.PushOperand(instr.Operand2);
33 | tr.PopOperand(instr.Operand1);
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/KoiVM/VMIL/Translation/MiscHandlers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST.IL;
3 | using KoiVM.AST.IR;
4 | using KoiVM.VMIR;
5 |
6 | namespace KoiVM.VMIL.Translation {
7 | public class VcallHandler : ITranslationHandler {
8 | public IROpCode IRCode {
9 | get { return IROpCode.VCALL; }
10 | }
11 |
12 | public void Translate(IRInstruction instr, ILTranslator tr) {
13 | if (instr.Operand2 != null)
14 | tr.PushOperand(instr.Operand2);
15 | tr.PushOperand(instr.Operand1);
16 | tr.Instructions.Add(new ILInstruction(ILOpCode.VCALL));
17 | }
18 | }
19 |
20 | public class NopHandler : ITranslationHandler {
21 | public IROpCode IRCode {
22 | get { return IROpCode.NOP; }
23 | }
24 |
25 | public void Translate(IRInstruction instr, ILTranslator tr) {
26 | tr.Instructions.Add(new ILInstruction(ILOpCode.NOP));
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/Compiler/IRCompilerAssemblyFinder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet;
3 |
4 | namespace KoiVM.VMIR.Compiler {
5 | public class IRCompilerAssemblyFinder : IAssemblyRefFinder {
6 | readonly ModuleDef module;
7 | readonly AssemblyDef corlib;
8 |
9 | public IRCompilerAssemblyFinder(ModuleDef module) {
10 | this.module = module;
11 | corlib = module.Context.AssemblyResolver.Resolve(module.CorLibTypes.AssemblyRef, module);
12 | }
13 |
14 | public AssemblyRef FindAssemblyRef(TypeRef nonNestedTypeRef) {
15 | if (corlib.Find(nonNestedTypeRef) != null) {
16 | return module.CorLibTypes.AssemblyRef;
17 | }
18 | return AssemblyRef.CurrentAssembly;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/IROpCode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace KoiVM.VMIR {
5 | [Obfuscation(Exclude = false, ApplyToMembers = false, Feature = "+rename(forceRen=true);")]
6 | public enum IROpCode {
7 | NOP,
8 |
9 | MOV,
10 | POP,
11 | PUSH,
12 | CALL,
13 | RET,
14 |
15 | NOR,
16 |
17 | CMP,
18 | JZ,
19 | JNZ,
20 | JMP,
21 | SWT,
22 |
23 | ADD,
24 | SUB, // Only for floats
25 | MUL,
26 | DIV,
27 | REM,
28 | SHR,
29 | SHL,
30 |
31 | FCONV,
32 | ICONV,
33 | SX,
34 |
35 | VCALL,
36 |
37 | TRY,
38 | LEAVE,
39 |
40 | Max,
41 |
42 | // Pseudo-Opcodes, will be eliminate by transforms
43 | __NOT,
44 | __AND,
45 | __OR,
46 | __XOR,
47 |
48 | __GETF,
49 | __SETF,
50 |
51 | __CALL,
52 | __CALLVIRT,
53 | __NEWOBJ,
54 | __BEGINCALL,
55 | __ENDCALL,
56 |
57 | __ENTRY,
58 | __EXIT,
59 |
60 | __LEAVE,
61 | __EHRET,
62 |
63 | __LDOBJ,
64 | __STOBJ,
65 |
66 | __GEN,
67 | __KILL,
68 |
69 | __LEA
70 | }
71 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/ITransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM.VMIR {
4 | public interface ITransform {
5 | void Initialize(IRTransformer tr);
6 | void Transform(IRTransformer tr);
7 | }
8 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/ITranslationHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet.Emit;
3 | using KoiVM.AST.ILAST;
4 | using KoiVM.AST.IR;
5 |
6 | namespace KoiVM.VMIR {
7 | public interface ITranslationHandler {
8 | Code ILCode { get; }
9 | IIROperand Translate(ILASTExpression expr, IRTranslator tr);
10 | }
11 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/RegAlloc/BlockLiveness.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using KoiVM.AST.IR;
4 |
5 | namespace KoiVM.VMIR.RegAlloc {
6 | public class BlockLiveness {
7 | BlockLiveness(HashSet inLive, HashSet outLive) {
8 | InLive = inLive;
9 | OutLive = outLive;
10 | }
11 |
12 | public HashSet InLive { get; private set; }
13 | public HashSet OutLive { get; private set; }
14 |
15 | internal static BlockLiveness Empty() {
16 | return new BlockLiveness(new HashSet(), new HashSet());
17 | }
18 |
19 | internal BlockLiveness Clone() {
20 | return new BlockLiveness(new HashSet(InLive), new HashSet(OutLive));
21 | }
22 |
23 | public override string ToString() {
24 | return string.Format("In=[{0}], Out=[{1}]", string.Join(", ", InLive), string.Join(", ", OutLive));
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/Transforms/GetSetFlagTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST.IR;
3 |
4 | namespace KoiVM.VMIR.Transforms {
5 | public class GetSetFlagTransform : ITransform {
6 | public void Initialize(IRTransformer tr) {
7 | }
8 |
9 | public void Transform(IRTransformer tr) {
10 | tr.Instructions.VisitInstrs(VisitInstr, tr);
11 | }
12 |
13 | void VisitInstr(IRInstrList instrs, IRInstruction instr, ref int index, IRTransformer tr) {
14 | if (instr.OpCode == IROpCode.__GETF) {
15 | instrs.Replace(index, new[] {
16 | new IRInstruction(IROpCode.MOV, instr.Operand1, IRRegister.FL, instr),
17 | new IRInstruction(IROpCode.__AND, instr.Operand1, instr.Operand2, instr)
18 | });
19 | }
20 | else if (instr.OpCode == IROpCode.__SETF) {
21 | instrs.Replace(index, new[] {
22 | new IRInstruction(IROpCode.__OR, IRRegister.FL, instr.Operand1, instr)
23 | });
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/Transforms/LeaTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using KoiVM.AST.IR;
4 |
5 | namespace KoiVM.VMIR.Transforms {
6 | public class LeaTransform : ITransform {
7 | public void Initialize(IRTransformer tr) {
8 | }
9 |
10 | public void Transform(IRTransformer tr) {
11 | tr.Instructions.VisitInstrs(VisitInstr, tr);
12 | }
13 |
14 | void VisitInstr(IRInstrList instrs, IRInstruction instr, ref int index, IRTransformer tr) {
15 | if (instr.OpCode == IROpCode.__LEA) {
16 | var source = (IRPointer)instr.Operand2;
17 | var target = instr.Operand1;
18 | Debug.Assert(source.Register == IRRegister.BP);
19 | instrs.Replace(index, new[] {
20 | new IRInstruction(IROpCode.MOV, target, IRRegister.BP, instr),
21 | new IRInstruction(IROpCode.ADD, target, IRConstant.FromI4(source.Offset), instr)
22 | });
23 | }
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/Transforms/MarkReturnRegTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.AST;
3 | using KoiVM.AST.IR;
4 |
5 | namespace KoiVM.VMIR.Transforms {
6 | public class MarkReturnRegTransform : ITransform {
7 | public void Initialize(IRTransformer tr) {
8 | }
9 |
10 | public void Transform(IRTransformer tr) {
11 | tr.Instructions.VisitInstrs(VisitInstr, tr);
12 | }
13 |
14 | void VisitInstr(IRInstrList instrs, IRInstruction instr, ref int index, IRTransformer tr) {
15 | var callInfo = instr.Annotation as InstrCallInfo;
16 | if (callInfo == null || callInfo.ReturnValue == null)
17 | return;
18 |
19 | if (instr.Operand1 is IRRegister && ((IRRegister)instr.Operand1).SourceVariable == callInfo.ReturnValue) {
20 | callInfo.ReturnRegister = (IRRegister)instr.Operand1;
21 | }
22 | else if (instr.Operand1 is IRPointer && ((IRPointer)instr.Operand1).SourceVariable == callInfo.ReturnValue) {
23 | callInfo.ReturnSlot = (IRPointer)instr.Operand1;
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/Transforms/MetadataTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using dnlib.DotNet;
3 | using KoiVM.AST.IR;
4 |
5 | namespace KoiVM.VMIR.Transforms {
6 | public class MetadataTransform : ITransform {
7 | public void Initialize(IRTransformer tr) {
8 | }
9 |
10 | public void Transform(IRTransformer tr) {
11 | tr.Instructions.VisitInstrs(VisitInstr, tr);
12 | }
13 |
14 | void VisitInstr(IRInstrList instrs, IRInstruction instr, ref int index, IRTransformer tr) {
15 | instr.Operand1 = TransformMD(instr.Operand1, tr);
16 | instr.Operand2 = TransformMD(instr.Operand2, tr);
17 | }
18 |
19 | IIROperand TransformMD(IIROperand operand, IRTransformer tr) {
20 | if (operand is IRMetaTarget) {
21 | var target = (IRMetaTarget)operand;
22 | if (!target.LateResolve) {
23 | if (!(target.MetadataItem is IMemberRef))
24 | throw new NotSupportedException();
25 | return IRConstant.FromI4((int)tr.VM.Data.GetId((IMemberRef)target.MetadataItem));
26 | }
27 | }
28 | return operand;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/Transforms/RegisterAllocationTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KoiVM.VMIR.RegAlloc;
3 |
4 | namespace KoiVM.VMIR.Transforms {
5 | public class RegisterAllocationTransform : ITransform {
6 | RegisterAllocator allocator;
7 |
8 | public static readonly object RegAllocatorKey = new object();
9 |
10 | public void Initialize(IRTransformer tr) {
11 | allocator = new RegisterAllocator(tr);
12 | allocator.Initialize();
13 | tr.Annotations[RegAllocatorKey] = allocator;
14 | }
15 |
16 | public void Transform(IRTransformer tr) {
17 | allocator.Allocate(tr.Block);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/KoiVM/VMIR/TranslationHelpers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using KoiVM.AST;
4 | using KoiVM.AST.IR;
5 |
6 | namespace KoiVM.VMIR {
7 | public static class TranslationHelpers {
8 | public static void EmitCompareEq(IRTranslator tr, ASTType type, IIROperand a, IIROperand b) {
9 | if (type == ASTType.O || type == ASTType.ByRef ||
10 | type == ASTType.R4 || type == ASTType.R8) {
11 | tr.Instructions.Add(new IRInstruction(IROpCode.CMP, a, b));
12 | }
13 | else {
14 | // I4/I8/Ptr
15 | Debug.Assert(type == ASTType.I4 || type == ASTType.I8 || type == ASTType.Ptr);
16 | tr.Instructions.Add(new IRInstruction(IROpCode.CMP, a, b));
17 | }
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/KoiVM/VisitFunc.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace KoiVM {
4 | public delegate void VisitFunc(TList list, TInstr instr, ref int index, TState state);
5 | }
--------------------------------------------------------------------------------
/KoiVM/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
5 |
--------------------------------------------------------------------------------
/KoiVM/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/KoiVM/obj/Debug/KoiVM.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM/obj/Debug/KoiVM.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/KoiVM/obj/Debug/KoiVM.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM/obj/Debug/KoiVM.csproj.CopyComplete
--------------------------------------------------------------------------------
/KoiVM/obj/Debug/KoiVM.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | bdaf1a1f839cecb276f0ca8610906fd313fb4b6d
2 |
--------------------------------------------------------------------------------
/KoiVM/obj/Debug/KoiVM.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM/obj/Debug/KoiVM.dll
--------------------------------------------------------------------------------
/KoiVM/obj/Debug/KoiVM.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/KoiVM/obj/Debug/KoiVM.pdb
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AstroNet
2 | An obfuscator uses dnlib, Modded KoiVM on decryption methods.
3 | - "Metadata Attribute" protection.
4 | - "Methods Renamer" protection.
5 | - "Base64 String" protection.
6 | - "String Encryption" protection.
7 | - "Base64 String" protection.
8 | - "Virtualization" protection.
9 | - "Arithmetic" protection.
10 | - "Base64 String" protection.
11 | - "Control Flow" protection.
12 | - "Constant Melting" protection.
13 |
14 |
15 | 
16 | 
17 |
--------------------------------------------------------------------------------
/References/dnlibOld.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/References/dnlibOld.dll
--------------------------------------------------------------------------------
/VM.Core/Injection/InjectMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using dnlib.DotNet;
7 |
8 | namespace Core.Injection
9 | {
10 | class InjectMethods
11 | {
12 | public static void methodInjector(ModuleDefMD moduleDefMD)
13 | {
14 | int pos = 0;
15 | foreach (Protection.MethodData methodData in Protection.MethodProccesor.AllMethods)
16 | {
17 | methodData.position = pos;
18 | var cipherLen = (methodData.DecryptedBytes.Length / 16 + 1) * 16;
19 | methodData.cipherSize = cipherLen;
20 | Console.WriteLine("injecting");
21 | Injection.InjectInitialise.InjectMethod(moduleDefMD, methodData.Method, methodData.position, methodData.ID, methodData.cipherSize);
22 |
23 |
24 | pos += cipherLen;
25 |
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/VM.Core/Protection/MethodData.cs:
--------------------------------------------------------------------------------
1 | using dnlib.DotNet;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Core.Protection
9 | {
10 | public class MethodData
11 | {
12 | public MethodDef Method;//the methoddef
13 | public byte[] DecryptedBytes;//the decrypted bytes
14 | public byte[] EncryptedBytes;//the encrypted bytes
15 | public bool Converted = false;//check to see if ive done conversion
16 | public bool Encrypted = false;//check to see if ive encrypted
17 | public int ID;//method ID
18 | public int size;//byte array size
19 | public int cipherSize;
20 | public int position;
21 | public MethodData(MethodDef methods)
22 | {
23 | Method = methods;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/VM.Core/Resources/ConversionBack.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/Resources/ConversionBack.dll
--------------------------------------------------------------------------------
/VM.Core/Resources/NativeEncoderx64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/Resources/NativeEncoderx64.dll
--------------------------------------------------------------------------------
/VM.Core/Resources/NativeEncoderx86.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/Resources/NativeEncoderx86.dll
--------------------------------------------------------------------------------
/VM.Core/Resources/XorMethod.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/Resources/XorMethod.bin
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
5 |
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | using System;
3 | using System.Reflection;
4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
5 |
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/Core.Properties.Resources.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/Core.Properties.Resources.resources
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/Core.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/Core.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/Core.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/Core.csproj.CopyComplete
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/Core.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 843a60fb1ed72f6544452ce5049e612fd70af422
2 |
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/Core.csproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/Core.csproj.GenerateResource.cache
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/Core.csprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/Core.csprojAssemblyReference.cache
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/Core.csprojResolveAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/Core.csprojResolveAssemblyReference.cache
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/Core.dll
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/Core.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/Core.pdb
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 01785de8d7886110443c35c94100e8fb8fb1f4d3
2 |
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/VM.Core.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/VM.Core.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/VM.Core.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/VM.Core.csproj.CopyComplete
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/VM.Core.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 365b563b77f6dbefb0a6239d8321952302d31b04
2 |
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/VM.Core.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Bin\Core.dll
2 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Bin\Core.pdb
3 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Core\obj\Debug\VM.Core.csproj.AssemblyReference.cache
4 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Core\obj\Debug\Core.Properties.Resources.resources
5 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Core\obj\Debug\VM.Core.csproj.GenerateResource.cache
6 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Core\obj\Debug\VM.Core.csproj.CoreCompileInputs.cache
7 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Core\obj\Debug\VM.Core.csproj.CopyComplete
8 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Core\obj\Debug\Core.dll
9 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Core\obj\Debug\Core.pdb
10 |
--------------------------------------------------------------------------------
/VM.Core/obj/Debug/VM.Core.csproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Debug/VM.Core.csproj.GenerateResource.cache
--------------------------------------------------------------------------------
/VM.Core/obj/Release/CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 2aa128dee006d6d0d584625ceb23ac2f9031c769
2 |
--------------------------------------------------------------------------------
/VM.Core/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/VM.Core/obj/Release/TempPE/Properties.Resources.Designer.cs.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Core/obj/Release/TempPE/Properties.Resources.Designer.cs.dll
--------------------------------------------------------------------------------
/VM.Runtime/ExceptionHandlers/ExceptionHandlerClass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace ConversionBack
6 | {
7 | //Exception handler class from the byte array
8 | public class ExceptionHandlerClass
9 | {
10 | public Type CatchType;
11 | public int FilterStart;
12 | public int HandlerEnd;
13 | public int HandlerStart;
14 | public int HandlerType;
15 | public int TryEnd;
16 | public int TryStart;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/VM.Runtime/ExceptionHandlers/FixedExceptionHandlerClass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace ConversionBack
6 | {
7 | //fixed exception handlers for handlers that start on the same instruction
8 | public class FixedExceptionHandlersClass
9 | {
10 | public List CatchType = new List();
11 | public int FilterStart;
12 | public int HandlerEnd;
13 | public List HandlerStart = new List();
14 | public int HandlerType;
15 | public int TryEnd;
16 | public int TryStart;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Add.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 |
5 | namespace VMExample.Instructions
6 | {
7 | class Add:Base
8 | {
9 | public override void emu()
10 | {
11 | var val2 = All.val.valueStack.Pop();
12 | var val1 = All.val.valueStack.Pop();
13 | All.val.valueStack.Push((int)val1 + (int)val2);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Base.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 |
5 | namespace VMExample.Instructions
6 | {
7 | public abstract class Base
8 | {
9 | public abstract void emu();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Br.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Br : Base
10 | {
11 | public override void emu()
12 | {
13 | var a = All.binr.ReadInt32();
14 | All.binr.BaseStream.Position = a;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Brfalse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 |
5 | namespace VMExample.Instructions
6 | {
7 | class Brfalse : Base
8 | {
9 | public override void emu()
10 | {
11 | var pos = All.binr.ReadInt32();
12 | var val = All.val.valueStack.Pop();
13 | if ((int)val == 0)
14 | All.binr.BaseStream.Position = pos;
15 | else
16 | {
17 | return;
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Brtrue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Brtrue : Base
10 | {
11 | public override void emu()
12 | {
13 | var pos = All.binr.ReadInt32();
14 | var val = All.val.valueStack.Pop();
15 | if ((int)val != 0)
16 | All.binr.BaseStream.Position = pos;
17 | else
18 | {
19 | return;
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Call.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Reflection;
5 | using System.Text;
6 |
7 |
8 | namespace VMExample.Instructions
9 | {
10 | class Call : Base
11 | {
12 | public override void emu()
13 | {
14 | var mdtoken = All.binr.ReadInt32();
15 | MethodBase metho = All.mod.ResolveMethod(mdtoken);
16 | if (metho.IsStatic)
17 | {
18 | object[] typ = new Object[metho.GetParameters().Length];
19 | for (int i = 0; i < typ.Length; i++)
20 | {
21 | typ[i] = All.val.valueStack.Pop();
22 | }
23 | if (!((MethodInfo) metho).ReturnType.ToString().Contains("System.Void"))
24 | {
25 | All.val.valueStack.Push(metho.Invoke(null, typ));
26 | }
27 | else
28 | {
29 | metho.Invoke(null, typ);
30 | }
31 | }
32 |
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Callvirt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Reflection;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Callvirt : Base
10 | {
11 | public static Dictionary cache = new Dictionary();
12 | public override void emu()
13 | {
14 | var mdtoken = All.binr.ReadInt32();
15 |
16 |
17 |
18 | var typ = new object[2];
19 | for (int i = typ.Length; i > 0; i--)
20 | {
21 | typ[i-1] = All.val.valueStack.Pop();
22 |
23 | }
24 |
25 |
26 | var type =(Random) All.val.valueStack.Pop();
27 |
28 | var a =type.Next(0, 250);
29 | All.val.valueStack.Push(a);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Ceq.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Ceq : Base
10 | {
11 | public override void emu()
12 | {
13 | var val1 = All.val.valueStack.Pop();
14 | var val2 = All.val.valueStack.Pop();
15 | All.val.valueStack.Push(val1 == val2 ? 1 : 0);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Clt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Clt : Base
10 | {
11 | public override void emu()
12 | {
13 | var value2 = All.val.valueStack.Pop();
14 | var value1 = All.val.valueStack.Pop();
15 | if ((int)value1 < (int)value2)
16 | {
17 |
18 | All.val.valueStack.Push(1);
19 | }
20 | else
21 | {
22 | All.val.valueStack.Push(0);
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/ConvI4.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class ConvI4 : Base
10 | {
11 | public override void emu()
12 | {
13 | var val = All.val.valueStack.Pop();
14 | All.val.valueStack.Push((int)val);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/ConvU1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class ConvU1 : Base
10 | {
11 | public override void emu()
12 | {
13 | var val = All.val.valueStack.Pop();
14 | byte bt = Convert.ToByte( val);
15 | All.val.valueStack.Push((int)bt);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Ldarg.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Ldarg : Base
10 | {
11 | public override void emu()
12 | {
13 | var index = All.binr.ReadInt32();
14 |
15 | All.val.valueStack.Push(All.val.parameters[index]);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Ldc.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Ldc : Base
10 | {
11 | public override void emu()
12 | {
13 | var val =All.binr.ReadInt32();
14 | All.val.valueStack.Push(val);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/LdelemU1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class LdelemU1 : Base
10 | {
11 | public override void emu()
12 | {
13 | var value = All.val.valueStack.Pop();
14 | var array =(byte[]) All.val.valueStack.Pop();
15 | All.val.valueStack.Push(array[(int)value]);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Ldlen.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Ldlen : Base
10 | {
11 | public override void emu()
12 | {
13 | byte[] dy2n =(byte[]) All.val.valueStack.Pop();
14 | All.val.valueStack.Push(dy2n.Length);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Ldloc.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Ldloc : Base
10 | {
11 | public override void emu()
12 | {
13 |
14 | var index = All.binr.ReadInt32();
15 | All.val.valueStack.Push(All.val.locals[index]) ;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Ldnull.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Ldnull : Base
10 | {
11 | public override void emu()
12 | {
13 | All.val.valueStack.Push(null);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Ldstr.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 | using IL_Emulator_Dynamic;
7 |
8 | namespace VMExample.Instructions
9 | {
10 | class Ldstr : Base
11 | {
12 | public override void emu()
13 | {
14 | string str = All.binr.ReadString();
15 | All.val.valueStack.Push(str);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/NewArr.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class NewArr : Base
10 | {
11 | public override void emu()
12 | {
13 | var amunt = All.val.valueStack.Pop();
14 | All.val.valueStack.Push(new byte[(int)amunt]);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/NewObj.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Reflection;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class NewObj : Base
10 | {
11 | public override void emu()
12 | {
13 | var mdtoken = All.binr.ReadInt32();
14 | ConstructorInfo metho = (ConstructorInfo) typeof(Random).GetConstructor(new Type[]{typeof(int)});
15 |
16 | object[] typ = new Object[metho.GetParameters().Length];
17 | for (int i = 0; i < typ.Length; i++)
18 | {
19 | typ[i] = All.val.valueStack.Pop();
20 |
21 | }
22 | var a = Activator.CreateInstance(metho.DeclaringType, typ);
23 | All.val.valueStack.Push(a);
24 |
25 |
26 |
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Nop.cs:
--------------------------------------------------------------------------------
1 | namespace VMExample.Instructions
2 | {
3 | class Nop : Base
4 | {
5 | public override void emu()
6 | {
7 |
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Pop.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Pop : Base
10 | {
11 | public override void emu()
12 | {
13 | dynamic var =All.val.valueStack.Pop();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Rem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Rem : Base
10 | {
11 | public override void emu()
12 | {
13 | var val2 =(int) All.val.valueStack.Pop();
14 | var val1 =(int) All.val.valueStack.Pop();
15 | var a = (int)val1 % val2;
16 | All.val.valueStack.Push(a);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/StelemI1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class StelemI1 : Base
10 | {
11 | public override void emu()
12 | {
13 | var value = All.val.valueStack.Pop();
14 | var index = All.val.valueStack.Pop();
15 | var array =(byte[]) All.val.valueStack.Pop();
16 | array[Convert.ToInt32(index)] =Convert.ToByte(Convert.ToInt32( value));
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/Stloc.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Text;
5 |
6 |
7 | namespace VMExample.Instructions
8 | {
9 | class Stloc : Base
10 | {
11 | public override void emu()
12 | {
13 | var val = All.val.valueStack.Pop();
14 | var index = All.binr.ReadInt32();
15 | All.val.locals[index] = val;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/VM.Runtime/OpCodes/ValueStack.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using System.Reflection;
5 | using System.Text;
6 |
7 |
8 |
9 | namespace IL_Emulator_Dynamic
10 | {
11 | public class ValueStack
12 | {
13 | public Stack