├── .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 | ![Obfuscating](https://i.imgur.com/F4dQOZH.png) 16 | ![DnSpy](https://i.imgur.com/5yvkldT.png) 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 StackvalueStack = new Stack(); 14 | public object[] locals; 15 | public Dictionary fields = new Dictionary(); 16 | public object[] parameters; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /VM.Runtime/OpCodes/Xor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using System.Text; 5 | 6 | 7 | namespace VMExample.Instructions 8 | { 9 | class Xor : Base 10 | { 11 | public override void emu() 12 | { 13 | var val2 = All.val.valueStack.Pop(); 14 | var val1 = All.val.valueStack.Pop(); 15 | var a = Convert.ToByte(val1) ^ (int)val2; 16 | All.val.valueStack.Push(a); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /VM.Runtime/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.Runtime/obj/Debug/CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 93636441b298961b14ad4b7c6f21ee15e12282de 2 | -------------------------------------------------------------------------------- /VM.Runtime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Runtime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /VM.Runtime/obj/Debug/Runtime.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 30d6132fb1155f3f8cb70eebf3c2192c01b86188 2 | -------------------------------------------------------------------------------- /VM.Runtime/obj/Debug/Runtime.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Runtime/obj/Debug/Runtime.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /VM.Runtime/obj/Debug/Runtime.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Runtime/obj/Debug/Runtime.dll -------------------------------------------------------------------------------- /VM.Runtime/obj/Debug/Runtime.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Runtime/obj/Debug/Runtime.pdb -------------------------------------------------------------------------------- /VM.Runtime/obj/Debug/VM.Runtime.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 34fc5bef0e97fa88670fafbc49b7b2bdf1cb3939 2 | -------------------------------------------------------------------------------- /VM.Runtime/obj/Debug/VM.Runtime.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Bin\Runtime.dll 2 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Bin\Runtime.pdb 3 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Runtime\obj\Debug\VM.Runtime.csproj.CoreCompileInputs.cache 4 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Runtime\obj\Debug\Runtime.dll 5 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\VM.Runtime\obj\Debug\Runtime.pdb 6 | -------------------------------------------------------------------------------- /VM.Runtime/obj/Release/CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 93636441b298961b14ad4b7c6f21ee15e12282de 2 | -------------------------------------------------------------------------------- /VM.Runtime/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/VM.Runtime/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /dnlib/DotNet/Emit/ExceptionHandlerType.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet.Emit { 6 | /// 7 | /// Type of exception handler. See CorHdr.h/CorExceptionFlag 8 | /// 9 | [Flags] 10 | public enum ExceptionHandlerType { 11 | /// 12 | Catch = 0x0000, 13 | /// 14 | Filter = 0x0001, 15 | /// 16 | Finally = 0x0002, 17 | /// 18 | Fault = 0x0004, 19 | /// 20 | Duplicated = 0x0008, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dnlib/DotNet/Emit/Extensions.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Emit { 4 | /// 5 | /// Extension methods 6 | /// 7 | public static partial class Extensions { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dnlib/DotNet/Emit/FlowControl.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Emit { 4 | /// 5 | /// CIL opcode flow control 6 | /// 7 | public enum FlowControl { 8 | /// 9 | Branch, 10 | /// 11 | Break, 12 | /// 13 | Call, 14 | /// 15 | Cond_Branch, 16 | /// 17 | Meta, 18 | /// 19 | Next, 20 | /// 21 | Phi, 22 | /// 23 | Return, 24 | /// 25 | Throw, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /dnlib/DotNet/Emit/InvalidMethodException.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet.Emit { 6 | /// 7 | /// Thrown when invalid data is detected while parsing a .NET method 8 | /// 9 | [Serializable] 10 | public class InvalidMethodException : Exception { 11 | /// 12 | /// Default constructor 13 | /// 14 | public InvalidMethodException() { 15 | } 16 | 17 | /// 18 | /// Constructor 19 | /// 20 | /// Error message 21 | public InvalidMethodException(string msg) 22 | : base(msg) { 23 | } 24 | 25 | /// 26 | /// Constructor 27 | /// 28 | /// Error message 29 | /// The inner exception or null if none 30 | public InvalidMethodException(string msg, Exception innerException) 31 | : base(msg, innerException) { 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /dnlib/DotNet/Emit/OpCodeType.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Emit { 4 | /// 5 | /// CIL opcode type 6 | /// 7 | public enum OpCodeType : byte { 8 | /// 9 | Annotation, 10 | /// 11 | Macro, 12 | /// 13 | Nternal, 14 | /// 15 | Objmodel, 16 | /// 17 | Prefix, 18 | /// 19 | Primitive, 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /dnlib/DotNet/EventAttributes.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet { 6 | /// 7 | /// Event attributes, see CorHdr.h/CorEventAttr 8 | /// 9 | [Flags] 10 | public enum EventAttributes : ushort { 11 | /// event is special. Name describes how. 12 | SpecialName = 0x0200, 13 | /// Runtime(metadata internal APIs) should check name encoding. 14 | RTSpecialName = 0x0400, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /dnlib/DotNet/Extensions.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet { 4 | /// 5 | /// Extension methods 6 | /// 7 | public static partial class Extensions { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dnlib/DotNet/FileAttributes.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet { 6 | /// 7 | /// File row flags. See CorHdr.h/CorFileFlags 8 | /// 9 | [Flags] 10 | public enum FileAttributes : uint { 11 | /// This is not a resource file 12 | ContainsMetaData = 0x0000, 13 | /// This is a resource file or other non-metadata-containing file 14 | ContainsNoMetaData = 0x0001, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /dnlib/DotNet/GenericParamAttributes.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet { 6 | /// 7 | /// Generic parameter flags. See CorHdr.h/CorGenericParamAttr 8 | /// 9 | [Flags] 10 | public enum GenericParamAttributes : ushort { 11 | /// 12 | VarianceMask = 0x0003, 13 | /// 14 | NonVariant = 0x0000, 15 | /// 16 | Covariant = 0x0001, 17 | /// 18 | Contravariant = 0x0002, 19 | 20 | /// 21 | SpecialConstraintMask = 0x001C, 22 | /// 23 | NoSpecialConstraint = 0x0000, 24 | /// type argument must be a reference type 25 | ReferenceTypeConstraint = 0x0004, 26 | /// type argument must be a value type but not Nullable 27 | NotNullableValueTypeConstraint = 0x0008, 28 | /// type argument must have a public default constructor 29 | DefaultConstructorConstraint = 0x0010, 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /dnlib/DotNet/ITokenResolver.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet { 4 | /// 5 | /// Resolves tokens 6 | /// 7 | public interface ITokenResolver { 8 | /// 9 | /// Resolves a token 10 | /// 11 | /// The metadata token 12 | /// Generic parameter context 13 | /// A or null if is invalid 14 | IMDTokenProvider ResolveToken(uint token, GenericParamContext gpContext); 15 | } 16 | 17 | public static partial class Extensions { 18 | /// 19 | /// Resolves a token 20 | /// 21 | /// This 22 | /// The metadata token 23 | /// A or null if is invalid 24 | public static IMDTokenProvider ResolveToken(this ITokenResolver self, uint token) { 25 | return self.ResolveToken(token, new GenericParamContext()); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /dnlib/DotNet/IVariable.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet { 4 | /// 5 | /// Interface to access a local or a parameter 6 | /// 7 | public interface IVariable { 8 | /// 9 | /// Gets the variable type 10 | /// 11 | TypeSig Type { get; } 12 | 13 | /// 14 | /// Gets the 0-based position 15 | /// 16 | int Index { get; } 17 | 18 | /// 19 | /// Gets/sets the variable name 20 | /// 21 | string Name { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dnlib/DotNet/MD/HeapType.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.MD { 4 | /// 5 | /// Heap type. The values are set in stone by MS. Don't change. 6 | /// 7 | public enum HeapType : uint { 8 | /// #Strings heap 9 | Strings = 0, 10 | /// #GUID heap 11 | Guid = 1, 12 | /// #Blob heap 13 | Blob = 2, 14 | /// #US heap 15 | US = 3, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /dnlib/DotNet/MD/HotHeapVersion.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.MD { 4 | /// 5 | /// Hot heap version 6 | /// 7 | public enum HotHeapVersion { 8 | /// 9 | /// CLR 2.0 (.NET 2.0 - 3.5) 10 | /// 11 | CLR20, 12 | 13 | /// 14 | /// CLR 4.0 (.NET 4.0 - 4.5) 15 | /// 16 | CLR40, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /dnlib/DotNet/MD/MDStreamFlags.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet.MD { 6 | /// 7 | /// MDStream flags 8 | /// 9 | [Flags] 10 | public enum MDStreamFlags : byte { 11 | /// #Strings stream is big and requires 4 byte offsets 12 | BigStrings = 1, 13 | /// #GUID stream is big and requires 4 byte offsets 14 | BigGUID = 2, 15 | /// #Blob stream is big and requires 4 byte offsets 16 | BigBlob = 4, 17 | /// 18 | Padding = 8, 19 | /// 20 | DeltaOnly = 0x20, 21 | /// Extra data follows the row counts 22 | ExtraData = 0x40, 23 | /// Set if certain tables can contain deleted rows. The name column (if present) is set to "_Deleted" 24 | HasDelete = 0x80, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /dnlib/DotNet/MD/StorageFlags.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet.MD { 6 | /// 7 | /// Storage flags found in the MD header 8 | /// 9 | [Flags] 10 | public enum StorageFlags : byte { 11 | /// 12 | /// Normal flags 13 | /// 14 | Normal = 0, 15 | 16 | /// 17 | /// More data after the header but before the streams. 18 | /// 19 | /// The CLR will fail to load the file if this flag (or any other bits) is set. 20 | ExtraData = 1, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dnlib/DotNet/ManifestResourceAttributes.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet { 6 | /// 7 | /// ManifestResource flags. See CorHdr.h/CorManifestResourceFlags 8 | /// 9 | [Flags] 10 | public enum ManifestResourceAttributes : uint { 11 | /// 12 | VisibilityMask = 0x0007, 13 | /// The Resource is exported from the Assembly. 14 | Public = 0x0001, 15 | /// The Resource is private to the Assembly. 16 | Private = 0x0002, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /dnlib/DotNet/MemberMDInitializer.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System.Collections.Generic; 4 | using dnlib.Threading; 5 | 6 | namespace dnlib.DotNet { 7 | /// 8 | /// Methods to load properties to make sure they're initialized 9 | /// 10 | static class MemberMDInitializer { 11 | /// 12 | /// Read every collection element 13 | /// 14 | /// Collection element type 15 | /// Collection 16 | public static void Initialize(IEnumerable coll) { 17 | if (coll == null) 18 | return; 19 | foreach (var c in coll.GetSafeEnumerable()) { 20 | } 21 | } 22 | 23 | /// 24 | /// Load the object instance 25 | /// 26 | /// The value (ignored) 27 | public static void Initialize(object o) { 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /dnlib/DotNet/MethodOverride.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet { 4 | /// 5 | /// Describes which method some method implements 6 | /// 7 | public struct MethodOverride { 8 | /// 9 | /// The method body. Usually a but could be a 10 | /// 11 | public IMethodDefOrRef MethodBody; 12 | 13 | /// 14 | /// The method implements 15 | /// 16 | public IMethodDefOrRef MethodDeclaration; 17 | 18 | /// 19 | /// Constructor 20 | /// 21 | /// Method body 22 | /// The method implements 23 | public MethodOverride(IMethodDefOrRef methodBody, IMethodDefOrRef methodDeclaration) { 24 | this.MethodBody = methodBody; 25 | this.MethodDeclaration = methodDeclaration; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /dnlib/DotNet/MethodSemanticsAttributes.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet { 6 | /// 7 | /// Method semantics flags, see CorHdr.h/CorMethodSemanticsAttr 8 | /// 9 | [Flags] 10 | public enum MethodSemanticsAttributes : ushort { 11 | /// No bit is set 12 | None = 0, 13 | /// Setter for property 14 | Setter = 0x0001, 15 | /// Getter for property 16 | Getter = 0x0002, 17 | /// other method for property or event 18 | Other = 0x0004, 19 | /// AddOn method for event 20 | AddOn = 0x0008, 21 | /// RemoveOn method for event 22 | RemoveOn = 0x0010, 23 | /// Fire method for event 24 | Fire = 0x0020, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /dnlib/DotNet/ModuleKind.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet { 4 | /// 5 | /// Module kind 6 | /// 7 | public enum ModuleKind { 8 | /// 9 | /// Console UI module 10 | /// 11 | Console, 12 | 13 | /// 14 | /// Windows GUI module 15 | /// 16 | Windows, 17 | 18 | /// 19 | /// DLL module 20 | /// 21 | Dll, 22 | 23 | /// 24 | /// Netmodule (it has no assembly manifest) 25 | /// 26 | NetModule, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /dnlib/DotNet/NullResolver.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet { 4 | /// 5 | /// A resolver that always fails 6 | /// 7 | public sealed class NullResolver : IAssemblyResolver, IResolver { 8 | /// 9 | /// The one and only instance of this type 10 | /// 11 | public static readonly NullResolver Instance = new NullResolver(); 12 | 13 | NullResolver() { 14 | } 15 | 16 | /// 17 | public AssemblyDef Resolve(IAssembly assembly, ModuleDef sourceModule) { 18 | return null; 19 | } 20 | 21 | /// 22 | public bool AddToCache(AssemblyDef asm) { 23 | return true; 24 | } 25 | 26 | /// 27 | public bool Remove(AssemblyDef asm) { 28 | return false; 29 | } 30 | 31 | /// 32 | public void Clear() { 33 | } 34 | 35 | /// 36 | public TypeDef Resolve(TypeRef typeRef, ModuleDef sourceModule) { 37 | return null; 38 | } 39 | 40 | /// 41 | public IMemberForwarded Resolve(MemberRef memberRef) { 42 | return null; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /dnlib/DotNet/ParamAttributes.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet { 6 | /// 7 | /// Parameter flags. See CorHdr.h/CorParamAttr 8 | /// 9 | [Flags] 10 | public enum ParamAttributes : ushort { 11 | /// Param is [In] 12 | In = 0x0001, 13 | /// Param is [out] 14 | Out = 0x0002, 15 | /// Param is optional 16 | Optional = 0x0010, 17 | 18 | /// Param has default value. 19 | HasDefault = 0x1000, 20 | /// Param has FieldMarshal. 21 | HasFieldMarshal = 0x2000, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dnlib/DotNet/Pdb/Dss/SymbolDocumentWriter.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | using System.Diagnostics.SymbolStore; 5 | 6 | namespace dnlib.DotNet.Pdb.Dss { 7 | sealed class SymbolDocumentWriter : ISymbolDocumentWriter { 8 | readonly ISymUnmanagedDocumentWriter writer; 9 | 10 | public ISymUnmanagedDocumentWriter SymUnmanagedDocumentWriter { 11 | get { return writer; } 12 | } 13 | 14 | public SymbolDocumentWriter(ISymUnmanagedDocumentWriter writer) { 15 | this.writer = writer; 16 | } 17 | 18 | public void SetCheckSum(Guid algorithmId, byte[] checkSum) { 19 | writer.SetCheckSum(algorithmId, (uint)(checkSum == null ? 0 : checkSum.Length), checkSum); 20 | } 21 | 22 | public void SetSource(byte[] source) { 23 | writer.SetSource((uint)source.Length, source); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /dnlib/DotNet/Pdb/Managed/DbiNamespace.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | using System.Diagnostics.SymbolStore; 5 | 6 | namespace dnlib.DotNet.Pdb.Managed { 7 | sealed class DbiNamespace : ISymbolNamespace { 8 | public string Namespace { get; private set; } 9 | 10 | public DbiNamespace(string ns) { 11 | Namespace = ns; 12 | } 13 | 14 | #region ISymbolNamespace 15 | 16 | public string Name { 17 | get { return Namespace; } 18 | } 19 | 20 | public ISymbolNamespace[] GetNamespaces() { 21 | throw new NotImplementedException(); 22 | } 23 | 24 | public ISymbolVariable[] GetVariables() { 25 | throw new NotImplementedException(); 26 | } 27 | 28 | #endregion 29 | } 30 | } -------------------------------------------------------------------------------- /dnlib/DotNet/Pdb/Managed/DbiSourceLine.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Pdb.Managed { 4 | struct DbiSourceLine { 5 | public DbiDocument Document; 6 | public uint Offset; 7 | public uint LineBegin; 8 | public uint LineEnd; 9 | public uint ColumnBegin; 10 | public uint ColumnEnd; 11 | } 12 | } -------------------------------------------------------------------------------- /dnlib/DotNet/Pdb/Managed/ModuleStreamType.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Pdb.Managed { 4 | enum ModuleStreamType : uint { 5 | Symbols = 0xF1, 6 | Lines = 0xF2, 7 | StringTable = 0xF3, 8 | FileInfo = 0xF4, 9 | FrameData = 0xF5, 10 | InlineeLines = 0xF6, 11 | CrossScopeImports = 0xF7, 12 | CrossScopeExports = 0xF8, 13 | ILLines = 0xF9, 14 | FuncMDTokenMap = 0xFA, 15 | TypeMDTokenMap = 0xFB, 16 | MergedAssemblyInput = 0xFC, 17 | } 18 | } -------------------------------------------------------------------------------- /dnlib/DotNet/Pdb/Managed/MsfStream.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | using dnlib.IO; 5 | 6 | namespace dnlib.DotNet.Pdb.Managed { 7 | sealed class MsfStream { 8 | public MsfStream(IImageStream[] pages, uint length) { 9 | byte[] buf = new byte[length]; 10 | int offset = 0; 11 | foreach (var page in pages) { 12 | page.Position = 0; 13 | int len = Math.Min((int)page.Length, (int)(length - offset)); 14 | offset += page.Read(buf, offset, len); 15 | } 16 | Content = new MemoryImageStream(0, buf, 0, buf.Length); 17 | } 18 | 19 | public IImageStream Content { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /dnlib/DotNet/Pdb/Managed/PdbException.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet.Pdb.Managed { 6 | /// 7 | /// Exception that is thrown when encounters an error. 8 | /// 9 | [Serializable] 10 | public sealed class PdbException : Exception { 11 | /// 12 | /// Constructor 13 | /// 14 | /// Exception message 15 | public PdbException(string message) 16 | : base("Failed to read PDB: " + message) { 17 | } 18 | 19 | /// 20 | /// Constructor 21 | /// 22 | /// Inner exception 23 | public PdbException(Exception innerException) 24 | : base("Failed to read PDB: " + innerException.Message, innerException) { 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /dnlib/DotNet/Pdb/PdbImplType.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Pdb { 4 | /// 5 | /// PDB implementation type 6 | /// 7 | public enum PdbImplType { 8 | /// 9 | /// Use Microsoft's COM DLL (diasymreader.dll) 10 | /// 11 | MicrosoftCOM, 12 | 13 | /// 14 | /// Use the managed PDB reader 15 | /// 16 | Managed, 17 | 18 | /// 19 | /// Use the default PDB reader 20 | /// 21 | Default = Managed, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dnlib/DotNet/Pdb/SymbolWriterCreator.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System.IO; 4 | 5 | namespace dnlib.DotNet.Pdb { 6 | /// 7 | /// Creates a 8 | /// 9 | public static class SymbolWriterCreator { 10 | /// 11 | /// Creates a new instance 12 | /// 13 | /// PDB file name 14 | /// A new instance 15 | public static ISymbolWriter2 Create(string pdbFileName) { 16 | return Dss.SymbolWriterCreator.Create(pdbFileName); 17 | } 18 | 19 | /// 20 | /// Creates a new instance 21 | /// 22 | /// PDB output stream 23 | /// PDB file name 24 | /// A new instance 25 | public static ISymbolWriter2 Create(Stream pdbStream, string pdbFileName) { 26 | return Dss.SymbolWriterCreator.Create(pdbStream, pdbFileName); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /dnlib/DotNet/PropertyAttributes.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet { 6 | /// 7 | /// Property attributes, see CorHdr.h/CorPropertyAttr 8 | /// 9 | [Flags] 10 | public enum PropertyAttributes : ushort { 11 | /// property is special. Name describes how. 12 | SpecialName = 0x0200, 13 | /// Runtime(metadata internal APIs) should check name encoding. 14 | RTSpecialName = 0x0400, 15 | /// Property has default 16 | HasDefault = 0x1000, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /dnlib/DotNet/PublicKeyToken.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet { 4 | /// 5 | /// Represents a public key token 6 | /// 7 | public sealed class PublicKeyToken : PublicKeyBase { 8 | /// 9 | /// Gets the 10 | /// 11 | public override PublicKeyToken Token { 12 | get { return this; } 13 | } 14 | 15 | /// 16 | public PublicKeyToken() 17 | : base() { 18 | } 19 | 20 | /// 21 | public PublicKeyToken(byte[] data) 22 | : base(data) { 23 | } 24 | 25 | /// 26 | public PublicKeyToken(string hexString) 27 | : base(hexString) { 28 | } 29 | 30 | /// 31 | public override bool Equals(object obj) { 32 | if ((object)this == obj) 33 | return true; 34 | var other = obj as PublicKeyToken; 35 | if (other == null) 36 | return false; 37 | return Utils.Equals(Data, other.Data); 38 | } 39 | 40 | /// 41 | public override int GetHashCode() { 42 | return Utils.GetHashCode(Data); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /dnlib/DotNet/Resources/IResourceData.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System.IO; 4 | using System.Runtime.Serialization; 5 | using dnlib.IO; 6 | 7 | namespace dnlib.DotNet.Resources { 8 | /// 9 | /// Implemented by all resource data 10 | /// 11 | public interface IResourceData : IFileSection { 12 | /// 13 | /// Gets the type of data 14 | /// 15 | ResourceTypeCode Code { get; } 16 | 17 | /// 18 | /// Start offset of the section in the file 19 | /// 20 | new FileOffset StartOffset { get; set; } 21 | 22 | /// 23 | /// End offset of the section in the file. This is one byte after the last 24 | /// valid offset in the section. 25 | /// 26 | new FileOffset EndOffset { get; set; } 27 | 28 | /// 29 | /// Writes the data 30 | /// 31 | /// Writer 32 | /// Formatter if needed by implementer 33 | void WriteData(BinaryWriter writer, IFormatter formatter); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /dnlib/DotNet/Resources/ResourceElement.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Resources { 4 | /// 5 | /// Resource element 6 | /// 7 | public sealed class ResourceElement { 8 | /// 9 | /// Name of resource 10 | /// 11 | public string Name { get; set; } 12 | 13 | /// 14 | /// Data of resource 15 | /// 16 | public IResourceData ResourceData { get; set; } 17 | 18 | /// 19 | public override string ToString() { 20 | return string.Format("N: {0}, V: {1}", Name, ResourceData); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dnlib/DotNet/Resources/ResourceElementSet.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace dnlib.DotNet.Resources { 7 | /// 8 | /// Resource element set 9 | /// 10 | public sealed class ResourceElementSet { 11 | readonly Dictionary dict = new Dictionary(StringComparer.Ordinal); 12 | 13 | /// 14 | /// Gets the number of elements in the set 15 | /// 16 | public int Count { 17 | get { return dict.Count; } 18 | } 19 | 20 | /// 21 | /// Gets all resource elements 22 | /// 23 | public IEnumerable ResourceElements { 24 | get { return dict.Values; } 25 | } 26 | 27 | /// 28 | /// Adds a new resource to the set, overwriting any existing resource 29 | /// 30 | /// 31 | public void Add(ResourceElement elem) { 32 | dict[elem.Name] = elem; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /dnlib/DotNet/Resources/UserResourceType.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Resources { 4 | /// 5 | /// User resource type 6 | /// 7 | public sealed class UserResourceType { 8 | readonly string name; 9 | readonly ResourceTypeCode code; 10 | 11 | /// 12 | /// Full name including assembly of type 13 | /// 14 | public string Name { 15 | get { return name; } 16 | } 17 | 18 | /// 19 | /// User type code 20 | /// 21 | public ResourceTypeCode Code { 22 | get { return code; } 23 | } 24 | 25 | /// 26 | /// Constructor 27 | /// 28 | /// Full name including assembly of type 29 | /// User type code 30 | public UserResourceType(string name, ResourceTypeCode code) { 31 | this.name = name; 32 | this.code = code; 33 | } 34 | 35 | /// 36 | public override string ToString() { 37 | return string.Format("{0:X2} {1}", (int)code, name); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /dnlib/DotNet/WinMDStatus.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet { 4 | /// 5 | /// WinMD status 6 | /// 7 | public enum WinMDStatus { 8 | /// 9 | /// This is not a WinMD file 10 | /// 11 | None, 12 | 13 | /// 14 | /// This is a pure WinMD file (not managed) 15 | /// 16 | Pure, 17 | 18 | /// 19 | /// This is a managed WinMD file (created by eg. winmdexp.exe) 20 | /// 21 | Managed, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dnlib/DotNet/Writer/Extensions.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System.IO; 4 | 5 | namespace dnlib.DotNet.Writer { 6 | /// 7 | /// Extension methods 8 | /// 9 | public static partial class Extensions { 10 | /// 11 | /// Write zeros 12 | /// 13 | /// this 14 | /// Number of zeros 15 | public static void WriteZeros(this BinaryWriter writer, int count) { 16 | if (count <= 0x20) { 17 | for (int i = 0; i < count; i++) 18 | writer.Write((byte)0); 19 | } 20 | else 21 | writer.Write(new byte[count]); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /dnlib/DotNet/Writer/IHeap.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Writer { 4 | /// 5 | /// .NET Heap interface 6 | /// 7 | public interface IHeap : IChunk { 8 | /// 9 | /// Gets the name of the heap 10 | /// 11 | string Name { get; } 12 | 13 | /// 14 | /// Checks whether the heap is empty 15 | /// 16 | bool IsEmpty { get; } 17 | 18 | /// 19 | /// Called when the heap should be set to read-only mode 20 | /// 21 | void SetReadOnly(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dnlib/DotNet/Writer/IWriterError.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.DotNet.Writer { 4 | /// 5 | /// Gets notified of errors. The default handler should normally throw since the written data 6 | /// will probably be invalid. Any error can be ignored. 7 | /// 8 | public interface IWriterError { 9 | /// 10 | /// Called when an error is detected (eg. a null pointer or other invalid value). The error 11 | /// can be ignored but the written data won't be valid. 12 | /// 13 | /// Error message 14 | void Error(string message); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /dnlib/DotNet/Writer/ModuleWriterException.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.DotNet.Writer { 6 | /// 7 | /// Thrown when the module writer encounters an unrecoverable error 8 | /// 9 | [Serializable] 10 | public class ModuleWriterException : Exception { 11 | /// 12 | /// Default constructor 13 | /// 14 | public ModuleWriterException() { 15 | } 16 | 17 | /// 18 | /// Constructor 19 | /// 20 | /// Error message 21 | public ModuleWriterException(string message) 22 | : base(message) { 23 | } 24 | 25 | /// 26 | /// Constructor 27 | /// 28 | /// Error message 29 | /// Other exception 30 | public ModuleWriterException(string message, Exception innerException) 31 | : base(message, innerException) { 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /dnlib/ExtensionAttribute.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | #pragma warning disable 1591 // XML doc warning 4 | 5 | namespace System.Runtime.CompilerServices { 6 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] 7 | public sealed class ExtensionAttribute : Attribute { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dnlib/HandleProcessCorruptedStateExceptionsAttribute.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | #pragma warning disable 1591 // XML doc warning 4 | 5 | namespace System.Runtime.ExceptionServices { 6 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 7 | sealed class HandleProcessCorruptedStateExceptionsAttribute : Attribute { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dnlib/IO/FileOffset.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.IO { 4 | /// 5 | /// Represents a file offset 6 | /// 7 | public enum FileOffset : long { 8 | } 9 | 10 | partial class IOExtensions { 11 | /// 12 | /// Align up 13 | /// 14 | /// this 15 | /// Alignment 16 | public static FileOffset AlignUp(this FileOffset offset, uint alignment) { 17 | return (FileOffset)(((uint)offset + alignment - 1) & ~(alignment - 1)); 18 | } 19 | 20 | /// 21 | /// Align up 22 | /// 23 | /// this 24 | /// Alignment 25 | public static FileOffset AlignUp(this FileOffset offset, int alignment) { 26 | return (FileOffset)(((uint)offset + alignment - 1) & ~(alignment - 1)); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /dnlib/IO/IFileSection.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.IO { 4 | /// 5 | /// Represents a section in a file 6 | /// 7 | public interface IFileSection { 8 | /// 9 | /// Start offset of the section in the file 10 | /// 11 | FileOffset StartOffset { get; } 12 | 13 | /// 14 | /// End offset of the section in the file. This is one byte after the last 15 | /// valid offset in the section. 16 | /// 17 | FileOffset EndOffset { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /dnlib/IO/IOExtensions.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.IO { 4 | /// 5 | /// Extension methods 6 | /// 7 | public static partial class IOExtensions { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dnlib/PE/IPEType.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using dnlib.IO; 4 | 5 | namespace dnlib.PE { 6 | /// 7 | /// Converts a to/from an 8 | /// 9 | interface IPEType { 10 | /// 11 | /// Converts a to an 12 | /// 13 | /// The PEInfo context 14 | /// The file offset to convert 15 | /// The RVA 16 | RVA ToRVA(PEInfo peInfo, FileOffset offset); 17 | 18 | /// 19 | /// Converts an to a 20 | /// 21 | /// The PEInfo context 22 | /// The RVA to convert 23 | /// The file offset 24 | FileOffset ToFileOffset(PEInfo peInfo, RVA rva); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /dnlib/PE/PEExtensions.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System.IO; 4 | 5 | namespace dnlib.PE { 6 | /// 7 | /// Extension methods 8 | /// 9 | public static partial class PEExtensions { 10 | /// 11 | /// Calculates a PE checksum 12 | /// 13 | /// Reader 14 | /// Length of image 15 | /// Offset of checksum 16 | /// PE checksum 17 | internal static uint CalculatePECheckSum(this BinaryReader reader, long length, long checkSumOffset) { 18 | uint checkSum = 0; 19 | for (long i = 0; i < length; i += 2) { 20 | if (i == checkSumOffset) { 21 | reader.ReadUInt32(); 22 | i += 2; 23 | continue; 24 | } 25 | checkSum += reader.ReadUInt16(); 26 | checkSum = (ushort)(checkSum + (checkSum >> 16)); 27 | } 28 | ulong cks = (ulong)checkSum + (ulong)length; 29 | return (uint)cks + (uint)(cks >> 32); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /dnlib/PE/RVA.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.PE { 4 | /// 5 | /// Represents an RVA (relative virtual address) 6 | /// 7 | public enum RVA : uint { 8 | } 9 | 10 | partial class PEExtensions { 11 | /// 12 | /// Align up 13 | /// 14 | /// this 15 | /// Alignment 16 | public static RVA AlignUp(this RVA rva, uint alignment) { 17 | return (RVA)(((uint)rva + alignment - 1) & ~(alignment - 1)); 18 | } 19 | 20 | /// 21 | /// Align up 22 | /// 23 | /// this 24 | /// Alignment 25 | public static RVA AlignUp(this RVA rva, int alignment) { 26 | return (RVA)(((uint)rva + alignment - 1) & ~(alignment - 1)); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /dnlib/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System.Reflection; 4 | using System.Runtime.InteropServices; 5 | 6 | #if THREAD_SAFE 7 | [assembly: AssemblyTitle("dnlib (thread safe)")] 8 | #else 9 | [assembly: AssemblyTitle("dnlib")] 10 | #endif 11 | [assembly: AssemblyDescription(".NET assembly reader/writer")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("dnlib")] 15 | [assembly: AssemblyCopyright("Copyright (C) 2012-2015 de4dot@gmail.com")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | [assembly: ComVisible(false)] 19 | [assembly: AssemblyVersion("1.5.0.1500")] 20 | [assembly: AssemblyFileVersion("1.5.0.1500")] 21 | -------------------------------------------------------------------------------- /dnlib/Settings.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib { 4 | /// 5 | /// dnlib settings 6 | /// 7 | public static class Settings { 8 | /// 9 | /// true if dnlib is thread safe. (THREAD_SAFE was defined during compilation) 10 | /// 11 | public static bool IsThreadSafe { 12 | get { 13 | #if THREAD_SAFE 14 | return true; 15 | #else 16 | return false; 17 | #endif 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /dnlib/Threading/Extensions.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.Threading { 4 | /// 5 | /// Extension methods 6 | /// 7 | public static partial class Extensions { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dnlib/Threading/ICancellationToken.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | using System; 4 | 5 | namespace dnlib.Threading { 6 | /// 7 | /// Cancellation token interface 8 | /// 9 | public interface ICancellationToken { 10 | /// 11 | /// Throws a if the operation should be canceled 12 | /// 13 | void ThrowIfCancellationRequested(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /dnlib/Utils/Extensions.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.Utils { 4 | /// 5 | /// Extension methods 6 | /// 7 | public static partial class Extensions { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dnlib/Utils/MFunc.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.Utils { 4 | delegate T MFunc(); 5 | delegate U MFunc(T t); 6 | 7 | /// 8 | /// Same as Func delegate 9 | /// 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | public delegate V MFunc(T t, U u); 17 | } 18 | -------------------------------------------------------------------------------- /dnlib/W32Resources/ResourceDirectoryEntry.cs: -------------------------------------------------------------------------------- 1 | // dnlib: See LICENSE.txt for more info 2 | 3 | namespace dnlib.W32Resources { 4 | /// 5 | /// Base class of and 6 | /// 7 | public abstract class ResourceDirectoryEntry { 8 | ResourceName name; 9 | 10 | /// 11 | /// Gets/sets the name 12 | /// 13 | public ResourceName Name { 14 | get { return name; } 15 | set { name = value; } 16 | } 17 | 18 | /// 19 | /// Constructor 20 | /// 21 | /// Name 22 | protected ResourceDirectoryEntry(ResourceName name) { 23 | this.name = name; 24 | } 25 | 26 | /// 27 | public override string ToString() { 28 | return name.ToString(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /dnlib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/dnlib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /dnlib/obj/Debug/dnlib.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 69c65c9361eca4d99cab0b05f406a9854df6c8c0 2 | -------------------------------------------------------------------------------- /dnlib/obj/Debug/dnlib.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/dnlib/obj/Debug/dnlib.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /dnlib/obj/Debug/dnlib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/dnlib/obj/Debug/dnlib.dll -------------------------------------------------------------------------------- /dnlib/obj/Debug/dnlib.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/dnlib/obj/Debug/dnlib.pdb -------------------------------------------------------------------------------- /dnlib/obj/Debug_ThreadSafe/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/dnlib/obj/Debug_ThreadSafe/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /dnlib/obj/Debug_ThreadSafe/dnlib.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | cda714ea26ae22989ef05bf209da971e32f595e0 2 | -------------------------------------------------------------------------------- /dnlib/obj/Debug_ThreadSafe/dnlib.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Debug\bin\dnlib.xml 2 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Debug\bin\dnlib.dll 3 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Debug\bin\dnlib.pdb 4 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Bin\dnlib.dll 5 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\Bin\dnlib.pdb 6 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\dnlib\obj\Debug_ThreadSafe\dnlib.csproj.CoreCompileInputs.cache 7 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\dnlib\obj\Debug_ThreadSafe\dnlib.dll 8 | D:\Reverse Engineering\dotNET Files\Coding Files\PROJECTS\AstroNet\dnlib\obj\Debug_ThreadSafe\dnlib.pdb 9 | -------------------------------------------------------------------------------- /dnlib/obj/Debug_ThreadSafe/dnlib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/dnlib/obj/Debug_ThreadSafe/dnlib.dll -------------------------------------------------------------------------------- /dnlib/obj/Debug_ThreadSafe/dnlib.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lckt0/AstroNet/33df6998f6f5f87f1ba41cbb527b3a219bd6739d/dnlib/obj/Debug_ThreadSafe/dnlib.pdb --------------------------------------------------------------------------------