Jump to content


Photo

Mac Address(es)


  • Please log in to reply
10 replies to this topic

#1 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 15 May 2008 - 11:01 PM

This is a simple dll to get the computer's physical mac address, but it was a bit of a challenge to write and to find information on how to do it.
The mac address can generally be used to uniquely identify the machine, but it can also easily be spoofed.
Thus, I'm not sure how useful it will be to people, but someone asked me to make it, so it must be somewhat useful.
Note: The mac address is oftentimes used in DRM. DRM is bad, mmkay? So if you're planning to use this for DRM, e.g. as some kind of registration mechanism, well, I just hope that you do a little research on DRM and change your mind, but I won't prevent you from using this dll.

Other than that, there's not really much else to say, so here it is:
http://www.IsmAvatar.com/dlls/mac.zip (7 kb)

Inside are 3 files:
mac.dll - the dll itself (14 kb)
mac.c - the source code for the dll (if you want it. If not, you can just discard it) (1 kb)
mac.gm6 - the scripts to use it and an example (6 kb)

Please read the comments inside macInit to see how to use it.
Some computers may have multiple mac addresses, thus where macHasNex() and macGetNext() come in handy. Most people who use this, though, will probably only use the macInit and macGetFirst functions.

-IsmAcatar

Edited by IsmAvatar, 18 May 2008 - 06:56 PM.

  • 0
Posted Image LateralGM is an IDE for editing GM files on Linux, Mac, and Windows.
We also house the GM File Format Documentation and other projects of that nature.
IsmAvatar.com | Examples | Scripts | Particles | DLLs | Credit Me
Email | Registered

#2 mme

mme

    MME

  • GMC Member
  • 1012 posts

Posted 16 May 2008 - 04:06 AM

I got this error upon running it :P

___________________________________________
ERROR in
action number 1
of Create Event
for object object0:

Error in code at line 3:
   m1 = show_message(external_call(g1))

at position 34: Unknown variable g1

so I modified your example and it seems to work now.

mac_m.zip

Hope you dont mind :P
  • 0
gmc_mdu2.pngrsa_gmc_sig.png

#3 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 16 May 2008 - 11:51 AM

Wasn't that a problem with the initiation script? I really like when they don't use them...mostly when they only have a few functions...

I want to see what my MAC Address is :D
  • 0

#4 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 16 May 2008 - 05:27 PM

That would be me leaving in debugging code instead of the scripts for the example. It has been corrected. Re-download.

Wasn't that a problem with the initiation script?

No.

I want to see what my MAC Address is

You can see what your mac address is by opening up the command prompt and typing "ipconfig /all" and hitting enter. It will be listed as "Physical Address". Of course, nobody wants to call a command prompt from GM and parse the results, so this dll just saves you that effort.

Edited by IsmAvatar, 16 May 2008 - 05:31 PM.

  • 0
Posted Image LateralGM is an IDE for editing GM files on Linux, Mac, and Windows.
We also house the GM File Format Documentation and other projects of that nature.
IsmAvatar.com | Examples | Scripts | Particles | DLLs | Credit Me
Email | Registered

#5 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 17 May 2008 - 02:13 PM

-IsmAcatar

Oops :P
Interesting, I don't see anything wrong with DRM though, the problem is how it is used.
Just like any other thing. I knife can be used to kill, yet it's usefull at cutting things.
  • 0

#6 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 18 May 2008 - 04:24 AM

It was intentional. With 1 simple letter change, I was able to get my name to read "mAc".

I'd consider DRM more along the lines of a nuclear bomb. There's nothing wrong with it, the problem is how it is used. Unfortunately, there is no other way to use it except its intended way.
  • 0
Posted Image LateralGM is an IDE for editing GM files on Linux, Mac, and Windows.
We also house the GM File Format Documentation and other projects of that nature.
IsmAvatar.com | Examples | Scripts | Particles | DLLs | Credit Me
Email | Registered

#7 Doogie_Forever

Doogie_Forever

    Dog Warrior

  • GMC Member
  • 824 posts
  • Version:GM:Studio

Posted 18 May 2008 - 05:58 AM

Couldn't someone just use the 39dll to obtain the mac-address or is there some advantage to this that I am missing?

The 39dll is open source, so you could have figured out how to retrieve it from there.
Either way good job, I'm sure its better somehow :huh:
  • 0

#8 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 18 May 2008 - 06:50 AM

I'm unaware of if 39dll was able to do it, but this would be more useful to someone who just wants to know the mac address without all the other stuff that 39dll carries, including filesize (compare mac.dll at 14 kb to 39dll.dll at 42 kb)

I'm also unaware of if 39dll is capable of obtaining *all* the mac addresses, in case the computer has multiple.

39dll is written in C++, which I do not know. I only know pascal and C for making dlls for GM. C++ and C are similar but too different.

Edited by IsmAvatar, 18 May 2008 - 07:00 AM.

  • 0
Posted Image LateralGM is an IDE for editing GM files on Linux, Mac, and Windows.
We also house the GM File Format Documentation and other projects of that nature.
IsmAvatar.com | Examples | Scripts | Particles | DLLs | Credit Me
Email | Registered

#9 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts
  • Version:Unknown

Posted 18 May 2008 - 05:39 PM

It would be usefull to those requiring the mac address without 39dll.
As to your alias, you could have bolded/italixed that part :huh: .
  • 0

#10 andreasng

andreasng

    GMC Member

  • GMC Member
  • 121 posts
  • Version:GM:Studio

Posted 22 March 2014 - 08:56 PM

i'd use the mac for registering unique players - to see how many people play ones game. Or to generate a seed that sticks to your machine. 

 

really helpful thanks.


  • 0

#11 Lonewolff

Lonewolff

    Permanent Resident

  • GMC Member
  • 3517 posts
  • Version:GM:Studio

Posted 22 March 2014 - 10:41 PM

I want to see what my MAC Address is biggrin.gif


ipconfig /all

There you go :)
  • 0