Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Nov 14, 2019 9:18 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Serial No of hardware
PostPosted: Tue Mar 12, 2013 1:41 pm 
Offline
User avatar

Joined: Tue Mar 04, 2008 1:20 pm
Posts: 95
DaveS wrote:
WOW...

Quote:
What happens if the OS is not English? You will not get the correct results.
What happens if an update changes in the OS and breaks your code ?


Since when are Mac Addresses and Serial Numbers Language specific?
What happens if the next release of an OS breaks the existing API (don't say that won't happen..... think CARBON vs COCOA)

So ALL solutions have a risk..... don't like my solution... post one of your own please.... don't say "use the API"... show HOW to use the API... this way we all learn something



Windows MSDN and Apple developer network have lots of examples on how to do this. There is also Google.

In your Windows script you look for certain words in English, if the users system is not English then it will not return
the correct information. The Mac Address and Serial numbers will be wrong.

You are presuming all Windows systems are English in your code.

Just my observation :D

_________________
iMac 2011, OSX Mountain Lion 10.8.1, Real Studio 2012r2.1


Top
 Profile  
Reply with quote  
 Post subject: Re: Serial No of hardware
PostPosted: Wed Mar 13, 2013 2:41 pm 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
Balu_MS wrote:
To give restricted access to one of my programs I use the MAC-Number to identify the computer.
Unfortunately this number changes when the user swaps between Wi-Fi and LAN.
It would be helpful when I could read out the serial number of the hardware (which should be stable), but I have no clue how to do so.
Thanks for any helpful information on this topic.

Bernhard


you can use MBS plugins (http://monkeybreadsoftware.net) or ToringoDRMInfo (http://www.toringo.com/product/index.html)
or declare into this (windows):
http://msdn.microsoft.com/en-us/library ... 93(v=vs.85).aspx

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
 Post subject: Re: Serial No of hardware
PostPosted: Thu Mar 14, 2013 5:03 pm 
Offline
User avatar

Joined: Sat Apr 02, 2011 1:20 pm
Posts: 92
Location: Netherlands
Please do not use the MAC-address for recognition. It is possibly the easiest thing to spoof. If protecting your software is that important, I guess customers will not hesitate to do this. You would even be better of checking for ip-adresses (I also don't recommend this).
Why not use the email address in a serial number for the software? Or parts of the creditcard to activate. That way, if someone wants to give away his serial number, you also need his personal info. And presumably this is not something you want to post on a crackerz website.


Top
 Profile  
Reply with quote  
 Post subject: Re: Serial No of hardware
PostPosted: Fri Mar 15, 2013 1:14 pm 
Offline

Joined: Wed Dec 14, 2011 4:20 am
Posts: 84
spacebuddy wrote:
DaveS wrote:
This works for OSX and WINDOWS..... NO PLUGINS REQUIRED


#If Not DebugBuild
#pragma DisableBackgroundTasks
#pragma DisableBoundsChecking
#pragma DisableAutoWaitCursor
#pragma StackOverflowchecking False
#pragma NilObjectChecking False
#EndIf
Dim sh As New Shell
Dim s As String
Dim x As Integer
If reg_key<>"" Then Return reg_key

#If TargetMacOS
//sh.execute "/usr/sbin/ioreg -l | /usr/bin/grep IOPlatformSerialNumber"
sh.execute "/usr/sbin/system_profiler SPHardwareDataType | /usr/bin/grep ""Serial Number (system):"""
s=sh.Result
x=InStr(s,"=")
If x=0 Then x=InStr(s,":")
If x>0 Then s=ReplaceAll(Trim(Mid(s,x+1)),Chr(34),"")
#ElseIf TargetWin32
// use IPCONFIG /all and parse the "Physical Address from "Local Area Connection" Block
// will be something like C4-2C-03-02-31-26 [C42c03023126 take first 11 char = C42C0302312]
sh.Execute("ipconfig /all")
If sh.ErrorCode = 0 Then
s = sh.Result
s = Mid(s,InStr(s,"Local Area Connection")+21)
s = Mid(s,InStr(s,"Physical Address")+16)
s = Left(s,InStr(s,EndOfLine))
s= Left(ReplaceAll(Trim(Right(s,19)),"-","")+"Q9734WF",11)
End If
#EndIf
If s="" Then s="Z98888AAAQ2" ' could not get REAL value.. so use something bogus

Return s


What happens if the OS is not English? You will not get the correct results.
What happens if an update changes in the OS and breaks your code ?

The correct way is to always use the API that is built into the OS.


Or maybe use windows command: getmac /FO csv

Then the format stays the same

see http://www.microsoft.com/resources/docu ... x?mfr=true


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group