Closed doegox closed 4 years ago
yup. we can skip print(".")
aswell.
How many of these do we have?
a lot apparently
rg printf|egrep -v "(snprintf|sprintf|liblua|fprintf|Dbprintf|armsrc|:[[:space:]]*/|hardnested_tables.c|zlib|mbedtls|hitag2crack|mfkey|nonce2key|//.*printf|\.git|Makefile|sh:|deprecated|argtable3|cliparser)"|grep -o "[^:]*\.c:"|sort|uniq -c|sort -n -r
27 client/src/emv/emv_pki.c:
18 client/src/fido/cbortools.c:
13 client/src/cmdhfmf.c:
11 client/src/loclass/ikeys.c:
11 client/src/cmdhfmfp.c:
10 client/deps/hardnested/hardnested_bf_core.c:
8 client/src/util.c:
7 client/src/emv/test/cda_test.c:
7 client/src/emv/crypto_polarssl.c:
6 client/src/emv/test/dda_test.c:
6 client/src/crypto/libpcrypto.c:
6 client/src/cmdhflegic.c:
5 client/src/loclass/hash1_brute.c:
4 client/src/uart/uart_win32.c:
4 client/src/scripting.c:
4 client/src/emv/test/sda_test.c:
4 client/src/comms.c:
4 client/src/cmdsmartcard.c:
4 client/src/cmdlf.c:
4 client/src/cmdhfmfdes.c:
4 client/src/cmdhffido.c:
3 client/src/mifare/mifarehost.c:
3 client/src/loclass/elite_crack.c:
3 client/src/emv/test/crypto_test.c:
3 client/src/emv/emv_pk.c:
2 client/src/ui.c:
2 client/src/uart/uart_posix.c:
2 client/src/emv/emv_roca.c:
2 client/src/cmdlft55xx.c:
2 client/src/cmdlfgallagher.c:
2 client/src/cmdhficlass.c:
2 client/src/cmddata.c:
2 client/src/cmdanalyse.c:
1 common/crc.c:
1 client/src/wiegand_formatutils.c:
1 client/src/proxmark3.c:
1 client/src/cmdhw.c:
1 client/src/cmdhfmfu.c:
1 client/src/cmdhffelica.c:
1 client/src/cmdhfcryptorf.c:
1 client/src/cmdhf.c:
1 client/src/cmdhf15.c:
1 client/src/cmdhf14b.c:
1 client/deps/tinycbor/cborpretty.c:
1 client/deps/jansson/strconv.c:
well... you take took many. s*printf , dbprintf, shouldn't be changed.
Well, if you don't wanna start with "PrintAndLogEx" on device side... NOoooo. Stop it.
well... you take took many. s*printf , dbprintf, shouldn't be changed.
They were filtered out
Well, if you don't wanna start with "PrintAndLogEx" on device side... NOoooo. Stop it.
ARM was filtered out
See the list of concerned files. Still there can be a few positive, e.g. in a /* comment
Adapted to exclude the new folders
rg printf|egrep -v "(snprintf|sprintf|liblua|fprintf|Dbprintf|armsrc|:[[:space:]]*/|hardnested_tables.c|zlib|mbedtls|cryptorf|mf_nonce_brute|hitag2crack|mfkey|nonce2key|//.*printf|\.git|Makefile|sh:|deprecated|argtable3|cliparser)"|grep -o "[^:]*\.c:"|sort|uniq -c|sort -n -r
4 client/src/ui.c: --> printing before "log"
2 tools/fpga_compress/fpga_compress.c: --> the tools are ignored.
2 client/src/proxmark3.c: --> is not included in the "lib" idea
1 common/crc.c: --> commented out
1 client/deps/tinycbor/cborpretty.c --> commented out
1 client/deps/jansson/strconv.c: --> commented out
So, reducing the filter (add cliparse, argtable)
rg printf|egrep -v "(snprintf|sprintf|liblua|fprintf|Dbprintf|armsrc|:[[:space:]]*/|hardnested_tables.c|zlib|mbedtls|cryptorf|mf_nonce_brute|hitag2crack|mfkey|nonce2key|//.*printf|\.git|Makefile|sh:|deprecated)"|grep -o "[^:]*\.c:"|sort|uniq -c|sort -n -r
28 client/deps/cliparser/argtable3.c:
19 client/src/pm3_pywrap.c:
18 client/src/pm3_luawrap.c:
4 client/src/ui.c: --> printing before "log"
2 tools/fpga_compress/fpga_compress.c: --> the tools are ignored.
2 client/src/proxmark3.c: --> is not included in the "lib" idea
1 common/crc.c: --> commented out
1 client/deps/tinycbor/cborpretty.c: --> commented out
1 client/deps/jansson/strconv.c: --> commented out
This leads me the clean list, where we have some new wrap files doing stuff.
28 client/deps/cliparser/argtable3.c:
19 client/src/pm3_pywrap.c:
18 client/src/pm3_luawrap.c:
wrappers are generated by SWIG, I guess it is safe to ignore them for the moment. but at some point we'll have to look into all I/O-related and SWIG.
There are still quite a number of printf in the client code. Maybe a few are legit, but most should be converted to make sure they get logged as well.
(magic grep:
rg printf|egrep -v "(snprintf|sprintf|liblua|fprintf|:[[:space:]]*/|hardnested_tables.c|//.*printf|\.git)"|grep -o "[^:]*\.c:"|sort|uniq -c|sort -n -r
)