some updated scripts

This commit is contained in:
iceman1001 2017-07-04 20:05:50 +02:00
commit fa8da9e651
6 changed files with 55 additions and 19 deletions

View file

@ -1,9 +1,8 @@
local _names = {
--[[
decimal, di version, model name
decimal, di edition, model name
--]]
{
"1000001","1","Mr. Incredible"},
local _names = {
{"1000001","1","Mr. Incredible"},
{"1000002","1","Sully"},
{"1000003","1","Captain Jack Sparrow"},
{"1000004","1","Lone Ranger"},
@ -320,6 +319,9 @@ local _names = {
{"4000226","3","?? unknown ??"},
{"4000227","3","?? unknown ??"},
{"4000229","3","Quad Jumper"},
--[[
these below are Portals. Not to be used for tags.
--]]
{"8032384","0","Infinity Base - 3DS"},
{"8032385","0","Infinity Base - Xbox"},
{"8032386","0","Infinity Base"},
@ -327,18 +329,17 @@ local _names = {
{"8039228","0","Infinity Base - Vita"},
{"8040889","0","Infinity Base - Bluetooth"},
}
local function find( main, sub)
local function find( main )
main = main:lower()
sub = sub:lower()
for k, v in pairs(_names) do
if ( v[2]:lower() == main and v[3]:lower() == sub) then
if ( v[1]:lower() == main ) then
return v
end
end
return nil
end
local function list()
print ("Type\tVer\t Model name")
print ("Type\tEdition\t Model name")
print (string.rep('=', 54))
for k, v in pairs(_names) do
print(("%s\t%s\t%s"):format(v[1],v[2],v[3] ))

View file

@ -26,7 +26,7 @@ local ISO14A_COMMAND = {
}
local ISO14443a_TYPES = {}
ISO14443a_TYPES[0x00] = "NXP MIFARE Ultralight | Ultralight C"
ISO14443a_TYPES[0x00] = "NXP MIFARE Ultralight | Ultralight C | NTAG"
ISO14443a_TYPES[0x01] = "NXP MIFARE TNP3xxx Activision Game Appliance"
ISO14443a_TYPES[0x04] = "NXP MIFARE (various !DESFire !DESFire EV1)"
ISO14443a_TYPES[0x08] = "NXP MIFARE CLASSIC 1k | Plus 2k"
@ -78,7 +78,7 @@ end
-- nil, errormessage if unsuccessfull
local function sendToDevice(command, ignoreresponse)
--core.clearCommandBuffer(
--core.clearCommandBuffer()
local err = core.SendCommand(command:getBytes())
if err then
print(err)

View file

@ -140,7 +140,7 @@ local Utils =
------------ CRC-64 ecma checksums
-- Takes a hex string and calculates a crc64 ecma
-- Takes a hex string and calculates a crc64 ecma hash
Crc64 = function(s)
if s == nil then return nil end
if #s == 0 then return nil end
@ -152,6 +152,19 @@ local Utils =
end
return nil
end,
------------ CRC-64 ecma 182 checksums
-- Takes a hex string and calculates a crc64 ecma182 hash
Crc64_ecma182 = function(s)
if s == nil then return nil end
if #s == 0 then return nil end
if type(s) == 'string' then
local utils = require('utils')
local asc = utils.ConvertHexToAscii(s)
local hash = core.crc64_ecma182(asc)
return hash
end
return nil
end,
------------ SHA1 hash
-- Takes a string and calculates a SHA1 hash