Results 1 to 14 of 14

Thread: [RESOLVED] Check if same app runs on other PC in local network

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Resolved [RESOLVED] Check if same app runs on other PC in local network

    Check if same app runs on other PC in local network

    I want to make a simple licensing system for my software.

    Up to now I use a quite outdated commercial system.
    This system can count the running copies in the local network.
    The license key holds the info e.g. 3 copies allowed.

    I have no clue how that works, but I need the same functionality.
    When my app runs, it has to set a marker somehow which can be read through the network.

    I don't know how.

    Any hints, or a basic sample somewhere?

    Thanks

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: Check if same app runs on other PC in local network

    1) Network-central-database. Each "client" must know where that Database/file is. Easy to spoof if you have access to the DB itself
    2) Winsock broadcast. Each "client" shouts into the network-world "I'm here", and each client listens to the network-world keeping a count of how many shouts there were (including his own). (though IMO that one should be easy to spoof --> Blocking ports? Don't remember if Winsock uses ports)
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  3. #3
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: Check if same app runs on other PC in local network

    Named pipe?

  4. #4
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: Check if same app runs on other PC in local network

    btw: my second approach above is not foolproof, either
    License for 3 clients
    2 Clients are running and shouting at each other
    3rd client is not running (!)
    4th client fires up, and gets accepted.....

    Bottom Line: The only foolproof way is to let "E.T. phone home", sending license key with MAC-Address.
    Though this implies a bit of work, if e.g. the licensed client gets installed on a new machine/receives hardware-upgrade (removing old MAC_address from your Database)
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  5. #5
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Check if same app runs on other PC in local network

    Guess that begs the question: is the intent to only have 3 computers with it installed period? With three being the number of the count, thou shant count two unless proceeding straight to three. Nor shall thy count four. Five is right out!
    Or is it limited to three _RUNNING_ at the same time?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: Check if same app runs on other PC in local network

    Quote Originally Posted by techgnome View Post
    Or is it limited to three _RUNNING_ at the same time?
    -tg
    "Running copies" (From OP) are running copies, so there is that.
    And you basically said the same as i did in post 4

    Guess that begs the question: is the intent to only have 3 computers with it installed period?
    Only possible if additional information is available/provided (e.g. MAC-Address), usually to the "vendor" of the Software.

    Think about how the Corporate Office-Licensing works: Company buys 100 Office-Licenses, and each User has to register with a unique identifier (usually his/her email-address) at Microsoft (Vendor!).
    Count of Users registered at MS reaches 100, the 101st User gets "Ooppps!" .... or the company receives a new invoice for the next batch of licenses......
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  7. #7
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: Check if same app runs on other PC in local network

    Quote Originally Posted by Karl77 View Post
    Check if same app runs on other PC in local network

    I want to make a simple licensing system for my software.

    Up to now I use a quite outdated commercial system.
    This system can count the running copies in the local network.
    The license key holds the info e.g. 3 copies allowed.

    I have no clue how that works, but I need the same functionality.
    When my app runs, it has to set a marker somehow which can be read through the network.

    I don't know how.

    Any hints, or a basic sample somewhere?

    Thanks
    There is nothing simple or basic about what you are looking to implement. If you are already using a component that does what you need, why do you think you need to stop using it and try to write your own?

    Outdated software that still works shouldn't be discarded simply because it is outdated. After all, you're still using VB6...

  8. #8
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: Check if same app runs on other PC in local network

    if u can setup a httpserver maybe it can work.
    requite u to have a smart system that is hard to crack.

    - there need to be an internet access or the exe will not start
    - each time the program starts, it will communicate with this httpserver, need to be encrypted
    - the first time the program communicate it could also send its unique identity (we could say: register)
    - each session need to be unique so it cant be emulated easily
    - the httpserver need to understand its from this network, to not get confused with other clients

    the importance is the communication that need to be encrypted in a way its hard to crack.

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: Check if same app runs on other PC in local network

    Thanks for your input.

    Network-central-database.
    It's not the kind of apps that work with a database.
    Also this kind of setup is too complicated for my customers.

    If you are already using a component that does what you need, why do you think you need to stop using it and try to write your own?
    1) The protection software can protect 32bit apps only.
    My goal is to have my apps in 64bit in 2-3 years (twinBasic).

    2) In a Win10 pre-release version there was a phase when none of the apps which used the protection system did work.
    I'm not very sure something like this could happen again.
    The manufacturer of the protection software doesn't exist anymore.

    "E.T. phone home", sending license key with MAC-Address.
    Though this implies a bit of work, if e.g. the licensed client gets installed on a new machine/receives hardware-upgrade (removing old MAC_address from your Database)
    I had a hardware locked license more than a decade ago.
    Caused nothing but trouble and unwanted work.
    Customer's shall be free to install the app wherever they want without further circumstances.

    ---

    Overall the licensing system doesn't have to be hard to crack.
    It will be cracked anyways.
    I want to make sure that in a company only the given count of licenses can be used.

  10. #10
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: Check if same app runs on other PC in local network

    Quote Originally Posted by Karl77 View Post
    I want to make sure that in a company only the given count of licenses can be used.
    Well, then my first answer (Post 2) the second option.
    You sell your client 10 licenses, he installs it on 20 machines, the moment 10 machines are up and running your program, the 11th (..to 20th) will be rejected

    EDIT: you would have to provide the allowed "count" in some form, maybe encrypted within your license-key
    Last edited by Zvoni; Nov 18th, 2022 at 02:54 AM.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  11. #11
    Junior Member
    Join Date
    Dec 2008
    Posts
    18

    Re: Check if same app runs on other PC in local network

    first of all ... there is a license ... so somehow ... the network needs to determine if it has license to run
    make a simple license server ... which sits on a pc which actually authenticates as licensed ...
    eg abcSrv.exe checks mac address and determines it has lets say 3 licenses
    now it listens on port xxx for request for verification of license ... it does a handshake ... with the calling program ... to determine if the calling program is authentic .. and at the same time the calling program determines that the server is authentic
    if everything is ok ... one license is leased ... the server may check from time to time ... or every time that someone requests a license ....
    depending on the application

    a financial program ... may check every time a transaction needs to be recorded ... also ... the server may determine the max date till which the transaction should be recorded ( the max date .. strictly works for financial transactions ... utilities etc ... can be invoked with date of the system set backwords ... but here "ET may phone home" to check the date)

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: Check if same app runs on other PC in local network

    Ok, understood:
    From the app I'll broadcast a message in an interval.
    From the same app I'll listen to the broadcasted messages and filter out the data I need.
    Sound simple... but I never had to do with Winsock up to now.


    I'm in the middle of trying to make a prototype.
    Sending is not a problem:

    Code:
    With Winsock1
        .Close
        .Protocol = sckUDPProtocol
        .RemoteHost = "255.255.255.255"
        .RemotePort = 444
        m = "AAAAAAAAAAAAAAAAAAAAAAA" & Time$
        .SendData m
    End With
    I checked in WireShark, the message is visible.

    In the receiving app I tried this:

    Code:
    With Winsock1
    .Close
    .Protocol = sckUDPProtocol
    .RemotePort = 444
    .Listen
    End With
    That's wrong, "Wrong protocol or connection state for the requested transaction or request."
    I already tried different attempts, like .LocalPort = 444 and other orders etc.

    Seems I simply don't really understand what to do.

    Can someone kick me to the right track?

  13. #13
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: Check if same app runs on other PC in local network

    Quote Originally Posted by Karl77 View Post
    Can someone kick me to the right track?
    http://www.solidautomation.com/bryon...al_Basic_6.htm
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: Check if same app runs on other PC in local network

    Tried that one before, but didn't work.

    Now I have found why:
    In the sending app, .Bind is wrong.

    Code:
    Private Sub Form_Load()
         Winsock1.Bind 420
    End Sub
    'Address in use' error.

    Not really knowing what I do, I commented the .Bind out.
    Works as expected now.

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width