示例#1
0
        protected override void BeginProcessing()
        {
            Vtero.VerboseOutput      = false;
            Vtero.DiagOutput         = false;
            Vtero.DisableProgressBar = true;

            mdb = new MetaDB(VteroFolder, 0, Size);
        }
示例#2
0
        protected override void BeginProcessing()
        {
            var copts = new ConfigOptions();

            copts.IgnoreSaveData   = Force;
            copts.FileName         = InputFile;
            copts.VersionsToEnable = Mode;
            copts.VerboseOutput    = Vtero.VerboseOutput;
            copts.VerboseLevel     = Vtero.VerboseLevel;

            mdb = new MetaDB(VteroFolder, HashSize);

            var MemoryDumpSize = new FileInfo(InputFile).Length;
            //# Check StopWatch
            var runTime = Stopwatch.StartNew();
            //# since we are not ignoring SaveData, this just get's our state from
            //# the underlying protobuf, pretty fast
            var vtero    = Scan.Scanit(copts);
            var proc_arr = vtero.Processes.ToArray();
            var low_proc = proc_arr[0];

            foreach (var px in proc_arr)
            {
                if (px.CR3Value < low_proc.CR3Value)
                {
                    low_proc = px;
                }
            }
            var proc = low_proc;

            WriteColor(1, ConsoleColor.White, $"Assumed Kernel Proc: {proc}");
            vtero.KernelProc = proc;
            proc.MemAccess   = new Mem(vtero.MemAccess);
            if (vtero.KVS == null)
            {
                var kvs = proc.ScanAndLoadModules();
                vtero.KVS = kvs;
            }
            else
            {
                proc.LoadSymbols();
            }
            var kMinorVer = proc.GetSymValueLong("NtBuildNumber") & 0xffff;

            WriteColor(1, ConsoleColor.Cyan, $"Kernel version detected {kMinorVer}");
            var logicalList = vtero.CoreWalkProcessList(vtero.KernelProc);

            foreach (var p in vtero.Processes)
            {
                WriteColor(1, ConsoleColor.Cyan, $"{p}");
            }

            try { vtero.HashAllProcs(mdb, LocalBitmap, CloudBitmap); }
            catch (Exception ex) { WriteColor(ConsoleColor.Red, $"Exception in Hash Generation {ex} "); }

            WriteColor(1, ConsoleColor.Cyan, "Done");
        }
