The Windows Registry also holds information regarding recently accessed files and considerable information about user activities, besides configuration information. Hence, this article serves the purpose is to provide you with a depth understanding of the Registry and Wealth of information it holds. Today most administrators and forensic analysts, the registry probably looks like the entrance to a dark.Windows RegistryThe system was largely managed by several files-specifically, autoexec.bat, config.sys, win.ini (on windows) and system.ini. So, various settings within these files determined what programs were loaded and how the system looked and responded to user input, a central hierarchical database that maintains configuration ... Read More
If we think an advance level of anti-virus has been installed on our computer, and we are fully secure as it performs a full system threat infection scan regularly. However, there may be instances where the scan did not detect any threat, or you cannot perform a scan. In these scenarios, we recommend that to notice the aggressive methods or symptoms to detect threats or attack.If it has been noticed an unwarranted presence of PowerShell in the task manager then our computer is definitely under attack.If a connection found to be established on port 4444 or 445 without your cognizance ... Read More
Runtime polymorphism has method overriding that is also known as dynamic binding or late binding. It is implemented by abstract classes and virtual functions.Abstract ClassesAbstract classes contain abstract methods, which are implemented by the derived class.Let us see an example of abstract classes that implements run time polymorphism −Example Live Demousing System; namespace PolymorphismApplication { abstract class Shape { public abstract int area(); } class Rectangle: Shape { private int length; private int width; public Rectangle( int a = 0, int b = 0) { ... Read More
In this tutorial, we will be discussing a program to understand coroutines in C/C++.Coroutines are control instructions which switch the execution control between two routines which returning any of them.Example Live Demo#include int range(int a, int b){ static long long int i; static int state = 0; switch (state){ case 0: state = 1; for (i = a; i < b; i++){ return i; //returning control case 1:; //resuming control } } state = 0; return 0; } int main(){ int i; for (; i=range(1, 5);) printf("control at main :%d", i); return 0; }Outputcontrol at main :1 control at main :2 control at main :3 control at main :4
In this tutorial, we will be discussing a program to create a C/C++ code formatting tool with the help of clang tools.SETUPsudo apt install python sudo apt install clang-format-3.5Then we will create a python file in location where the current user has read and write permissions.Exampleimport os cpp_extensions = (".cxx", ".cpp", ".c", ".hxx", ".hh", ".cc", ".hpp") for root, dirs, files in os.walk(os.getcwd()): for file in files: if file.endswith(cpp_extensions): os.system("clang-format-3.5 -i -style=file " + root + "/" + file)Create a file formatting file in the top directory of the current user.Outputclang-format-3.5 -style=google -dump-config ... Read More
In this tutorial, we will be discussing a program to count distinct consecutive sub-string of length two using C++ STL.For this we will provided with a string. Our task is to count and print all the unique substrings of length two from the given string.Example Live Demo#include using namespace std; void calc_distinct(string str){ map dPairs; for (int i=0; i
In this tutorial, we will be discussing a program to count inversions using set in C++ STL.Inversion count is a measure of how near the array is to be completely sorted. If the array is already sorted, the inversion count will be 0.Example Live Demo#include using namespace std; //returning inversion count int get_Icount(int arr[],int n){ multiset set1; set1.insert(arr[0]); int invcount = 0; //initializing result multiset::iterator itset1; for (int i=1; i
In this tutorial, we will be discussing a program to count the number of 1’s and 0’s in a binary array using STL in C++.For this we will be provided with an array. Our task is to count the number of 0’s and 1’s present in the array.Example Live Demo#include using namespace std; // checking if element is 1 or not bool isOne(int i){ if (i == 1) return true; else return false; } int main(){ int a[] = { 1, 0, 0, 1, 0, 0, 1 }; int n = sizeof(a) / sizeof(a[0]); int count_of_one = count_if(a, a + n, isOne); cout
In this tutorial, we will be discussing a program to count smaller elements on right side using set in C++ STL.For this we will be provided with an array. Our task is to construct a new array and add the number of smaller elements on the right side of the current element at its position.Example Live Demo#include using namespace std; void count_Rsmall(int A[], int len){ set s; int countSmaller[len]; for (int i = len - 1; i >= 0; i--) { s.insert(A[i]); auto it = s.lower_bound(A[i]); countSmaller[i] = ... Read More
In this tutorial, we will be discussing a program to count smaller elements in sorted array in C++.In this we will be given a number and our task is to count all the elements present in the sorted array which are smaller than the given number.Example Live Demo#include using namespace std; int countSmaller(int arr[], int n, int x){ return upper_bound(arr, arr+n, x) - arr; } int main(){ int arr[] = { 10, 20, 30, 40, 50 }; int n = sizeof(arr)/sizeof(arr[0]); cout