Limit process to one instance. menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    mixtape's Avatar Private
    Reputation
    1
    Join Date
    May 2012
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Limit process to one instance.

    What is a good way to limit a process to a single instance. As in attempting to start another process while one is already running it could detect this..?

    I'm looking for something un-obvious like checking the process list.

    Limit process to one instance.
  2. #2
    sitnspinlock's Avatar Elite User CoreCoins Purchaser
    Reputation
    398
    Join Date
    Sep 2010
    Posts
    439
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not checking the process list makes it sound as if you don't want it hacked? ;p

    you have a great deal of options but not many that are going to stump a veteran. here are some i can think of at the moment:

    try a named synchronization object like a mutex or event. maybe even a section object, those seem to be popular methods.
    Last edited by sitnspinlock; 12-03-2012 at 10:15 PM.

  3. #3
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Everything can be solved with a rootkit . If you are looking for a quick fix that will work its not going to be easy. I have seen some software you can buy that will do the trick with drivers.

  4. #4
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarkLinux View Post
    Everything can be solved with a rootkit . If you are looking for a quick fix that will work its not going to be easy. I have seen some software you can buy that will do the trick with drivers.
    Dude you try to shoot with a cannon on flies.

    Regex is the best mentioned method so far and very easy to implement. Of course does the method depend on the language you're using, so please tell us its name

  5. #5
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    on start-up, check if process is already running, and if so, exit current process?

    main () {
    _allProcesses = GetAllRunningProcesses();
    if _allProcesses.Contains (myAppName)
    Application.Exit();
    end if
    }

    edit: once your process has started, there should be 2 copies of 'myAppName' running -- check for .Contains() twice and exit on that ?
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

  6. #6
    Kanyle's Avatar Corporal
    Reputation
    9
    Join Date
    Jul 2011
    Posts
    19
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a mutex

  7. #7
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The common solution is to use a named mutex. Though like everdox said, it sounds like you're looking for something a little more 'stealthy'... Perhaps you could tell us why it needs to be 'un-obvious'?

  8. #8
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarkLinux View Post
    What if they change the name of the program and run it.... Do you think your method would work?
    Your question is rhetorical, you're basically saying "You're Wrong."

    You're right. I assumed* the program name wouldn't change, because, most don't. If that had been mentioned in the problem, my answer would have been different.
    Last edited by abuckau907; 12-04-2012 at 04:21 AM.
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

  9. #9
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by mixtape View Post
    What is a good way to limit a process to a single instance. As in attempting to start another process while one is already running it could detect this..?
    I'm looking for something un-obvious like checking the process list.
    Checking the task manager - any reason you mention doing it this way? It's unobvious, but for a reason - why do it?
    process1
    process1' <--second occurrence

    You say "could it detect this"<-- so you want process1 to 'detect' that process1' is loading/starting up, and kill it ? That's the hard way? Instead make process1' check if process1 is running, and if so, cancel loading. This is the 'usual' way to do it. Unless you have a specific reason to not do it this way? Use regex for string comparison if you want*

    example in vb.net
    Code:
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim _allProcesses() As Process = Process.GetProcesses()
            Dim _myAppName As String = Process.GetCurrentProcess.ProcessName
            Dim _foundOnce As Boolean = False
            For Each pp As Process In _allProcesses
                If pp.ProcessName = _myappname Then
                    If _foundOnce = False Then
                        'first occurance
                        _foundOnce = True
                    Else
                                Me.Exit() ''Application.Exit()
                    End If
                End If
            Next
            '' If you get here, there was no 2nd copy found.
            '' Continue as normal.
            '' ...
        End Sub
    
    *this assumes the process name is constant. If yours isn't, please give more project details and I'll try to update the demo.
    *if you're not on .Net you might have to code some of the Process() functions yourself - do you have a specific project/language in mind?
    c#
    Code:
            private void Form1_Load(object sender, EventArgs e)
            {
                Process[] _allProcesses = Process.GetProcesses();
                string _myAppName = Process.GetCurrentProcess().ProcessName; //.exe's filename
                bool _foundOnce = false;
                foreach (Process pp in _allProcesses)
                {
                    if (pp.ProcessName == _myAppName)
                    {
                    if (!_foundOnce)
                        _foundOnce = true;
                    else
                        this.Close(); //auto exit, no warning to user.
                    }
                }
                //if you get here, this is the only copy running. Continue as normal.
                //..
            }
    Last edited by abuckau907; 12-06-2012 at 10:53 AM.
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

  10. #10
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edit: removed flame
    Last edited by abuckau907; 12-05-2012 at 08:20 PM.
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

  11. #11
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by abuckau907 View Post
    Anyone else second that? I'll leave if I'm not wanted...


    BTW, he didn't say hide it from the task manager! ..he meant "pull the list of running processes from taskmanager.exe." --which is how the ppl are doing it in auto-it here. (I smell non-programmer) :F
    He is correct that few people here use VB, but not that you should leave. But your code may be skipped by most people (I didn't even read it, myself). Nothing personal.

  12. #12
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @namreeb: ok, not what I wanted to hear ofc, but thnx. Not taken, I wrote it for mixtape, not you --in my first post, i had a quazi-c pseudocode..i should have taken the extra 2 seconds to replace end if w/ } and wrap the if in ( )'s. I'll consider that next time I post code.
    Last edited by abuckau907; 12-05-2012 at 09:40 PM.
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

  13. #13
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edit: removed flame
    Last edited by abuckau907; 12-05-2012 at 08:16 PM.
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

  14. #14
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edit: removed flame
    Last edited by abuckau907; 12-05-2012 at 08:16 PM.
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

  15. #15
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @dark
    [I assume] he wasn't asking how to hide it from the task manager, or anything else hacker related?
    It's still back there on page 1,show me where it says he's trying to hide his process from the task manager? Or anything else 'hacker-ish.' If he had, my answer would have reflected that. --He just needs basic programming help! "unobvious" != "anti-hacker" --maybe* that is what he meant, but it's not really clearly defined in the post.
    My method works for what he asked for.. Your comment was rude and unwarranted. Just because YOU won't read it, doesn't mean the user who asked the question won't read it to help learn some core concept.


    edit: massive edits /flames removed
    Last edited by abuckau907; 12-05-2012 at 09:41 PM.
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

Page 1 of 2 12 LastLast

Similar Threads

  1. Ignore instance limit
    By rafen in forum World of Warcraft Exploits
    Replies: 23
    Last Post: 06-21-2008, 12:30 AM
  2. Bypassing the instance reset limit
    By regnarog in forum World of Warcraft Exploits
    Replies: 38
    Last Post: 04-06-2008, 05:43 AM
  3. dual-boxing(instancing) on ONE pc
    By raceboy404 in forum World of Warcraft Bots and Programs
    Replies: 33
    Last Post: 02-16-2008, 11:24 AM
  4. If I've made a whole instance or a Mall.. how do i put all the stuff in one .sql ?
    By Wheeze201 in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 12-26-2007, 04:49 PM
  5. Possible:no limit on instance resets
    By lolister in forum World of Warcraft Exploits
    Replies: 7
    Last Post: 12-03-2007, 09:35 PM
All times are GMT -5. The time now is 12:06 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search