The value is zero

Good morning,

I would like to extract msb data using the lua script but it gives me the nil value.

my code :
local function read_Data()
local block9 = core.console(‘lf em 4x50 rdbl -b 9’)
print(string.format(acgreen…‘MSB : %s’, block9)…acoff)
end

how can I get the msb value compared to the code lf em 4x50 rdbl -b 9?

1 Like

Can you post more details of what you’re trying to do? What are you trying to achieve? What cards or fobs are you working with? What tools are you using? (Ok, I assume a Proxmark3 Easy but more details could be helpful) What client and firmware versions are you using?

2 Likes

the goal is to have the sum on the key directly without going through the dump file. the client and firmware versions that use: version v4.18341

my original code:
— balance reading on the key
local function read_Data()
print(acgreen…‘balance reading’…acoff)

-- Reading blocks 5 and 9
local block5 = core.console('lf em 4x50 rdbl -b 5')  -- Example command to read block 5
local block9 = core.console('lf em 4x50 rdbl -b 9')  -- Example command to read block 9

-- Extracting hexadecimal data and converting to decimal
local hex_value = string.format("%s%s", block5, block9) -- Combine data if necessary
local saldo = tonumber(hex_value, 16) / 10  -- Divide by 10 to get the exact amount

print(acgreen..'The current balance is : '..saldo..' euros'..acoff)
return saldo

end

1 Like

here is the result in core.console(‘lf em 4x50 rdbl -b 9’)
result :
[=] # | word (msb) | word (lsb) | desc
[=] ----±------------±------------±-------------------
[=] 9 | A4 80 00 00 | 00 00 01 25 | user data
[=] ----±------------±------------±-------------------

how can I get the msb value in core.console?

1 Like