Giter Site home page Giter Site logo

Comments (1)

wiresock avatar wiresock commented on June 3, 2024

The process name matching functionality is encapsulated in the match_app_name function as detailed below:

/**
 * @brief Matches an application name pattern against process details.
 *
 * This function determines whether the provided application name pattern is part of the process's path or name. 
 * It first checks if the pattern contains a path by searching for "/" or "\\". If a path is present, 
 * it matches the pattern against the process's path_name; otherwise, it matches against the process's name.
 * The matching process is case-insensitive.
 *
 * @param app The application name or pattern to match against the process details.
 * @param process The process details being matched against the application pattern.
 * @return True if the process details match the application pattern, False otherwise.
 */
static bool match_app_name(const std::wstring& app, const std::shared_ptr<iphelper::network_process>& process)
{
    return (app.find(L'\\') != std::wstring::npos || app.find(L'/') != std::wstring::npos)
        ? (to_upper(process->path_name).find(app) != std::wstring::npos)
        : (to_upper(process->name).find(app) != std::wstring::npos);
}

Passing an empty string to the app parameter might act as a wildcard, potentially matching any process. However, this behavior hasn't been explicitly tested.

from proxifyre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.