Skip to content

Instantly share code, notes, and snippets.

@colinoflynn
Created September 7, 2021 14:27
Show Gist options
  • Save colinoflynn/4c8b0cc1966733e6b6e615e323f99a58 to your computer and use it in GitHub Desktop.
Save colinoflynn/4c8b0cc1966733e6b6e615e323f99a58 to your computer and use it in GitHub Desktop.
ioprox Card Numbers to Proxmark Hex Data
# Encodes ioprox data to format used by proxmark, if using a version that doesn't allow you to specify
# the version/facility/cardnumber seperately.
id_str = "XSF(01)66:25342"
version = id_str.split('(')[1].split(')')[0]
facility = id_str.split('(')[1].split(')')[1].split(':')[0]
code = id_str.split(':')[1]
version = int(version, 16) #is this hex? Have only seen 1 or 2 here
facility = int(facility, 16) #this is always hex
code = int(code, 10) #this is always decimal
checksum = 0xF0 + facility + version + (code >> 8) + (code & 0xff)
checksum = 0xFF ^ (checksum & 0xff)
id_strbin = format(0, '08b') + "0" + \
format(0xF0, '08b') + "1" + \
format(facility, '08b') + "1" + \
format(version, '08b') + "1" + \
format(code >> 8, '08b') + "1" + \
format(code & 0xff, '08b') + "1" + \
format(checksum, '08b') + "11"
print(id_strbin)
id_int = int(id_strbin, 2)
id_strhex = format(id_int, '016x')
print(id_strhex)
@iceman1001
Copy link

interesting, sim vs clone doesn't allow for raw vs vn/fc/cn inputs. That would be a nice addition

lf io sim
lf io clone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment