Using API calls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ANSWER

    #1

    Using API calls

    Hi,

    I have developed dictionary (Eng, Ger, Fra, Ita) in Access. The word list
    for each is in separate table (Eng_Ger), (Eng_Fra), (Eng_Ita).

    I want to protect my dict from unlegal copying with next procedure:

    examine and save the serial number of the hard drive using API calls.

    Q: Does anybody know this procedure to help me finish this project.

    Thanks


  • Terry Kreft

    #2
    Re: Using API calls

    ' In a module
    Private Declare Function GetVolumeInform ation _
    Lib "kernel32" Alias "GetVolumeInfor mationA" ( _
    ByVal lpRootPathName As String, ByVal lpVolumeNameBuf fer As String, _
    ByVal nVolumeNameSize As Long, lpVolumeSerialN umber As Long, _
    lpMaximumCompon entLength As Long, lpFileSystemFla gs As Long, _
    ByVal lpFileSystemNam eBuffer As String, _
    ByVal nFileSystemName Size As Long _
    ) As Long

    Function DriveSerialNumb er(RootPath As String) As String
    Dim lngret As Long
    Dim lpRootPathName As String
    Dim lpVolumeNameBuf fer As String
    Dim nVolumeNameSize As Long
    Dim lpVolumeSerialN umber As Long
    Dim lpMaximumCompon entLength As Long
    Dim lpFileSystemFla gs As Long
    Dim lpFileSystemNam eBuffer As String
    Dim nFileSystemName Size As Long

    ' lpVolumeSerialN umber = Space(250)

    lngret = GetVolumeInform ation(RootPath, lpVolumeNameBuf fer, _
    nVolumeNameSize , lpVolumeSerialN umber, _
    lpMaximumCompon entLength, lpFileSystemFla gs,
    _
    lpFileSystemNam eBuffer, nFileSystemName Size)

    DriveSerialNumb er = Hex(lpVolumeSer ialNumber)
    End Function


    'Sample call
    Dim strDriveSN
    strDriveSN = DriveSerialNumb er("C:\")

    --
    Terry Kreft
    MVP Microsoft Access


    "ANSWER" <ANSWER@ANSWER. com> wrote in message
    news:c81vfd$m9k $1@news.teol.ne t...[color=blue]
    > Hi,
    >
    > I have developed dictionary (Eng, Ger, Fra, Ita) in Access. The word list
    > for each is in separate table (Eng_Ger), (Eng_Fra), (Eng_Ita).
    >
    > I want to protect my dict from unlegal copying with next procedure:
    >
    > examine and save the serial number of the hard drive using API calls.
    >
    > Q: Does anybody know this procedure to help me finish this project.
    >
    > Thanks
    >
    >[/color]


    Comment

    • Emily Jones

      #3
      Re: Using API calls

      Really? Could you point me in the direction of those Chuck? Just for me to
      investigate. I use this technique on hand installed Access apps (compiled as
      MDEs and encrypted) in order to prevent casual copying. I'd like to know if
      this is as trivial to bypass as your post suggests.

      Cheers, Emily

      "Chuck Grimsby" <c.grimsby@worl dnet.att.net.in valid> wrote in message
      news:ljkaa0hc8e png6cqogkbecmj1 m5ooved65@4ax.c om...[color=blue]
      >
      > Remember however, that this API call returns the name of the *Volume*
      > not the hard drive serial number. A volume can span disks, or only be
      > a portion of a disk, and it changes with each format. It's also
      > easily "spoofed" by a variety of utilities that trap the API call and
      > return whatever the user wants.
      >
      >
      > On Fri, 14 May 2004 12:09:44 +0100, "Terry Kreft"
      > <terry.kreft@mp s.co.uk> wrote:
      >[color=green]
      > >' In a module
      > >Private Declare Function GetVolumeInform ation _
      > > Lib "kernel32" Alias "GetVolumeInfor mationA" ( _
      > > ByVal lpRootPathName As String, ByVal lpVolumeNameBuf fer As String, _
      > > ByVal nVolumeNameSize As Long, lpVolumeSerialN umber As Long, _
      > > lpMaximumCompon entLength As Long, lpFileSystemFla gs As Long, _
      > > ByVal lpFileSystemNam eBuffer As String, _
      > > ByVal nFileSystemName Size As Long _
      > >) As Long
      > >
      > >Function DriveSerialNumb er(RootPath As String) As String
      > > Dim lngret As Long
      > > Dim lpRootPathName As String
      > > Dim lpVolumeNameBuf fer As String
      > > Dim nVolumeNameSize As Long
      > > Dim lpVolumeSerialN umber As Long
      > > Dim lpMaximumCompon entLength As Long
      > > Dim lpFileSystemFla gs As Long
      > > Dim lpFileSystemNam eBuffer As String
      > > Dim nFileSystemName Size As Long
      > >
      > >' lpVolumeSerialN umber = Space(250)
      > >
      > > lngret = GetVolumeInform ation(RootPath, lpVolumeNameBuf fer, _
      > > nVolumeNameSize , lpVolumeSerialN umber, _
      > > lpMaximumCompon entLength,[/color][/color]
      lpFileSystemFla gs,[color=blue][color=green]
      > >_
      > > lpFileSystemNam eBuffer,[/color][/color]
      nFileSystemName Size)[color=blue][color=green]
      > >
      > > DriveSerialNumb er = Hex(lpVolumeSer ialNumber)
      > >End Function
      > >
      > >
      > >'Sample call
      > >Dim strDriveSN
      > >strDriveSN = DriveSerialNumb er("C:\")[/color]
      >[/color]


      Comment

      • Emily Jones

        #4
        Re: Using API calls

        "Chuck Grimsby" <c.grimsby@worl dnet.att.net.in valid> wrote in message
        news:ghuba0dp9r 3sgtmoub5pgi72u jtcna7e05@4ax.c om...[color=blue]
        >
        > Any good download site should have a few programs to change the volume
        > serial number without re-formatting. There isn't one I "like" since I
        > really haven't had a need for these sort of utilities for quite some
        > time now.
        >
        > At one point in time, both Partition Magic and Norton Utilities had
        > the capability of changing the volume serial number whenever you
        > wanted, although it's been a long time since I looked at either of
        > those programs as well.
        >
        > Any self-respecting "hacker"/"cracker" site will also have a few, as
        > well as utilities to trap the API call.
        >
        > You may also want to spend some time at google.groups and see all the
        > previous discussions on this topic. As you'll discover from other
        > people's posts, it *is* that trivial.[/color]

        Thanks Chuck. Doesn't worry me too much. As the user has first got to work
        out that that's what I've done. The message box doesn't say - "You have
        attempted to install this Access database program on a hard disk that
        doesn't have the correct volume number" or anything so obvious. Just "Error
        blah blah, the application will now close".

        And if it's an MDE _and_ it's encrypted then it doesn't seem to be possible
        to discover what's happening.

        The volume number is hardcoded into a routine which is then checked from the
        OnOpen of various key forms. Of course I can only do this if I'm doing hand
        installs, or at least that I can re-create the MDE each time, having
        discovered the serial number.

        Emily.


        Comment

        • Emily Jones

          #5
          Re: Using API calls

          "Chuck Grimsby" <c.grimsby@worl dnet.att.net.in valid> wrote in message
          [color=blue]
          > Just FYI, one of the problems many Network Administrators have with
          > "protection " schemes like this is the one of disaster recovery. In a
          > disaster, programs that can only be installed to a specific place or
          > those where they have to contact someone in order to install or use a
          > program, tend to be the last to be recovered... if they are recovered
          > at all. Generally, the NAs have enough going on during a disaster to
          > have to deal with that as well. Assuming they *can* contact you![/color]

          Good advice. I'd not thought of that.
          [color=blue]
          > I've no idea what industry you work in, or how "mission critical" the
          > applications you develop are, however I would strongly encourage you
          > to find another protection scheme so that you will be ready for such
          > an occurrence. And you may also want to have a lawyer look at
          > whatever contract, license or other agreement you have with the
          > company(s) so that *you* are protected from law suits arising from
          > your protection scheme. You would not be the first programmer to lose
          > such a suit.
          >
          > In any protection scheme, regardless of just about anything, it's
          > important to remember that although the program may be your creation,
          > the data almost never is. Preventing access to someone else's data is
          > considered a form of "theft".[/color]

          In this case it's a FE/BE split with no protection on the BE, fairly obvious
          (to a developer) object names and relationships 'hard wired'. So they can
          still get at the data.

          Cheers, Emily


          Comment

          Working...