Hi All,
2 (related) questions in 1 thread here:
I'm looking at Chapter 10.5.1.7 of GSM 04.08, also Figure 10.5.7 there, but I am not quite getting how to interpret it in relation to either openBSC log output such as:
<000d> db.c:1130 Sync Equipment IMEI=357371048322730, classmark1=33, classmark2=33 18 82 , classmark3=00 08 00 52 20 00 00 4b
or equally:
root@bsc:~# echo "SELECT classmark1 FROM Equipment where id='505';" | sqlite3 /var/lib/osmocom/hlr.sqlite3 | xxd 0000000: 3531 0a 51. root@bsc:~# echo "SELECT classmark2 FROM Equipment where id='505';" | sqlite3 /var/lib/osmocom/hlr.sqlite3 | xxd 0000000: 0132 1781 0a .2... root@bsc:~# echo "SELECT classmark3 FROM Equipment where id='505';" | sqlite3 /var/lib/osmocom/hlr.sqlite3 | xxd 0000000: 01ff 07ff 511f ffff 4a0a ....Q...J.
Specifically, in this case, not having the mathematical theory, I don't understand how to map
01ff 07ff 511f ffff 4a0a to 00 08 00 52 20 00 00 4b It doesn't /quite/ match, but more importantly mapping to Classmark 3 Value Part
Could you help me understand how to map 01ff 07ff 511f ffff 4a0a to Figure 10.5.7
BTW, I get that the BLOBs in sqlite are somehow encoded, (if that is not completely the wrong term to use) as hex_value-1, I've also noted this in the SMS table when trying to identify an sms in the sms_queue. So question part 2: what is that about? Is there an easy way I could "decode" on the command line, as in:
echo "SELECT user_data FROM sms limit 1;" | sqlite3 /var/lib/osmocom/hlr.sqlite3 | some magic to display readable SMS content
Any tips?
Thanks!
On 09 Sep 2016, at 15:06, Keith Whyte keith@rhizomatica.org wrote:
BTW, I get that the BLOBs in sqlite are somehow encoded, (if that is not completely the wrong term to use) as hex_value-1, I've also noted this in the SMS table when trying to identify an sms in the sms_queue. So question part 2: what is that about? Is there an easy way I could "decode" on the command line, as in:
echo "SELECT user_data FROM sms limit 1;" | sqlite3 /var/lib/osmocom/hlr.sqlite3 | some magic to display readable SMS content
Right libdbi has encoding for "blob". tnt has written a _dbi_binary_quote in python in pysim. It might help you to write the unquote.
holger
On 09/09/2016 15:49, Holger Freyther wrote:
Right libdbi has encoding for "blob". tnt has written a _dbi_binary_quote in python in pysim. It might help you to write the unquote.
holger
Right, not perfect, but it'll do:
def _dbi_binary_unquote(s): e = ord(s[0]) out = [] for c in s: x = (256 + ord(c) + e) % 256 if x < 256: out.append(chr(x)) return ''.join(out)
Any clues on classmark analysis?
Thanks.
On 09 Sep 2016, at 19:39, Keith keith@rhizomatica.org wrote:
Any clues on classmark analysis?
As in general approach? Take the wireshark code and feed it your data? If you want to do analysis in python you could look at "libmich" and see how good their bit parsing infrastructure is?
holger