If you have Lookout version >=4 then it is not too hard since Lookout supports data polymorphism. Attached is a Lookout 5.0 file that can help you. If you do not have Lookout 5 then compile the script file (.lks) in Lookout 4 (you may need to make some minor modifications). If you have < Lookout 4 then this may not work at all.
Basically, I parsed the hex value into its binary components and performed individual bit ands. I then recombined the bits to output a decimal and hexadecimal value. Its a little tedious but not too hard.
This will at least give you some ideas.
Regards,
Tommy Scharmann