proxmark3
proxmark3 copied to clipboard
Standalone Mode Memory Handling
Hi,
I'm trying to modify the HF_LEGIC
standalone module which saves scanned cards to SPIFFS for later use.
However, when saving them those dumps, it just checks the filename and appends an increasing -\d
if the
file already exists.
Now my plan was to avoid duplicates, but preferably based on the dump itself rather than just the name.
So I thought I could somehow load the existing file with rdv40_spiffs_read
into one variable and compare
that to the one just read which lives in another variable.
My problem is: malloc
does not seem to work and the BigBuf stuff does not sound like it allows me to
initiallize two variables?
I hope this makes any sense, my C is a bit rusty. I did learn C/C++ in university, but it's been some time.
Better to ask questions on discord.
You would need to first know how lard memory sections to handle. When in standalone mode you have much over to play with. So you can either define some arrays of the files you want to compare and act accordingly.
Or you can do bigbuff_malloc for two memory allocations but remember when freeing bigbuff, you free it all.