MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SerialCheck

Function SerialCheck

Descent3/d3serial.cpp:101–207  ·  view source on GitHub ↗

checks the exectuable (serialization)

Source from the content-addressed store, hash-verified

99
100// checks the exectuable (serialization)
101int SerialCheck(void) {
102 char name2[] = DESC_ID_TAG "0000000000000000000000000000000000000000";
103 char time_str[] = DESC_DEAD_TIME_TAG "00000000";
104 int i, found;
105 uint32_t *checksum, test_checksum;
106 uint32_t *serialnum;
107 time_t current_time, saved_time;
108
109#ifdef DEMO
110 char regstr[] = "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! NOTICE "
111 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
112 "\nThis Descent 3 Demo %s has been specially prepared for\n"
113 "\n"
114 "\t\t%s (Serial Num: %d)\n"
115 "\n"
116 " and is the Confidential Property of Outrage Entertainment, Inc.\n"
117 "\n"
118 "\n"
119 "\t\tDISTRIBUTION IS PROHIBITED\n"
120 "\n"
121 "\n"
122 " Descent 3 is Copyright (c) 1998,1999 Outrage Entertainment, Inc.\n"
123 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
124 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
125#else
126 char regstr[] = "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! NOTICE "
127 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
128 "\nThis pre-release version of Descent 3 has been specially prepared for\n"
129 "\n"
130 "\t\t%s (Serial Num: %d)\n"
131 "\n"
132 " and is the Confidential Property of Outrage Entertainment, Inc.\n"
133 "\n"
134 "\n"
135 "\t\tDISTRIBUTION IS PROHIBITED\n"
136 "\n"
137 "This version of Descent 3 should be used for evaluation and testing only.\n"
138 "Because the game is not yet complete, items may be missing the bugs may be\n"
139 "encountered.\n"
140 "\n"
141 " Descent 3 is Copyright (c) 1998,1999 Outrage Entertainment, Inc.\n"
142 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
143 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
144#endif
145
146 // get the expiration time of the executable
147 char *start_time = &time_str[DESC_DEAD_TIME_TAG_LEN];
148 saved_time = (time_t)strtol(start_time, NULL, 16);
149 if (saved_time == (time_t)0)
150 // this guy has never been registered with the serialization program
151 return SERIAL_NO_ERR;
152
153 // adjust pointer, so it points to the registered name
154 char *name = name2 + DESC_ID_TAG_LEN;
155
156 // save for later use
157 strcpy(name_copy, name);
158

Callers

nothing calls this directly

Calls 1

Debug_MessageBoxFunction · 0.50

Tested by

no test coverage detected