RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
3.63k stars 981 forks source link

Standalone Mode Memory Handling #1694

Closed cyber-vi-king closed 1 year ago

cyber-vi-king commented 2 years ago

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.

iceman1001 commented 2 years ago

Better to ask questions on discord.

iceman1001 commented 1 year ago

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.