proxmark3 icon indicating copy to clipboard operation
proxmark3 copied to clipboard

Standalone Mode Memory Handling

Open cyber-vi-king opened this issue 2 years ago • 1 comments

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.

cyber-vi-king avatar Jun 15 '22 16:06 cyber-vi-king

Better to ask questions on discord.

iceman1001 avatar Jun 20 '22 15:06 iceman1001

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.

iceman1001 avatar Aug 16 '22 02:08 iceman1001