Showing posts with label technology. Show all posts
Showing posts with label technology. Show all posts

Wednesday, December 12, 2012

hex2float.py

Quick an dirty hex2float python code.

Useful for taking a hexadecimal value and turn it into a floating point, this follow IEEE 754 and understanding of C99 Standard Section 6.4.4.2.



  # Assuming a hexadecimal value passed in, print out the
  # floating point equivalent. Can then use things like
  # float.hex(), float.fromhex() etc.
  1 def hex2float(hex):
  2   h = int(hex)
  3   sign = ((h >> 31) & 0x1)
  4   exp  = (h >> 23) & 0xff
  5
  6   ctr = 1
  7   mantissa = 0.0 if (exp-127) == -127 else 1.0  # Per IEEE 754
  8   while ctr <= 23:
  9     mantissa += ((h >> (23 - ctr) & 0x1) * (2**(-ctr)))
 10     ctr += 1
 11
 12   result = ( ((-1)**sign) * (mantissa) * (2**(exp-127)) )
 13   print "result = %s" % (result)

Tuesday, October 2, 2012

Mobile Security

Mobile device security has been a focus for my career and I have the opportunity to work on some really amazing projects. All which are sadly not acceptable for public consumption/sharing.


Seeing as though this is my first 'Technology' focused post, I thought I'd share a link to a security researchers who I often following. While there are dozens of researchers out there who publish great work in the domain of computer network/system security. Collin Mulliner of http://www.Mulliner.org is often publishing research pertinent to my interests.

In recent news, USSD has been demonstrated to be be capable of wiping some Samsung phones. Collin has released a quick tool to help mitigate this. Here is a link to his page, http://mulliner.org/security/telstop/. There is no use in re-iterating its purpose here, head over to his page and take a look at the tool as well as the link to the presentation showing how to use USSD in nefarious ways.

In the future I'll try and post things that I either find interesting, or that I work on my own (and can publish) which are Technology related. 

Monday, September 17, 2012

Sticking my head out of the nest...

Taking a look at what these inter-webs is all about. Going to potentially post some information, mostly for myself on here. If you come across it and find it useful great, if not, well bugger off. Since I have various hobbies, interests, etc. I figured I may as well capture some of it somewhere.