Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-04

OnGuard component: CreateMachineID not working?

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

John Repucci

I'm seeing an oddity with the CreateMachineID function within the OnGuard component.
Is there anyone who has used this component in depth? Any idea who I would submit a ticket to or who can tell me if I'm doing something wrong?

I'm using the CreateMachineID code to pull an id for networking, drives and then Networking + Drives and the values I'm getting do not seem correct:

Network, Drives, Network + Drives
42312D6C, CA7CFA8F, 42312D6C

I would not expect that Network = Network + Drives?

I did see the conversation about OnGuard in early 2010 about drive ID's, so I'm getting leery of using the drive ID information.

var
  InfoSet  : TEsMachineInfoSet;
  HWInfo   : LongInt;
  HWInfoNW : LongInt;  // the Network HWInfo
  HWInfoDr : LongInt;  // the Drive HWInfo
  sHWInfo, sHWInfoNW, sHWInfoDr : String;
Begin
try
  InfoSet := [];
  InfoSet := InfoSet + [midNetwork];
  HWInfoNW := CreateMachineID(InfoSet);  // Request just the Network Info
  sHWInfoNW := BufferToHex(HWInfoNW, SizeOf(LongInt));
  InfoSet := [];
  InfoSet := InfoSet + [midDrives];
  HWInfoDR := CreateMachineID(InfoSet);  // request just the Drive Info
  sHWInfoDr := BufferToHex(HWInfoDr, SizeOf(LongInt));
  InfoSet := [];
  InfoSet := InfoSet + [midDrives] + [midNetwork];
  HWInfo := CreateMachineID(InfoSet);   //  Request both Network & Drive Info
  sHWInfo := BufferToHex(HWInfo, SizeOf(LongInt));
  Edit1.Text := sHWInfoNW + ', ' + sHWInfoDr + ', ' + sHWInfo;    //

Display the HWInfo
except on E:Exception do

   ShowMessage(E.Message);
  end;

end.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110427/b1f88b0b/attachment.html>

Reply by email

Graeme Geldenhuys
to John Repucci

2011/4/28 John Repucci <john.repucci at gm*****>:

I did see the conversation about OnGuard in early 2010 about drive ID's, so I'm getting leery of using the drive ID information.

I finally got to the stage in our company project to start implementing security, and working on OnGuard improvements. I haven't looked at the OnGuard code for a long time, but looking at it today again, it is in a royal mess! GUI and non-GUI code all mixed up. Lots of IFDEF's. InstantObject framework dependencies etc. Yikes!!!

Anyway, I created a fork of subversion Lazarus CCR's OnGuard repository. My new repository is located on GitHub. I don't know if my goals for OnGuard are on par with the Lazarus CCR, so to reduce friction, I decided to rather work on a fork instead. The original OnGuard maintainers are welcome to back-port anything from my repository if they want.

https://github.com/graemeg/onguard

Changes so far:
* split the single package into two. One non-gui and one Lazarus IDE design time package.
* Some minor code changes to get things to build on my side
* Added a text file with some new ideas I have for OnGuard

My goals over the next few days
* Split the GUI units from the 'source' into various "gui toolkit" directories. eg: source/lcl & source/fpgui
* Split the demos between toolkits too.
* Create some console demos to see what actually works and what not.
* Implement the new hard drive serial number detection under Linux. Without requiring root access, and that supports USB and SATA drives too.
* Probably add some unit tests too, seeing that I can't program without unit testing code.

If this is going to solve your problem... I don't know. I guess it is too soon to tell. But maybe give it another try in a few days.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email