示例#3
0
 protected override void BeginProcessing()
 {
     mdb = new MetaDB(VteroFolder, HashSize, 0, BufferCount);
 }
        public bool DbFetchSheduller()
        {
            var BaseLocation = _Configuration["LocationsList:BaseLocation"];
            var LocationList = _Configuration.GetSection("LocationsList:ToLocations").GetChildren().Select(x => x.Value).ToArray();

            foreach (var item in LocationList)
            {
                DateTime DateStart = DateTime.Now;
                DateTime DateStop  = DateStart.AddDays(330);

                for (DateTime DateRunning = DateStart; DateRunning.Date < DateStop.Date; DateRunning = DateRunning.AddDays(1))
                {
                    FlightOfferSearchRQ     FlightOfferSearchRQ     = new FlightOfferSearchRQ();
                    OriginLocationCode      OriginLocationCode      = new OriginLocationCode();
                    DestinationLocationCode DestinationLocationCode = new DestinationLocationCode();
                    Pax Pax = new Pax();

                    OriginLocationCode.DepartureDate = DateRunning;
                    OriginLocationCode.IataCode      = BaseLocation;

                    DestinationLocationCode.IataCode = item;

                    FlightOfferSearchRQ.TravelClass  = "";
                    FlightOfferSearchRQ.NonStop      = true;
                    FlightOfferSearchRQ.CurrencyCode = "";

                    Pax.Adult = 1;

                    var SearchString = "flight-offers?originLocationCode=" + OriginLocationCode.IataCode + "&destinationLocationCode=" + DestinationLocationCode.IataCode + "&departureDate=" + OriginLocationCode.DepartureDate.ToString("yyyy-MM-dd") + "&adults=" + Pax.Adult + "&nonStop=" + FlightOfferSearchRQ.NonStop.ToString().ToLower() + "&max=250";

                    FlightOffersSearchRS FlightOffersSearchRS = _ISearchConnecterCaller.FlightOffersSearch(SearchString);

                    if (FlightOffersSearchRS == null)
                    {
                        int i = 0;
                        while (FlightOffersSearchRS == null && i < 3)
                        {
                            System.Threading.Thread.Sleep(1000);
                            FlightOffersSearchRS = _ISearchConnecterCaller.FlightOffersSearch(SearchString);
                            i++;
                        }
                    }

                    try
                    {
                        FlightOffersSearchDB FlightOffersSearchDBObj = new FlightOffersSearchDB();
                        MetaDB         MetaDBObj         = new MetaDB();
                        List <DatumDB> DatumDBList       = new List <DatumDB>();
                        DictionariesDB DictionariesDBObj = new DictionariesDB();

                        MetaDBObj.links = FlightOffersSearchRS.meta.links;
                        MetaDBObj.count = FlightOffersSearchRS.meta.count;
                        FlightOffersSearchDBObj.meta = MetaDBObj;

                        foreach (var Data in FlightOffersSearchRS.data)
                        {
                            DatumDB DatumDBObj = new DatumDB();
                            DatumDBObj.type   = Data.type;
                            DatumDBObj.id     = Data.id;
                            DatumDBObj.source = Data.source;
                            DatumDBObj.instantTicketingRequired = Data.instantTicketingRequired;
                            DatumDBObj.nonHomogeneous           = Data.nonHomogeneous;
                            DatumDBObj.oneWay                = Data.oneWay;
                            DatumDBObj.lastTicketingDate     = Data.lastTicketingDate;
                            DatumDBObj.numberOfBookableSeats = Data.numberOfBookableSeats;

                            List <ItineraryDB> ItineraryDBList = new List <ItineraryDB>();
                            foreach (var Itineraries in Data.itineraries)
                            {
                                ItineraryDB ItineraryDBObj = new ItineraryDB();
                                ItineraryDBObj.duration = Itineraries.duration;
                                List <SegmentDB> SegmentDBList = new List <SegmentDB>();

                                foreach (var Segments in Itineraries.segments)
                                {
                                    SegmentDB SegmentDBObj = new SegmentDB();
                                    SegmentDBObj.carrierCode     = Segments.carrierCode;
                                    SegmentDBObj.number          = Segments.number;
                                    SegmentDBObj.duration        = Segments.duration;
                                    SegmentDBObj.id              = Segments.id;
                                    SegmentDBObj.numberOfStops   = Segments.numberOfStops;
                                    SegmentDBObj.blacklistedInEU = Segments.blacklistedInEU;

                                    DepartureDB DepartureDBObj = new DepartureDB();
                                    DepartureDBObj.iataCode = Segments.departure.iataCode;
                                    DepartureDBObj.terminal = Segments.departure.terminal;
                                    DepartureDBObj.at       = Segments.departure.at;

                                    SegmentDBObj.departure = DepartureDBObj;

                                    ArrivalDB ArrivalDBObj = new ArrivalDB();
                                    ArrivalDBObj.iataCode = Segments.arrival.iataCode;
                                    ArrivalDBObj.terminal = Segments.arrival.terminal;
                                    ArrivalDBObj.at       = Segments.arrival.at;

                                    SegmentDBObj.arrival = ArrivalDBObj;

                                    AircraftDB AircraftDBObj = new AircraftDB();
                                    AircraftDBObj.code = Segments.aircraft.code;

                                    SegmentDBObj.aircraft = AircraftDBObj;

                                    OperatingDB OperatingDBObj = new OperatingDB();
                                    OperatingDBObj.carrierCode = Segments.operating.carrierCode;

                                    SegmentDBObj.operating = OperatingDBObj;

                                    SegmentDBList.Add(SegmentDBObj);
                                }
                                ItineraryDBObj.segments = SegmentDBList;
                                ItineraryDBList.Add(ItineraryDBObj);
                            }
                            DatumDBObj.itineraries = ItineraryDBList;

                            PriceDB PriceDBObj = new PriceDB();
                            PriceDBObj.currency   = Data.price.currency;
                            PriceDBObj.total      = Data.price.total;
                            PriceDBObj.@base      = Data.price.@base;
                            PriceDBObj.grandTotal = Data.price.grandTotal;

                            List <FeeDB> FeesDBList = new List <FeeDB>();
                            foreach (var Fees in Data.price.fees)
                            {
                                FeeDB FeesDB = new FeeDB();
                                FeesDB.amount = Fees.amount;
                                FeesDB.type   = Fees.type;
                                FeesDBList.Add(FeesDB);
                            }
                            PriceDBObj.fees = FeesDBList;

                            DatumDBObj.price = PriceDBObj;

                            PricingOptionsDB PricingOptionsDBobj = new PricingOptionsDB();
                            PricingOptionsDBobj.includedCheckedBagsOnly = Data.pricingOptions.includedCheckedBagsOnly;

                            foreach (var Fare in Data.pricingOptions.fareType)
                            {
                                PricingOptionsDBobj.fareType += Fare + ",";
                            }

                            DatumDBObj.pricingOptions = PricingOptionsDBobj;

                            foreach (var validatingAirlineCodes in Data.validatingAirlineCodes)
                            {
                                DatumDBObj.validatingAirlineCodes += validatingAirlineCodes + ",";
                            }

                            List <TravelerPricingDB> TravelerPricingDBList = new List <TravelerPricingDB>();
                            foreach (var TravelerPricings in Data.travelerPricings)
                            {
                                TravelerPricingDB TravelerPricingDBObj = new TravelerPricingDB();
                                TravelerPricingDBObj.travelerId   = TravelerPricings.travelerId;
                                TravelerPricingDBObj.fareOption   = TravelerPricings.fareOption;
                                TravelerPricingDBObj.travelerType = TravelerPricings.travelerType;

                                TravelPriceDB TravelPriceDBObj = new TravelPriceDB();
                                TravelPriceDBObj.currency  = TravelerPricings.price.currency;
                                TravelPriceDBObj.total     = TravelerPricings.price.total;
                                TravelPriceDBObj.@base     = TravelerPricings.price.@base;
                                TravelerPricingDBObj.price = TravelPriceDBObj;

                                List <FareDetailsBySegmentDB> FareDetailsBySegmentDBList = new List <FareDetailsBySegmentDB>();
                                foreach (var FareDetailsBySegment in TravelerPricings.fareDetailsBySegment)
                                {
                                    FareDetailsBySegmentDB FareDetailsBySegmentDBObj = new FareDetailsBySegmentDB();
                                    FareDetailsBySegmentDBObj.cabin     = FareDetailsBySegment.cabin;
                                    FareDetailsBySegmentDBObj.segmentId = FareDetailsBySegment.segmentId;
                                    FareDetailsBySegmentDBObj.fareBasis = FareDetailsBySegment.fareBasis;
                                    FareDetailsBySegmentDBObj.@class    = FareDetailsBySegment.@class;

                                    IncludedCheckedBagsDB IncludedCheckedBagsDBObj = new IncludedCheckedBagsDB();
                                    IncludedCheckedBagsDBObj.weight     = FareDetailsBySegment.includedCheckedBags.weight;
                                    IncludedCheckedBagsDBObj.weightUnit = FareDetailsBySegment.includedCheckedBags.weightUnit;

                                    FareDetailsBySegmentDBObj.includedCheckedBags = IncludedCheckedBagsDBObj;
                                    FareDetailsBySegmentDBList.Add(FareDetailsBySegmentDBObj);
                                }

                                TravelerPricingDBObj.fareDetailsBySegment = FareDetailsBySegmentDBList;
                                TravelerPricingDBList.Add(TravelerPricingDBObj);
                            }
                            DatumDBObj.travelerPricings = TravelerPricingDBList;
                            DatumDBList.Add(DatumDBObj);
                        }

                        FlightOffersSearchDBObj.data = DatumDBList;
                        DictionariesDB     DictionariesDBObjI = new DictionariesDB();
                        List <AircraftsDB> AircraftsDBList    = new List <AircraftsDB>();
                        List <CurenciesDB> CurenciesDBList    = new List <CurenciesDB>();
                        List <CarriersDB>  CarriersDBList     = new List <CarriersDB>();

                        foreach (KeyValuePair <string, string> entry in FlightOffersSearchRS.dictionaries.Aircraft)
                        {
                            AircraftsDB AircraftsDBObj = new AircraftsDB();
                            AircraftsDBObj.Details = entry.Key + "_ " + entry.Value;
                            AircraftsDBList.Add(AircraftsDBObj);
                        }

                        DictionariesDBObjI.Aircraft = AircraftsDBList;

                        foreach (KeyValuePair <string, string> entry in FlightOffersSearchRS.dictionaries.Currencies)
                        {
                            CurenciesDB CurenciesDBObj = new CurenciesDB();
                            CurenciesDBObj.Details = entry.Key + "_ " + entry.Value;
                            CurenciesDBList.Add(CurenciesDBObj);
                        }

                        DictionariesDBObjI.Currencies = CurenciesDBList;


                        foreach (KeyValuePair <string, string> entry in FlightOffersSearchRS.dictionaries.Carriers)
                        {
                            CarriersDB CarriersDBObj = new CarriersDB();
                            CarriersDBObj.Details = entry.Key + " _ " + entry.Value;
                            CarriersDBList.Add(CarriersDBObj);
                        }
                        DictionariesDBObjI.Carriers          = CarriersDBList;
                        FlightOffersSearchDBObj.dictionaries = DictionariesDBObjI;

                        _DatabaseContext.Add <FlightOffersSearchDB>(FlightOffersSearchDBObj);
                        _DatabaseContext.SaveChanges();
                    }
                    catch (Exception)
                    {
                        throw;
                    }
                }
            }
            return(true);
        }