Move old to a differnet folder
This commit is contained in:
parent
490ebad2f4
commit
628e91efe8
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
|
@ -1,270 +1,270 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
char key[0xA8] = { 0x01,0x0A,0x16,0x04,0x07,0x18,0x0C,0x10,0x05,0x17,0x09,0x03,0x12,0x08,0x15,0x13,0x0B,0x02,0x0F,0x0D,0x11,0x0E,0x06,0x14,0x07,0x0C,0x0E,0x11,0x09,0x16,0x10,0x06,0x14,0x0D,0x01,0x02,0x12,0x08,0x13,0x0B,0x0F,0x0A,0x18,0x15,0x04,0x05,0x03,0x17,0x0F,0x04,0x09,0x03,0x06,0x07,0x11,0x12,0x15,0x16,0x02,0x08,0x05,0x17,0x0C,0x0D,0x01,0x18,0x0B,0x14,0x0E,0x10,0x13,0x0A,0x02,0x0A,0x0E,0x12,0x0B,0x03,0x0C,0x06,0x13,0x07,0x11,0x09,0x15,0x18,0x10,0x17,0x14,0x0F,0x04,0x01,0x05,0x08,0x16,0x0D,0x0B,0x02,0x09,0x16,0x14,0x01,0x12,0x11,0x15,0x06,0x0F,0x17,0x07,0x10,0x0C,0x0E,0x08,0x18,0x13,0x03,0x0A,0x0D,0x04,0x05,0x09,0x0F,0x05,0x0D,0x16,0x15,0x12,0x11,0x03,0x0A,0x04,0x10,0x0E,0x14,0x02,0x01,0x13,0x0C,0x06,0x0B,0x17,0x18,0x07,0x08,0x12,0x02,0x0C,0x09,0x0D,0x0E,0x04,0x07,0x16,0x14,0x17,0x01,0x11,0x03,0x10,0x15,0x08,0x0A,0x05,0x13,0x0B,0x18,0x0F,0x06 };
|
char key[0xA8] = { 0x01,0x0A,0x16,0x04,0x07,0x18,0x0C,0x10,0x05,0x17,0x09,0x03,0x12,0x08,0x15,0x13,0x0B,0x02,0x0F,0x0D,0x11,0x0E,0x06,0x14,0x07,0x0C,0x0E,0x11,0x09,0x16,0x10,0x06,0x14,0x0D,0x01,0x02,0x12,0x08,0x13,0x0B,0x0F,0x0A,0x18,0x15,0x04,0x05,0x03,0x17,0x0F,0x04,0x09,0x03,0x06,0x07,0x11,0x12,0x15,0x16,0x02,0x08,0x05,0x17,0x0C,0x0D,0x01,0x18,0x0B,0x14,0x0E,0x10,0x13,0x0A,0x02,0x0A,0x0E,0x12,0x0B,0x03,0x0C,0x06,0x13,0x07,0x11,0x09,0x15,0x18,0x10,0x17,0x14,0x0F,0x04,0x01,0x05,0x08,0x16,0x0D,0x0B,0x02,0x09,0x16,0x14,0x01,0x12,0x11,0x15,0x06,0x0F,0x17,0x07,0x10,0x0C,0x0E,0x08,0x18,0x13,0x03,0x0A,0x0D,0x04,0x05,0x09,0x0F,0x05,0x0D,0x16,0x15,0x12,0x11,0x03,0x0A,0x04,0x10,0x0E,0x14,0x02,0x01,0x13,0x0C,0x06,0x0B,0x17,0x18,0x07,0x08,0x12,0x02,0x0C,0x09,0x0D,0x0E,0x04,0x07,0x16,0x14,0x17,0x01,0x11,0x03,0x10,0x15,0x08,0x0A,0x05,0x13,0x0B,0x18,0x0F,0x06 };
|
||||||
char* hex_values = "0123456789ABCDEF";
|
char* hex_values = "0123456789ABCDEF";
|
||||||
char* password_chars = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
char* password_chars = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
||||||
unsigned short output_vals[6];
|
unsigned short output_vals[6];
|
||||||
|
|
||||||
void substitute(char* input, char* output, int multiply_by)
|
void substitute(char* input, char* output, int multiply_by)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char* keyChar;
|
char* keyChar;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
keyChar = (char*)(multiply_by * 0x18 + (key));
|
keyChar = (char*)(multiply_by * 0x18 + (key));
|
||||||
for(int i = 0; i < 0x18; i++) {
|
for(int i = 0; i < 0x18; i++) {
|
||||||
output[i] = input[*keyChar + -1];
|
output[i] = input[*keyChar + -1];
|
||||||
keyChar ++;
|
keyChar ++;
|
||||||
}
|
}
|
||||||
output[0x18] = 0;
|
output[0x18] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int the_crazy_math_part(unsigned int val1, unsigned int val2, int carry, int start_at)
|
int the_crazy_math_part(unsigned int val1, unsigned int val2, int carry, int start_at)
|
||||||
{
|
{
|
||||||
int c = carry;
|
int c = carry;
|
||||||
|
|
||||||
long long r1 = 0xFFFFFFF9;
|
long long r1 = 0xFFFFFFF9;
|
||||||
long long r0 = val1;
|
long long r0 = val1;
|
||||||
long long r3 = val2;
|
long long r3 = val2;
|
||||||
|
|
||||||
|
|
||||||
// yes this is just the asm implemented in C, dont @ me
|
// yes this is just the asm implemented in C, dont @ me
|
||||||
|
|
||||||
for (int i = start_at; i < 0x20; i++)
|
for (int i = start_at; i < 0x20; i++)
|
||||||
{
|
{
|
||||||
// adcs r3,r1,r3,lsl 1h
|
// adcs r3,r1,r3,lsl 1h
|
||||||
r3 = (r1 + (r3 << 1)) + c; //same as r3 = (r3+(r1 * 2)) + c;
|
r3 = (r1 + (r3 << 1)) + c; //same as r3 = (r3+(r1 * 2)) + c;
|
||||||
c = (r3 >> 32); // set c flag
|
c = (r3 >> 32); // set c flag
|
||||||
r3 &= 0xFFFFFFFF;
|
r3 &= 0xFFFFFFFF;
|
||||||
|
|
||||||
// subcc r3,r3,r1
|
// subcc r3,r3,r1
|
||||||
if (!c)
|
if (!c)
|
||||||
{
|
{
|
||||||
r3 = (r3 - r1);
|
r3 = (r3 - r1);
|
||||||
r3 &= 0xFFFFFFFF;
|
r3 &= 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
// adcs r0,r0,r0
|
// adcs r0,r0,r0
|
||||||
r0 = r0 + r0 + c; //Same as r0 = (r0 * 2) + c;
|
r0 = r0 + r0 + c; //Same as r0 = (r0 * 2) + c;
|
||||||
c = (r0 >> 32); // set c flag
|
c = (r0 >> 32); // set c flag
|
||||||
r0 &= 0xFFFFFFFF;
|
r0 &= 0xFFFFFFFF;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r3;
|
return r3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int find_multiplier(char* system_in)
|
int find_multiplier(char* system_in)
|
||||||
{
|
{
|
||||||
int total_iterations = 0;
|
int total_iterations = 0;
|
||||||
int ii = 0;
|
int ii = 0;
|
||||||
int next_var = 0;
|
int next_var = 0;
|
||||||
|
|
||||||
char* system_in_base_ptr = system_in;
|
char* system_in_base_ptr = system_in;
|
||||||
char* hex_values_ptr = hex_values;
|
char* hex_values_ptr = hex_values;
|
||||||
for (int i = 0; i < strlen(system_in_base_ptr); i++)
|
for (int i = 0; i < strlen(system_in_base_ptr); i++)
|
||||||
{
|
{
|
||||||
char c = *system_in++;
|
char c = *system_in++;
|
||||||
char characters[2];
|
char characters[2];
|
||||||
memset(characters, 0, 2);
|
memset(characters, 0, 2);
|
||||||
characters[0] = c;
|
characters[0] = c;
|
||||||
|
|
||||||
char* a2b = strstr(hex_values_ptr, characters);
|
char* a2b = strstr(hex_values_ptr, characters);
|
||||||
next_var = a2b - (uintptr_t)hex_values_ptr;
|
next_var = a2b - (uintptr_t)hex_values_ptr;
|
||||||
if (!a2b)
|
if (!a2b)
|
||||||
next_var = 0;
|
next_var = 0;
|
||||||
total_iterations += next_var;
|
total_iterations += next_var;
|
||||||
}
|
}
|
||||||
// step 2
|
// step 2
|
||||||
|
|
||||||
unsigned int offset = 7;
|
unsigned int offset = 7;
|
||||||
|
|
||||||
if (offset <= total_iterations)
|
if (offset <= total_iterations)
|
||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
int start_at = 0x1c;
|
int start_at = 0x1c;
|
||||||
unsigned int r3 = total_iterations >> 4;
|
unsigned int r3 = total_iterations >> 4;
|
||||||
if (offset <= r3 >> 0xC)
|
if (offset <= r3 >> 0xC)
|
||||||
{
|
{
|
||||||
start_at -= 0x10;
|
start_at -= 0x10;
|
||||||
r3 >>= 0x10;
|
r3 >>= 0x10;
|
||||||
}
|
}
|
||||||
if (offset <= r3 >> 0x10)
|
if (offset <= r3 >> 0x10)
|
||||||
{
|
{
|
||||||
start_at -= 0x8;
|
start_at -= 0x8;
|
||||||
r3 >>= 0x8;
|
r3 >>= 0x8;
|
||||||
}
|
}
|
||||||
if (offset <= r3)
|
if (offset <= r3)
|
||||||
{
|
{
|
||||||
start_at -= 0x4;
|
start_at -= 0x4;
|
||||||
r3 >>= 0x4;
|
r3 >>= 0x4;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int r0 = total_iterations << (start_at & 0xFF);
|
unsigned int r0 = total_iterations << (start_at & 0xFF);
|
||||||
|
|
||||||
|
|
||||||
c = ((long long int)r0 * 2) > 0xFFFFFFFF;
|
c = ((long long int)r0 * 2) > 0xFFFFFFFF;
|
||||||
r0 = r0 * 2;
|
r0 = r0 * 2;
|
||||||
|
|
||||||
// printf("Starting Carry: %x\n", c);
|
// printf("Starting Carry: %x\n", c);
|
||||||
|
|
||||||
|
|
||||||
return the_crazy_math_part(r0, r3, c, start_at);
|
return the_crazy_math_part(r0, r3, c, start_at);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int hex_to_bytes(char* input, int iterator)
|
unsigned int hex_to_bytes(char* input, int iterator)
|
||||||
{
|
{
|
||||||
char* iteration;
|
char* iteration;
|
||||||
char* final_char;
|
char* final_char;
|
||||||
int result;
|
int result;
|
||||||
int i;
|
int i;
|
||||||
char* current_char;
|
char* current_char;
|
||||||
char* enc = hex_values;
|
char* enc = hex_values;
|
||||||
result = 0;
|
result = 0;
|
||||||
i = 0;
|
i = 0;
|
||||||
current_char = input + iterator;
|
current_char = input + iterator;
|
||||||
int ii = 0xc;
|
int ii = 0xc;
|
||||||
do {
|
do {
|
||||||
char curChar[2];
|
char curChar[2];
|
||||||
memset(curChar, 0x00, 2);
|
memset(curChar, 0x00, 2);
|
||||||
curChar[0] = current_char[0];
|
curChar[0] = current_char[0];
|
||||||
|
|
||||||
iteration = strstr(enc, curChar);
|
iteration = strstr(enc, curChar);
|
||||||
final_char = iteration + -(intptr_t)enc;
|
final_char = iteration + -(intptr_t)enc;
|
||||||
if (iteration == (char*)0x0) {
|
if (iteration == (char*)0x0) {
|
||||||
final_char = (char*)0x0;
|
final_char = (char*)0x0;
|
||||||
}
|
}
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
result = result + ((int)final_char << (ii & 0xff));
|
result = result + ((int)final_char << (ii & 0xff));
|
||||||
ii = ii - 4 & 0xffff;
|
ii = ii - 4 & 0xffff;
|
||||||
current_char = current_char + 1;
|
current_char = current_char + 1;
|
||||||
} while (i < 4);
|
} while (i < 4);
|
||||||
return result & 0xffff;
|
return result & 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
void generate_password(unsigned short* input, char* output)
|
void generate_password(unsigned short* input, char* output)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
output[i] = password_chars[input[i] - 1];
|
output[i] = password_chars[input[i] - 1];
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
} while (i < 6);
|
} while (i < 6);
|
||||||
output[i] = '\0';
|
output[i] = '\0';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
char maccas_id[64];
|
char maccas_id[64];
|
||||||
char mannager_id[64];
|
char mannager_id[64];
|
||||||
char mac_address[64];
|
char mac_address[64];
|
||||||
char formatted[64];
|
char formatted[64];
|
||||||
char encoded[64];
|
char encoded[64];
|
||||||
char final_key[100];
|
char final_key[100];
|
||||||
char total_output [64];
|
char total_output [64];
|
||||||
int iterator = 0;
|
int iterator = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int ii = 0;
|
int ii = 0;
|
||||||
memset(mac_address, 0x00, 64);
|
memset(mac_address, 0x00, 64);
|
||||||
memset(maccas_id, 0x00, 64);
|
memset(maccas_id, 0x00, 64);
|
||||||
memset(mannager_id, 0x00, 64);
|
memset(mannager_id, 0x00, 64);
|
||||||
|
|
||||||
if(argc >= 4){
|
if(argc >= 4){
|
||||||
strncpy(mac_address,argv[1],63);
|
strncpy(mac_address,argv[1],63);
|
||||||
strncpy(maccas_id,argv[2],63);
|
strncpy(maccas_id,argv[2],63);
|
||||||
strncpy(mannager_id,argv[3],63);
|
strncpy(mannager_id,argv[3],63);
|
||||||
goto run;
|
goto run;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("eCDP Serial Number Generator\n");
|
// printf("eCDP Serial Number Generator\n");
|
||||||
// printf("Credits: SilicaAndPina (Reversing, writing code), Rufis_ (ARM asm help)\n");
|
// printf("Credits: SilicaAndPina (Reversing, writing code), Rufis_ (ARM asm help)\n");
|
||||||
// printf("-- A backdoor on the worlds rarest DS game.\n");
|
// printf("-- A backdoor on the worlds rarest DS game.\n");
|
||||||
|
|
||||||
|
|
||||||
entry:
|
entry:
|
||||||
|
|
||||||
|
|
||||||
// printf("Enter your NDS's Mac Address (ALL uppercase, no seperators): ");
|
// printf("Enter your NDS's Mac Address (ALL uppercase, no seperators): ");
|
||||||
fgets(mac_address, 64, stdin);
|
fgets(mac_address, 64, stdin);
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
len = strlen(mac_address)-1;
|
len = strlen(mac_address)-1;
|
||||||
mac_address[len] = '\0'; // remove \n
|
mac_address[len] = '\0'; // remove \n
|
||||||
if (len != 12)
|
if (len != 12)
|
||||||
goto entry;
|
goto entry;
|
||||||
|
|
||||||
|
|
||||||
// printf("Enter McDonalds 'Store Number' (first 6 digit entry): ");
|
// printf("Enter McDonalds 'Store Number' (first 6 digit entry): ");
|
||||||
fgets(maccas_id, 64, stdin);
|
fgets(maccas_id, 64, stdin);
|
||||||
|
|
||||||
len = strlen(maccas_id)-1;
|
len = strlen(maccas_id)-1;
|
||||||
maccas_id[len] = '\0';
|
maccas_id[len] = '\0';
|
||||||
if (len != 6)
|
if (len != 6)
|
||||||
goto entry;
|
goto entry;
|
||||||
|
|
||||||
|
|
||||||
// printf("Enter McDonalds 'Store Management Number of DS Card' (second 6 digit entry): ");
|
// printf("Enter McDonalds 'Store Management Number of DS Card' (second 6 digit entry): ");
|
||||||
fgets(mannager_id, 64, stdin);
|
fgets(mannager_id, 64, stdin);
|
||||||
|
|
||||||
len = strlen(mannager_id)-1;
|
len = strlen(mannager_id)-1;
|
||||||
mannager_id[len] = '\0';
|
mannager_id[len] = '\0';
|
||||||
if (len != 6)
|
if (len != 6)
|
||||||
goto entry;
|
goto entry;
|
||||||
|
|
||||||
run:
|
run:
|
||||||
snprintf(formatted, 64, "%s%s%s", mac_address, maccas_id, mannager_id);
|
snprintf(formatted, 64, "%s%s%s", mac_address, maccas_id, mannager_id);
|
||||||
// printf("Formatted Data: %s\n", formatted);
|
// printf("Formatted Data: %s\n", formatted);
|
||||||
int multiplier = find_multiplier(formatted);
|
int multiplier = find_multiplier(formatted);
|
||||||
// printf("Multiplier: %x\n", multiplier);
|
// printf("Multiplier: %x\n", multiplier);
|
||||||
substitute(formatted, encoded, multiplier);
|
substitute(formatted, encoded, multiplier);
|
||||||
// printf("Encoded Data: %s\n", encoded);
|
// printf("Encoded Data: %s\n", encoded);
|
||||||
unsigned short password_values[6];
|
unsigned short password_values[6];
|
||||||
memset(password_values, 0x00, 6 * 2);
|
memset(password_values, 0x00, 6 * 2);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
int chr = hex_to_bytes(encoded, iterator);
|
int chr = hex_to_bytes(encoded, iterator);
|
||||||
i = ii + 1;
|
i = ii + 1;
|
||||||
password_values[ii] = (unsigned short)chr;
|
password_values[ii] = (unsigned short)chr;
|
||||||
iterator = iterator + 4;
|
iterator = iterator + 4;
|
||||||
ii = i;
|
ii = i;
|
||||||
} while (i < 6);
|
} while (i < 6);
|
||||||
|
|
||||||
// printf("Password Values 1: ");
|
// printf("Password Values 1: ");
|
||||||
// for (int i = 0; i < 6; i++)
|
// for (int i = 0; i < 6; i++)
|
||||||
// {
|
// {
|
||||||
// printf("%x ", password_values[i]);
|
// printf("%x ", password_values[i]);
|
||||||
// }
|
// }
|
||||||
// printf("\n");
|
// printf("\n");
|
||||||
i = 0;
|
i = 0;
|
||||||
ii = 0;
|
ii = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
i = ii;
|
i = ii;
|
||||||
int chr = password_values[ii++];
|
int chr = password_values[ii++];
|
||||||
password_values[i] = chr % 33 + 1;
|
password_values[i] = chr % 33 + 1;
|
||||||
} while (ii < 6);
|
} while (ii < 6);
|
||||||
// printf("Password Values 2: ");
|
// printf("Password Values 2: ");
|
||||||
// for (int i = 0; i < 6; i++)
|
// for (int i = 0; i < 6; i++)
|
||||||
// {
|
// {
|
||||||
// printf("%x ", password_values[i]);
|
// printf("%x ", password_values[i]);
|
||||||
// }
|
// }
|
||||||
// printf("\n");
|
// printf("\n");
|
||||||
generate_password(password_values, final_key);
|
generate_password(password_values, final_key);
|
||||||
printf("%s\n", final_key);
|
printf("%s\n", final_key);
|
||||||
|
|
||||||
|
|
||||||
// printf("\n\nThou hast been reversed!\n");
|
// printf("\n\nThou hast been reversed!\n");
|
||||||
// getchar();
|
// getchar();
|
||||||
}
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
body{
|
||||||
|
background-image: url("bg.gif");
|
||||||
|
background-repeat: repeat;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
.keygen{
|
||||||
|
display: inline-block;
|
||||||
|
top: 15%;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
padding:20px;
|
||||||
|
width:50%;
|
||||||
|
text-align:center;
|
||||||
|
background-color: green;
|
||||||
|
color: white;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.macAddr{
|
||||||
|
width: 60px;
|
||||||
|
padding: 12px 20px;
|
||||||
|
margin: 8px 0;
|
||||||
|
border-radius: 100%;
|
||||||
|
background-color: black;
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button{
|
||||||
|
width: 60%;
|
||||||
|
margin-top:50px;
|
||||||
|
padding:12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: yellow;
|
||||||
|
}
|
||||||
|
.entry{
|
||||||
|
width: 60%;
|
||||||
|
padding:12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: black;
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
.leaveOffering{
|
||||||
|
text-align:center;
|
||||||
|
width:100%;
|
||||||
|
padding: 20px;
|
||||||
|
color: white;
|
||||||
|
font-size: 140%;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.askRonald{
|
||||||
|
float:left;
|
||||||
|
padding-right: 3%;
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 111 KiB |
|
@ -0,0 +1,48 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title> McKeygen - Serial Key Generator for eCDP</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=0.2">
|
||||||
|
<link rel="stylesheet" type="text/css" href="ecdp.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="keygen">
|
||||||
|
<img src="donald.jpg" class="askRonald" width="228" height="406">
|
||||||
|
<div class="leaveOffering"> Leave an offering for Ronald McDonald </div>
|
||||||
|
DSi Mac Address:<br>
|
||||||
|
<input type="text" id="dsiMac0" class="macAddr" value="00" maxlength="2"> :
|
||||||
|
<input type="text" id="dsiMac1" class="macAddr" value="00" maxlength="2"> :
|
||||||
|
<input type="text" id="dsiMac2" class="macAddr" value="00" maxlength="2"> :
|
||||||
|
<input type="text" id="dsiMac3" class="macAddr" value="00" maxlength="2"> :
|
||||||
|
<input type="text" id="dsiMac4" class="macAddr" value="00" maxlength="2"> :
|
||||||
|
<input type="text" id="dsiMac5" class="macAddr" value="00" maxlength="2"><br>
|
||||||
|
Store Number:<br>
|
||||||
|
<input type="text" id="storeId" class="entry" value="000000" maxlength="6" size="3"><br>
|
||||||
|
Store Management Number of DS Card:<br>
|
||||||
|
<input type="text" id="managementId" class="entry" value="000000" maxlength="6" size="3"><br>
|
||||||
|
<input type="submit" id="generate_password" class="button" value="Place Offering" onclick="placeOffering()"><br>
|
||||||
|
<div id="offering"></div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function placeOffering()
|
||||||
|
{
|
||||||
|
query = "/password.php?mac0="+dsiMac0.value+"&mac1="+dsiMac1.value+"&mac2="+dsiMac2.value+"&mac3="+dsiMac3.value+"&mac4="+dsiMac4.value+"&mac5="+dsiMac5.value+"&store="+storeId.value+"&management="+managementId.value;
|
||||||
|
offering.innerText = "Contacting Ronald McDonald...";
|
||||||
|
xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("GET",query,true);
|
||||||
|
xhr.onreadystatechange = function () {
|
||||||
|
if(xhr.readyState === XMLHttpRequest.DONE) {
|
||||||
|
var status = xhr.status;
|
||||||
|
if (status === 0 || (status >= 200 && status < 400)) {
|
||||||
|
offering.innerText = "Ronald McDonald speaks with a cryptic message: "+xhr.responseText;
|
||||||
|
} else {
|
||||||
|
offering.innerText = "Ronald McDonald looks at you, disgusted, throwing your BigMac right back at you.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,31 +1,31 @@
|
||||||
<?php
|
<?php
|
||||||
if(isset($_GET["mac0"]) && isset($_GET["mac1"]) && isset($_GET["mac2"]) && isset($_GET["mac3"]) && isset($_GET["mac4"]) && isset($_GET["mac5"]) && isset($_GET['store']) && isset($_GET['management']))
|
if(isset($_GET["mac0"]) && isset($_GET["mac1"]) && isset($_GET["mac2"]) && isset($_GET["mac3"]) && isset($_GET["mac4"]) && isset($_GET["mac5"]) && isset($_GET['store']) && isset($_GET['management']))
|
||||||
{
|
{
|
||||||
$full_mac = "";
|
$full_mac = "";
|
||||||
|
|
||||||
$full_mac .= $_GET["mac0"];
|
$full_mac .= $_GET["mac0"];
|
||||||
$full_mac .= $_GET["mac1"];
|
$full_mac .= $_GET["mac1"];
|
||||||
$full_mac .= $_GET["mac2"];
|
$full_mac .= $_GET["mac2"];
|
||||||
$full_mac .= $_GET["mac3"];
|
$full_mac .= $_GET["mac3"];
|
||||||
$full_mac .= $_GET["mac4"];
|
$full_mac .= $_GET["mac4"];
|
||||||
$full_mac .= $_GET["mac5"];
|
$full_mac .= $_GET["mac5"];
|
||||||
$full_mac = strtoupper($full_mac);
|
$full_mac = strtoupper($full_mac);
|
||||||
|
|
||||||
$management = $_GET['management'];
|
$management = $_GET['management'];
|
||||||
$store = $_GET['store'];
|
$store = $_GET['store'];
|
||||||
if((strlen($full_mac) == 12 && preg_match_all ("/^[A-F0-9]*$/",$full_mac)) && (strlen($management) == 6 && preg_match_all ("/^[0-9]*$/",$management)) && (strlen($store) == 6 && preg_match_all ("/^[0-9]*$/",$store)))
|
if((strlen($full_mac) == 12 && preg_match_all ("/^[A-F0-9]*$/",$full_mac)) && (strlen($management) == 6 && preg_match_all ("/^[0-9]*$/",$management)) && (strlen($store) == 6 && preg_match_all ("/^[0-9]*$/",$store)))
|
||||||
{
|
{
|
||||||
echo(exec("./eCDPSerialGenerator.elf ".escapeshellarg($full_mac)." ".escapeshellarg($store)." ".escapeshellarg($management)));
|
echo(exec("./eCDPSerialGenerator.elf ".escapeshellarg($full_mac)." ".escapeshellarg($store)." ".escapeshellarg($management)));
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo("invalid query");
|
echo("invalid query");
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo("invalid request");
|
echo("invalid request");
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue