flattspott
Jun 19 2004, 04:52 AM
| CODE |
// GUID Generator
Set GUID "" For I = 1 To 5 Set GUID%I% "" Next
Set Part1 8 Set Part2 4 Set Part3 4 Set Part4 4 Set Part5 12 Set Split -
Set g1 $SerialNumber$ Set g2 $XboxVersion$ Set g3 $MAC$ Set g4 $Time$ Set g5 $Timer$
Set Table "0123456789abcdef" SetFunc Count Length %Table%
For I = 0 To %Count% SetFunc Char%I% Mid %I% 1 %Table% Next
For S = 1 To 5 For I = 1 To %Part{S}% :Again Set Current $rand$ Mod Current %Count% If# %Current% < 0 Goto Again Set GUID%S% %GUID{S}%%Char{Current}% Set GUID%S% %GUID{S}%%g{S}% SetFunc GUID%S% MD5 %GUID{S}% SetFunc GUID%S% Left %Part{S}% %GUID{S}% Next If# %S% == 5 Then Set Split "" EndIf Set GUID %GUID%%GUID{S}%%Split% Next
Set GUID {%GUID%} MsgBox "GUID is %GUID%" Quit |
EDIT. I changed it a little...
geniusalz
Jun 19 2004, 04:57 AM
But you're defeating the purpose of a GUID being a GUID. I think there's more to it than just random numbers.
Anyway, KF, your inbox is full.
The script reminds me of a bug: the mod command sometimes returns negatives when using $rand$.
pelago
Jun 19 2004, 06:59 AM
Yeah, to generate GUIDs 'properly', you're supposed to use the machines MAC address, current time, and various other things I can't remember. The idea is that no two machines can create the same GUID twice.
http://hegel.ittc.ukans.edu/topics/interne...ds-guids-01.txt I think is the definitive reference, but it may have been superceded.
koldfuzion
Jun 19 2004, 10:35 AM
| QUOTE |
| Anyway, KF, your inbox is full. |
yea, i saw that, its been cleaned up but i think i still got the msg.
Yuyu
Jun 19 2004, 12:16 PM
| QUOTE (pelago @ Jun 19 2004, 03:59 AM) |
| Yeah, to generate GUIDs 'properly', you're supposed to use the machines MAC address, current time, and various other things I can't remember. The idea is that no two machines can create the same GUID twice. http://hegel.ittc.ukans.edu/topics/interne...ds-guids-01.txt I think is the definitive reference, but it may have been superceded. |
Yeah, we have a real GUID creator on the mediaxmenu website, in the scripting section, already... I believe flattspott was just messing around with a concept...
flattspott
Jun 19 2004, 02:12 PM
Well what I I were to do this
65BD716E%XBOXMAC% > MD5 > First 8 letters
DC1A%XBOXMAC% > MD5 > First 4 letters
4d07%XBOXMAC% > MD5 > First 4 letters
9FCD%XBOXMAC% > MD5 > First 4 letters
0C2FFE3B78FE%XBOXMAC% > MD5 > First 12 letters
Hopefully you get the idea. Wouldn't that be unique?
The point was so I could could convert xas files to Modules and install then in the File Manager.
geniusalz
Jun 19 2004, 02:28 PM
The actual GUID is designed to be globally unique until the next century or so. Meaning, any ID's being generated on any machine in the world will be different.
However, on the xbox, we will probably not need that 'secure' uniqueness, because the chances of a matching ID are pretty slim. So you could work with completely random digits.
From what I know, a part of the ID is generated using the current time on the machine, and then another part of it is generated from the MAC. Therefore, every machine will generate different ID's at different times, and every machine will generate different ID's even at the same time because of the MAC.
flattspott
Jun 19 2004, 02:35 PM
| QUOTE |
| The script reminds me of a bug: the mod command sometimes returns negatives when using $rand$. |
Thats what I said back in the day. Everyone thought I was retarded or something.
That's why I put If# %Current% < 0 Goto Again in it.
Anywho, I thought the script what pretty good seeing how simple it is.
flattspott
Jun 19 2004, 03:24 PM
I just put the whole thing into a For Loop and spit out each GUID to a file 1000 times. Then using UltraEdit I sorted the list to check for dupes. Everyone was unique.
geniusalz
Jun 19 2004, 04:05 PM
Someone called you retarded?
koldfuzion
Jun 19 2004, 04:12 PM
btw.. i concur.
you were setting
| QUOTE |
Set g1 $SerialNumber$ Set g2 $XboxVersion$ Set g3 $MAC$ Set g4 $Time$ Set g5 $Timer$
|
but nowhere in the script did i see you use them in the guid creation.
you could probably just use something like
MD5($SerialNumber$$RANDOMNUMBER$XboxVersion$$MAC$$Time$)
and format it accordinly to get a decent GUID for the xbox.
geniusalz
Jun 19 2004, 04:18 PM
| QUOTE |
| Set GUID%S% %GUID{S}%%g{S}% |
I don't know when it was added, but it's there.
Edit: Maybe you shouldn't use serial numbers in there
BenJeremy
Jun 19 2004, 04:39 PM
Oh, BTW....random numbers are generated as DWORDs (unsigned 32 bit), but when examining values as numbers, it looks at them as signed. I'll have to take a quick look at the random "special" to make sure it's formatting it as unsigned.
flattspott
Jun 19 2004, 05:02 PM
That reminds me %($rand%100)% and dont work right.
Am I doing it right?
BenJeremy
Jun 19 2004, 05:06 PM
Yes, but Geniusalz has said that the mod operator wasn't working, so I'll take a look at it shortly.
BenJeremy
Jun 19 2004, 05:44 PM
Well, easily fixed. The original code (not that I'm pointing fingers at you, Geniusalz), but the parser was lacking the '%' in the case statement. Easily solved.
I also will make sure all (int) casts are changed to (__int64) casts.
Doing some more checks...
geniusalz
Jun 19 2004, 05:50 PM
Another stupid bug which doesn't really affect anything is that the 'length' parameter for the evaluate function is treated as 'end+1'. It doesn't matter, because all strings passed are trimmed before passing.
Just wondering: does mxm do anything with 'cout's? They should be changed to 'real' error messages.
BenJeremy
Jun 19 2004, 07:13 PM
| QUOTE (geniusalz @ Jun 19 2004, 02:50 PM) |
Another stupid bug which doesn't really affect anything is that the 'length' parameter for the evaluate function is treated as 'end+1'. It doesn't matter, because all strings passed are trimmed before passing.
Just wondering: does mxm do anything with 'cout's? They should be changed to 'real' error messages. |
OK, I've converted them to LOGMSG calls.
I was getting an odd "FATX: found unrecognized signature" message repeated times in the last run. I have no clue as to what causes the message (something buried inthe Kernel, to be sure).
geniusalz
Jun 19 2004, 07:37 PM
That might be the cause of some "Unable to read file" errors I've been getting in the gamesave manager, even though I open/close all files properly.
BenJeremy
Jun 19 2004, 08:05 PM
Strange.
Well, I'm alternating between MXM and watching Band Of Brothers with my older son.... hopefully, there will be a WIP update tonight.
chilin_dude
Jun 19 2004, 08:09 PM
| QUOTE (BenJeremy @ Jun 19 2004, 10:05 PM) |
| watching Band Of Brothers with my older son.... hopefully, there will be a WIP update tonight. |
Sorry but I've got to jump in here, that program rocked so much, there were 10 episodes I believe, are you enjoying it? THis reminded me I haven't cracked open my box set I got a couple of weeks back.. I really enjoyed this show, nearly as much as 24
BenJeremy
Jun 19 2004, 09:32 PM
| QUOTE (chilin_dude @ Jun 19 2004, 05:09 PM) |
Sorry but I've got to jump in here, that program rocked so much, there were 10 episodes I believe, are you enjoying it? THis reminded me I haven't cracked open my box set I got a couple of weeks back.. I really enjoyed this show, nearly as much as 24 |
Yes, I missed most of it the first time around.... I think I finally caught it for the episode where they liberated the death camp.
flattspott
Jun 19 2004, 10:00 PM
I've never watched BoB before. But 24 does indeed rule, especially last season
koldfuzion
Jun 19 2004, 11:10 PM
BoB rocks
flattspott
Jun 19 2004, 11:21 PM
Just thought I'd let you know geniusalz.. your expression stuff rocks man.
koldfuzion
Jun 22 2004, 10:18 PM
http://www.mediaxmenu.com/scripts_games.xmlwill this xml be ok? or not?
flattspott, 94 downloads on your game script.. and 0.9o isnt even out yet
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.