Mediawiki: exadecimal values for archived mysql data
Many of the values archived on /for the Media Wiki software on a default installation and that constitute the environment data sources for this application written in php are encoded in hexadecimal, so for example the field related to the users options look like this sequence (the string need to be considered on one single line without spaces and tabs: it has been split on several lines to do not breack out html tables):
0x717569636b6261723d310a756e6465726c696e653
d320a636f6c733d38300a726f77733d32350a
7365617263686c696d69743d32300a636f6e7
46578746c696e65733d350a636f6e74657874
63686172733d35300a64697361626c6573756
7676573743d300a736b696e3d0a6d6174683d
310a7573656e657772633d300a72636461797
33d370a72636c696d69743d35300a776c6c69
6d69743d3235300a686964656d696e6f723d30
0a686967686c6967687462726f6b656e3d310a
737475627468726573686f6c643d300a707265
766965776f6e746f703d310a707265766965776
f6e66697273743d300a6564697473656374696f
6e3d310a6564697473656374696f6e6f6e72696
76874636c69636b3d300a656469746f6e64626
c636c69636b3d300a6564697477696474683d3
00a73686f77746f633d310a73686f77746f6f6c6
261723d310a6d696e6f7264656661756c743d3
00a646174653d64656661756c740a696d61676
573697a653d320a7468756d6273697a653d320
a72656d656d62657270617373776f72643d300
a6e6f63616368653d300a646966666f6e6c793d
300a73686f7768696464656e636174733d300a
6e6f726f6c6c6261636b646966663d300a656e6
f74696677617463686c69737470616765733d3
00a656e6f7469667573657274616c6b7061676
5733d310a656e6f7469666d696e6f7265646974
733d300a656e6f74696672657665616c616464
723d300a73686f776e756d6265727377617463
68696e673d310a66616e63797369673d300a65
787465726e616c656469746f723d300a657874
65726e616c646966663d300a666f7263656564
697473756d6d6172793d300a73686f776a756d
706c696e6b733d310a6a7573746966793d300a
6e756d62657268656164696e67733d300a7573
656c697665707265766965773d300a77617463
686c697374646179733d330a657874656e6477
617463686c6973743d300a77617463686c6973
74686964656d696e6f723d300a77617463686c
69737468696465626f74733d300a7761746368
6c697374686964656f776e3d300a7761746368
6c69737468696465616e6f6e733d300a776174
63686c697374686964656c69753d300a776174
63686372656174696f6e733d300a7761746368
64656661756c743d300a77617463686d6f7665
733d300a776174636864656c6574696f6e3d30
0a6e6f636f6e766572746c696e6b3d300a76617
269616e743d656e0a6c616e67756167653d656
e0a7365617263684e73303d31
while this is the text translation of the hexadecimal:
quickbar=1
underline=2
cols=80
rows=25
searchlimit=20
contextlines=5
contextchars=50
disablesuggest=0
skin=
math=1
usenewrc=0
rcdays=7
rclimit=50
wllimit=250
hideminor=0
highlightbroken=1
stubthreshold=0
previewontop=1
previewonfirst=0
editsection=1
editsectiononrightclick=0
editondblclick=0
editwidth=0
showtoc=1
showtoolbar=1
minordefault=0
date=default
imagesize=2
thumbsize=2
rememberpassword=0
nocache=0
diffonly=0
showhiddencats=0
norollbackdiff=0
enotifwatchlistpages=0
enotifusertalkpages=1
enotifminoredits=0
enotifrevealaddr=0
shownumberswatching=1
fancysig=0
externaleditor=0
externaldiff=0
forceeditsummary=0
showjumplinks=1
justify=0
numberheadings=0
uselivepreview=0
watchlistdays=3
extendwatchlist=0
watchlisthideminor=0
watchlisthidebots=0
watchlisthideown=0
watchlisthideanons=0
watchlisthideliu=0
watchcreations=0
watchdefault=0
watchmoves=0
watchdeletion=0
noconvertlink=0
variant=en
language=en
searchNs0=1
An useful, well done and simple Php function grabbed from php.net that convert hexadecimal to binary-string is this:
// Convert a hex-string to binary-string (the way back from bin2hex) - by Chaos79
function hex2bin($h)
{
if (!is_string($h)) return null;
$r=”;
for ($a=0; $a < strlen($h); $a+=2) { $r.=chr(hexdec($h{$a}.$h{($a+1)})); }
return $r;
}
echo bin2hex(‘Hello’); // result: 48656c6c6f
echo hex2bin(‘48656c6c6f’); // result: Hello
Note: you need to cut off the initial 0x characters from the passed hexadecimal value or the conversion will return nothing.
Tags: 0x, hexadecimal, mediawiki, mysql

