Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Array of functions.
- Function func[functionArraySize];
- //Array of instructions to filter by. That is a function must contain all of these instructions to be added to the filtered vector.
- Instruction instructionSet[instructionSetSize];
- //Filtered functions.
- std::vector<Function> filteredFunctions;
- for(unsigned int i = 0; i < functionArraySize; i++){
- bool hasAllInstructions = true;
- for(unsigned int j = 0; j < instructionSetSize; j++){
- bool instructionFound = false;
- //Loop through the instructions of the function and look for a match.
- for(unsigned int k = 0; k < func[i].instructionCount; k++){
- if(func[i].instructions[k] == instructionSet[j]){
- instructionFound = true;
- }
- }
- hasAllInstructions &= instructionFound;
- }
- //If all of the instructions were found, add to the vector.
- if(hasAllInstructions){
- filteredFunctions.push_back(func[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment