djekl Developments
An Uneducated example of Intelligence!
An Uneducated example of Intelligence!
Feb 19th
A few days ago I finished a new API I have been working on for a long time.
As you have seen before from me I created an API from the official XBOX Gamercard. This was good enough for getting a users information. However the Gamercard data is only refreshed every 2 or so hours. Also there is a big time difference between the en-US and en-GB versions of the gamercard.
Well I am proud to announce that this API has a lot more information, is as real-time as I can get without having XBCDP access, and has that all important Online Status, Full Games list and Achievement lists. Please note that this service will soon have an API limit placed on it, much like Twitters system. I won’t explain this system here as I am yet to fully design and implment it within the application.
Feel free to check it out, use the API and see exactly what can be done with it.
All example links are on the homepage… Xboxapi.com
PLEASE NOTE:
Xboxapi.com is an unofficial API of the Xbox LIVE Service, it is in no way endorsed or affiliated to the Microsoft Corporation, Xbox, Xbox LIVE and any Xbox images are registered trademarks of their respected owners.
Thanks, djekl
Dec 25th
I would like to wish everyone a merry Christmas, hope you all got everything you asked for off Santa.

Nov 15th
OK so I have seen that I am getting more and more hits on my site for “json to xml”+”php”.
This is all fine and well, as I know that the last major Gamertag Information API was made by Duncan and was in XML.
So what I am giving to you all today is a PHP script to convert JSON (fast and low footprint) to XML (not so) witin PHP.
Simple to use, and hopefully understand.
PHP Code:
< ?php
function ARRAYtoXML($array, $depth = 0){
$indent = '';
$return = '';
for($i = 0; $i < $depth; $i++)
$indent .= "\t";
foreach($array as $key => $item){
$return .= "{$indent}< {$key}>\n";
if(is_array($item))
$return .= ARRAYtoXML($item, $depth + 1);
else
$return .= "{$indent}\t< ![CDATA[{$item}]]>\n";
$return .= "{$indent}\n";
}
return $return;
}
$json_data = file_get_contents('http://djekldev.co.uk/card/json.php?tag=djekl');
$data = json_decode($json_data, true);
@header("Content-Type: text/xml");
print '< ?xml version="1.0" ?>' . "\n";
print ARRAYtoXML($data);
?>
CURL Function replacement for ‘file_get_contents()’:
// This is a CURL replacement to 'file_get_contents()'.
function get_contents($url)
{
$url = str_replace(" ", "%20", $url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
Example Output:
< ![CDATA[true]]> < ![CDATA[djekl]]> < ![CDATA[http://avatar.xboxlive.com/avatar/djekl/avatarpic-l.png]]> < ![CDATA[http://avatar.xboxlive.com/avatar/djekl/avatarpic-s.png]]> < ![CDATA[http://avatar.xboxlive.com/avatar/djekl/avatar-body.png]]>< ![CDATA[Gold]]> < ![CDATA[53346]]> < ![CDATA[500]]> < ![CDATA[Male]]> < ![CDATA[false]]> < ![CDATA[Newcastle, England]]> < ![CDATA[www.twitter.com/djekl]]> < ![CDATA[Loading...™]]> < ![CDATA[Quitting the game since 1988... Fallen friends will never be forgotten! Lets hope I'm not when its my time.]]> < ![CDATA[false]]> < ![CDATA[false]]> < ![CDATA[false]]> < ![CDATA[Skyrim]]> < ![CDATA[425307E6]]> < ![CDATA[http://marketplace.xbox.com/Title/1112737766]]> < ![CDATA[http://live.xbox.com/en-US/GameCenter/Achievements?titleId=1112737766&compareTo=djekl]]> < ![CDATA[http://tiles.xbox.com/tiles/qR/QI/1Gdsb2JhbA9ECgQKGgMfWSpVL2ljb24vMC84MDAwIAAAAAAAAPsnFLY=.jpg]]> < ![CDATA[11/15/2011]]> < ![CDATA[115]]> < ![CDATA[1000]]> < ![CDATA[11]]> < ![CDATA[50]]> < ![CDATA[22%]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/425307E6/en-US/smallboxart.jpg]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/425307E6/en-US/largeboxart.jpg]]> < ![CDATA[Modern Warfare® 3]]> < ![CDATA[415608CB]]> < ![CDATA[http://marketplace.xbox.com/Title/1096157387]]> < ![CDATA[http://live.xbox.com/en-US/GameCenter/Achievements?titleId=1096157387&compareTo=djekl]]> < ![CDATA[http://tiles.xbox.com/tiles/63/-y/0mdsb2JhbA9ECgQJGgYfViwhL2ljb24vMC84MDAwIAAAAAAAAP3df-Q=.jpg]]> < ![CDATA[11/9/2011]]> < ![CDATA[65]]> < ![CDATA[1000]]> < ![CDATA[7]]> < ![CDATA[50]]> < ![CDATA[14%]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/415608CB/en-US/smallboxart.jpg]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/415608CB/en-US/largeboxart.jpg]]> < ![CDATA[Battlefield 3]]> < ![CDATA[45410950]]> < ![CDATA[http://marketplace.xbox.com/Title/1161890128]]> < ![CDATA[http://live.xbox.com/en-US/GameCenter/Achievements?titleId=1161890128&compareTo=djekl]]> < ![CDATA[http://tiles.xbox.com/tiles/Fb/Ys/02dsb2JhbA9ECgQNGwEfV1pTL2ljb24vMC84MDAwIAAAAAAAAPwDtgo=.jpg]]> < ![CDATA[11/8/2011]]> < ![CDATA[300]]> < ![CDATA[1000]]> < ![CDATA[14]]> < ![CDATA[38]]> < ![CDATA[36%]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/45410950/en-US/smallboxart.jpg]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/45410950/en-US/largeboxart.jpg]]> < ![CDATA[Call of Duty ELITE]]> < ![CDATA[41560898]]> < ![CDATA[http://marketplace.xbox.com/Title/1096157336]]> < ![CDATA[http://live.xbox.com/en-US/GameCenter/Achievements?titleId=1096157336&compareTo=djekl]]> < ![CDATA[http://tiles.xbox.com/tiles/S9/J4/0mdsb2JhbA9ECgQJGgYfVlZbL2ljb24vMC84MDAwIAAAAAAAAP1X0lQ=.jpg]]> < ![CDATA[11/8/2011]]> < ![CDATA[0]]> < ![CDATA[0]]> < ![CDATA[0]]> < ![CDATA[0]]> < ![CDATA[0%]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/41560898/en-US/smallboxart.jpg]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/41560898/en-US/largeboxart.jpg]]> < ![CDATA[Forza Motorsport 4]]> < ![CDATA[4D530910]]> < ![CDATA[http://marketplace.xbox.com/Title/1297287440]]> < ![CDATA[http://live.xbox.com/en-US/GameCenter/Achievements?titleId=1297287440&compareTo=djekl]]> < ![CDATA[http://tiles.xbox.com/tiles/9R/uF/1Gdsb2JhbA9ECgR8GgMfV15TL2ljb24vMC84MDAwIAAAAAAAAPuqG+o=.jpg]]> < ![CDATA[11/1/2011]]> < ![CDATA[405]]> < ![CDATA[1000]]> < ![CDATA[30]]> < ![CDATA[48]]> < ![CDATA[62%]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/4D530910/en-US/smallboxart.jpg]]> < ![CDATA[http://tiles.xbox.com/consoleAssets/4D530910/en-US/largeboxart.jpg]]>
Aug 25th
OK so I have recently recoded the API with a few extra features. And because many of you are already using this I didn’t want to mess to much with the v1.
Well all I am going to say is here is the link, have fun.
https://www.djekldev.co.uk/card/v2
This version is now using a cache system that will update if the cache is older than an hour. This means for you faster results.
Jul 21st
Recently @SecurityTube have started releasing Megaprimer course DVD’s. These are the video’s from the website on a DVD for you to watch at home to learn from.
I am showing my support by offering the hosting of a mirror. – http://securitytube.djekl.co.uk
Be sure to check them out at the following links:
@SecurityTube on Twitter
SecurityTube Website
Jul 18th
OK so today I will be sharing with you AES 256 Encryption for use between PHP and C#.
This encryption can be Encrypted in either PHP or C# and Decrypted in the other.
PHP Code:
function addpadding($string, $blocksize = 32)
{
$len = strlen($string);
$pad = $blocksize - ($len % $blocksize);
$string .= str_repeat(chr($pad), $pad);
return $string;
}
function strippadding($string)
{
$slast = ord(substr($string, -1));
$slastc = chr($slast);
$pcheck = substr($string, -$slast);
if(preg_match("/$slastc{".$slast."}/", $string)){
$string = substr($string, 0, strlen($string)-$slast);
return $string;
} else {
return false;
}
}
function encrypt($string = "")
{
$keyfile = "./AES.keyz";
$keyfile = file($keyfile);
$key = base64_decode($keyfile[0]);
$iv = base64_decode($keyfile[1]);
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, addpadding($string), MCRYPT_MODE_CBC, $iv));
}
function decrypt($string = "")
{
$keyfile = "./AES.keyz";
$keyfile = file($keyfile);
$key = base64_decode($keyfile[0]);
$iv = base64_decode($keyfile[1]);
$string = base64_decode($string);
return strippadding(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $string, MCRYPT_MODE_CBC, $iv));
}
C# Code:
private String AES_encrypt(String Input)
{
var aes = new RijndaelManaged();
aes.KeySize = 256;
aes.BlockSize = 256;
aes.Padding = PaddingMode.PKCS7;
aes.Key = Convert.FromBase64String(AES_Key);
aes.IV = Convert.FromBase64String(AES_IV);
var encrypt = aes.CreateEncryptor(aes.Key, aes.IV);
byte[] xBuff = null;
using (var ms = new MemoryStream())
{
using (var cs = new CryptoStream(ms, encrypt, CryptoStreamMode.Write))
{
byte[] xXml = Encoding.UTF8.GetBytes(Input);
cs.Write(xXml, 0, xXml.Length);
}
xBuff = ms.ToArray();
}
String Output = Convert.ToBase64String(xBuff);
return Output;
}
private String AES_decrypt(String Input)
{
RijndaelManaged aes = new RijndaelManaged();
aes.KeySize = 256;
aes.BlockSize = 256;
aes.Mode = CipherMode.CBC;
aes.Padding = PaddingMode.PKCS7;
aes.Key = Convert.FromBase64String(AES_Key);
aes.IV = Convert.FromBase64String(AES_IV);
var decrypt = aes.CreateDecryptor();
byte[] xBuff = null;
using (var ms = new MemoryStream())
{
using (var cs = new CryptoStream(ms, decrypt, CryptoStreamMode.Write))
{
byte[] xXml = Convert.FromBase64String(Input);
cs.Write(xXml, 0, xXml.Length);
}
xBuff = ms.ToArray();
}
String Output = Encoding.UTF8.GetString(xBuff);
return Output;
}
For the AES.Keyz file this is it.
PSVJQRk9QTEpNVU1DWUZCRVFGV1VVT0ZOV1RRU1NaWQ=
YWlFLVEZZUFNaWlhPQ01ZT0lLWU5HTFJQVFNCRUJZVA=
32 chr string (32 * 8 = 256 bit)
For this the IV and Key MUST both be a 32 char (256bit) key. I am using a byte[]
Nice and simple to use and has helped me out more than once.
It also supports PKCS7 padding within the PHP.
Example Application
http://dl.dropbox.com/u/11393837/C%20sharp%20AES%20EnDecryption.rar
EDIT: PHP code updated, thanks to PepLamb for noticing.
Jul 5th
OK so I know I have neglected this project for some time now. And with the v2 still not out of a beta, I am wanting some of you to test this extensively.
When I develop and test this, I only have a virgin board. This means no customisation from a fresh install.
I know you guys can have a heavily modified board.
With V2 I have given you the opportunity to show errors, therefore when your users say there having issues, or you are saying to me you have issues, we can sit down and attempt to figure it out better than “Bad Username/Pass”.
What I am looking for is at least 2 beta testers with modified boards of the following forums.
• SMF
• vBulletin
• IP.Board v2 and v3 (Invision Power Board / IPB)
• MyBB 1.6
• phpBB3
If you have a forum that is not listed, then please do put down your contact details and the forum, after testing and development of v2 I will contact you to get your forum type developed and tested.
REPLY WITH THIS INFORMATION
Name:
Email: example[AT]domain[DOT]com
Forum Name:
Forum Script:
Modified? YES/NO
If yes, heavily modified? YES/NO
Do you currently use ForumConnect? YES/NO
If you use ForumConnect, is it working? YES/NO
Thanks
I have now created a testing application for the Beta testers of the ForumConnect 2 script.
Here is what it looks like, and I have also hidden in a small “Controlled Enviroment” test.
It reads the version number from the dll. To use simply enter the URL for the ForumConnect, your private SALT, Username and Password.
Jun 11th
OK so I have noticed that more and more people are using JSON for there API’s.
Now this I know can be seen as tricky for some to use, so what I have done today is gather some code together to convert JSON to a more familuar Markup language XML.
1st things 1st
Without the dll from James Newton King, I would not have been able to do this.
Also you will need to download said dll for use with this example code. || DOWNLOAD LINK.
Now to the code, here it is.
Its just an example of how you can do it, and is provided as is!
using System;
using System.IO;
using System.Net;
using System.Windows.Forms;
using System.Xml;
using Newtonsoft.Json;
namespace JSON2XML
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e1)
{
/* because the origional JSON string has multiple root's this needs to be added */
string json = "{BFBC2_GlobalStats:";
json += DownlodUrl("http://api.bfbcs.com/api/xbox360?globalstats");
json += "}";
XmlDocument doc = (XmlDocument)JsonConvert.DeserializeXmlNode(json);
textBox1.Text = GetXmlString(doc);
}
private string DownlodUrl(string url)
{
string result = null;
try
{
WebClient client = new WebClient();
result = client.DownloadString(url);
}
catch (Exception ex)
{
// handle error
result = ex.Message;
}
return result;
}
private string GetXmlString(XmlDocument xmlDoc)
{
StringWriter sw = new StringWriter();
XmlTextWriter xw = new XmlTextWriter(sw);
xw.Formatting = System.Xml.Formatting.Indented;
xmlDoc.WriteTo(xw);
return sw.ToString();
}
}
}
Jun 3rd
Well today I finally got into Forrst
A massive thanks goes out to Zack Kitzmiller @ZackKitzmiller who I now know is STAFF on Forrst.
Well if you want come check me out http://forrst.me/djekl
Jun 1st
OK so with thanks to @RealJBlaze for his gamercard src. Was nice to start from.
I am now offering a gamercard service free of charge, feel free to use…
This can be found here –> http://www.djeklDev.co.uk


Bionic TicTac’s Gamercard



SAS Chimera’s Gamercard



JI IB IL A Z IE’s Gamercard



UPDATE: Added NXE Gamercards