From d8342d31735b119a52ada7e3f321274f1d65f168 Mon Sep 17 00:00:00 2001 From: Baruch Even Date: Fri, 25 Aug 2017 21:53:56 +0300 Subject: [PATCH] Squashed 'libscsicmd/' changes from 135a605c..f53e6bbf f53e6bbf Add some comments 4e666b9f Remove check on inquiry format 39a5bd4f Allow inquiry format 0 as well 9893ef86 Fix incorrect field setting 167c63d8 Parse 16bit counter in log pages bc512a45 Adjust inquiry request to 96 bytes 4f2eccbc Inquiry may fail on older devices with too high buffer size 639ee05a Collect ATA CHECK POWER MODE 82c84f3e Validate ATA pages 1f31c0e1 Read all ATA SMART READ LOG pages 92303709 Continue reading if the sense key is only corrected error fcffb5df Streamline ATA checksum checks 72069890 Parse qword in ATA, use for extended addressable num blocks 13c79486 Fix warnings about casts 5c502209 Collect all LOG READ EXT pages from ATA device d56d934c Change ATA buffers to use unsigned char * 0dbd2885 Collect only relevant GPL LOG PAGES 4480fb1d Refactor READ LOG EXT a bit 054bedaa Use simple_command throughout collect_raw_data 167c5b3a Collect ATA READ LOG EXT data from ATA devices b8386fb8 Add fields to ATA IDENTIFY parsing 5c09c117 Parse more bits in ATA IDENTIFY 5405f878 Add collection of ATA commands a69e81cd Fix handling of LOG SENSE page 0 handling 1896a4ed Forgot to break after removing returns in select 4f568bea Parse multiple inputs when not in AFL mode 06223061 Implement functions for LOG SENSE page 0 and also supported subpages ff2dd689 Fix a spelling mistake 6876bcbe Do more loops in AFL eea73c0c Fix missing checks for memory overrun 059ca6ad Fix a memory leak 09606b26 Speed up AFL further c046da7b Add debug logs for some parsing in mode sense 80e34f9f Refactor LOG SENSE validations dffd8185 Fix bug in parsing MODE SENSE data pages 3ec7cce8 Prevent overflows when calculating on page fields cc7cfe0b Speed up AFL testing c2ec02de Reorder flags to allow command line override 30104e8c Remove long test files adf29c6b Provide a macro to traverse MODE SENSE pages safely 3f6293a5 Update AFL test cases abf0cf2e Use consistent naming with _is_valid a958ec3c Add instructions for using AFL cd825dec Fix warning 51b8dddf Option to build in Debug and Release mode ce662176 Fix hang on parsing sense buffer 0239fcb4 Use common utility functions ac587543 Fix hang on MODE SENSE parsing d57b47dc Validate EVPD parsing cf187cdb Allocate memory for data read 2b967673 Validate MODE SENSE 6 header aaa9c819 Ensure CSV input is null-terminated 7b5c1077 Better validation of SES config page 1 descriptors 625cd3dc Fix crash found with AFL 48d8147a Make code easier to debug 04aaf73a Allow input from file for American Fuzzy Lop 567cbcbf Parse LOG SENSE counters and ascii strings 802b56c3 Add SCSI protocol identifier list 027c9f79 Compile with full optimization 9cf3fcab Add headers to output 57fef724 Utilities to debug for parse_scsi and collect_raw_data 959c401e Parse LOG SENSE Information Exceptions (0x2F) 32b237e5 Parse SES page 1 (config) partially cc627ebd Parse RECEIVE DIAGNOSTIC RESULT 69f52561 Reminder to parse mode sense 70498133 Fully parse READ DEFECT DATA 446e9b32 Output format name as string f2c1bf1c Parse structure of READ DEFECT DATA 10 and 12 0da69ffa Change API of get_uint32 and get_uint64 10f5a1c7 Parse MODE SENSE structures 773be5c5 Add debug info b5dbafb4 Do not consider errors as debug 915ee2c4 List TODO items in the code 0f713b1b parse_scsi: Parse inquiry data ff0b6909 parse_scsi: Parse READ CAPACITY 16 b441d383 parse_scsi: Parse the sense buffer f7a9cc36 parse_scsi: Parse READ CAPACITY 10 0ced00de Rename parse_scsi_log_sense to parse_scsi 64c76d95 Properly parse Log Sense page 0 and subpage 0/0xff 0f9f46ea Fix wrong print format 907ae093 Avoid warning on unnused variable 85a1ec79 Parse the informational exception log sense page 0x2f 5828602c Parse more of the LOG SENSE data a4b9db5f Parse LOG SENSE data b31817d1 Clear buffer before reading a639c199 Collect READ DEFECT DATA 29338a54 Collect READ CAPACITY information 4b296f89 Add utility to collect raw data for later analysis bc1842db Allow avoiding debug messages ccd6413a Fix a copy/paste mistake 72be5d95 Dump simple inquiry in hex 6c611f1d Add a missing include a4069041 Dump EVPD data 8e1d09b6 Remove subpage from RECEIVE DIAGNOSTIC RESULTS 393f20dd Dump the CDB to be able to debug and compare 95b8a275 Use the response dump definition in one header only 6e418c72 Parse MODE SENSE headers f879214e Fix RECEIVE DIAGNOSTIC RESULTS 567bcd06 Move common functions to a util header b785b4b1 Add cdbs for MODE SENSE 6 and MODE SENSE 10 328c5a40 Dump RECEIVE DIAGNOSTICS page data ad8c0b18 Add send and receive diagnostics commands git-subtree-dir: libscsicmd git-subtree-split: f53e6bbf3ba5f3b9cf321d3ac6a58e0ec686cd9f --- .gitignore | 4 + CMakeLists.txt | 5 +- README.md | 31 +- .../186704e9f39832c4c7b4f2ab71c52762017bd728 | 1 + .../1b5fac8682806d6e823c301159d6da81e30f421a | 1 + .../28eeac63bfcf7ad2126d2eddcdc04019270075ec | 1 + .../2b34251f3421af9a5c53a41f7e27f1cc3e8a13b0 | 1 + ...c99f32ec43d6ee12857a64e031114ae7cf23cd.csv | 1 + .../4941885df82498d8ca26375728606d41be818e27 | 1 + ...4ff10f0a6f35849db7e44176aa94c6dc232872.csv | 1 + .../5b7d04cbfbe29ec8f91526131c87e7cc8e9ea10e | 1 + ...7ce3a43c7dbb1ba99a422ce455c1b55d2260b4.csv | 1 + .../6184436113637747407bf86315ebd987300b8799 | 1 + ...7af263aa78ee4d6b755df9e00a159d5c88dc2a.csv | 1 + ...5f69394ad87d7d234e796b1a54a31f970e2510.csv | 1 + .../7c597125d72d146425d1899f6512b82df99b59c1 | 1 + .../7e1e393db35bd119ab38a395829ff5deadd9501a | 1 + .../7eeaad7ca0a2197d1283c87d441a15f6c8d5e6f6 | 1 + .../801bc5987bfe420b04e07eb1cd5ae0462a0b750c | 1 + ...29e3313860bfd6b8dd1252b4a4542d4c791f13.csv | 1 + .../86f870fdeb8e99954869aaf1b58e456109e2e6c8 | 1 + .../90548a1ef4bae0b9b7382497097a01691333fb4f | 1 + ...62ca40d53bbf790d9338ed79b5215ca76178d2.csv | 1 + .../961ce3b94d711105a238b82068012e5b765b4027 | 1 + .../9c3040be62f1785b6387524185ae7508966a8fca | 1 + ...a9f3b23df2a728a486968d9e4f4a87aff34bf6.csv | 1 + ...51877bf52e199210ffd96778f7698e3dc6978e.csv | 1 + .../a3a3b5b0ea540bc579228dfe70b21f40d9c0df96 | 1 + ...005cb54f820f0dc3889aab343ea1698b1dd5f4.csv | 1 + .../a6b72fc2c30cf1d9ff74a2d5054bcb5dca317c15 | 1 + .../a750591769e551117e3144c8927a05d96fdfb362 | 1 + ...eeafbc752b681e5d68332192c8097ef43ab687.csv | 1 + ...0a88e1e4a0e0044936b2e61de5364d48b16e8c.csv | 1 + .../c144c7638bb08162db1ae53954e6cd20e66474f7 | 1 + .../ca52cd17cb1a061767830cb4e49867be9b637e56 | 1 + .../ce03e25003a16fc03abb3d4f337a39e622962c60 | 1 + .../d2f9abc5e26020e42b45a32fcf3777cc61ea711c | 1 + .../e71ac2a14ce3dd789a00eae0c656b36e2c07186a | 1 + .../ebc80a44e5ef0a66fddb29c48373701b2eeb5227 | 1 + .../ee66ad0b8b05525c54c4538059714a92646c39fb | 1 + ...bceb65beacbe25d0db149e5c37198ee5be1912.csv | 1 + .../ef22fafdd3041dc08043fe2bb908e96dffa34ff5 | 1 + .../f007593acbf7f63773efa1b65ef61da7fcefbb34 | 1 + .../f3492a44323a0bf7bea4e59b536feaf7620b8e8b | 1 + .../f40e3999c3fe73cd2e50083874537ec000697cb7 | 1 + .../f5272bcea41574f9cd663f33334c530abcca01d7 | 1 + .../f7db47bebdfb5888fae0fbe826b37df33a450292 | 1 + .../f7faaa230cdb97e1aec1e5ca75f89b7ea8b78726 | 1 + ...0082d5df4c4f237f65ac2c2717ae46408c17b8.csv | 1 + .../fbc7b5cc87f1afa84d70c82f152761258a3b0ca6 | 1 + .../fc52fecd84a8f8a478b99b4965333a7f9dfa002c | 1 + .../fcc19a8cc98ada27c4b6a605adca5bb497ad618e | 1 + .../fcd8ce757f7d3f54ab0ee3d01007e0a6d70fa288 | 1 + .../febd83d39f830202ca6081514960b4242e536df7 | 1 + .../fec38c54692c2fcff269370fc1bbb9e598b821a7 | 1 + ...c50c6c3f5486958b33beada06857deeff177dd.csv | 1 + .../fedb716d47c930bafffff38b6c274ce9202187ac | 1 + .../ff0232f5144d65579feeccb6b65687c5056501a7 | 1 + .../ff3242c96b948a6ded16dd8ae51b1e61c40c5a66 | 1 + .../ff5a0c3111af229b7f4ec8c4a38d82ccf7e553a2 | 1 + ...5f50f7b5d36b765da768ef583a8b289be09a7e.csv | 1 + .../ff82315f17a9d582afd6aba974c222e00d14af15 | 1 + .../ff980b7b6e39f929b8ddb08e419a2904abd44b33 | 1 + ...b313726fc6fa8b68381e5df22e960cb623b62c.csv | 1 + .../ffe9cd6ca4dbbdd2b2429c8d8023183b84c2962f | 1 + .../ffefa3f6034cc5680792a8cae855bc7a2d9f9019 | 1 + .../fff9db19407d43fdb18735c075071a866a5f0795 | 1 + .../fffa5f13587a7e46023238c9e7db91fd61414105 | 1 + ...:000001,sig:11,src:005156,op:ext_AO,pos:34 | 1 + ...00001,src:000141,op:arith8,pos:118,val:-34 | 1 + .../id:000002,src:000200,op:ext_AO,pos:571 | 1 + .../id:000003,src:000314,op:flip1,pos:19 | 1 + ...id:000005,sig:11,src:005234,op:havoc,rep:2 | Bin 0 -> 136 bytes .../id:000005,src:000445,op:flip1,pos:132 | 1 + ...d:000007,sig:11,src:005483,op:flip2,pos:43 | 1 + .../id:000008,src:001208,op:flip1,pos:89 | 1 + ...id:000013,sig:11,src:005882,op:havoc,rep:2 | Bin 0 -> 112 bytes .../id:000015,src:001216,op:flip1,pos:229 | 1 + ...d:000018,sig:11,src:001807,op:flip1,pos:93 | 1 + .../id:000018,src:001179,op:ext_AO,pos:826 | 1 + ...:000019,sig:11,src:001807,op:flip1,pos:670 | 1 + .../id:000019,src:001231,op:flip1,pos:72 | Bin 0 -> 212 bytes ...000020,sig:11,src:001807,op:flip1,pos:2325 | 1 + ...:000021,sig:11,src:001807,op:flip2,pos:238 | 1 + ...d3419f85d952cf54a38196fc0775a2bfa4c6ff.csv | 1 + ...03383386fa3d77d3d460480a52e0b99a1c580e.csv | 1 + ...2c16bd44de5cf72ba1a55c0b6258349a74e5d6.csv | 1 + ...92aef3ac66f84b8996edeb95ef1e7e9d6660cb.csv | 1 + ...08fbd86ddd3f34a56532faf9b46f0ae135e644.csv | 1 + ...ca65053fcb0a0b0a479e181fa8b497beb40d9c.csv | 1 + ...4080b69b8ca7d50d16f424305467a18d8eded9.csv | 1 + ...58600bcf8dc103f911bb2a6a867ab2c8e42fe2.csv | 1 + ...e62c433d9a885d2a5670ff890f5b00089739aa.csv | 1 + ...ee0af0b99b68b9d287e6f65ad08a4e11967daa.csv | 1 + include/ata.h | 42 +- include/ata_parse.h | 433 ++++++---- include/parse_extended_inquiry.h | 86 ++ include/parse_log_sense.h | 156 ++++ include/parse_mode_sense.h | 228 ++++++ include/parse_read_defect_data.h | 187 +++++ include/parse_receive_diagnostics.h | 161 ++++ include/scsicmd.h | 78 ++ include/scsicmd_utils.h | 68 ++ src/CMakeLists.txt | 2 +- src/ata.c | 19 +- src/cdb.c | 73 ++ src/log_sense.c | 26 + src/parse.c | 19 + src/parse_inquiry.c | 4 - src/parse_read_cap.c | 29 +- src/parse_sense.c | 58 +- structs/ata_identify.yaml | 71 +- structs/ata_struct_2_c_dump.py | 15 +- structs/ata_struct_2_h.py | 23 +- structs/ata_struct_2_h_dump.py | 2 +- test/CMakeLists.txt | 12 + test/ata_identify.c | 2 +- test/ata_smart_read_data.c | 5 +- test/collect_raw_data.c | 531 +++++++++++++ test/main.c | 13 +- test/main.h | 4 +- test/parse_scsi.c | 746 ++++++++++++++++++ test/samples/breakout.py | 37 + test/samples/parse_file.py | 36 + test/scsi_inquiry.c | 122 ++- test/scsi_log_sense.c | 9 +- test/scsi_mode_sense.c | 95 +++ test/scsi_receive_diagnostics.c | 101 +++ test/sense_dump.c | 11 + test/sense_dump.h | 1 + 130 files changed, 3360 insertions(+), 273 deletions(-) create mode 100644 afl/testcase/186704e9f39832c4c7b4f2ab71c52762017bd728 create mode 100644 afl/testcase/1b5fac8682806d6e823c301159d6da81e30f421a create mode 100644 afl/testcase/28eeac63bfcf7ad2126d2eddcdc04019270075ec create mode 100644 afl/testcase/2b34251f3421af9a5c53a41f7e27f1cc3e8a13b0 create mode 100644 afl/testcase/39c99f32ec43d6ee12857a64e031114ae7cf23cd.csv create mode 100644 afl/testcase/4941885df82498d8ca26375728606d41be818e27 create mode 100644 afl/testcase/554ff10f0a6f35849db7e44176aa94c6dc232872.csv create mode 100644 afl/testcase/5b7d04cbfbe29ec8f91526131c87e7cc8e9ea10e create mode 100644 afl/testcase/617ce3a43c7dbb1ba99a422ce455c1b55d2260b4.csv create mode 100644 afl/testcase/6184436113637747407bf86315ebd987300b8799 create mode 100644 afl/testcase/657af263aa78ee4d6b755df9e00a159d5c88dc2a.csv create mode 100644 afl/testcase/745f69394ad87d7d234e796b1a54a31f970e2510.csv create mode 100644 afl/testcase/7c597125d72d146425d1899f6512b82df99b59c1 create mode 100644 afl/testcase/7e1e393db35bd119ab38a395829ff5deadd9501a create mode 100644 afl/testcase/7eeaad7ca0a2197d1283c87d441a15f6c8d5e6f6 create mode 100644 afl/testcase/801bc5987bfe420b04e07eb1cd5ae0462a0b750c create mode 100644 afl/testcase/8329e3313860bfd6b8dd1252b4a4542d4c791f13.csv create mode 100644 afl/testcase/86f870fdeb8e99954869aaf1b58e456109e2e6c8 create mode 100644 afl/testcase/90548a1ef4bae0b9b7382497097a01691333fb4f create mode 100644 afl/testcase/9062ca40d53bbf790d9338ed79b5215ca76178d2.csv create mode 100644 afl/testcase/961ce3b94d711105a238b82068012e5b765b4027 create mode 100644 afl/testcase/9c3040be62f1785b6387524185ae7508966a8fca create mode 100644 afl/testcase/9da9f3b23df2a728a486968d9e4f4a87aff34bf6.csv create mode 100644 afl/testcase/a051877bf52e199210ffd96778f7698e3dc6978e.csv create mode 100644 afl/testcase/a3a3b5b0ea540bc579228dfe70b21f40d9c0df96 create mode 100644 afl/testcase/a4005cb54f820f0dc3889aab343ea1698b1dd5f4.csv create mode 100644 afl/testcase/a6b72fc2c30cf1d9ff74a2d5054bcb5dca317c15 create mode 100644 afl/testcase/a750591769e551117e3144c8927a05d96fdfb362 create mode 100644 afl/testcase/b2eeafbc752b681e5d68332192c8097ef43ab687.csv create mode 100644 afl/testcase/b40a88e1e4a0e0044936b2e61de5364d48b16e8c.csv create mode 100644 afl/testcase/c144c7638bb08162db1ae53954e6cd20e66474f7 create mode 100644 afl/testcase/ca52cd17cb1a061767830cb4e49867be9b637e56 create mode 100644 afl/testcase/ce03e25003a16fc03abb3d4f337a39e622962c60 create mode 100644 afl/testcase/d2f9abc5e26020e42b45a32fcf3777cc61ea711c create mode 100644 afl/testcase/e71ac2a14ce3dd789a00eae0c656b36e2c07186a create mode 100644 afl/testcase/ebc80a44e5ef0a66fddb29c48373701b2eeb5227 create mode 100644 afl/testcase/ee66ad0b8b05525c54c4538059714a92646c39fb create mode 100644 afl/testcase/eebceb65beacbe25d0db149e5c37198ee5be1912.csv create mode 100644 afl/testcase/ef22fafdd3041dc08043fe2bb908e96dffa34ff5 create mode 100644 afl/testcase/f007593acbf7f63773efa1b65ef61da7fcefbb34 create mode 100644 afl/testcase/f3492a44323a0bf7bea4e59b536feaf7620b8e8b create mode 100644 afl/testcase/f40e3999c3fe73cd2e50083874537ec000697cb7 create mode 100644 afl/testcase/f5272bcea41574f9cd663f33334c530abcca01d7 create mode 100644 afl/testcase/f7db47bebdfb5888fae0fbe826b37df33a450292 create mode 100644 afl/testcase/f7faaa230cdb97e1aec1e5ca75f89b7ea8b78726 create mode 100644 afl/testcase/fb0082d5df4c4f237f65ac2c2717ae46408c17b8.csv create mode 100644 afl/testcase/fbc7b5cc87f1afa84d70c82f152761258a3b0ca6 create mode 100644 afl/testcase/fc52fecd84a8f8a478b99b4965333a7f9dfa002c create mode 100644 afl/testcase/fcc19a8cc98ada27c4b6a605adca5bb497ad618e create mode 100644 afl/testcase/fcd8ce757f7d3f54ab0ee3d01007e0a6d70fa288 create mode 100644 afl/testcase/febd83d39f830202ca6081514960b4242e536df7 create mode 100644 afl/testcase/fec38c54692c2fcff269370fc1bbb9e598b821a7 create mode 100644 afl/testcase/fec50c6c3f5486958b33beada06857deeff177dd.csv create mode 100644 afl/testcase/fedb716d47c930bafffff38b6c274ce9202187ac create mode 100644 afl/testcase/ff0232f5144d65579feeccb6b65687c5056501a7 create mode 100644 afl/testcase/ff3242c96b948a6ded16dd8ae51b1e61c40c5a66 create mode 100644 afl/testcase/ff5a0c3111af229b7f4ec8c4a38d82ccf7e553a2 create mode 100644 afl/testcase/ff5f50f7b5d36b765da768ef583a8b289be09a7e.csv create mode 100644 afl/testcase/ff82315f17a9d582afd6aba974c222e00d14af15 create mode 100644 afl/testcase/ff980b7b6e39f929b8ddb08e419a2904abd44b33 create mode 100644 afl/testcase/ffb313726fc6fa8b68381e5df22e960cb623b62c.csv create mode 100644 afl/testcase/ffe9cd6ca4dbbdd2b2429c8d8023183b84c2962f create mode 100644 afl/testcase/ffefa3f6034cc5680792a8cae855bc7a2d9f9019 create mode 100644 afl/testcase/fff9db19407d43fdb18735c075071a866a5f0795 create mode 100644 afl/testcase/fffa5f13587a7e46023238c9e7db91fd61414105 create mode 100644 afl/testcase/id:000001,sig:11,src:005156,op:ext_AO,pos:34 create mode 100644 afl/testcase/id:000001,src:000141,op:arith8,pos:118,val:-34 create mode 100644 afl/testcase/id:000002,src:000200,op:ext_AO,pos:571 create mode 100644 afl/testcase/id:000003,src:000314,op:flip1,pos:19 create mode 100644 afl/testcase/id:000005,sig:11,src:005234,op:havoc,rep:2 create mode 100644 afl/testcase/id:000005,src:000445,op:flip1,pos:132 create mode 100644 afl/testcase/id:000007,sig:11,src:005483,op:flip2,pos:43 create mode 100644 afl/testcase/id:000008,src:001208,op:flip1,pos:89 create mode 100644 afl/testcase/id:000013,sig:11,src:005882,op:havoc,rep:2 create mode 100644 afl/testcase/id:000015,src:001216,op:flip1,pos:229 create mode 100644 afl/testcase/id:000018,sig:11,src:001807,op:flip1,pos:93 create mode 100644 afl/testcase/id:000018,src:001179,op:ext_AO,pos:826 create mode 100644 afl/testcase/id:000019,sig:11,src:001807,op:flip1,pos:670 create mode 100644 afl/testcase/id:000019,src:001231,op:flip1,pos:72 create mode 100644 afl/testcase/id:000020,sig:11,src:001807,op:flip1,pos:2325 create mode 100644 afl/testcase/id:000021,sig:11,src:001807,op:flip2,pos:238 create mode 100644 afl/testcase/log_sense_9bd3419f85d952cf54a38196fc0775a2bfa4c6ff.csv create mode 100644 afl/testcase/log_sense_ac03383386fa3d77d3d460480a52e0b99a1c580e.csv create mode 100644 afl/testcase/log_sense_c52c16bd44de5cf72ba1a55c0b6258349a74e5d6.csv create mode 100644 afl/testcase/log_sense_d192aef3ac66f84b8996edeb95ef1e7e9d6660cb.csv create mode 100644 afl/testcase/log_sense_dc08fbd86ddd3f34a56532faf9b46f0ae135e644.csv create mode 100644 afl/testcase/log_sense_f2ca65053fcb0a0b0a479e181fa8b497beb40d9c.csv create mode 100644 afl/testcase/log_sense_fb4080b69b8ca7d50d16f424305467a18d8eded9.csv create mode 100644 afl/testcase/log_sense_fc58600bcf8dc103f911bb2a6a867ab2c8e42fe2.csv create mode 100644 afl/testcase/log_sense_ffe62c433d9a885d2a5670ff890f5b00089739aa.csv create mode 100644 afl/testcase/log_sense_ffee0af0b99b68b9d287e6f65ad08a4e11967daa.csv create mode 100644 include/parse_extended_inquiry.h create mode 100644 include/parse_log_sense.h create mode 100644 include/parse_mode_sense.h create mode 100644 include/parse_read_defect_data.h create mode 100644 include/parse_receive_diagnostics.h create mode 100644 include/scsicmd_utils.h create mode 100644 src/log_sense.c create mode 100644 src/parse.c create mode 100644 test/collect_raw_data.c create mode 100644 test/parse_scsi.c create mode 100755 test/samples/breakout.py create mode 100755 test/samples/parse_file.py create mode 100644 test/scsi_mode_sense.c create mode 100644 test/scsi_receive_diagnostics.c diff --git a/.gitignore b/.gitignore index 83ba3bf..e8b643f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,10 @@ scsi_read_capacity_10 scsi_read_capacity_16 scsi_inquiry scsi_log_sense +scsi_mode_sense +scsi_receive_diagnostics +parse_scsi +collect_raw_data test/libtestlib.a CMakeCache.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index fb62f88..2180bce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,11 @@ project(libscsicmd) export(PACKAGE libscsicmd) include_directories("include") -add_compile_options(-Wall -Wextra -Wshadow -Wmissing-prototypes -Winit-self) +add_compile_options(-Wall -Wextra -Wshadow -Wmissing-prototypes -Winit-self -g) add_definitions(-D_GNU_SOURCE -D_FORTIFY_SOURCE=2) +set(CMAKE_C_FLAGS_DEBUG "-Werror -O0 ${CMAKE_C_FLAGS_DEBUG}") +set(CMAKE_C_FLAGS_RELEASE "-Wall -O3 ${CMAKE_C_FLAGS_RELEASE}") + add_subdirectory(src) add_subdirectory(test) diff --git a/README.md b/README.md index 84b4352..a85239b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -libscsicmd -========== +# libscsicmd A library to create SCSI commands (CDBs) and parse the results, also for ATA commands and results. @@ -7,14 +6,32 @@ This library doesn't deal with actually submitting the CDBs or getting the resul the commands themselves. The actual sending of the command is different between the different OSes and this library tries to be OS agnostic. -Build -===== +## Build The build system is using cmake, you need to get it before you can build. To build, run: - cmake . && make -Author -====== + cmake . && make + +For a developer debug build use: + + cmake -DCMAKE_BUILD_TYPE=Debug . + +To build for American Fuzzy Lop instrumentation: + + cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/afl-gcc -DCMAKE_C_FLAGS=-DAFL_HARDEN=1 . + +## Testing + +Testing is either done manually with some raw data collected from SCSI devices +with test/collect\_raw\_data or with American Fuzzy Lop (AFL) for parsing +problems. + +Using AFL: + + afl-fuzz -t 200 -i afl/testcase -o afl/finding test/parse_scsi + +## Author + Baruch Even diff --git a/afl/testcase/186704e9f39832c4c7b4f2ab71c52762017bd728 b/afl/testcase/186704e9f39832c4c7b4f2ab71c52762017bd728 new file mode 100644 index 0000000..fce798c --- /dev/null +++ b/afl/testcase/186704e9f39832c4c7b4f2ab71c52762017bd728 @@ -0,0 +1 @@ +,4d 00 55 00 00 00 00 40 00 00,,95 00 08 20 00 00 03 0c 00 10 9a 5e 00 08 02 32 00 00 02 32 00 01 03 14 00 00 16 c7 51 17 01 20 3b 37 06 46 00 00 00 00 0a 3b 31 ae 00 02 03 14 00 00 1e bc 51 17 01 20 45 0e 05 59 00 00 00 00 0b ef ff f5 00 03 03 14 00 00 29 a5 51 17 01 20 30 f7 01 4a 00 00 00 00 08 7d ea bc 00 04 03 14 00 00 31 95 51 17 01 20 30 f7 01 4e 00 00 00 00 08 7d ea c0 00 05 03 14 00 00 59 54 51 17 01 20 45 39 00 b7 00 00 00 00 0b f1 22 f3 00 06 03 14 00 02 10 4d 51 17 01 20 00 e1 01 a7 00 00 00 00 00 3c e8 11 00 07 03 14 00 02 8b 87 51 17 01 20 1d d9 07 13 00 00 00 00 05 4e 51 89 00 08 03 14 00 02 ad a8 51 17 01 20 55 1a 06 06 00 00 00 00 0e ad 67 8d 00 09 03 14 00 03 4a 6b 51 17 01 20 99 22 05 2c 00 00 00 00 19 c7 58 b0 00 0a 03 14 00 03 68 e6 51 17 01 20 88 b8 02 de 00 00 00 00 17 26 3a 94 00 0b 03 14 00 03 69 5f 51 17 01 40 17 58 04 d2 00 00 00 00 04 2f dc f6 00 0c 03 14 00 03 ac 6d 51 17 01 20 15 b2 02 54 00 00 00 00 03 d7 af b1 00 0d 03 14 00 03 de b4 51 17 01 20 00 e1 01 a3 00 00 00 00 00 3c e8 0d 00 0e 03 14 00 03 de b7 51 17 01 20 10 47 02 79 00 00 00 00 02 d9 5c d5 00 0f 03 14 00 03 de d5 51 17 01 20 ab a0 02 c8 00 00 00 00 1c c6 eb 8a 00 10 03 14 00 05 a8 fc 51 17 01 20 15 b2 02 51 00 00 00 00 03 d7 af ae 00 11 03 14 00 06 26 4e 51 17 01 20 15 b2 02 43 00 00 00 00 03 d7 af a0 00 12 03 14 00 06 33 f7 51 17 01 20 29 da 06 1f 00 00 00 00 07 53 23 4b 00 13 03 14 00 06 34 b2 51 17 01 20 17 38 01 ee 00 00 00 00 04 21 d7 6e 00 14 03 14 00 06 35 bc 51 17 01 20 01 d5 03 8f 00 00 00 00 00 57 bd 11 00 15 03 14 00 06 35 c5 51 17 01 20 1c 58 04 53 00 00 00 00 05 04 4a 6e 00 16 03 14 00 06 35 d0 51 17 01 20 3a c6 03 6b 00 00 00 00 0a 38 17 d3 00 17 03 14 00 06 36 cb 51 17 01 20 01 d5 03 8e 00 00 00 00 00 57 bd 10 00 18 03 14 00 06 3c ba 51 17 01 20 49 43 05 2e 00 00 00 00 0c ae da 39 00 19 03 14 00 06 6e 21 51 17 01 20 1d f8 02 78 00 00 00 00 05 4f 2a c6 00 1a 03 14 00 06 96 52 51 17 01 20 9d 87 04 b7 00 00 00 00 1a 71 05 cf 00 1b 03 14 00 06 97 30 51 17 01 20 2a a3 02 72 00 00 00 00 07 81 d5 26 00 1c 03 14 00 06 cb 8a 51 17 01 20 3e 2d 01 d2 00 00 00 00 0a cc 67 e2 00 1d 03 14 00 07 22 0b 51 17 01 20 1c 07 06 77 00 00 00 00 04 e4 bf 7b 00 1e 03 14 00 07 40 c7 51 17 01 20 86 3c 05 8d 00 00 00 00 16 c5 84 e5 00 1f 03 14 00 07 9d ea 51 17 01 20 19 70 02 06 00 00 00 00 04 70 f9 79 00 20 03 14 00 08 21 6f 51 17 01 20 01 8e 07 1f 00 00 00 00 00 39 4f e2 00 21 03 14 00 08 26 28 51 17 01 20 00 72 00 2c 00 00 00 00 00 0f c6 34 00 22 03 14 00 08 26 29 51 17 01 20 01 8e 07 12 00 00 00 00 00 39 4f d5 00 23 03 14 00 08 26 29 51 17 01 20 01 8e 07 13 00 00 00 00 00 39 4f d6 00 24 03 14 00 08 27 8c 51 17 01 20 00 72 00 27 00 00 00 00 00 0f c6 2f 00 25 03 14 00 08 3c d8 51 17 01 20 00 72 00 28 00 00 00 00 00 0f c6 30 00 26 03 14 00 08 3c ef 51 17 01 20 49 55 03 96 00 00 00 00 0c ae 5c e1 00 27 03 14 00 08 e6 f0 51 17 01 20 00 72 00 30 00 00 00 00 00 0f c6 38 00 28 03 14 00 09 9f eb 51 17 01 20 1c ce 02 64 00 00 00 00 05 07 94 ef 00 29 03 14 00 0a 4b aa 51 17 01 20 31 d6 06 4f 00 00 00 00 08 a7 65 49 00 2a 03 14 00 0a 4b af 51 17 01 20 3f 3d 00 16 00 00 00 00 0a f9 70 ad 00 2b 03 14 00 0b 70 fb 51 17 01 20 e9 d6 04 fc 00 00 00 00 26 72 2e ad 00 2c 03 14 00 0b 7d 35 51 17 01 20 3f 49 05 ee 00 00 00 00 0a f9 22 85 00 2d 03 14 00 0b 89 09 51 17 01 20 3c 2d 03 dd 00 00 00 00 0a 62 eb cd 00 2e 03 14 00 0b 8c 1f 51 17 01 20 00 ea 02 ce 00 00 00 00 00 3c a8 e7 00 2f 03 14 00 0b 94 3b 51 17 01 20 1d 18 04 a1 00 00 00 00 05 34 11 af 00 30 03 14 00 0b 9e fd 51 17 01 20 1e 6f 02 cf 00 00 00 00 05 52 7e b5 00 31 03 14 00 0b 9f 0a 51 17 01 20 44 26 02 43 00 00 00 00 0b d3 cd c3 00 32 03 14 00 0b a2 ce 51 17 01 20 01 69 05 7e 00 00 00 00 00 3a 55 bb 00 33 03 14 00 0b a7 5a 51 17 01 20 24 e8 00 97 00 00 00 00 06 77 04 e1 00 34 03 14 00 0b a8 b0 51 17 01 20 24 e8 00 9a 00 00 00 00 06 77 04 e4 00 35 03 14 00 0b f1 4c 51 17 01 21 2e 62 05 23 00 00 00 00 30 be 48 20 00 36 03 14 00 0c 09 56 51 17 01 20 35 88 01 66 00 00 00 00 09 58 a2 d3 00 37 03 14 00 0c 21 c0 51 17 01 21 2e 62 05 25 00 00 00 00 30 be 48 22 00 38 03 14 00 0c 2d f8 51 17 01 20 24 e8 00 ae 00 00 00 00 06 77 04 f8 00 39 03 14 00 0c 36 fe 51 17 01 20 9e 49 05 6c 00 00 00 00 1a 97 f7 b3 00 3a 03 14 00 0c 4d ef 51 17 01 20 24 e8 00 a9 00 00 00 00 06 77 04 f3 00 3b 03 14 00 0c 4f 52 51 17 01 20 4f 03 02 9e 00 00 00 00 0d a4 fe 0e 00 3c 03 14 00 0c 5b 5b 51 17 01 20 24 e8 00 9b 00 00 00 00 06 77 04 e5 00 3d 03 14 00 0c 81 ec 51 17 01 20 24 e8 00 aa 00 00 00 00 06 77 04 f4 00 3e 03 14 00 0c 81 ec 51 17 01 20 24 e8 00 ab 00 00 00 00 06 77 04 f5 00 3f 03 14 00 0c 88 98 51 17 01 21 2e 62 05 26 00 00 00 00 30 be 48 23 00 40 03 14 00 0c ab 23 51 17 01 20 00 03 02 0a 00 00 00 00 00 0c ae 1a 00 41 03 14 00 0c d8 7f 51 17 01 20 9e 49 05 70 00 00 00 00 1a 97 f7 b7 00 42 03 14 00 0c e0 ab 51 17 01 20 ed 32 00 6a 00 00 00 00 26 f5 c6 52 00 43 03 14 00 0c ef 0e 51 17 01 20 68 a7 03 a1 00 00 00 00 11 e1 48 c4 00 44 03 14 00 0d 00 1c 51 17 01 20 1e 6f 02 ce 00 00 00 00 05 52 7e b4 00 45 03 14 00 0d 06 3b 51 17 01 20 93 c6 06 5f 00 00 00 00 18 fa 98 dd 00 46 03 14 00 0d 0b ff 51 17 01 20 24 e8 00 99 00 00 00 00 06 77 04 e3 00 47 03 14 00 0d 6b 5f 51 17 01 20 05 9e 04 3a 00 00 00 00 00 f1 53 b6 00 48 03 14 00 0d 7b 58 51 17 01 20 24 e8 00 8f 00 00 00 00 06 77 04 d9 00 49 03 14 00 0d 86 9c 51 17 01 21 2e 62 05 27 00 00 00 00 30 be 48 24 00 4a 03 14 00 0d da 5b 51 17 01 20 29 b2 00 d2 00 00 00 00 07 52 05 fe 00 4b 03 14 00 0d da 81 51 17 01 20 9e 49 05 74 00 00 00 00 1a 97 f7 bb 00 4c 03 14 00 0e 1f 48 51 17 01 40 2d e3 06 44 00 00 00 00 08 09 eb 8e 00 4d 03 14 00 0e 4b 21 51 17 01 20 4f 03 02 9a 00 00 00 00 0d a4 fe 0a 00 4e 03 14 00 0e 5e 54 51 17 01 20 24 e8 00 9f 00 00 00 00 06 77 04 e9 00 4f 03 14 00 0e 71 d2 51 17 01 20 24 e8 00 9e 00 00 00 00 06 77 04 e8 00 50 03 14 00 0e 99 b1 51 17 01 20 29 b2 00 ce 00 00 00 00 07 52 05 fa 00 51 03 14 00 0f 10 6f 51 17 01 20 05 9e 04 3b 00 00 00 00 00 f1 53 b7 00 52 03 14 00 0f 13 48 51 17 01 21 87 1b 01 8e 00 00 00 00 3d 55 25 d6 00 53 03 14 00 0f 29 da 51 17 01 20 7f 65 00 1d 00 00 00 00 15 ac 02 e4 00 54 03 14 00 0f 71 11 51 17 01 20 1d 18 04 a0 00 00 00 00 05 34 11 ae 00 55 03 14 00 0f c7 1a 51 17 01 20 c2 04 05 15 00 00 00 00 20 3f 7a 16 00 56 03 14 00 0f ce ab 51 17 01 20 29 b2 00 d1 00 00 00 00 07 52 05 fd diff --git a/afl/testcase/1b5fac8682806d6e823c301159d6da81e30f421a b/afl/testcase/1b5fac8682806d6e823c301159d6da81e30f421a new file mode 100644 index 0000000..9cb21b4 --- /dev/null +++ b/afl/testcase/1b5fac8682806d6e823c301159d6da81e30f421a @@ -0,0 +1 @@ +,4d 00 40 03 00 00 00 40 00 00,70 00 05 00 00 00 00 18 00 00 00 00 24 00 00 c0 00 03 00 00 f8 23 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/28eeac63bfcf7ad2126d2eddcdc04019270075ec b/afl/testcase/28eeac63bfcf7ad2126d2eddcdc04019270075ec new file mode 100644 index 0000000..ed9b30b --- /dev/null +++ b/afl/testcase/28eeac63bfcf7ad2126d2eddcdc04019270075ec @@ -0,0 +1 @@ +,1c 01 05 40 00 00,,05 00 01 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 41 14 0f 76 73 14 0f 76 73 14 0f 76 73 14 0f 76 73 14 0f 55 52 14 0f 55 52 14 0f 76 73 14 0f 76 73 14 0f 55 52 14 0f 55 52 14 0f 76 73 14 0f 76 73 14 0f 55 52 14 0f 55 52 14 0f 76 73 14 0f 76 73 14 0f 55 52 14 0f 55 52 14 0f 76 73 14 0f 76 73 14 0f 00 00 00 00 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 0e 0a 0a 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/2b34251f3421af9a5c53a41f7e27f1cc3e8a13b0 b/afl/testcase/2b34251f3421af9a5c53a41f7e27f1cc3e8a13b0 new file mode 100644 index 0000000..14df7b9 --- /dev/null +++ b/afl/testcase/2b34251f3421af9a5c53a41f7e27f1cc3e8a13b0 @@ -0,0 +1 @@ +,5a 00 3f ff 00 00 00 10 00 00,,00 3a 00 00 00 00 00 00 02 0e 00 00 00 00 00 00 27 10 00 09 00 00 00 00 0a 0a 00 00 00 00 00 00 00 00 00 00 18 06 06 00 00 00 00 00 19 0e 46 00 07 d0 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/39c99f32ec43d6ee12857a64e031114ae7cf23cd.csv b/afl/testcase/39c99f32ec43d6ee12857a64e031114ae7cf23cd.csv new file mode 100644 index 0000000..e7dfc21 --- /dev/null +++ b/afl/testcase/39c99f32ec43d6ee12857a64e031114ae7cf23cd.csv @@ -0,0 +1 @@ +,25 00 00 00 00 00 00 00 00 00,, diff --git a/afl/testcase/4941885df82498d8ca26375728606d41be818e27 b/afl/testcase/4941885df82498d8ca26375728606d41be818e27 new file mode 100644 index 0000000..daf11b6 --- /dev/null +++ b/afl/testcase/4941885df82498d8ca26375728606d41be818e27 @@ -0,0 +1 @@ +,4d 00 40 ff 00 00 00 40 00 00,,00 00 00 4c 00 00 00 ff 02 00 02 ff 03 00 03 ff 05 00 05 ff 06 00 06 ff 0c 00 0c ff 0d 00 0d ff 0e 00 0e ff 0f 00 0f ff 10 00 10 ff 11 00 11 ff 15 00 15 ff 18 00 18 ff 19 00 19 ff 1a 00 1a ff 2f 00 2f ff 30 00 30 ff 31 00 31 ff 38 00 38 ff diff --git a/afl/testcase/554ff10f0a6f35849db7e44176aa94c6dc232872.csv b/afl/testcase/554ff10f0a6f35849db7e44176aa94c6dc232872.csv new file mode 100644 index 0000000..7ad6008 --- /dev/null +++ b/afl/testcase/554ff10f0a6f35849db7e44176aa94c6dc232872.csv @@ -0,0 +1 @@ +,9e 10 00 00 00 00 00 00 00 00 00 00 02 00 00 00,, diff --git a/afl/testcase/5b7d04cbfbe29ec8f91526131c87e7cc8e9ea10e b/afl/testcase/5b7d04cbfbe29ec8f91526131c87e7cc8e9ea10e new file mode 100644 index 0000000..da6d8ec --- /dev/null +++ b/afl/testcase/5b7d04cbfbe29ec8f91526131c87e7cc8e9ea10e @@ -0,0 +1 @@ +,4d 00 40 ff 00 00 00 40 00 00,,40 ff 00 44 00 00 00 ff 02 00 02 ff 03 00 03 ff 05 00 05 ff 06 00 06 ff 0d 00 0d ff 0e 00 0e ff 0f 00 0f ff 10 00 10 ff 11 00 11 ff 15 00 15 ff 18 00 18 ff 1a 00 1a ff 2f 00 2f ff 30 00 30 ff 31 00 31 ff 37 00 37 ff diff --git a/afl/testcase/617ce3a43c7dbb1ba99a422ce455c1b55d2260b4.csv b/afl/testcase/617ce3a43c7dbb1ba99a422ce455c1b55d2260b4.csv new file mode 100644 index 0000000..3ec2569 --- /dev/null +++ b/afl/testcase/617ce3a43c7dbb1ba99a422ce455c1b55d2260b4.csv @@ -0,0 +1 @@ +,1c 01 00 40 00 00,,00 00 00 0a 00 01 02 04 05 07 0d 0e 0f 1d diff --git a/afl/testcase/6184436113637747407bf86315ebd987300b8799 b/afl/testcase/6184436113637747407bf86315ebd987300b8799 new file mode 100644 index 0000000..8378616 --- /dev/null +++ b/afl/testcase/6184436113637747407bf86315ebd987300b8799 @@ -0,0 +1 @@ +,37 00 0a 00 00 00 00 02 00 00,,00 0a 00 00 diff --git a/afl/testcase/657af263aa78ee4d6b755df9e00a159d5c88dc2a.csv b/afl/testcase/657af263aa78ee4d6b755df9e00a159d5c88dc2a.csv new file mode 100644 index 0000000..e1b90f8 --- /dev/null +++ b/afl/testcase/657af263aa78ee4d6b755df9e00a159d5c88dc2a.csv @@ -0,0 +1 @@ +,1c 01 00 40 00 00,,00 00 00 02 00 3f diff --git a/afl/testcase/745f69394ad87d7d234e796b1a54a31f970e2510.csv b/afl/testcase/745f69394ad87d7d234e796b1a54a31f970e2510.csv new file mode 100644 index 0000000..dfaf26e --- /dev/null +++ b/afl/testcase/745f69394ad87d7d234e796b1a54a31f970e2510.csv @@ -0,0 +1 @@ +,1a 00 3f ff ff 00,,37 00 00 08 00 00 00 00 00 00 02 00 01 0a 80 00 00 00 00 00 00 00 00 00 08 12 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 0a 02 00 00 00 00 00 ff ff 00 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/7c597125d72d146425d1899f6512b82df99b59c1 b/afl/testcase/7c597125d72d146425d1899f6512b82df99b59c1 new file mode 100644 index 0000000..66d52cb --- /dev/null +++ b/afl/testcase/7c597125d72d146425d1899f6512b82df99b59c1 @@ -0,0 +1 @@ +,b7 14 00 00 00 00 00 00 02 00 00 00,,00 16 00 00 00 00 17 f8 00 00 00 72 00 00 00 33 00 00 00 0f 00 00 00 70 00 00 00 17 00 00 00 cc 00 00 00 17 00 00 00 d0 00 00 00 61 00 00 01 85 00 00 00 0f 00 00 02 00 00 00 00 00 00 00 02 02 00 00 00 00 00 00 02 03 00 00 00 01 00 00 02 02 00 00 00 01 00 00 02 03 00 00 00 02 00 00 02 02 00 00 00 02 00 00 02 03 00 00 00 03 00 00 02 02 00 00 00 03 00 00 02 03 00 00 00 04 00 00 02 02 00 00 00 04 00 00 02 03 00 00 00 05 00 00 02 02 00 00 00 05 00 00 02 03 00 00 00 06 00 00 02 02 00 00 00 06 00 00 02 03 00 00 00 07 00 00 02 02 00 00 00 07 00 00 02 03 00 00 00 08 00 00 02 02 00 00 00 08 00 00 02 03 00 00 00 09 00 00 02 02 00 00 00 09 00 00 02 03 00 00 00 0a 00 00 02 02 00 00 00 0a 00 00 02 03 00 00 00 0b 00 00 02 02 00 00 00 0b 00 00 02 03 00 00 00 0c 00 00 02 02 00 00 00 0c 00 00 02 03 00 00 00 0d 00 00 02 02 00 00 00 0d 00 00 02 03 00 00 00 0e 00 00 02 02 00 00 00 0e 00 00 02 03 00 00 00 0f 00 00 02 02 00 00 00 0f 00 00 02 03 00 00 00 10 00 00 02 02 00 00 00 10 00 00 02 03 00 00 00 11 00 00 02 02 00 00 00 11 00 00 02 03 00 00 00 12 00 00 02 02 00 00 00 12 00 00 02 03 00 00 00 13 00 00 02 02 00 00 00 13 00 00 02 03 00 00 00 14 00 00 02 02 00 00 00 14 00 00 02 03 00 00 00 15 00 00 02 02 00 00 00 15 00 00 02 03 00 00 00 16 00 00 02 02 00 00 00 16 00 00 02 03 00 00 00 17 00 00 02 02 00 00 00 17 00 00 02 03 00 00 00 18 00 00 02 02 00 00 00 18 00 00 02 03 00 00 00 19 00 00 02 02 00 00 00 19 00 00 02 03 00 00 00 1a 00 00 02 02 00 00 00 1a 00 00 02 03 00 00 00 1b 00 00 02 02 00 00 00 1b 00 00 02 0 diff --git a/afl/testcase/7e1e393db35bd119ab38a395829ff5deadd9501a b/afl/testcase/7e1e393db35bd119ab38a395829ff5deadd9501a new file mode 100644 index 0000000..0132abb --- /dev/null +++ b/afl/testcase/7e1e393db35bd119ab38a395829ff5deadd9501a @@ -0,0 +1 @@ +,1c 01 1b 40 00 00,,1b 00 00 04 00 01 00 03 diff --git a/afl/testcase/7eeaad7ca0a2197d1283c87d441a15f6c8d5e6f6 b/afl/testcase/7eeaad7ca0a2197d1283c87d441a15f6c8d5e6f6 new file mode 100644 index 0000000..2666710 --- /dev/null +++ b/afl/testcase/7eeaad7ca0a2197d1283c87d441a15f6c8d5e6f6 @@ -0,0 +1 @@ +,25 00 00 00 00 00 00 00 00 00,70 00 04 00 00 00 00 18 00 00 00 00 29 07 00 00 00 00 00 00 f5 19 00 00 00 00 00 00 00 00 00 00, diff --git a/afl/testcase/801bc5987bfe420b04e07eb1cd5ae0462a0b750c b/afl/testcase/801bc5987bfe420b04e07eb1cd5ae0462a0b750c new file mode 100644 index 0000000..e84ee6f --- /dev/null +++ b/afl/testcase/801bc5987bfe420b04e07eb1cd5ae0462a0b750c @@ -0,0 +1 @@ +,37 00 0e 00 00 00 00 00 08 00,70 00 01 00 00 00 00 10 00 00 00 00 1c 00 00 80 00 00 00 21 1c 00 00 00,00 0c 00 00 diff --git a/afl/testcase/8329e3313860bfd6b8dd1252b4a4542d4c791f13.csv b/afl/testcase/8329e3313860bfd6b8dd1252b4a4542d4c791f13.csv new file mode 100644 index 0000000..b09aa75 --- /dev/null +++ b/afl/testcase/8329e3313860bfd6b8dd1252b4a4542d4c791f13.csv @@ -0,0 +1 @@ +,37 00 08 00 00 00 00 00 08 00,,00 00 00 05 00 3f 45 46 82 27 21 60 00 00 02 00 81 0a c4 01 00 00 00 00 00 00 0c 00 82 0e 00 00 00 00 00 00 01 f4 00 00 00 00 00 00 03 16 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 40 00 00 00 04 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 87 0a 04 01 00 00 00 00 00 00 0c 00 88 12 10 00 ff ff 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 8a 0a 00 10 00 00 00 00 00 00 00 06 ca 01 00 1c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ca 02 01 8c 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/86f870fdeb8e99954869aaf1b58e456109e2e6c8 b/afl/testcase/86f870fdeb8e99954869aaf1b58e456109e2e6c8 new file mode 100644 index 0000000..b0a7eb5 --- /dev/null +++ b/afl/testcase/86f870fdeb8e99954869aaf1b58e456109e2e6c8 @@ -0,0 +1 @@ +,37 00 0a 00 00 00 00 00 08 00,70 00 01 00 00 00 00 18 00 00 00 00 1c 02 00 c0 00 02 00 00 17 48 00 00 00 00 00 00 00 00 00 00,00 0e 00 00 diff --git a/afl/testcase/90548a1ef4bae0b9b7382497097a01691333fb4f b/afl/testcase/90548a1ef4bae0b9b7382497097a01691333fb4f new file mode 100644 index 0000000..31fce84 --- /dev/null +++ b/afl/testcase/90548a1ef4bae0b9b7382497097a01691333fb4f @@ -0,0 +1 @@ +,1c 01 01 40 00 00,,01 04 04 68 00 00 00 08 11 00 0a ea 50 06 04 80 a0 1c 19 3e 45 4d 43 20 20 20 20 20 44 65 72 72 69 6e 67 65 72 20 4c 43 43 20 20 20 30 42 33 30 07 81 42 02 00 01 02 55 53 31 44 30 31 31 30 35 30 30 30 35 39 00 00 05 40 a6 20 31 35 31 20 53 58 50 20 33 36 78 36 47 73 65 63 00 40 20 20 33 31 34 20 53 58 50 20 33 36 78 36 47 73 65 63 00 40 21 20 32 32 32 20 53 58 50 20 33 36 78 36 47 73 65 63 00 40 22 20 32 31 36 20 53 58 50 20 33 36 78 36 47 73 65 63 00 40 23 20 30 32 31 20 43 44 45 46 00 00 00 00 00 00 00 00 00 10 02 80 00 01 03 00 02 01 04 80 02 00 05 01 40 00 06 03 40 00 07 85 00 00 08 86 00 00 09 02 00 00 0a 02 01 00 0b 02 02 00 0c 02 03 00 0d 02 04 00 0e 02 05 00 0f 02 06 00 10 02 07 00 11 04 00 00 02 c0 c1 05 4c 43 43 20 42 11 01 06 b5 50 06 04 80 d8 21 42 be 45 4d 43 20 20 20 20 20 44 65 72 72 69 6e 67 65 72 20 4c 43 43 20 20 20 30 42 33 30 07 80 41 02 01 00 01 4a 57 58 45 4c 31 33 30 35 30 30 35 35 31 00 00 05 5a 06 20 31 35 31 20 53 58 50 20 33 36 78 36 47 73 65 63 00 5a 00 20 33 31 34 20 53 58 50 20 33 36 78 36 47 73 65 63 00 5a 01 20 32 32 32 20 53 58 50 20 33 36 78 36 47 73 65 63 00 5a 02 20 32 31 36 20 53 58 50 20 33 36 78 36 47 73 65 63 00 5a 03 20 30 32 31 20 43 44 45 46 00 00 00 00 00 00 00 00 00 03 12 00 03 01 13 80 03 00 14 03 5a 00 01 c2 05 4c 43 43 20 41 11 02 04 4f 50 06 04 80 00 00 00 00 45 4d 43 20 20 20 20 20 44 65 72 72 69 6e 67 65 72 20 45 6e 63 6c 20 20 30 30 31 31 0e 1f 4d 02 02 02 00 43 4b 4d 30 30 31 33 31 38 30 31 37 35 38 00 00 00 02 00 00 01 01 01 80 01 00 01 c3 07 43 68 61 73 73 69 73 11 03 03 6a 50 06 04 80 00 00 00 00 45 4d 43 20 20 20 20 20 30 30 30 42 30 30 31 39 00 00 00 00 00 00 00 00 32 41 31 30 02 81 42 02 00 04 33 41 43 37 42 30 31 33 30 32 31 37 38 31 39 20 20 01 86 a4 20 35 2e 33 33 53 58 50 33 36 78 36 47 00 00 00 00 00 02 15 00 04 01 16 80 04 00 01 c4 0e 50 6f 77 65 72 20 53 75 70 70 6c 79 20 42 11 04 03 56 50 06 04 80 00 00 00 00 45 4d 43 20 20 20 20 20 45 4d 43 20 44 45 52 52 49 4e 47 45 52 20 50 53 43 30 33 30 02 80 41 02 01 03 32 41 43 37 42 30 31 33 30 32 31 37 35 31 38 20 20 00 02 17 00 05 01 18 80 05 00 01 c5 0e 50 6f 77 65 72 20 53 75 70 70 6c 79 20 41 17 19 00 0c 04 01 00 0e 0e 01 00 05 81 25 00 0c 18 01 00 0a 07 01 00 0c 19 0a 00 0f 0c 02 00 0d 0c 01 00 0c 10 01 00 08 04 01 01 0e 0e 01 01 05 81 08 01 0c 18 01 01 0a 07 01 01 0c 19 0a 01 0f 0e 01 02 09 03 00 02 0d 04 01 02 0e 19 1a 02 0f 03 02 03 0d 04 02 03 0e 02 01 03 0e 03 02 04 0d 04 02 04 0e 02 01 04 0e 41 72 72 61 79 20 44 65 76 69 63 65 54 65 6d 70 2e 20 53 65 6e 73 6f 72 20 42 4c 43 43 20 42 45 78 70 61 6e 64 65 72 20 50 68 79 45 78 70 61 6e 64 65 72 20 42 43 6f 6e 74 72 6f 6c 6c 65 72 20 42 53 41 53 20 43 6f 6e 6e 65 63 74 6f 72 20 42 44 69 73 70 6c 61 79 20 47 72 65 65 6e 44 69 73 70 6c 61 79 20 42 6c 75 65 4c 61 6e 67 75 61 67 65 54 65 6d 70 2e 20 53 65 6e 73 6f 72 20 41 4c 43 43 20 41 45 78 70 61 6e 64 65 72 20 50 68 79 45 78 70 61 6e 64 65 72 20 41 43 6f 6e 74 72 6f 6c 6c 65 72 20 41 53 41 53 20 43 6f 6e 6e 65 63 74 6f 72 20 41 45 6e 63 6c 6f 73 75 72 65 43 6f 6f 6c 69 6e 67 20 46 61 6e 20 4d 54 65 6d 70 2e 20 53 65 6e 73 6f 72 20 4d 53 41 53 20 43 6f 6e 6e 65 63 74 6f 72 20 4d 43 6f 6f 6c 69 6e 67 20 46 61 6e 20 42 54 65 6d 70 2e 20 53 65 6e 73 6f 72 20 42 50 6f 77 65 72 20 53 75 70 70 6c 79 20 42 43 6f 6f 6c 69 6e 67 20 46 61 6e 20 41 54 65 6d 70 2e 20 53 65 6e 73 6f 72 20 41 50 6f 77 65 72 20 53 75 70 70 6c 79 20 41 diff --git a/afl/testcase/9062ca40d53bbf790d9338ed79b5215ca76178d2.csv b/afl/testcase/9062ca40d53bbf790d9338ed79b5215ca76178d2.csv new file mode 100644 index 0000000..e9ebb7e --- /dev/null +++ b/afl/testcase/9062ca40d53bbf790d9338ed79b5215ca76178d2.csv @@ -0,0 +1 @@ +,1c 01 00 40 00 00,,00 00 00 03 00 3f 82 diff --git a/afl/testcase/961ce3b94d711105a238b82068012e5b765b4027 b/afl/testcase/961ce3b94d711105a238b82068012e5b765b4027 new file mode 100644 index 0000000..385155a --- /dev/null +++ b/afl/testcase/961ce3b94d711105a238b82068012e5b765b4027 @@ -0,0 +1 @@ +,1c 01 00 40 00 00,70 00 02 00 00 00 00 18 00 00 00 00 31 01 00 00 00 00 00 00 f5 07 00 00 00 00 00 00 00 00 00 00, diff --git a/afl/testcase/9c3040be62f1785b6387524185ae7508966a8fca b/afl/testcase/9c3040be62f1785b6387524185ae7508966a8fca new file mode 100644 index 0000000..afe54b0 --- /dev/null +++ b/afl/testcase/9c3040be62f1785b6387524185ae7508966a8fca @@ -0,0 +1 @@ +,4d 00 40 ff 00 00 00 40 00 00,,40 ff 00 04 00 ff 34 ff 00 00 00 00 diff --git a/afl/testcase/9da9f3b23df2a728a486968d9e4f4a87aff34bf6.csv b/afl/testcase/9da9f3b23df2a728a486968d9e4f4a87aff34bf6.csv new file mode 100644 index 0000000..d208321 --- /dev/null +++ b/afl/testcase/9da9f3b23df2a728a486968d9e4f4a87aff34bf6.csv @@ -0,0 +1 @@ +,1c 01 00 40 00 00,,00 00 00 11 00 01 02 04 05 0a 0e 10 11 80 81 82 83 90 91 f0 f1 diff --git a/afl/testcase/a051877bf52e199210ffd96778f7698e3dc6978e.csv b/afl/testcase/a051877bf52e199210ffd96778f7698e3dc6978e.csv new file mode 100644 index 0000000..dee91fb --- /dev/null +++ b/afl/testcase/a051877bf52e199210ffd96778f7698e3dc6978e.csv @@ -0,0 +1 @@ +,1c 01 04 40 00 00,,04 00 01 fa 30 37 3a 30 32 3a 31 31 3a 35 34 3a 35 33 37 20 74 6e 6c 2f 74 75 6e 6e 65 6c 5f 73 74 65 5f 72 65 63 76 5f 64 69 61 67 5f 6d 73 67 5f 68 61 6e 64 6c 65 72 3a 20 74 75 6e 6e 65 6c 69 6e 67 20 52 45 43 56 20 44 49 41 47 4e 4f 53 54 49 43 20 72 65 63 65 69 76 65 64 20 66 72 6f 6d 20 53 54 45 2e 0a 30 37 3a 30 32 3a 31 31 3a 35 34 3a 37 34 38 20 64 65 76 2f 70 68 79 2e 32 32 3a 20 72 65 61 64 79 0a 30 37 3a 30 32 3a 31 31 3a 35 34 3a 37 35 31 20 64 65 76 2f 70 68 79 2e 32 32 3a 20 6c 69 6e 6b 20 72 65 61 64 79 0a 30 37 3a 30 32 3a 31 31 3a 35 34 3a 37 35 38 20 64 65 76 2f 70 68 79 2e 32 32 3a 20 72 61 74 65 20 75 6e 6b 6e 6f 77 6e 2d 3e 36 47 0a 30 37 3a 30 32 3a 31 31 3a 35 34 3a 37 36 32 20 64 65 76 2f 70 68 79 2e 32 32 3a 20 61 74 74 61 63 68 65 64 20 70 68 79 20 69 64 20 30 78 66 66 2d 3e 30 78 30 30 0a 30 37 3a 30 32 3a 31 31 3a 35 34 3a 37 38 37 20 45 53 45 53 3a 20 66 77 64 6c 20 70 72 74 74 6e 20 63 6e 74 72 6c 20 73 74 61 74 75 73 20 72 65 63 65 69 76 65 64 3a 20 61 63 74 69 76 65 3a 20 31 20 64 61 74 61 3a 20 30 20 69 6d 67 30 63 72 63 3a 20 30 78 62 64 20 69 6d 67 31 63 72 63 3a 20 30 78 61 34 0a 30 37 3a 30 32 3a 31 31 3a 35 36 3a 37 37 35 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a 30 37 3a 30 32 3a 31 31 3a 35 36 3a 37 38 34 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a diff --git a/afl/testcase/a3a3b5b0ea540bc579228dfe70b21f40d9c0df96 b/afl/testcase/a3a3b5b0ea540bc579228dfe70b21f40d9c0df96 new file mode 100644 index 0000000..3c8e2df --- /dev/null +++ b/afl/testcase/a3a3b5b0ea540bc579228dfe70b21f40d9c0df96 @@ -0,0 +1 @@ +,1c 01 04 40 00 00,,04 00 0a a9 30 35 3a 31 37 3a 33 36 3a 35 38 3a 33 38 38 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 33 37 3a 30 31 3a 33 32 36 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 33 37 3a 30 31 3a 33 33 30 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 33 37 3a 30 31 3a 33 34 31 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 33 37 3a 30 31 3a 33 35 30 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 33 38 3a 35 38 3a 35 38 32 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 33 38 3a 35 38 3a 35 38 36 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 33 38 3a 35 38 3a 35 39 36 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 33 38 3a 35 38 3a 36 30 35 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 33 39 3a 30 31 3a 31 30 37 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 33 39 3a 30 31 3a 31 31 31 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 33 39 3a 30 31 3a 31 32 30 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 33 39 3a 30 31 3a 31 33 32 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 30 3a 35 38 3a 35 38 36 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 34 30 3a 35 38 3a 35 39 30 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 34 30 3a 35 38 3a 36 30 31 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 30 3a 35 38 3a 36 31 30 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 31 3a 30 31 3a 31 33 34 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 34 31 3a 30 31 3a 31 33 38 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 34 31 3a 30 31 3a 31 34 37 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 31 3a 30 31 3a 31 35 37 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 32 3a 35 38 3a 35 35 30 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 34 32 3a 35 38 3a 35 35 34 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 34 32 3a 35 38 3a 35 36 34 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 32 3a 35 38 3a 35 37 33 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 33 3a 30 31 3a 31 34 36 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 34 33 3a 30 31 3a 31 35 30 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 34 33 3a 30 31 3a 31 36 31 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 33 3a 30 31 3a 31 37 30 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 34 3a 35 38 3a 35 38 38 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 34 34 3a 35 38 3a 35 39 32 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 34 34 3a 35 38 3a 36 30 33 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 34 3a 35 38 3a 36 31 32 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 35 3a 30 31 3a 33 33 38 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 34 35 3a 30 31 3a 33 34 32 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 34 35 3a 30 31 3a 33 35 31 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 35 3a 30 31 3a 33 36 30 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 36 3a 35 38 3a 37 36 34 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 34 36 3a 35 38 3a 37 36 38 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 34 36 3a 35 38 3a 37 38 30 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 36 3a 35 38 3a 37 38 38 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 30 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 37 3a 30 31 3a 32 32 32 20 65 78 70 61 6e 64 65 72 3a 20 72 65 63 76 64 20 6d 73 67 20 74 79 70 65 3a 20 32 0a 30 35 3a 31 37 3a 34 37 3a 30 31 3a 32 32 37 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 70 72 6f 63 65 73 73 20 70 63 64 20 73 65 6e 64 20 6d 73 67 0a 30 35 3a 31 37 3a 34 37 3a 30 31 3a 32 33 37 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 66 77 72 65 76 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 37 3a 30 31 3a 32 34 38 20 64 65 76 2f 65 78 70 61 6e 64 65 72 2e 31 3a 20 73 65 6e 74 20 73 61 73 61 64 64 72 20 74 6f 20 70 65 65 72 0a 30 35 3a 31 37 3a 34 37 3a 30 31 3a 39 32 38 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a 30 35 3a 31 37 3a 34 37 3a 30 31 3a 39 33 35 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a 30 35 3a 31 37 3a 34 37 3a 30 33 3a 38 34 32 20 74 6e 6c 2f 74 75 6e 6e 65 6c 5f 73 74 65 5f 72 65 63 76 5f 64 69 61 67 5f 6d 73 67 5f 68 61 6e 64 6c 65 72 3a 20 74 75 6e 6e 65 6c 69 6e 67 20 52 45 43 56 20 44 49 41 47 4e 4f 53 54 49 43 20 72 65 63 65 69 76 65 64 20 66 72 6f 6d 20 53 54 45 2e 0a 30 35 3a 31 37 3a 34 37 3a 30 34 3a 30 35 32 20 45 53 45 53 3a 20 66 77 64 6c 20 70 72 74 74 6e 20 63 6e 74 72 6c 20 73 74 61 74 75 73 20 72 65 63 65 69 76 65 64 3a 20 61 63 74 69 76 65 3a 20 30 20 64 61 74 61 3a 20 31 20 69 6d 67 30 63 72 63 3a 20 30 78 62 64 20 69 6d 67 31 63 72 63 3a 20 30 78 65 34 0a 30 35 3a 31 37 3a 34 37 3a 34 39 3a 34 34 34 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a 30 35 3a 31 37 3a 34 37 3a 34 39 3a 34 35 33 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a diff --git a/afl/testcase/a4005cb54f820f0dc3889aab343ea1698b1dd5f4.csv b/afl/testcase/a4005cb54f820f0dc3889aab343ea1698b1dd5f4.csv new file mode 100644 index 0000000..3fa2351 --- /dev/null +++ b/afl/testcase/a4005cb54f820f0dc3889aab343ea1698b1dd5f4.csv @@ -0,0 +1 @@ +,b7 0d 00 00 00 00 00 00 02 00 00 00,,00 0e 00 00 00 00 01 98 00 00 00 00 00 00 00 b6 00 00 00 00 00 00 04 62 00 00 00 00 00 00 00 70 00 00 00 00 00 00 00 98 00 00 00 00 00 00 02 ce 00 00 00 00 00 00 02 14 00 00 00 00 00 00 06 64 00 00 00 00 00 00 05 4a 00 00 00 00 00 00 07 02 00 00 00 00 00 00 04 bc 00 00 00 00 00 00 04 08 00 00 00 00 00 00 04 54 00 00 00 00 00 00 03 98 00 00 00 00 00 00 06 6e 00 00 00 00 00 00 00 9e 00 00 00 00 00 00 03 c0 00 00 00 00 00 00 01 12 00 00 00 00 00 00 02 92 00 00 00 00 00 00 02 a8 00 00 00 00 00 00 02 8c 00 00 00 00 00 00 04 de 00 00 00 00 00 00 03 a2 00 00 00 00 00 00 07 36 00 00 00 00 00 00 07 3e 00 00 00 00 00 00 04 40 00 00 00 00 00 00 05 0e 00 00 00 00 00 00 01 52 00 00 00 00 00 00 02 34 00 00 00 00 00 00 00 36 00 00 00 00 00 00 00 8c 00 00 00 00 00 00 05 b4 00 00 00 00 00 00 01 82 00 00 00 00 00 00 05 36 00 00 00 00 00 00 02 16 00 00 00 00 00 00 06 f2 00 00 00 00 00 00 04 ea 00 00 00 00 00 00 02 86 00 00 00 00 00 00 03 b8 00 00 00 00 00 00 01 60 00 00 00 00 00 00 05 cc 00 00 00 00 00 00 07 56 00 00 00 00 00 00 01 dc 00 00 00 00 00 00 01 3a 00 00 00 00 00 00 05 a0 00 00 00 00 00 00 05 08 00 00 00 00 00 00 01 a6 00 00 00 00 00 00 06 c0 00 00 00 00 00 00 05 d4 00 00 00 00 00 00 05 aa 00 00 00 00 00 00 00 e8 00 00 00 00 00 00 04 24 diff --git a/afl/testcase/a6b72fc2c30cf1d9ff74a2d5054bcb5dca317c15 b/afl/testcase/a6b72fc2c30cf1d9ff74a2d5054bcb5dca317c15 new file mode 100644 index 0000000..fb4a258 --- /dev/null +++ b/afl/testcase/a6b72fc2c30cf1d9ff74a2d5054bcb5dca317c15 @@ -0,0 +1 @@ +,25 00 00 00 00 00 00 00 00 00,70 00 06 00 00 00 00 18 00 00 00 00 3f 01 00 00 00 00 00 00 f5 22 00 00 00 00 00 00 00 00 00 00, diff --git a/afl/testcase/a750591769e551117e3144c8927a05d96fdfb362 b/afl/testcase/a750591769e551117e3144c8927a05d96fdfb362 new file mode 100644 index 0000000..f2840a2 --- /dev/null +++ b/afl/testcase/a750591769e551117e3144c8927a05d96fdfb362 @@ -0,0 +1 @@ +,4d 00 42 00 00 00 00 40 00 00,,02 00 00 36 00 00 00 04 00 00 00 00 00 01 00 04 00 00 00 00 00 02 00 04 00 00 00 00 00 03 00 04 00 00 00 00 00 05 00 0a 00 00 00 00 00 00 00 01 80 00 00 06 00 04 00 00 00 00 diff --git a/afl/testcase/b2eeafbc752b681e5d68332192c8097ef43ab687.csv b/afl/testcase/b2eeafbc752b681e5d68332192c8097ef43ab687.csv new file mode 100644 index 0000000..e51e18b --- /dev/null +++ b/afl/testcase/b2eeafbc752b681e5d68332192c8097ef43ab687.csv @@ -0,0 +1 @@ +,37 00 08 00 00 00 00 00 08 00,, diff --git a/afl/testcase/b40a88e1e4a0e0044936b2e61de5364d48b16e8c.csv b/afl/testcase/b40a88e1e4a0e0044936b2e61de5364d48b16e8c.csv new file mode 100644 index 0000000..f659091 --- /dev/null +++ b/afl/testcase/b40a88e1e4a0e0044936b2e61de5364d48b16e8c.csv @@ -0,0 +1 @@ +,1a 00 7f ff ff 00,, diff --git a/afl/testcase/c144c7638bb08162db1ae53954e6cd20e66474f7 b/afl/testcase/c144c7638bb08162db1ae53954e6cd20e66474f7 new file mode 100644 index 0000000..9f36a78 --- /dev/null +++ b/afl/testcase/c144c7638bb08162db1ae53954e6cd20e66474f7 @@ -0,0 +1 @@ +,b7 0a 00 00 00 00 00 00 02 00 00 00,,00 83 00 48 01 03 00 08 50 00 cc a0 2b 03 e0 b0 61 93 00 08 50 00 cc a0 2b 03 e0 b2 61 94 00 04 00 00 00 02 61 a3 00 08 50 00 cc a0 2b 03 e0 b3 63 a8 00 18 6e 61 61 2e 35 30 30 30 43 43 41 30 32 42 30 33 45 30 42 33 00 00 00 00 00 00 02 03 00 00 00 03 00 00 02 02 00 00 00 03 00 00 02 03 00 00 00 04 00 00 02 02 00 00 00 04 00 00 02 03 00 00 00 05 00 00 02 02 00 00 00 05 00 00 02 03 00 00 00 06 00 00 02 02 00 00 00 06 00 00 02 03 00 00 00 07 00 00 02 02 00 00 00 07 00 00 02 03 00 00 00 08 00 00 02 02 00 00 00 08 00 00 02 03 00 00 00 09 00 00 02 02 00 00 00 09 00 00 02 03 00 00 00 0a 00 00 02 02 00 00 00 0a 00 00 02 03 00 00 00 0b 00 00 02 02 00 00 00 0b 00 00 02 03 00 00 00 0c 00 00 02 02 00 00 00 0c 00 00 02 03 00 00 00 0d 00 00 02 02 00 00 00 0d 00 00 02 03 00 00 00 0e 00 00 02 02 00 00 00 0e 00 00 02 03 00 00 00 0f 00 00 02 02 00 00 00 0f 00 00 02 03 00 00 00 10 00 00 02 02 00 00 00 10 00 00 02 03 00 00 00 11 00 00 02 02 00 00 00 11 00 00 02 03 00 00 00 12 00 00 02 02 00 00 00 12 00 00 02 03 00 00 00 13 00 00 02 02 00 00 00 13 00 00 02 03 00 00 00 14 00 00 02 02 00 00 00 14 00 00 02 03 00 00 00 15 00 00 02 02 00 00 00 15 00 00 02 03 00 00 00 16 00 00 02 02 00 00 00 16 00 00 02 03 00 00 00 17 00 00 02 02 00 00 00 17 00 00 02 03 00 00 00 18 00 00 02 02 00 00 00 18 00 00 02 03 00 00 00 19 00 00 02 02 00 00 00 19 00 00 02 03 00 00 00 1a 00 00 02 02 00 00 00 1a 00 00 02 03 00 00 00 1b 00 00 02 02 00 00 00 1b 00 00 02 03 00 00 00 1c 00 00 02 02 00 00 00 1c 00 00 02 03 00 00 00 1d 00 00 02 02 00 00 00 1d 00 00 02 03 diff --git a/afl/testcase/ca52cd17cb1a061767830cb4e49867be9b637e56 b/afl/testcase/ca52cd17cb1a061767830cb4e49867be9b637e56 new file mode 100644 index 0000000..bb65811 --- /dev/null +++ b/afl/testcase/ca52cd17cb1a061767830cb4e49867be9b637e56 @@ -0,0 +1 @@ +,1c 01 04 40 00 00,,04 00 04 5f 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 30 39 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 31 38 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 32 39 20 64 65 76 2f 70 68 79 2e 30 3a 20 45 4e 41 42 4c 45 44 2d 3e 44 49 53 41 42 4c 45 44 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 34 31 20 64 65 76 2f 70 68 79 2e 31 3a 20 45 4e 41 42 4c 45 44 2d 3e 44 49 53 41 42 4c 45 44 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 35 33 20 64 65 76 2f 70 68 79 2e 32 3a 20 45 4e 41 42 4c 45 44 2d 3e 44 49 53 41 42 4c 45 44 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 36 32 20 64 65 76 2f 70 68 79 2e 33 3a 20 45 4e 41 42 4c 45 44 2d 3e 44 49 53 41 42 4c 45 44 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 36 37 20 64 65 76 2f 70 68 79 2e 30 3a 20 6e 6f 74 20 72 65 61 64 79 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 37 32 20 64 65 76 2f 70 68 79 2e 30 3a 20 6c 69 6e 6b 20 6e 6f 74 20 72 65 61 64 79 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 38 33 20 64 65 76 2f 70 68 79 2e 30 3a 20 72 61 74 65 20 36 47 2d 3e 75 6e 6b 6e 6f 77 6e 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 32 38 39 20 64 65 76 2f 70 68 79 2e 30 3a 20 61 74 74 61 63 68 65 64 20 70 68 79 20 69 64 20 30 78 30 34 2d 3e 30 78 66 66 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 30 31 20 64 65 76 2f 70 68 79 2e 31 3a 20 6e 6f 74 20 72 65 61 64 79 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 30 36 20 64 65 76 2f 70 68 79 2e 31 3a 20 6c 69 6e 6b 20 6e 6f 74 20 72 65 61 64 79 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 31 30 20 64 65 76 2f 70 68 79 2e 31 3a 20 72 61 74 65 20 36 47 2d 3e 75 6e 6b 6e 6f 77 6e 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 31 35 20 64 65 76 2f 70 68 79 2e 31 3a 20 61 74 74 61 63 68 65 64 20 70 68 79 20 69 64 20 30 78 30 35 2d 3e 30 78 66 66 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 32 37 20 74 6e 6c 2f 74 75 6e 6e 65 6c 5f 73 74 65 5f 72 65 63 76 5f 64 69 61 67 5f 6d 73 67 5f 68 61 6e 64 6c 65 72 3a 20 74 75 6e 6e 65 6c 69 6e 67 20 52 45 43 56 20 44 49 41 47 4e 4f 53 54 49 43 20 72 65 63 65 69 76 65 64 20 66 72 6f 6d 20 53 54 45 2e 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 32 38 20 64 65 76 2f 70 68 79 2e 32 3a 20 6e 6f 74 20 72 65 61 64 79 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 34 34 20 64 65 76 2f 70 68 79 2e 32 3a 20 6c 69 6e 6b 20 6e 6f 74 20 72 65 61 64 79 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 34 38 20 64 65 76 2f 70 68 79 2e 32 3a 20 72 61 74 65 20 36 47 2d 3e 75 6e 6b 6e 6f 77 6e 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 35 32 20 64 65 76 2f 70 68 79 2e 32 3a 20 61 74 74 61 63 68 65 64 20 70 68 79 20 69 64 20 30 78 30 36 2d 3e 30 78 66 66 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 36 34 20 64 65 76 2f 70 68 79 2e 33 3a 20 6e 6f 74 20 72 65 61 64 79 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 36 38 20 64 65 76 2f 70 68 79 2e 33 3a 20 6c 69 6e 6b 20 6e 6f 74 20 72 65 61 64 79 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 37 33 20 64 65 76 2f 70 68 79 2e 33 3a 20 72 61 74 65 20 36 47 2d 3e 75 6e 6b 6e 6f 77 6e 0a 30 33 3a 31 36 3a 35 38 3a 31 32 3a 33 37 38 20 64 65 76 2f 70 68 79 2e 33 3a 20 61 74 74 61 63 68 65 64 20 70 68 79 20 69 64 20 30 78 30 37 2d 3e 30 78 66 66 0a diff --git a/afl/testcase/ce03e25003a16fc03abb3d4f337a39e622962c60 b/afl/testcase/ce03e25003a16fc03abb3d4f337a39e622962c60 new file mode 100644 index 0000000..a76ba86 --- /dev/null +++ b/afl/testcase/ce03e25003a16fc03abb3d4f337a39e622962c60 @@ -0,0 +1 @@ +,1c 01 02 40 00 00,,02 00 01 00 00 00 00 00 00 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 11 00 00 00 00 00 00 00 01 00 2f 00 01 00 30 00 01 00 30 00 01 00 30 00 01 00 30 00 01 00 31 00 01 00 33 00 01 00 34 00 01 00 37 00 01 00 34 00 01 00 34 00 01 00 31 00 01 00 31 00 01 00 30 00 01 00 30 00 01 00 30 00 01 00 30 00 01 00 2e 00 00 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 01 20 00 00 diff --git a/afl/testcase/d2f9abc5e26020e42b45a32fcf3777cc61ea711c b/afl/testcase/d2f9abc5e26020e42b45a32fcf3777cc61ea711c new file mode 100644 index 0000000..4326cb4 --- /dev/null +++ b/afl/testcase/d2f9abc5e26020e42b45a32fcf3777cc61ea711c @@ -0,0 +1 @@ +,1a 08 ff ff ff 00,70 00 02 00 00 00 00 18 00 00 00 00 04 03 00 00 00 00 00 00 02 04 03 00 ff ff ff ff ff ff 00 00,01 aa 00 10 01 00 00 10 00 00 00 00 68 cb 9e 30 00 00 00 00 00 00 02 00 81 0a 04 14 ff 00 00 00 05 00 0c 00 82 0e 00 00 00 00 00 00 00 00 01 3a 00 00 00 00 83 16 bb d0 00 00 00 00 03 80 04 c4 02 08 00 01 00 a0 00 18 40 00 00 00 84 16 02 d3 c1 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 31 00 00 87 0a 04 14 ff 00 00 00 00 00 0c 00 88 12 10 00 ff ff 00 00 ff ff ff ff 80 03 00 00 00 00 00 00 8a 0a 00 10 00 80 00 00 00 00 00 06 18 06 06 00 00 00 00 00 99 0e 06 00 23 28 1b 58 00 00 00 00 00 00 00 00 59 01 00 64 00 06 00 02 00 00 00 00 10 49 0e 00 50 00 c5 00 68 59 9c bd 50 01 e6 78 7a c0 e0 00 01 00 00 00 00 00 00 00 88 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 50 00 c5 00 68 59 9c be 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/e71ac2a14ce3dd789a00eae0c656b36e2c07186a b/afl/testcase/e71ac2a14ce3dd789a00eae0c656b36e2c07186a new file mode 100644 index 0000000..62d2f34 --- /dev/null +++ b/afl/testcase/e71ac2a14ce3dd789a00eae0c656b36e2c07186a @@ -0,0 +1 @@ +,1a 08 3f ff ff 00,70 00 02 00 00 00 00 18 00 00 00 00 04 01 00 00 00 00 00 00 f5 02 00 00 00 00 00 00 00 00 00 00, diff --git a/afl/testcase/ebc80a44e5ef0a66fddb29c48373701b2eeb5227 b/afl/testcase/ebc80a44e5ef0a66fddb29c48373701b2eeb5227 new file mode 100644 index 0000000..adbec6f --- /dev/null +++ b/afl/testcase/ebc80a44e5ef0a66fddb29c48373701b2eeb5227 @@ -0,0 +1 @@ +,4d 00 71 00 00 00 00 40 00 00,,31 00 00 68 80 00 03 08 00 00 00 00 00 00 01 bd 80 01 03 08 00 00 00 00 00 00 01 bd 80 02 03 08 00 00 00 00 00 00 01 97 80 03 03 08 00 00 00 00 00 00 01 a6 8f fa 03 08 00 00 00 00 00 00 01 97 8f fb 03 08 00 00 00 00 00 00 01 a6 8f fc 03 04 00 00 00 63 8f fd 03 04 00 00 00 00 8f fe 03 04 00 00 10 70 8f ff 03 04 00 00 74 04 diff --git a/afl/testcase/ee66ad0b8b05525c54c4538059714a92646c39fb b/afl/testcase/ee66ad0b8b05525c54c4538059714a92646c39fb new file mode 100644 index 0000000..9502adc --- /dev/null +++ b/afl/testcase/ee66ad0b8b05525c54c4538059714a92646c39fb @@ -0,0 +1 @@ +,1c 01 80 40 00 00,,80 00 00 1c 56 45 4e 44 4f 52 20 20 03 01 41 30 35 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/eebceb65beacbe25d0db149e5c37198ee5be1912.csv b/afl/testcase/eebceb65beacbe25d0db149e5c37198ee5be1912.csv new file mode 100644 index 0000000..0e9b0f2 --- /dev/null +++ b/afl/testcase/eebceb65beacbe25d0db149e5c37198ee5be1912.csv @@ -0,0 +1 @@ +,25 00 00 00 00 00 00 00 00 00,,00 0e 00 00 00 00 00 00 diff --git a/afl/testcase/ef22fafdd3041dc08043fe2bb908e96dffa34ff5 b/afl/testcase/ef22fafdd3041dc08043fe2bb908e96dffa34ff5 new file mode 100644 index 0000000..0c8c45b --- /dev/null +++ b/afl/testcase/ef22fafdd3041dc08043fe2bb908e96dffa34ff5 @@ -0,0 +1 @@ +,37 00 0b 00 00 00 00 02 00 00,,00 0e 01 18 00 00 00 12 00 00 07 75 00 00 00 12 00 00 00 c1 00 00 00 12 00 00 07 4f 00 00 00 12 00 00 01 3d 00 00 00 12 00 00 05 eb 00 00 00 12 00 00 05 bd 00 00 00 12 00 00 07 33 00 00 00 12 00 00 05 23 00 00 00 12 00 00 04 35 00 00 00 12 00 00 06 ed 00 00 00 12 00 00 01 97 00 00 00 12 00 00 02 07 00 00 00 12 00 00 02 2b 00 00 00 12 00 00 03 f5 00 00 00 12 00 00 04 f7 00 00 00 12 00 00 06 cf 00 00 00 12 00 00 04 17 00 00 00 12 00 00 01 0b 00 00 00 12 00 00 02 73 00 00 00 12 00 00 02 35 00 00 00 12 00 00 02 3d 00 00 00 12 00 00 01 31 00 00 00 12 00 00 03 37 00 00 00 12 00 00 06 07 00 00 00 12 00 00 00 5d 00 00 00 12 00 00 06 af 00 00 00 12 00 00 03 dd 00 00 00 12 00 00 00 6f 00 00 00 12 00 00 06 0d 00 00 00 12 00 00 05 9d 00 00 00 12 00 00 04 49 00 00 00 12 00 00 01 f5 00 00 00 12 00 00 06 a1 00 00 00 12 00 00 03 f3 00 00 00 12 00 00 03 55 diff --git a/afl/testcase/f007593acbf7f63773efa1b65ef61da7fcefbb34 b/afl/testcase/f007593acbf7f63773efa1b65ef61da7fcefbb34 new file mode 100644 index 0000000..db8459a --- /dev/null +++ b/afl/testcase/f007593acbf7f63773efa1b65ef61da7fcefbb34 @@ -0,0 +1 @@ +,25 00 00 00 00 00 00 00 00 00,70 00 06 00 00 00 00 0a 00 00 00 00 29 00 00 00 00 00, diff --git a/afl/testcase/f3492a44323a0bf7bea4e59b536feaf7620b8e8b b/afl/testcase/f3492a44323a0bf7bea4e59b536feaf7620b8e8b new file mode 100644 index 0000000..b5a0d35 --- /dev/null +++ b/afl/testcase/f3492a44323a0bf7bea4e59b536feaf7620b8e8b @@ -0,0 +1 @@ +,5a 00 3f ff 00 00 00 10 00 00,,00 52 00 00 00 00 00 00 02 0e 00 00 00 00 00 00 00 00 00 09 00 00 00 00 0a 0a 00 00 00 00 00 00 00 00 00 00 18 06 06 00 00 00 00 00 19 06 16 00 00 0a 00 00 a0 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 21 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/f40e3999c3fe73cd2e50083874537ec000697cb7 b/afl/testcase/f40e3999c3fe73cd2e50083874537ec000697cb7 new file mode 100644 index 0000000..9e9ecc1 --- /dev/null +++ b/afl/testcase/f40e3999c3fe73cd2e50083874537ec000697cb7 @@ -0,0 +1 @@ +,25 00 00 00 00 00 00 00 00 00,71 00 04 00 00 00 00 18 00 00 00 00 44 a2 00 00 00 00 00 00 f6 22 00 00 00 00 00 00 00 00 00 00, diff --git a/afl/testcase/f5272bcea41574f9cd663f33334c530abcca01d7 b/afl/testcase/f5272bcea41574f9cd663f33334c530abcca01d7 new file mode 100644 index 0000000..d0434e9 --- /dev/null +++ b/afl/testcase/f5272bcea41574f9cd663f33334c530abcca01d7 @@ -0,0 +1 @@ +,1c 01 01 40 00 00,,01 00 00 d8 00 00 00 00 22 00 06 58 50 01 63 60 01 b6 34 3e 51 55 41 4e 54 41 00 00 4a 42 45 20 49 53 49 4d 37 20 20 20 00 00 00 00 30 31 30 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 12 00 10 04 12 00 10 07 01 00 10 0e 01 00 10 18 01 00 10 19 12 00 10 41 72 72 61 79 20 44 65 76 69 63 65 20 20 20 20 54 65 6d 70 65 72 61 74 75 72 65 20 20 20 20 20 45 4d 4d 20 20 20 20 20 20 20 20 20 20 20 20 20 45 6e 63 6c 6f 73 75 72 65 20 20 20 20 20 20 20 45 78 70 61 6e 64 65 72 20 20 20 20 20 20 20 20 43 6f 6e 6e 65 63 74 6f 72 20 20 20 20 20 20 20 diff --git a/afl/testcase/f7db47bebdfb5888fae0fbe826b37df33a450292 b/afl/testcase/f7db47bebdfb5888fae0fbe826b37df33a450292 new file mode 100644 index 0000000..1371d72 --- /dev/null +++ b/afl/testcase/f7db47bebdfb5888fae0fbe826b37df33a450292 @@ -0,0 +1 @@ +,37 00 08 00 00 00 00 00 08 00,,00 0e 00 00 00 00 00 00 00 00 00 0c 00 00 00 70 00 00 00 0c 00 00 00 8e 00 00 00 0c 00 00 01 06 00 00 00 00 00 00 02 02 00 00 00 00 00 00 02 03 00 00 00 01 00 00 02 02 00 00 00 01 00 00 02 03 00 00 00 02 00 00 02 02 00 00 00 02 00 00 02 03 00 00 00 03 00 00 02 02 00 00 00 03 00 00 02 03 00 00 00 04 00 00 02 02 00 00 00 04 00 00 02 03 00 00 00 05 00 00 02 02 00 00 00 05 00 00 02 03 00 00 00 06 00 00 02 02 00 00 00 06 00 00 02 03 00 00 00 07 00 00 02 02 00 00 00 07 00 00 02 03 00 00 00 08 00 00 02 02 00 00 00 08 00 00 02 03 00 00 00 09 00 00 02 02 00 00 00 09 00 00 02 03 00 00 00 0a 00 00 02 02 00 00 00 0a 00 00 02 03 00 00 00 0b 00 00 02 02 00 00 00 0b 00 00 02 03 00 00 00 0c 00 00 02 02 00 00 00 0c 00 00 02 03 00 00 00 0d 00 00 02 02 00 00 00 0d 00 00 02 03 00 00 00 0e 00 00 02 02 00 00 00 0e 00 00 02 03 00 00 00 0f 00 00 02 02 00 00 00 0f 00 00 02 03 00 00 00 10 00 00 02 02 00 00 00 10 00 00 02 03 00 00 00 11 00 00 02 02 00 00 00 11 00 00 02 03 00 00 00 12 00 00 02 02 00 00 00 12 00 00 02 03 00 00 00 13 00 00 02 02 00 00 00 13 00 00 02 03 00 00 00 14 00 00 02 02 00 00 00 14 00 00 02 03 00 00 00 15 00 00 02 02 00 00 00 15 00 00 02 03 00 00 00 16 00 00 02 02 00 00 00 16 00 00 02 03 00 00 00 17 00 00 02 02 00 00 00 17 00 00 02 03 00 00 00 18 00 00 02 02 00 00 00 18 00 00 02 03 00 00 00 19 00 00 02 02 00 00 00 19 00 00 02 03 00 00 00 1a 00 00 02 02 00 00 00 1a 00 00 02 03 00 00 00 1b 00 00 02 02 00 00 00 1b 00 00 02 03 00 00 00 1c 00 00 02 02 00 00 00 1c 00 00 02 03 00 00 00 1d 00 00 02 02 00 00 00 1d 00 00 02 03 diff --git a/afl/testcase/f7faaa230cdb97e1aec1e5ca75f89b7ea8b78726 b/afl/testcase/f7faaa230cdb97e1aec1e5ca75f89b7ea8b78726 new file mode 100644 index 0000000..eb60eb1 --- /dev/null +++ b/afl/testcase/f7faaa230cdb97e1aec1e5ca75f89b7ea8b78726 @@ -0,0 +1 @@ +,25 00 00 00 00 00 00 00 00 00,70 00 03 00 00 00 00 18 00 00 00 00 31 00 03 00 00 00 00 00 03 31 00 03 ff ff ff ff ff ff 00 00,00 83 00 48 01 03 00 08 diff --git a/afl/testcase/fb0082d5df4c4f237f65ac2c2717ae46408c17b8.csv b/afl/testcase/fb0082d5df4c4f237f65ac2c2717ae46408c17b8.csv new file mode 100644 index 0000000..3b671fa --- /dev/null +++ b/afl/testcase/fb0082d5df4c4f237f65ac2c2717ae46408c17b8.csv @@ -0,0 +1 @@ +,1c 01 00 40 00 00,,00 00 00 04 00 3f 40 82 diff --git a/afl/testcase/fbc7b5cc87f1afa84d70c82f152761258a3b0ca6 b/afl/testcase/fbc7b5cc87f1afa84d70c82f152761258a3b0ca6 new file mode 100644 index 0000000..12c5c6c --- /dev/null +++ b/afl/testcase/fbc7b5cc87f1afa84d70c82f152761258a3b0ca6 @@ -0,0 +1 @@ +,b7 0d 00 00 00 00 00 00 00 08 00 00,,00 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 5a 00 00 00 01 00 00 00 5a 00 00 00 02 00 00 00 5a 00 00 00 03 00 00 00 5a 00 00 00 04 00 00 00 5a 00 00 00 06 00 00 00 5a 00 00 00 07 00 00 00 5a 00 00 00 08 00 00 00 5a 00 00 00 09 00 00 00 5a 00 00 00 0a 00 00 00 5a 00 00 00 0b 00 00 00 5a 00 00 00 12 00 00 00 5a 00 00 00 0c 00 00 00 5a 00 00 00 0d 00 00 00 5a 00 00 00 0e 00 00 00 5a 00 00 00 0f 00 00 00 5a 00 00 00 10 00 00 00 5a 00 00 00 05 00 00 00 5a 00 00 00 11 00 00 00 5a 00 00 00 13 00 00 00 5a 00 00 00 1e 00 00 00 5a 00 00 00 14 00 00 00 5a 00 00 00 15 00 00 00 5a 00 00 00 16 00 00 00 5a 00 00 00 17 00 00 00 5a 00 00 00 1f 00 00 00 5a 00 00 00 20 00 00 00 5a 00 00 00 21 00 00 00 5a 00 00 00 22 00 00 00 5a 00 00 00 23 00 00 00 5a 00 00 00 18 00 00 00 5a 00 00 00 19 00 00 00 5a 00 00 00 1a 00 00 00 5a 00 00 00 1b 00 00 00 5a 00 00 00 1c 00 00 00 5a 00 00 00 1d 00 00 00 5a 00 00 00 24 00 00 00 5a 00 00 00 25 00 00 00 5a 00 00 00 26 00 00 00 5a 00 00 00 27 00 00 00 5a 00 00 00 28 00 00 00 5a 00 00 00 29 00 00 00 5a 00 00 00 2a 00 00 00 5a 00 00 00 2d 00 00 00 5a 00 00 00 2e 00 00 00 5a 00 00 00 2f 00 00 00 5a 00 00 00 30 00 00 00 5a 00 00 00 31 00 00 00 5a 00 00 00 32 00 00 00 5a 00 00 00 33 00 00 00 5a 00 00 00 34 00 00 00 5a 00 00 00 35 00 00 00 5a 00 00 00 2b 00 00 00 5a 00 00 00 2c 00 00 00 5a 00 00 00 06 00 00 00 5b 00 00 00 00 00 00 00 5b 00 00 00 01 00 00 00 5b 00 00 00 04 00 00 00 5b 00 00 00 02 00 00 00 5b 00 00 00 03 00 00 00 5b 00 00 00 05 00 00 00 5b 00 00 00 07 00 00 00 5b 00 00 00 38 00 00 00 5a diff --git a/afl/testcase/fc52fecd84a8f8a478b99b4965333a7f9dfa002c b/afl/testcase/fc52fecd84a8f8a478b99b4965333a7f9dfa002c new file mode 100644 index 0000000..7168aba --- /dev/null +++ b/afl/testcase/fc52fecd84a8f8a478b99b4965333a7f9dfa002c @@ -0,0 +1 @@ +,37 00 11 00 00 00 00 00 08 00,70 00 01 00 00 00 00 18 00 00 00 00 1c 01 00 c0 00 02 00 00 17 47 00 00 00 00 00 00 00 00 00 00,00 16 04 50 00 00 00 00 diff --git a/afl/testcase/fcc19a8cc98ada27c4b6a605adca5bb497ad618e b/afl/testcase/fcc19a8cc98ada27c4b6a605adca5bb497ad618e new file mode 100644 index 0000000..353da06 --- /dev/null +++ b/afl/testcase/fcc19a8cc98ada27c4b6a605adca5bb497ad618e @@ -0,0 +1 @@ +,4d 00 4d 00 00 00 00 40 00 00,,0d 00 00 0c 00 00 43 02 00 17 00 01 43 02 00 46 diff --git a/afl/testcase/fcd8ce757f7d3f54ab0ee3d01007e0a6d70fa288 b/afl/testcase/fcd8ce757f7d3f54ab0ee3d01007e0a6d70fa288 new file mode 100644 index 0000000..093745a --- /dev/null +++ b/afl/testcase/fcd8ce757f7d3f54ab0ee3d01007e0a6d70fa288 @@ -0,0 +1 @@ +,1a 08 bf ff ff 00,70 00 05 00 00 00 00 18 00 00 00 00 24 00 00 c0 00 04 00 00 05 24 00 00 ff ff ff ff ff ff 00 00,01 aa 00 10 01 00 00 10 00 00 00 00 68 cb 9e 30 00 00 00 00 00 00 02 00 81 0a c4 14 ff 00 00 00 05 00 0c 00 82 0e 00 00 00 00 00 00 00 00 01 3a 00 00 00 00 83 16 bb d0 00 00 00 00 03 80 04 c4 02 00 00 01 00 a0 00 18 40 00 00 00 84 16 02 d3 c1 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 31 00 00 87 0a 04 14 ff 00 00 00 00 00 0c 00 88 12 14 00 ff ff 00 00 ff ff ff ff 80 03 00 00 00 00 00 00 8a 0a 00 10 00 80 00 00 00 00 00 06 18 06 06 00 00 00 00 00 99 0e 06 00 23 28 1b 58 00 00 00 00 00 00 00 00 59 01 00 64 00 06 00 02 00 00 00 00 10 49 0e 00 50 00 c5 00 54 97 b0 31 50 01 e6 75 96 b7 10 00 01 00 00 00 00 00 00 00 88 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 50 00 c5 00 54 97 b0 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/febd83d39f830202ca6081514960b4242e536df7 b/afl/testcase/febd83d39f830202ca6081514960b4242e536df7 new file mode 100644 index 0000000..6f64b6d --- /dev/null +++ b/afl/testcase/febd83d39f830202ca6081514960b4242e536df7 @@ -0,0 +1 @@ +,5a 08 ff ff 00 00 00 10 00 00,,01 f6 00 00 00 00 00 00 81 0a c8 ff ff 00 00 00 ff 00 13 88 82 0e 00 00 00 0a 00 00 00 00 01 00 00 00 00 00 83 16 00 80 00 00 00 00 00 00 00 80 02 00 00 01 00 00 00 00 40 00 00 00 84 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 87 0a 08 ff ff 00 00 00 00 00 13 88 88 12 14 00 ff ff 00 00 00 00 ff ff 00 08 00 00 00 00 00 00 8a 0a 00 00 00 00 00 00 00 00 07 08 ca 01 00 1c 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 98 06 06 00 00 00 00 00 99 0e 06 00 23 28 1b 58 00 00 00 00 00 00 00 00 d9 01 00 64 00 06 01 02 00 00 00 00 21 1a 02 02 50 00 03 96 9c 89 bf e2 50 06 04 80 78 0f c3 3f 0e 00 00 00 00 00 00 00 88 bb 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 21 1a 02 02 50 00 03 96 9c 89 bf e3 50 06 04 80 78 0e dc bf 20 00 00 00 00 00 00 00 88 bb 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d9 02 00 0c 00 06 00 00 00 00 00 00 00 00 00 00 59 03 00 2c 00 06 01 02 00 00 00 10 80 ab 00 00 80 af 00 01 c0 a8 00 01 00 00 0a 00 00 01 00 10 80 ab 00 00 80 af 00 01 c0 a8 00 01 00 00 0a 00 9a 26 00 02 00 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 da 01 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 9c 0a 08 00 00 00 00 00 00 00 00 01 a4 0e 00 00 40 37 0f 13 00 00 00 00 00 00 00 00 e4 01 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 c0 01 00 30 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/fec38c54692c2fcff269370fc1bbb9e598b821a7 b/afl/testcase/fec38c54692c2fcff269370fc1bbb9e598b821a7 new file mode 100644 index 0000000..32590ee --- /dev/null +++ b/afl/testcase/fec38c54692c2fcff269370fc1bbb9e598b821a7 @@ -0,0 +1 @@ +,1a 00 7f ff ff 00,70 00 02 00 00 00 00 18 00 00 00 00 04 04 00 80 30 9e 00 00 f5 04 00 00 00 00 00 00 00 00 00 00, diff --git a/afl/testcase/fec50c6c3f5486958b33beada06857deeff177dd.csv b/afl/testcase/fec50c6c3f5486958b33beada06857deeff177dd.csv new file mode 100644 index 0000000..98be7ac --- /dev/null +++ b/afl/testcase/fec50c6c3f5486958b33beada06857deeff177dd.csv @@ -0,0 +1 @@ +,12 00 00 02 00 00,,0d 00 06 12 83 00 d0 02 45 4d 43 20 20 20 20 20 45 53 45 53 20 45 6e 63 6c 6f 73 75 72 65 20 20 30 30 30 31 50 4d 43 53 49 45 52 41 80 05 02 00 00 00 00 00 00 00 00 00 00 00 00 75 0c 00 03 01 03 e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 03 00 00 00 01 41 50 4d 30 30 31 34 30 37 32 34 32 36 38 00 00 diff --git a/afl/testcase/fedb716d47c930bafffff38b6c274ce9202187ac b/afl/testcase/fedb716d47c930bafffff38b6c274ce9202187ac new file mode 100644 index 0000000..c4c75e5 --- /dev/null +++ b/afl/testcase/fedb716d47c930bafffff38b6c274ce9202187ac @@ -0,0 +1 @@ +,1a 08 bf ff ff 00,,00 0e 00 00 00 00 00 00 00 00 00 03 00 00 00 2c 00 00 00 00 00 00 00 5a 00 00 00 01 00 00 00 5a 00 00 00 02 00 00 00 5a 00 00 00 03 00 00 00 5a 00 00 00 04 00 00 00 5a 00 00 00 06 00 00 00 5a 00 00 00 07 00 00 00 5a 00 00 00 08 00 00 00 5a 00 00 00 09 00 00 00 5a 00 00 00 0a 00 00 00 5a 00 00 00 0b 00 00 00 5a 00 00 00 12 00 00 00 5a 00 00 00 0c 00 00 00 5a 00 00 00 0d 00 00 00 5a 00 00 00 0e 00 00 00 5a 00 00 00 0f 00 00 00 5a 00 00 00 10 00 00 00 5a 00 00 00 05 00 00 00 5a 00 00 00 11 00 00 00 5a 00 00 00 13 00 00 00 5a 00 00 00 1e 00 00 00 5a 00 00 00 14 00 00 00 5a 00 00 00 15 00 00 00 5a 00 00 00 16 00 00 00 5a 00 00 00 17 00 00 00 5a 00 00 00 1f 00 00 00 5a 00 00 00 20 00 00 00 5a 00 00 00 21 00 00 00 5a 00 00 00 22 00 00 00 5a 00 00 00 23 00 00 00 diff --git a/afl/testcase/ff0232f5144d65579feeccb6b65687c5056501a7 b/afl/testcase/ff0232f5144d65579feeccb6b65687c5056501a7 new file mode 100644 index 0000000..f4cfe05 --- /dev/null +++ b/afl/testcase/ff0232f5144d65579feeccb6b65687c5056501a7 @@ -0,0 +1 @@ +,4d 00 77 00 00 00 00 40 00 00,,37 00 00 28 00 00 02 04 4a 92 79 ba 00 01 02 04 71 dd 1f cd 00 02 02 04 6d 2c da 32 00 03 02 04 01 87 03 91 00 04 02 04 00 00 00 00 diff --git a/afl/testcase/ff3242c96b948a6ded16dd8ae51b1e61c40c5a66 b/afl/testcase/ff3242c96b948a6ded16dd8ae51b1e61c40c5a66 new file mode 100644 index 0000000..08fd42f --- /dev/null +++ b/afl/testcase/ff3242c96b948a6ded16dd8ae51b1e61c40c5a66 @@ -0,0 +1 @@ +,1a 00 bf ff ff 00,70 00 05 00 00 00 00 28 00 00 00 00 24 00 00 c0 00 04 00 1a 13 01 01 00 00 00 00 00 00 00 78 00 00 1d 31 1a 18 00 00 00 00 00 14 00 00 00 00 00, diff --git a/afl/testcase/ff5a0c3111af229b7f4ec8c4a38d82ccf7e553a2 b/afl/testcase/ff5a0c3111af229b7f4ec8c4a38d82ccf7e553a2 new file mode 100644 index 0000000..649daa8 --- /dev/null +++ b/afl/testcase/ff5a0c3111af229b7f4ec8c4a38d82ccf7e553a2 @@ -0,0 +1 @@ +,1a 08 3f ff ff 00,70 00 05 00 00 00 00 18 00 00 00 00 24 00 00 c0 00 04 00 00 05 24 00 00 ff ff ff ff ff ff 00 00,01 aa 00 10 01 00 00 10 00 00 00 00 68 cb 9e 30 00 00 00 00 00 00 02 00 81 0a 04 14 ff 00 00 00 05 00 0c 00 82 0e 00 00 00 00 00 00 00 00 01 3a 00 00 00 00 83 16 bb d0 00 00 00 00 03 80 04 c4 02 00 00 01 00 a0 00 18 40 00 00 00 84 16 02 d3 c1 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 31 00 00 87 0a 04 14 ff 00 00 00 00 00 0c 00 88 12 14 00 ff ff 00 00 ff ff ff ff 80 03 00 00 00 00 00 00 8a 0a 00 10 00 80 00 00 00 00 00 06 18 06 06 00 00 00 00 00 99 0e 06 00 23 28 1b 58 00 00 00 00 00 00 00 00 59 01 00 64 00 06 00 02 00 00 00 00 10 49 0e 00 50 00 c5 00 70 c8 b6 d5 50 01 e6 78 ea fa c0 00 01 00 00 00 00 00 00 00 88 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 50 00 c5 00 70 c8 b6 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/ff5f50f7b5d36b765da768ef583a8b289be09a7e.csv b/afl/testcase/ff5f50f7b5d36b765da768ef583a8b289be09a7e.csv new file mode 100644 index 0000000..d86fae8 --- /dev/null +++ b/afl/testcase/ff5f50f7b5d36b765da768ef583a8b289be09a7e.csv @@ -0,0 +1 @@ +,1a 08 3f ff ff 00,,23 00 10 00 08 12 10 00 ff ff 00 00 ff ff ff ff 00 ff 00 00 00 00 00 00 1c 0a 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/ff82315f17a9d582afd6aba974c222e00d14af15 b/afl/testcase/ff82315f17a9d582afd6aba974c222e00d14af15 new file mode 100644 index 0000000..de410ae --- /dev/null +++ b/afl/testcase/ff82315f17a9d582afd6aba974c222e00d14af15 @@ -0,0 +1 @@ +,4d 00 5f d2 00 00 00 40 00 00,70 00 05 00 00 00 00 18 00 00 00 00 24 00 00 cd 00 02 00 00 f8 23 00 00 00 00 00 00 00 00 00 00, diff --git a/afl/testcase/ff980b7b6e39f929b8ddb08e419a2904abd44b33 b/afl/testcase/ff980b7b6e39f929b8ddb08e419a2904abd44b33 new file mode 100644 index 0000000..48d941f --- /dev/null +++ b/afl/testcase/ff980b7b6e39f929b8ddb08e419a2904abd44b33 @@ -0,0 +1 @@ +,1c 01 04 40 00 00,,04 00 01 4d 32 34 3a 31 35 3a 31 31 3a 31 37 3a 30 30 30 20 74 6e 6c 2f 74 75 6e 6e 65 6c 5f 73 74 65 5f 72 65 63 76 5f 64 69 61 67 5f 6d 73 67 5f 68 61 6e 64 6c 65 72 3a 20 74 75 6e 6e 65 6c 69 6e 67 20 52 45 43 56 20 44 49 41 47 4e 4f 53 54 49 43 20 72 65 63 65 69 76 65 64 20 66 72 6f 6d 20 53 54 45 2e 0a 32 34 3a 31 35 3a 31 31 3a 31 37 3a 32 30 33 20 45 53 45 53 3a 20 66 77 64 6c 20 70 72 74 74 6e 20 63 6e 74 72 6c 20 73 74 61 74 75 73 20 72 65 63 65 69 76 65 64 3a 20 61 63 74 69 76 65 3a 20 31 20 64 61 74 61 3a 20 30 20 69 6d 67 30 63 72 63 3a 20 30 78 62 64 20 69 6d 67 31 63 72 63 3a 20 30 78 61 34 0a 32 34 3a 31 35 3a 31 31 3a 32 35 3a 31 38 30 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a 32 34 3a 31 35 3a 31 31 3a 32 35 3a 31 38 38 20 45 4d 43 20 53 54 45 3a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 56 50 44 20 70 61 67 65 73 20 77 61 73 20 31 30 2c 20 6e 6f 77 20 31 30 0a diff --git a/afl/testcase/ffb313726fc6fa8b68381e5df22e960cb623b62c.csv b/afl/testcase/ffb313726fc6fa8b68381e5df22e960cb623b62c.csv new file mode 100644 index 0000000..f5805b8 --- /dev/null +++ b/afl/testcase/ffb313726fc6fa8b68381e5df22e960cb623b62c.csv @@ -0,0 +1 @@ +,9e 10 00 00 00 00 00 00 00 00 00 00 02 00 00 00,,00 00 00 00 00 e7 bf ff 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/ffe9cd6ca4dbbdd2b2429c8d8023183b84c2962f b/afl/testcase/ffe9cd6ca4dbbdd2b2429c8d8023183b84c2962f new file mode 100644 index 0000000..9705d76 --- /dev/null +++ b/afl/testcase/ffe9cd6ca4dbbdd2b2429c8d8023183b84c2962f @@ -0,0 +1 @@ +,12 01 88 02 00 00,,00 88 00 30 00 00 00 01 00 00 00 00 00 00 00 0c 61 93 00 08 50 00 c5 00 67 b9 53 ad 00 00 00 02 00 00 00 00 00 00 00 0c 61 93 00 08 50 00 c5 00 67 b9 53 ae diff --git a/afl/testcase/ffefa3f6034cc5680792a8cae855bc7a2d9f9019 b/afl/testcase/ffefa3f6034cc5680792a8cae855bc7a2d9f9019 new file mode 100644 index 0000000..eaaaaa6 --- /dev/null +++ b/afl/testcase/ffefa3f6034cc5680792a8cae855bc7a2d9f9019 @@ -0,0 +1 @@ +,12 01 c0 02 00 00,,0d c0 00 24 01 00 00 00 24 00 00 00 66 2f e0 06 0d 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 23 4a 88 75 diff --git a/afl/testcase/fff9db19407d43fdb18735c075071a866a5f0795 b/afl/testcase/fff9db19407d43fdb18735c075071a866a5f0795 new file mode 100644 index 0000000..64bbb03 --- /dev/null +++ b/afl/testcase/fff9db19407d43fdb18735c075071a866a5f0795 @@ -0,0 +1 @@ +,1c 01 82 40 00 00,,82 00 00 6e 48 49 54 41 43 48 49 20 43 32 36 30 00 01 00 00 00 00 00 00 0b 08 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 0e 00 01 00 01 00 00 00 5f 00 02 00 00 00 00 00 0b 00 02 00 01 00 00 00 11 00 03 00 00 00 00 00 00 00 03 00 01 00 00 00 00 00 04 00 00 00 00 00 00 00 04 00 01 00 00 00 00 00 05 00 00 00 00 00 0e 00 05 00 01 00 00 00 50 diff --git a/afl/testcase/fffa5f13587a7e46023238c9e7db91fd61414105 b/afl/testcase/fffa5f13587a7e46023238c9e7db91fd61414105 new file mode 100644 index 0000000..a0415e7 --- /dev/null +++ b/afl/testcase/fffa5f13587a7e46023238c9e7db91fd61414105 @@ -0,0 +1 @@ +,1a 00 bf ff ff 00,,bf 00 10 08 2e 90 ed d0 00 00 02 00 81 0a 04 01 00 00 00 00 00 00 0c 00 82 0e 00 00 00 00 00 00 01 f4 00 00 00 00 00 00 03 16 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 40 00 00 00 04 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 87 0a 04 01 00 00 00 00 00 00 0c 00 88 12 10 00 ff ff 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 8a 0a 00 10 00 00 00 00 00 00 00 06 ca 01 00 1c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 98 06 06 00 00 00 00 00 99 0e 06 00 23 28 1b 58 00 00 00 00 00 00 00 00 d9 01 00 64 00 06 02 02 00 00 00 00 21 0a 02 02 50 00 cc a0 13 07 16 b1 50 06 04 80 d8 12 41 bf 18 00 00 00 00 00 00 00 88 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 21 0a 02 02 50 00 cc diff --git a/afl/testcase/id:000001,sig:11,src:005156,op:ext_AO,pos:34 b/afl/testcase/id:000001,sig:11,src:005156,op:ext_AO,pos:34 new file mode 100644 index 0000000..be05386 --- /dev/null +++ b/afl/testcase/id:000001,sig:11,src:005156,op:ext_AO,pos:34 @@ -0,0 +1 @@ +,1C 00 43 00 00 00 00 40 00 00,,01 aa 00 54 00 00 00 08 00 00 00 00 00 00 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 02 00 08 00 00 00 00 00 00B00030 00 03 00 08 00 00 00 00 00 00 00 00 00 04 00 08 00 00 00 00 00 00 00 00 00 05 00 08 00 00 73 e0 f6 d9 46 00 00 06 00 08 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/id:000001,src:000141,op:arith8,pos:118,val:-34 b/afl/testcase/id:000001,src:000141,op:arith8,pos:118,val:-34 new file mode 100644 index 0000000..01bdfaf --- /dev/null +++ b/afl/testcase/id:000001,src:000141,op:arith8,pos:118,val:-34 @@ -0,0 +1 @@ +,5a 10 300,,00 2e 00 10 01 00 00 18 00 00 00 00 00 e7 bf ff 00 00 00 00 00 00 02 00 08 12 10 00 ff ff 00 00 ff ff ff fD 00 ff 00 00 00 00 00 00 1c 0a 00 00 diff --git a/afl/testcase/id:000002,src:000200,op:ext_AO,pos:571 b/afl/testcase/id:000002,src:000200,op:ext_AO,pos:571 new file mode 100644 index 0000000..c0fd043 --- /dev/null +++ b/afl/testcase/id:000002,src:000200,op:ext_AO,pos:571 @@ -0,0 +1 @@ +,5a 00 bf ff 00 00 00 10 00 00,,01 a2 00 10 00 00 00 08 68 cb 9e 30 00 00 02 00 81 0a 04 14 ff 00 00 00 05 00 0c 00 82 0e 00 00 00 00 00 00 00 00 01 3a 00 00 00 00 83 16 bb d0 00 00 00 00 03 80 04 c4 02 08 00 01 00 a0 00 18 40 00 00 00 84 16 02 d3 c1 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 31 00 00 87 0a 04 14 ff 00 00 00 00 00 0c 00 88 12 10 00 ff ff 00 00 ff ff ff ff 80 03 00 00 00 00 00 00 8a 0a 00 10 00 80 00 00 00 00 00 06 18 0B 06 00 00 00 00 00 99 0e 06 00 23 28 1b 58 00 00 00 00 00 00 00 00 59 01 00 64 00 06 00 02 00 00 00 00 10 49 0e 00 50 00 c5 00 ff fd f2 f1 50 01 e6 77 5a 4d b0 00 01 00 00 00 00 00 00 00 88 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 50 00 c5 00 5f 0d f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 88 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 02 00 0c 00 06 03 e8 00 00 00 00 00 00 00 00 59 03 00 2c 00 06 00 02 00 00 00 10 80 ac 00 01 80 ac 00 01 00 00 00 00 00 00 09 00 00 01 00 10 80 ac 00 01 80 ac 00 01 00 00 00 00 00 00 00 00 9a 26 00 00 00 00 00 0a 00 00 8c a0 00 00 17 70 00 00 46 50 00 00 46 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9c 0a 00 04 00 00 00 00 00 00 00 01 dc 01 00 0c 01 00 00 48 00 18 01 f4 00 00 00 00 80 16 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 00 00 00 00 00 00 diff --git a/afl/testcase/id:000003,src:000314,op:flip1,pos:19 b/afl/testcase/id:000003,src:000314,op:flip1,pos:19 new file mode 100644 index 0000000..50e6481 --- /dev/null +++ b/afl/testcase/id:000003,src:000314,op:flip1,pos:19 @@ -0,0 +1 @@ +,5a 10 3f ff00,,00 0e 40 10 01 00 00 10 00 00 00 00 00 e7 bf ff 00 00 00 00 00 00 d2 00 08 00 ff ff ff ff ff ffff 0000 ff 00 00 ff ff 00 ff 00 00 00 00 00 00 1 \ No newline at end of file diff --git a/afl/testcase/id:000005,sig:11,src:005234,op:havoc,rep:2 b/afl/testcase/id:000005,sig:11,src:005234,op:havoc,rep:2 new file mode 100644 index 0000000000000000000000000000000000000000..a6ecac6e72705bcd426ee58b6109541678eb5931 GIT binary patch literal 136 zcmdNfbXG7hP%tqDkw65YbaV_1fh-_!1(Rq5SV{q`M8UuUq6I{{f{lO}1SO5YvPf!R QvQ9uVjUnn87#RKo0BdU)A^-pY literal 0 HcmV?d00001 diff --git a/afl/testcase/id:000005,src:000445,op:flip1,pos:132 b/afl/testcase/id:000005,src:000445,op:flip1,pos:132 new file mode 100644 index 0000000..a95d404 --- /dev/null +++ b/afl/testcase/id:000005,src:000445,op:flip1,pos:132 @@ -0,0 +1 @@ +,5a 10 3f ff00,,00 2e 00 10 01 00 00 10 00 00 00 00 00 e7 bd ff 00 00 00 00 00 00 08 12 10 09 ff ff 00 02 00 0810 00 ff ff ff ff fd 00 ff 00 00 0000 00 1c 0a \ No newline at end of file diff --git a/afl/testcase/id:000007,sig:11,src:005483,op:flip2,pos:43 b/afl/testcase/id:000007,sig:11,src:005483,op:flip2,pos:43 new file mode 100644 index 0000000..fbceede --- /dev/null +++ b/afl/testcase/id:000007,sig:11,src:005483,op:flip2,pos:43 @@ -0,0 +1 @@ +,12 01 43 00 00 00 00 40 00 00,,03 40 00 54,00 00 00 08 00 00 00 00 00 00 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 02 00 08 00 00 00 00 00 00B00030 00 03 00 08 00 00 00 00 00 00 00 00 00 04 00 08 00 00 00 00 00 00 00 00 00 05 00 08 00 00 73 e0 f6 d9 46 00 00 06 00 08 00 00 00 00 00 00 00 00 diff --git a/afl/testcase/id:000008,src:001208,op:flip1,pos:89 b/afl/testcase/id:000008,src:001208,op:flip1,pos:89 new file mode 100644 index 0000000..95bc29c --- /dev/null +++ b/afl/testcase/id:000008,src:001208,op:flip1,pos:89 @@ -0,0 +1 @@ +,1a 08 300,,23 00 10 00 08 12 1F 00 ff ff 00 00 ff ff ff ff 00 ff 00 00 00 00 00fffffffffdffffffffffff00 00 \ No newline at end of file diff --git a/afl/testcase/id:000013,sig:11,src:005882,op:havoc,rep:2 b/afl/testcase/id:000013,sig:11,src:005882,op:havoc,rep:2 new file mode 100644 index 0000000000000000000000000000000000000000..798228b6cf01c3982e1887751f29b716dbe911de GIT binary patch literal 112 zcmdNfbW|`fP%tqDlLjCX#Dy|+bPT`}AW;jb97F{&$-t-pl=lS@AoLq6VEoDm0swZy BBwPRh literal 0 HcmV?d00001 diff --git a/afl/testcase/id:000015,src:001216,op:flip1,pos:229 b/afl/testcase/id:000015,src:001216,op:flip1,pos:229 new file mode 100644 index 0000000..0998714 --- /dev/null +++ b/afl/testcase/id:000015,src:001216,op:flip1,pos:229 @@ -0,0 +1 @@ +,5a 20 3f ff00 00 10 00 00,,00 52 00 00 00 00 00 00 02 0e 00 00 00 00 00 00 40 00 00 09 00 00 00 00 0a 0a 00 00 00 00 00 00 00 00 0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffff0 00 18 06fffffffffffff \ No newline at end of file diff --git a/afl/testcase/id:000018,sig:11,src:001807,op:flip1,pos:93 b/afl/testcase/id:000018,sig:11,src:001807,op:flip1,pos:93 new file mode 100644 index 0000000..adeb2f9 --- /dev/null +++ b/afl/testcase/id:000018,sig:11,src:001807,op:flip1,pos:93 @@ -0,0 +1 @@ +,4d 00 55 00 00 00 00,,95 00 07 60 00 00 03 0c 00 0e ad cb 00 08 02 32 00 00 02 32 00 01 03 94 00 00 d8 00 13 11 00 01 e7 50 03 91 00 00 00 00 4a 26 37 51 00 02 03 14 00 01 e9 72 13 11 00 40 2b 52 02 8d 00 00 00 00 07 9f 84 21 00 03 03 14 00 02 22 c6 51 17 01 42 c5 b9 01 a9 00 00 00 00 66 25 50 00 00 04 03 14 00 02 27 74 51 17 01 41 f0 e7 00 6e 00 00 00 00 4d dd e2 00 00 05 03 14 00 02 30 a0 13 11 00 30 ff 76 03 41 00 00 00 00 29 9a 7c 93 00 06 03 14 00 02 42 cf 13 11 00 50 45 63 04 c2 00 00 00 00 0c 30 a4 fc 00 07 03 14 00 03 d9 dd 13 11 00 10 d6 c8 04 28 00 00 00 00 25 5d 1f a2 00 08 03 14 00 06 69 3a 51 17 01 50 19 fb 03 97 00 00 00 00 04 c3 f6 00 00 09 03 14 00 07 c0 13 51 17 01 52 94 3f 01 31 00 00 00 00 5e fc 5d e2 00 0a 03 14 00 08 79 da 51 17 01 42 c4 56 02 6f 00 00 00 00 65 fd 2d a6 00 0b 03 14 00 09 ed 76 51 17 01 52 88 b3 00 41 00 00 00 00 5d c1 81 dc 00 0c 03 14 00 0a 55 83 51 17 01 12 31 4f 00 4c 00 00 00 00 55 d9 f2 c0 00 0d 03 14 00 0a 55 94 51 17 01 02 7b fe 03 4d 00 00 00 00 5b ad f8 43 00 0e 03 14 00 0a 55 94 51 17 01 02 7b fe 03 52 00 00 00 00 5b ad f8 48 00 0f 03 14 00 0a 55 94 51 17 01 02 7b fe 03 57 00 00 00 00 5b ad f8 4d 00 10 03 14 00 0a 55 94 51 17 01 02 7b fe 03 62 00 00 00 00 5b ad f8 58 00 11 03 14 00 0a 55 94 51 17 01 02 7b fe 03 63 00 00 00 00 5b ad f8 59 00 12 03 14 00 0a 55 94 51 17 01 02 7b fe 03 64 00 00 00 00 5b ad f8 5a 00 13 03 14 00 0a 55 94 51 17 01 02 7b fe 03 6e 00 00 00 00 5b ad f8 64 00 14 03 14 00 0a 55 94 51 18 01 02 7b fe 03 71 00 00 00 00 5b ad f8 67 00 15 03 14 00 0a 55 94 51 17 01 02 7b fe 03 76 00 00 00 00 5b ad f8 6c 00 16 03 14 00 0a 55 94 51 17 01 02 7b fe 03 81 00 00 00 00 5b ad f8 77 00 17 03 14 00 0a 55 94 51 17 01 02 7b fe 03 82 00 00 00 00 5b ad f8 78 00 18 03 14 00 0a 55 9a 51 17 01 02 7b fe 03 83 00 00 00 00 5b ad f8 79 00 19 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 84 00 00 00 00 5b ad f8 7a 00 1a 03 14 00 0a 55 e5 51 18 01 02 7b fe 03 85 00 00 00 00 5b ad f8 7b 00 1b 03 14 00 0a 55 e5 51 18 01 02 7b fe 03 8d 00 00 00 00 5b ad f8 83 00 1c 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 8e 00 00 00 00 5b ad f8 84 00 1d 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 8f 00 00 00 00 5b ad f8 85 00 1e 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 90 00 00 00 00 5b ad f8 86 00 1f 03 14 00 0a 56 87 13 11 00 02 7b fe 03 91 00 00 00 00 5b ad f8 87 00 20 03 14 00 0a 56 87 13 11 00 02 7b fe 03 92 00 00 00 00 5b ad f8 88 00 21 03 14 00 0a 56 87 51 18 01 02 7b fe 03 93 00 00 00 00 5b ad f8 89 00 22 03 14 00 0a 56 87 51 17 01 02 7b fe 03 94 00 00 00 00 5b ad f8 8a 00 23 03 14 00 0a 56 87 13 11 00 02 7b fe 03 95 00 00 00 00 5b ad f8 8b 00 24 03 14 00 0a 56 87 51 17 01 02 7b fe 03 96 00 00 00 00 5b ad f8 8c 00 25 03 14 00 0a 56 87 51 17 01 02 7b fe 03 97 00 00 00 00 5b ad f8 8d 00 26 03 14 00 0a 56 87 51 17 01 02 7b fe 03 99 00 00 00 00 5b ad f8 8f 00 27 03 14 00 0a 56 e0 13 11 00 02 7b fe 03 9a 00 00 00 00 5b ad f8 90 00 28 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 9f 00 00 00 00 5b ad f8 95 00 29 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 a4 00 00 00 00 5b ad f8 9a 00 2a 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a5 00 00 00 00 5b ad f8 9b 00 2b 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a6 00 00 00 00 5b ad f8 9c 00 2c 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a7 00 00 00 00 5b ad f8 9d 00 2d 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 b4 00 00 00 00 5b ad f8 aa 00 2e 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 b5 00 00 00 00 5b ad f8 ab 00 2f 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 b6 00 00 00 00 5b ad f8 ac 00 30 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 c7 00 00 00 00 5b ad f8 bd 00 31 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 c8 00 00 00 00 5b ad f8 be 00 32 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 c9 00 00 00 00 5b ad f8 bf 00 33 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 ca 00 00 00 00 5b ad f8 c0 00 34 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 56 00 00 00 00 5b ad fc c8 00 35 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 57 00 00 00 00 5b ad fc c9 00 36 03 14 00 0a 56 e0 51 18 01 02 7b ff 03 80 00 00 00 00 5b ad fc f2 00 37 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 84 00 00 00 00 5b ad fc f6 00 38 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 86 00 00 00 00 5b ad fc f8 00 39 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 87 00 00 00 00 5b ad fc f9 00 3a 03 14 00 0a 57 8b 51 18 01 02 7b ff 03 88 00 00 00 00 5b ad fc fa 00 3b 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 89 00 00 00 00 5b ad fc fb 00 3c 03 14 00 0a 57 8b 51 18 01 02 7b ff 03 95 00 00 00 00 5b ad fd 07 00 3d 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 96 00 00 00 00 5b ad fd 08 00 3e 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 97 00 00 00 00 5b ad fd 09 00 3f 03 14 00 0a 57 8b 51 18 01 02 7c 00 03 7b 00 00 00 00 5b ae 01 68 00 40 03 14 00 0a 57 b9 13 11 00 02 7c 00 03 7c 00 00 00 00 5b ae 01 69 00 41 03 14 00 0a 5e 51 51 17 01 02 7c 00 03 69 00 00 00 00 5b ae 01 56 00 42 03 14 00 0a 67 7a 51 17 01 02 7b ff 03 a4 00 00 00 00 5b ad fd 16 00 43 03 14 00 0a 73 09 51 17 01 02 7b ff 03 85 00 00 00 00 5b ad fc f7 00 44 03 14 00 0a 79 20 51 17 01 02 7c 00 03 68 00 00 00 00 5b ae 01 55 00 45 03 14 00 0a 85 b4 51 17 01 02 7b fe 03 b3 00 00 00 00 5b ad f8 a9 00 46 03 14 00 0a 85 b4 51 17 01 02 7b fe 03 cb 00 00 00 00 5b ad f8 c1 00 47 03 14 00 0a 8a 35 51 17 01 02 7b ff 03 64 00 00 00 00 5b ad fc d6 00 48 03 14 00 0a 9a da 51 17 01 02 7b ff 035b ad fc d7 00 49 03 14 00 0a d5 f7 51 17 01 02 7b ff 03 83 00 00 00 00 5b ad fc f5 00 4a 03 14 00 0a e8 64 51 17 01 02 7b fe 03 4a 00 00 00 00 5b ad f8 40 00 4b 03 14 00 0a e8 64 51 17 01 02 7c 00 03 38 00 00 00 00 5b ae 01 25 00 4c 03 14 00 0b b3 10 51 17 01 32 a3 06 01 d6 00 00 00 00 5f 89 3d 79 00 4d 03 14 00 0b b3 10 51 17 01 32 a3 0a 01 6a 00 00 00 00 5f 89 4f 6d 00 4e 03 14 00 0c a0 61 51 17 01 33 00 9e 02 e8 00 00 00 00 \ No newline at end of file diff --git a/afl/testcase/id:000018,src:001179,op:ext_AO,pos:826 b/afl/testcase/id:000018,src:001179,op:ext_AO,pos:826 new file mode 100644 index 0000000..d4c18ac --- /dev/null +++ b/afl/testcase/id:000018,src:001179,op:ext_AO,pos:826 @@ -0,0 +1 @@ +,5a 00 bf ff 00 00 00 10 00 00,,01 a2 00 10 00 00 00 08 68 cb 9e 30 00 00 02 00 81 0a 04 14 ff 00 00 00 05 00 0c 00 82 0e 00 00 00 00 00 00 00 00 01 3a 00 00 00 00 83 16 bb d0 00 00 00 00 03 80 04 c4 02 08 00 01 00 a0 00 18 40 00 00 00 84 16 02 d3 c1 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 31 00 00 87 0a 04 14 ff 00 00 00 00 00 0c 00 88 12 10 00 ff ff 00 00 ff ff ff ff 80 03 00 00 00 00 00 00 8a 0a 00 10 00 80 00 00 00 00 00 06 18 06 06 00 00 00 00 00 99 0e 06 00 23 28 1b 58 00 00 00 00 00 00 00 00 59 01 00 65 00 06 00 02 00 00 00 00 10 49 0e 00 50 00 c5 00 5f 0d f2 f1 50 01 e6 77 5a 4d b0 00 01 00 00 00 00 00 00 00 88 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 50 00 c5 00 5f 0d f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 88 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 ff ff fd 00 06 03 e8 00 00 00 00 00 00 00 00 59 03 00 2c 00 06 00 02 00 00 00 10 80 ac 00 01 80 ac 00 01 00 00 00 00 00 00 09 00 00 01 00 10 80 ac 00 01 80 ac 00 01 00 00 00 00 00 00 00 00 9a 26 00 00 00 00 00 0a 00 00 8c a0 00 00 17 70 00 00 46 50 00 00 46 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9c 0a 00 04 00 00 00 00 00 00 00 01 dc 01 00 0c 01 00 00 48 00 18 01 f4 00 00 00 00 80 16 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 00 00 00 00 00 00 diff --git a/afl/testcase/id:000019,sig:11,src:001807,op:flip1,pos:670 b/afl/testcase/id:000019,sig:11,src:001807,op:flip1,pos:670 new file mode 100644 index 0000000..e12f018 --- /dev/null +++ b/afl/testcase/id:000019,sig:11,src:001807,op:flip1,pos:670 @@ -0,0 +1 @@ +,4d 00 55 00 00 00 00,,95 00 07 60 00 00 03 0c 00 0e ad cb 00 08 02 32 00 00 02 32 00 01 03 14 00 00 d8 00 13 11 00 01 e7 50 03 91 00 00 00 00 4a 26 37 51 00 02 03 14 00 01 e9 72 13 11 00 40 2b 52 02 8d 00 00 00 00 07 9f 84 21 00 03 03 14 00 02 22 c6 51 17 01 42 c5 b9 01 a9 00 00 00 00 66 25 50 00 00 04 03 14 00 02 27 74 51 17 01 41 f0 e7 00 6e 00 00 00 00 4d dd e2 00 00 05 03 14 00 02 30 a0 13 11 00 30 ff 76 03 41 00 00 00 00 29 9a 7c 93 00 06 03 14 00 02 42 cf 13 11 00 50 45 63 04 c2 00 00 00 00 0c 30 a4 fc 00 07 03 14 00 03 d9 dd 13 11 00 10 d6 c8 04 28 00 00 00 00 25 5d 1f a2 00 08 03 14 00 06 69 3a 51 17 01 50 19 fb 03 97 00 00 00 00 04 c3 f6 00 00 09 03 16 00 07 c0 13 51 17 01 52 94 3f 01 31 00 00 00 00 5e fc 5d e2 00 0a 03 14 00 08 79 da 51 17 01 42 c4 56 02 6f 00 00 00 00 65 fd 2d a6 00 0b 03 14 00 09 ed 76 51 17 01 52 88 b3 00 41 00 00 00 00 5d c1 81 dc 00 0c 03 14 00 0a 55 83 51 17 01 12 31 4f 00 4c 00 00 00 00 55 d9 f2 c0 00 0d 03 14 00 0a 55 94 51 17 01 02 7b fe 03 4d 00 00 00 00 5b ad f8 43 00 0e 03 14 00 0a 55 94 51 17 01 02 7b fe 03 52 00 00 00 00 5b ad f8 48 00 0f 03 14 00 0a 55 94 51 17 01 02 7b fe 03 57 00 00 00 00 5b ad f8 4d 00 10 03 14 00 0a 55 94 51 17 01 02 7b fe 03 62 00 00 00 00 5b ad f8 58 00 11 03 14 00 0a 55 94 51 17 01 02 7b fe 03 63 00 00 00 00 5b ad f8 59 00 12 03 14 00 0a 55 94 51 17 01 02 7b fe 03 64 00 00 00 00 5b ad f8 5a 00 13 03 14 00 0a 55 94 51 17 01 02 7b fe 03 6e 00 00 00 00 5b ad f8 64 00 14 03 14 00 0a 55 94 51 18 01 02 7b fe 03 71 00 00 00 00 5b ad f8 67 00 15 03 14 00 0a 55 94 51 17 01 02 7b fe 03 76 00 00 00 00 5b ad f8 6c 00 16 03 14 00 0a 55 94 51 17 01 02 7b fe 03 81 00 00 00 00 5b ad f8 77 00 17 03 14 00 0a 55 94 51 17 01 02 7b fe 03 82 00 00 00 00 5b ad f8 78 00 18 03 14 00 0a 55 9a 51 17 01 02 7b fe 03 83 00 00 00 00 5b ad f8 79 00 19 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 84 00 00 00 00 5b ad f8 7a 00 1a 03 14 00 0a 55 e5 51 18 01 02 7b fe 03 85 00 00 00 00 5b ad f8 7b 00 1b 03 14 00 0a 55 e5 51 18 01 02 7b fe 03 8d 00 00 00 00 5b ad f8 83 00 1c 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 8e 00 00 00 00 5b ad f8 84 00 1d 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 8f 00 00 00 00 5b ad f8 85 00 1e 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 90 00 00 00 00 5b ad f8 86 00 1f 03 14 00 0a 56 87 13 11 00 02 7b fe 03 91 00 00 00 00 5b ad f8 87 00 20 03 14 00 0a 56 87 13 11 00 02 7b fe 03 92 00 00 00 00 5b ad f8 88 00 21 03 14 00 0a 56 87 51 18 01 02 7b fe 03 93 00 00 00 00 5b ad f8 89 00 22 03 14 00 0a 56 87 51 17 01 02 7b fe 03 94 00 00 00 00 5b ad f8 8a 00 23 03 14 00 0a 56 87 13 11 00 02 7b fe 03 95 00 00 00 00 5b ad f8 8b 00 24 03 14 00 0a 56 87 51 17 01 02 7b fe 03 96 00 00 00 00 5b ad f8 8c 00 25 03 14 00 0a 56 87 51 17 01 02 7b fe 03 97 00 00 00 00 5b ad f8 8d 00 26 03 14 00 0a 56 87 51 17 01 02 7b fe 03 99 00 00 00 00 5b ad f8 8f 00 27 03 14 00 0a 56 e0 13 11 00 02 7b fe 03 9a 00 00 00 00 5b ad f8 90 00 28 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 9f 00 00 00 00 5b ad f8 95 00 29 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 a4 00 00 00 00 5b ad f8 9a 00 2a 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a5 00 00 00 00 5b ad f8 9b 00 2b 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a6 00 00 00 00 5b ad f8 9c 00 2c 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a7 00 00 00 00 5b ad f8 9d 00 2d 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 b4 00 00 00 00 5b ad f8 aa 00 2e 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 b5 00 00 00 00 5b ad f8 ab 00 2f 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 b6 00 00 00 00 5b ad f8 ac 00 30 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 c7 00 00 00 00 5b ad f8 bd 00 31 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 c8 00 00 00 00 5b ad f8 be 00 32 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 c9 00 00 00 00 5b ad f8 bf 00 33 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 ca 00 00 00 00 5b ad f8 c0 00 34 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 56 00 00 00 00 5b ad fc c8 00 35 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 57 00 00 00 00 5b ad fc c9 00 36 03 14 00 0a 56 e0 51 18 01 02 7b ff 03 80 00 00 00 00 5b ad fc f2 00 37 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 84 00 00 00 00 5b ad fc f6 00 38 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 86 00 00 00 00 5b ad fc f8 00 39 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 87 00 00 00 00 5b ad fc f9 00 3a 03 14 00 0a 57 8b 51 18 01 02 7b ff 03 88 00 00 00 00 5b ad fc fa 00 3b 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 89 00 00 00 00 5b ad fc fb 00 3c 03 14 00 0a 57 8b 51 18 01 02 7b ff 03 95 00 00 00 00 5b ad fd 07 00 3d 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 96 00 00 00 00 5b ad fd 08 00 3e 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 97 00 00 00 00 5b ad fd 09 00 3f 03 14 00 0a 57 8b 51 18 01 02 7c 00 03 7b 00 00 00 00 5b ae 01 68 00 40 03 14 00 0a 57 b9 13 11 00 02 7c 00 03 7c 00 00 00 00 5b ae 01 69 00 41 03 14 00 0a 5e 51 51 17 01 02 7c 00 03 69 00 00 00 00 5b ae 01 56 00 42 03 14 00 0a 67 7a 51 17 01 02 7b ff 03 a4 00 00 00 00 5b ad fd 16 00 43 03 14 00 0a 73 09 51 17 01 02 7b ff 03 85 00 00 00 00 5b ad fc f7 00 44 03 14 00 0a 79 20 51 17 01 02 7c 00 03 68 00 00 00 00 5b ae 01 55 00 45 03 14 00 0a 85 b4 51 17 01 02 7b fe 03 b3 00 00 00 00 5b ad f8 a9 00 46 03 14 00 0a 85 b4 51 17 01 02 7b fe 03 cb 00 00 00 00 5b ad f8 c1 00 47 03 14 00 0a 8a 35 51 17 01 02 7b ff 03 64 00 00 00 00 5b ad fc d6 00 48 03 14 00 0a 9a da 51 17 01 02 7b ff 035b ad fc d7 00 49 03 14 00 0a d5 f7 51 17 01 02 7b ff 03 83 00 00 00 00 5b ad fc f5 00 4a 03 14 00 0a e8 64 51 17 01 02 7b fe 03 4a 00 00 00 00 5b ad f8 40 00 4b 03 14 00 0a e8 64 51 17 01 02 7c 00 03 38 00 00 00 00 5b ae 01 25 00 4c 03 14 00 0b b3 10 51 17 01 32 a3 06 01 d6 00 00 00 00 5f 89 3d 79 00 4d 03 14 00 0b b3 10 51 17 01 32 a3 0a 01 6a 00 00 00 00 5f 89 4f 6d 00 4e 03 14 00 0c a0 61 51 17 01 33 00 9e 02 e8 00 00 00 00 \ No newline at end of file diff --git a/afl/testcase/id:000019,src:001231,op:flip1,pos:72 b/afl/testcase/id:000019,src:001231,op:flip1,pos:72 new file mode 100644 index 0000000000000000000000000000000000000000..443b798725265a0dc40484cb3e9d05919f2daaf5 GIT binary patch literal 212 scmdNfO;j*2(9tn4P%yOwvQUwef`O5OK`N>ssv0*4aDmbTPcbk60JDcP761SM literal 0 HcmV?d00001 diff --git a/afl/testcase/id:000020,sig:11,src:001807,op:flip1,pos:2325 b/afl/testcase/id:000020,sig:11,src:001807,op:flip1,pos:2325 new file mode 100644 index 0000000..3fa95bc --- /dev/null +++ b/afl/testcase/id:000020,sig:11,src:001807,op:flip1,pos:2325 @@ -0,0 +1 @@ +,4d 00 55 00 00 00 00,,95 00 07 60 00 00 03 0c 00 0e ad cb 00 08 02 32 00 00 02 32 00 01 03 14 00 00 d8 00 13 11 00 01 e7 50 03 91 00 00 00 00 4a 26 37 51 00 02 03 14 00 01 e9 72 13 11 00 40 2b 52 02 8d 00 00 00 00 07 9f 84 21 00 03 03 14 00 02 22 c6 51 17 01 42 c5 b9 01 a9 00 00 00 00 66 25 50 00 00 04 03 14 00 02 27 74 51 17 01 41 f0 e7 00 6e 00 00 00 00 4d dd e2 00 00 05 03 14 00 02 30 a0 13 11 00 30 ff 76 03 41 00 00 00 00 29 9a 7c 93 00 06 03 14 00 02 42 cf 13 11 00 50 45 63 04 c2 00 00 00 00 0c 30 a4 fc 00 07 03 14 00 03 d9 dd 13 11 00 10 d6 c8 04 28 00 00 00 00 25 5d 1f a2 00 08 03 14 00 06 69 3a 51 17 01 50 19 fb 03 97 00 00 00 00 04 c3 f6 00 00 09 03 14 00 07 c0 13 51 17 01 52 94 3f 01 31 00 00 00 00 5e fc 5d e2 00 0a 03 14 00 08 79 da 51 17 01 42 c4 56 02 6f 00 00 00 00 65 fd 2d a6 00 0b 03 14 00 09 ed 76 51 17 01 52 88 b3 00 41 00 00 00 00 5d c1 81 dc 00 0c 03 14 00 0a 55 83 51 17 01 12 31 4f 00 4c 00 00 00 00 55 d9 f2 c0 00 0d 03 14 00 0a 55 94 51 17 01 02 7b fe 03 4d 00 00 00 00 5b ad f8 43 00 0e 03 14 00 0a 55 94 51 17 01 02 7b fe 03 52 00 00 00 00 5b ad f8 48 00 0f 03 14 00 0a 55 94 51 17 01 02 7b fe 03 57 00 00 00 00 5b ad f8 4d 00 10 03 14 00 0a 55 94 51 17 01 02 7b fe 03 62 00 00 00 00 5b ad f8 58 00 11 03 14 00 0a 55 94 51 17 01 02 7b fe 03 63 00 00 00 00 5b ad f8 59 00 12 03 14 00 0a 55 94 51 17 01 02 7b fe 03 64 00 00 00 00 5b ad f8 5a 00 13 03 14 00 0a 55 94 51 17 01 02 7b fe 03 6e 00 00 00 00 5b ad f8 64 00 14 03 14 00 0a 55 94 51 18 01 02 7b fe 03 71 00 00 00 00 5b ad f8 67 00 15 03 14 00 0a 55 94 51 17 01 02 7b fe 03 76 00 00 00 00 5b ad f8 6c 00 16 03 14 00 0a 55 94 51 17 01 02 7b fe 03 81 00 00 00 00 5b ad f8 77 00 17 03 14 00 0a 55 94 51 17 01 02 7b fe 03 82 00 00 00 00 5b ad f8 78 00 18 03 14 00 0a 55 9a 51 17 01 02 7b fe 03 83 00 00 00 00 5b ad f8 79 00 19 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 84 00 00 00 00 5b ad f8 7a 00 1a 03 14 00 0a 55 e5 51 18 01 02 7b fe 03 85 00 00 00 00 5b ad f8 7b 00 1b 03 14 00 0a 55 e5 51 18 01 02 7b fe 03 8d 00 00 00 00 5b ad f8 83 00 1c 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 8e 00 00 00 00 5b ad f8 84 00 1d 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 8f 00 00 00 00 5b ad f8 85 00 1e 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 90 00 00 00 00 5b ad f8 86 00 1f 03 14 00 0a 56 87 13 11 00 02 7b fe 03 91 00 00 00 00 5b ad f8 87 00 20 03 94 00 0a 56 87 13 11 00 02 7b fe 03 92 00 00 00 00 5b ad f8 88 00 21 03 14 00 0a 56 87 51 18 01 02 7b fe 03 93 00 00 00 00 5b ad f8 89 00 22 03 14 00 0a 56 87 51 17 01 02 7b fe 03 94 00 00 00 00 5b ad f8 8a 00 23 03 14 00 0a 56 87 13 11 00 02 7b fe 03 95 00 00 00 00 5b ad f8 8b 00 24 03 14 00 0a 56 87 51 17 01 02 7b fe 03 96 00 00 00 00 5b ad f8 8c 00 25 03 14 00 0a 56 87 51 17 01 02 7b fe 03 97 00 00 00 00 5b ad f8 8d 00 26 03 14 00 0a 56 87 51 17 01 02 7b fe 03 99 00 00 00 00 5b ad f8 8f 00 27 03 14 00 0a 56 e0 13 11 00 02 7b fe 03 9a 00 00 00 00 5b ad f8 90 00 28 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 9f 00 00 00 00 5b ad f8 95 00 29 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 a4 00 00 00 00 5b ad f8 9a 00 2a 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a5 00 00 00 00 5b ad f8 9b 00 2b 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a6 00 00 00 00 5b ad f8 9c 00 2c 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a7 00 00 00 00 5b ad f8 9d 00 2d 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 b4 00 00 00 00 5b ad f8 aa 00 2e 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 b5 00 00 00 00 5b ad f8 ab 00 2f 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 b6 00 00 00 00 5b ad f8 ac 00 30 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 c7 00 00 00 00 5b ad f8 bd 00 31 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 c8 00 00 00 00 5b ad f8 be 00 32 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 c9 00 00 00 00 5b ad f8 bf 00 33 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 ca 00 00 00 00 5b ad f8 c0 00 34 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 56 00 00 00 00 5b ad fc c8 00 35 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 57 00 00 00 00 5b ad fc c9 00 36 03 14 00 0a 56 e0 51 18 01 02 7b ff 03 80 00 00 00 00 5b ad fc f2 00 37 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 84 00 00 00 00 5b ad fc f6 00 38 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 86 00 00 00 00 5b ad fc f8 00 39 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 87 00 00 00 00 5b ad fc f9 00 3a 03 14 00 0a 57 8b 51 18 01 02 7b ff 03 88 00 00 00 00 5b ad fc fa 00 3b 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 89 00 00 00 00 5b ad fc fb 00 3c 03 14 00 0a 57 8b 51 18 01 02 7b ff 03 95 00 00 00 00 5b ad fd 07 00 3d 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 96 00 00 00 00 5b ad fd 08 00 3e 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 97 00 00 00 00 5b ad fd 09 00 3f 03 14 00 0a 57 8b 51 18 01 02 7c 00 03 7b 00 00 00 00 5b ae 01 68 00 40 03 14 00 0a 57 b9 13 11 00 02 7c 00 03 7c 00 00 00 00 5b ae 01 69 00 41 03 14 00 0a 5e 51 51 17 01 02 7c 00 03 69 00 00 00 00 5b ae 01 56 00 42 03 14 00 0a 67 7a 51 17 01 02 7b ff 03 a4 00 00 00 00 5b ad fd 16 00 43 03 14 00 0a 73 09 51 17 01 02 7b ff 03 85 00 00 00 00 5b ad fc f7 00 44 03 14 00 0a 79 20 51 17 01 02 7c 00 03 68 00 00 00 00 5b ae 01 55 00 45 03 14 00 0a 85 b4 51 17 01 02 7b fe 03 b3 00 00 00 00 5b ad f8 a9 00 46 03 14 00 0a 85 b4 51 17 01 02 7b fe 03 cb 00 00 00 00 5b ad f8 c1 00 47 03 14 00 0a 8a 35 51 17 01 02 7b ff 03 64 00 00 00 00 5b ad fc d6 00 48 03 14 00 0a 9a da 51 17 01 02 7b ff 035b ad fc d7 00 49 03 14 00 0a d5 f7 51 17 01 02 7b ff 03 83 00 00 00 00 5b ad fc f5 00 4a 03 14 00 0a e8 64 51 17 01 02 7b fe 03 4a 00 00 00 00 5b ad f8 40 00 4b 03 14 00 0a e8 64 51 17 01 02 7c 00 03 38 00 00 00 00 5b ae 01 25 00 4c 03 14 00 0b b3 10 51 17 01 32 a3 06 01 d6 00 00 00 00 5f 89 3d 79 00 4d 03 14 00 0b b3 10 51 17 01 32 a3 0a 01 6a 00 00 00 00 5f 89 4f 6d 00 4e 03 14 00 0c a0 61 51 17 01 33 00 9e 02 e8 00 00 00 00 \ No newline at end of file diff --git a/afl/testcase/id:000021,sig:11,src:001807,op:flip2,pos:238 b/afl/testcase/id:000021,sig:11,src:001807,op:flip2,pos:238 new file mode 100644 index 0000000..1fc43e5 --- /dev/null +++ b/afl/testcase/id:000021,sig:11,src:001807,op:flip2,pos:238 @@ -0,0 +1 @@ +,4d 00 55 00 00 00 00,,95 00 07 60 00 00 03 0c 00 0e ad cb 00 08 02 32 00 00 02 32 00 01 03 14 00 00 d8 00 13 11 00 01 e7 50 03 91 00 00 00 00 4a 26 37 51 00 02 03 14 00 01 e9 72 13 11 00 40 2b 52 02 8d 00 00 00 00 07 9f 84 21 00 03 03 12 00 02 22 c6 51 17 01 42 c5 b9 01 a9 00 00 00 00 66 25 50 00 00 04 03 14 00 02 27 74 51 17 01 41 f0 e7 00 6e 00 00 00 00 4d dd e2 00 00 05 03 14 00 02 30 a0 13 11 00 30 ff 76 03 41 00 00 00 00 29 9a 7c 93 00 06 03 14 00 02 42 cf 13 11 00 50 45 63 04 c2 00 00 00 00 0c 30 a4 fc 00 07 03 14 00 03 d9 dd 13 11 00 10 d6 c8 04 28 00 00 00 00 25 5d 1f a2 00 08 03 14 00 06 69 3a 51 17 01 50 19 fb 03 97 00 00 00 00 04 c3 f6 00 00 09 03 14 00 07 c0 13 51 17 01 52 94 3f 01 31 00 00 00 00 5e fc 5d e2 00 0a 03 14 00 08 79 da 51 17 01 42 c4 56 02 6f 00 00 00 00 65 fd 2d a6 00 0b 03 14 00 09 ed 76 51 17 01 52 88 b3 00 41 00 00 00 00 5d c1 81 dc 00 0c 03 14 00 0a 55 83 51 17 01 12 31 4f 00 4c 00 00 00 00 55 d9 f2 c0 00 0d 03 14 00 0a 55 94 51 17 01 02 7b fe 03 4d 00 00 00 00 5b ad f8 43 00 0e 03 14 00 0a 55 94 51 17 01 02 7b fe 03 52 00 00 00 00 5b ad f8 48 00 0f 03 14 00 0a 55 94 51 17 01 02 7b fe 03 57 00 00 00 00 5b ad f8 4d 00 10 03 14 00 0a 55 94 51 17 01 02 7b fe 03 62 00 00 00 00 5b ad f8 58 00 11 03 14 00 0a 55 94 51 17 01 02 7b fe 03 63 00 00 00 00 5b ad f8 59 00 12 03 14 00 0a 55 94 51 17 01 02 7b fe 03 64 00 00 00 00 5b ad f8 5a 00 13 03 14 00 0a 55 94 51 17 01 02 7b fe 03 6e 00 00 00 00 5b ad f8 64 00 14 03 14 00 0a 55 94 51 18 01 02 7b fe 03 71 00 00 00 00 5b ad f8 67 00 15 03 14 00 0a 55 94 51 17 01 02 7b fe 03 76 00 00 00 00 5b ad f8 6c 00 16 03 14 00 0a 55 94 51 17 01 02 7b fe 03 81 00 00 00 00 5b ad f8 77 00 17 03 14 00 0a 55 94 51 17 01 02 7b fe 03 82 00 00 00 00 5b ad f8 78 00 18 03 14 00 0a 55 9a 51 17 01 02 7b fe 03 83 00 00 00 00 5b ad f8 79 00 19 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 84 00 00 00 00 5b ad f8 7a 00 1a 03 14 00 0a 55 e5 51 18 01 02 7b fe 03 85 00 00 00 00 5b ad f8 7b 00 1b 03 14 00 0a 55 e5 51 18 01 02 7b fe 03 8d 00 00 00 00 5b ad f8 83 00 1c 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 8e 00 00 00 00 5b ad f8 84 00 1d 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 8f 00 00 00 00 5b ad f8 85 00 1e 03 14 00 0a 55 e5 51 17 01 02 7b fe 03 90 00 00 00 00 5b ad f8 86 00 1f 03 14 00 0a 56 87 13 11 00 02 7b fe 03 91 00 00 00 00 5b ad f8 87 00 20 03 14 00 0a 56 87 13 11 00 02 7b fe 03 92 00 00 00 00 5b ad f8 88 00 21 03 14 00 0a 56 87 51 18 01 02 7b fe 03 93 00 00 00 00 5b ad f8 89 00 22 03 14 00 0a 56 87 51 17 01 02 7b fe 03 94 00 00 00 00 5b ad f8 8a 00 23 03 14 00 0a 56 87 13 11 00 02 7b fe 03 95 00 00 00 00 5b ad f8 8b 00 24 03 14 00 0a 56 87 51 17 01 02 7b fe 03 96 00 00 00 00 5b ad f8 8c 00 25 03 14 00 0a 56 87 51 17 01 02 7b fe 03 97 00 00 00 00 5b ad f8 8d 00 26 03 14 00 0a 56 87 51 17 01 02 7b fe 03 99 00 00 00 00 5b ad f8 8f 00 27 03 14 00 0a 56 e0 13 11 00 02 7b fe 03 9a 00 00 00 00 5b ad f8 90 00 28 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 9f 00 00 00 00 5b ad f8 95 00 29 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 a4 00 00 00 00 5b ad f8 9a 00 2a 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a5 00 00 00 00 5b ad f8 9b 00 2b 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a6 00 00 00 00 5b ad f8 9c 00 2c 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 a7 00 00 00 00 5b ad f8 9d 00 2d 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 b4 00 00 00 00 5b ad f8 aa 00 2e 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 b5 00 00 00 00 5b ad f8 ab 00 2f 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 b6 00 00 00 00 5b ad f8 ac 00 30 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 c7 00 00 00 00 5b ad f8 bd 00 31 03 14 00 0a 56 e0 51 17 01 02 7b fe 03 c8 00 00 00 00 5b ad f8 be 00 32 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 c9 00 00 00 00 5b ad f8 bf 00 33 03 14 00 0a 56 e0 51 18 01 02 7b fe 03 ca 00 00 00 00 5b ad f8 c0 00 34 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 56 00 00 00 00 5b ad fc c8 00 35 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 57 00 00 00 00 5b ad fc c9 00 36 03 14 00 0a 56 e0 51 18 01 02 7b ff 03 80 00 00 00 00 5b ad fc f2 00 37 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 84 00 00 00 00 5b ad fc f6 00 38 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 86 00 00 00 00 5b ad fc f8 00 39 03 14 00 0a 56 e0 51 17 01 02 7b ff 03 87 00 00 00 00 5b ad fc f9 00 3a 03 14 00 0a 57 8b 51 18 01 02 7b ff 03 88 00 00 00 00 5b ad fc fa 00 3b 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 89 00 00 00 00 5b ad fc fb 00 3c 03 14 00 0a 57 8b 51 18 01 02 7b ff 03 95 00 00 00 00 5b ad fd 07 00 3d 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 96 00 00 00 00 5b ad fd 08 00 3e 03 14 00 0a 57 8b 51 17 01 02 7b ff 03 97 00 00 00 00 5b ad fd 09 00 3f 03 14 00 0a 57 8b 51 18 01 02 7c 00 03 7b 00 00 00 00 5b ae 01 68 00 40 03 14 00 0a 57 b9 13 11 00 02 7c 00 03 7c 00 00 00 00 5b ae 01 69 00 41 03 14 00 0a 5e 51 51 17 01 02 7c 00 03 69 00 00 00 00 5b ae 01 56 00 42 03 14 00 0a 67 7a 51 17 01 02 7b ff 03 a4 00 00 00 00 5b ad fd 16 00 43 03 14 00 0a 73 09 51 17 01 02 7b ff 03 85 00 00 00 00 5b ad fc f7 00 44 03 14 00 0a 79 20 51 17 01 02 7c 00 03 68 00 00 00 00 5b ae 01 55 00 45 03 14 00 0a 85 b4 51 17 01 02 7b fe 03 b3 00 00 00 00 5b ad f8 a9 00 46 03 14 00 0a 85 b4 51 17 01 02 7b fe 03 cb 00 00 00 00 5b ad f8 c1 00 47 03 14 00 0a 8a 35 51 17 01 02 7b ff 03 64 00 00 00 00 5b ad fc d6 00 48 03 14 00 0a 9a da 51 17 01 02 7b ff 035b ad fc d7 00 49 03 14 00 0a d5 f7 51 17 01 02 7b ff 03 83 00 00 00 00 5b ad fc f5 00 4a 03 14 00 0a e8 64 51 17 01 02 7b fe 03 4a 00 00 00 00 5b ad f8 40 00 4b 03 14 00 0a e8 64 51 17 01 02 7c 00 03 38 00 00 00 00 5b ae 01 25 00 4c 03 14 00 0b b3 10 51 17 01 32 a3 06 01 d6 00 00 00 00 5f 89 3d 79 00 4d 03 14 00 0b b3 10 51 17 01 32 a3 0a 01 6a 00 00 00 00 5f 89 4f 6d 00 4e 03 14 00 0c a0 61 51 17 01 33 00 9e 02 e8 00 00 00 00 \ No newline at end of file diff --git a/afl/testcase/log_sense_9bd3419f85d952cf54a38196fc0775a2bfa4c6ff.csv b/afl/testcase/log_sense_9bd3419f85d952cf54a38196fc0775a2bfa4c6ff.csv new file mode 100644 index 0000000..79c5a6b --- /dev/null +++ b/afl/testcase/log_sense_9bd3419f85d952cf54a38196fc0775a2bfa4c6ff.csv @@ -0,0 +1 @@ +,4d 00 55 00 00 00 00 40 00 00,,95 00 00 88 00 00 03 0c 00 0f 17 2b 00 08 02 5d 00 00 02 5d 00 01 03 14 00 03 7f bf 51 18 01 50 5b 54 03 48 00 00 00 00 11 57 80 1b 00 02 03 14 00 0c 68 1c 13 11 00 20 44 4c 03 9d 00 00 00 00 0b 8f 13 7a 00 03 03 14 00 0c 6c da 51 17 01 20 9d ef 05 26 00 00 00 00 1a 25 64 00 00 04 03 14 00 0c f2 ec 51 17 01 21 f2 bd 04 4a 00 00 00 00 4a cf 77 f7 00 05 03 14 00 0d ab 1d 51 17 01 21 89 2a 03 75 00 00 00 00 3c f7 ac 00 diff --git a/afl/testcase/log_sense_ac03383386fa3d77d3d460480a52e0b99a1c580e.csv b/afl/testcase/log_sense_ac03383386fa3d77d3d460480a52e0b99a1c580e.csv new file mode 100644 index 0000000..7d8f5fc --- /dev/null +++ b/afl/testcase/log_sense_ac03383386fa3d77d3d460480a52e0b99a1c580e.csv @@ -0,0 +1 @@ +,4d 00 7e 00 00 00 00 40 00 00,,3e 00 00 24 00 00 02 04 00 10 c8 20 00 08 02 04 00 00 00 10 00 09 02 04 00 00 00 3c 00 0e 02 08 00 00 3c 04 24 09 8b 7d diff --git a/afl/testcase/log_sense_c52c16bd44de5cf72ba1a55c0b6258349a74e5d6.csv b/afl/testcase/log_sense_c52c16bd44de5cf72ba1a55c0b6258349a74e5d6.csv new file mode 100644 index 0000000..dfe6bcb --- /dev/null +++ b/afl/testcase/log_sense_c52c16bd44de5cf72ba1a55c0b6258349a74e5d6.csv @@ -0,0 +1 @@ +,4d 00 40 00 00 00 00 40 00 00,,00 00 00 11 00 02 03 05 06 0d 0e 0f 10 11 15 18 1a 2f 30 31 37 diff --git a/afl/testcase/log_sense_d192aef3ac66f84b8996edeb95ef1e7e9d6660cb.csv b/afl/testcase/log_sense_d192aef3ac66f84b8996edeb95ef1e7e9d6660cb.csv new file mode 100644 index 0000000..cc73881 --- /dev/null +++ b/afl/testcase/log_sense_d192aef3ac66f84b8996edeb95ef1e7e9d6660cb.csv @@ -0,0 +1 @@ +,4d 00 40 00 00 00 00 40 00 00,,00 00 00 0f 00 02 03 05 06 0d 0e 0f 10 11 15 18 1a 2f 31 diff --git a/afl/testcase/log_sense_dc08fbd86ddd3f34a56532faf9b46f0ae135e644.csv b/afl/testcase/log_sense_dc08fbd86ddd3f34a56532faf9b46f0ae135e644.csv new file mode 100644 index 0000000..a29de14 --- /dev/null +++ b/afl/testcase/log_sense_dc08fbd86ddd3f34a56532faf9b46f0ae135e644.csv @@ -0,0 +1 @@ +,4d 00 6f 00 00 00 00 40 00 00,,2f 00 00 3c 00 00 03 08 00 00 19 55 21 00 00 00 00 01 03 04 5d 53 00 00 00 02 03 04 5d 54 00 00 00 03 03 04 5d 28 00 00 00 04 03 04 0b 06 00 00 00 05 03 04 5d 55 00 00 00 06 03 04 5d 56 00 00 diff --git a/afl/testcase/log_sense_f2ca65053fcb0a0b0a479e181fa8b497beb40d9c.csv b/afl/testcase/log_sense_f2ca65053fcb0a0b0a479e181fa8b497beb40d9c.csv new file mode 100644 index 0000000..ee164b1 --- /dev/null +++ b/afl/testcase/log_sense_f2ca65053fcb0a0b0a479e181fa8b497beb40d9c.csv @@ -0,0 +1 @@ +,4d 00 4e 00 00 00 00 40 00 00,,0e 00 00 34 00 01 01 06 32 30 31 33 34 37 00 02 01 06 32 30 31 33 34 37 00 03 03 04 00 00 27 10 00 04 03 04 00 00 05 53 00 05 03 04 00 04 93 e0 00 06 03 04 00 00 05 53 diff --git a/afl/testcase/log_sense_fb4080b69b8ca7d50d16f424305467a18d8eded9.csv b/afl/testcase/log_sense_fb4080b69b8ca7d50d16f424305467a18d8eded9.csv new file mode 100644 index 0000000..3cefe26 --- /dev/null +++ b/afl/testcase/log_sense_fb4080b69b8ca7d50d16f424305467a18d8eded9.csv @@ -0,0 +1 @@ +,4d 00 46 00 00 00 00 40 00 00,,06 00 00 08 00 00 02 04 00 00 02 44 diff --git a/afl/testcase/log_sense_fc58600bcf8dc103f911bb2a6a867ab2c8e42fe2.csv b/afl/testcase/log_sense_fc58600bcf8dc103f911bb2a6a867ab2c8e42fe2.csv new file mode 100644 index 0000000..bb5fc86 --- /dev/null +++ b/afl/testcase/log_sense_fc58600bcf8dc103f911bb2a6a867ab2c8e42fe2.csv @@ -0,0 +1 @@ +,4d 00 6f 00 00 00 00 40 00 00,,2f 00 00 4c 00 00 03 08 00 00 1c 46 26 00 00 00 00 01 03 04 5d 53 00 00 00 02 03 04 5d 54 00 00 00 03 03 04 5d 57 00 00 00 04 03 04 5d 28 00 00 00 05 03 04 0b 06 01 00 00 06 03 04 5d 56 38 00 00 07 03 04 5d 55 00 00 00 08 03 04 5d 20 00 00 diff --git a/afl/testcase/log_sense_ffe62c433d9a885d2a5670ff890f5b00089739aa.csv b/afl/testcase/log_sense_ffe62c433d9a885d2a5670ff890f5b00089739aa.csv new file mode 100644 index 0000000..ed96e7b --- /dev/null +++ b/afl/testcase/log_sense_ffe62c433d9a885d2a5670ff890f5b00089739aa.csv @@ -0,0 +1 @@ +,4d 00 59 00 00 00 00 40 00 00,,19 00 00 5c 00 01 02 40 00 00 00 05 1d 74 16 f0 00 00 00 04 62 22 c5 8d 00 00 00 43 98 00 04 2c 00 00 00 53 be 7d 55 4d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 02 08 00 00 00 00 01 b4 c1 aa 00 03 03 08 00 00 00 02 00 00 00 05 diff --git a/afl/testcase/log_sense_ffee0af0b99b68b9d287e6f65ad08a4e11967daa.csv b/afl/testcase/log_sense_ffee0af0b99b68b9d287e6f65ad08a4e11967daa.csv new file mode 100644 index 0000000..91d72c7 --- /dev/null +++ b/afl/testcase/log_sense_ffee0af0b99b68b9d287e6f65ad08a4e11967daa.csv @@ -0,0 +1 @@ +,4d 00 43 00 00 00 00 40 00 00,,03 00 00 54 00 00 00 08 00 00 00 00 00 00 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 02 00 08 00 00 00 00 00 00 00 00 00 03 00 08 00 00 00 00 00 00 00 00 00 04 00 08 00 00 00 00 00 00 00 00 00 05 00 08 00 01 69 53 90 5e 44 00 00 06 00 08 00 00 00 00 00 00 00 00 diff --git a/include/ata.h b/include/ata.h index d387ade..377cb38 100644 --- a/include/ata.h +++ b/include/ata.h @@ -23,6 +23,7 @@ typedef uint16_t ata_word_t; typedef uint32_t ata_longword_t; +typedef uint64_t ata_qword_t; typedef enum passthrough_protocol_e { PT_PROTO_HARDWARE_RESET = 0, @@ -47,12 +48,12 @@ typedef enum ata_passthrough_len_spec_e { ATA_PT_LEN_SPEC_TPSIU = 3, } ata_passthrough_len_spec_e; -static inline ata_word_t ata_get_word(const char *buf, int word) +static inline ata_word_t ata_get_word(const unsigned char *buf, int word) { return (uint16_t)(buf[word*2+1])<<8 | buf[word*2]; } -static inline uint16_t ata_get_bits(const char *buf, int word, int start_bit, int end_bit) +static inline uint16_t ata_get_bits(const unsigned char *buf, int word, int start_bit, int end_bit) { uint16_t val = ata_get_word(buf, word); uint16_t shift = start_bit; @@ -80,12 +81,12 @@ static inline uint16_t ata_get_bits(const char *buf, int word, int start_bit, in return (val >> shift) & mask; } -static inline bool ata_get_bit(char *buf, int word, int bit) +static inline bool ata_get_bit(const unsigned char *buf, int word, int bit) { return ata_get_bits(buf, word, bit, bit); } -static inline char *ata_get_string(const char *buf, int word_start, int word_end, char *str) +static inline char *ata_get_string(const unsigned char *buf, int word_start, int word_end, char *str) { int word; int i; @@ -100,7 +101,7 @@ static inline char *ata_get_string(const char *buf, int word_start, int word_end return str; } -static inline ata_longword_t ata_get_longword(const char *buf, int start_word) +static inline ata_longword_t ata_get_longword(const unsigned char *buf, int start_word) { ata_longword_t high = ata_get_word(buf, start_word+1); ata_longword_t low = ata_get_word(buf, start_word); @@ -108,7 +109,15 @@ static inline ata_longword_t ata_get_longword(const char *buf, int start_word) return longword; } -bool ata_inquiry_checksum_verify(const char *buf, int buf_len); +static inline ata_qword_t ata_get_qword(const unsigned char *buf, int start_word) +{ + ata_qword_t low = ata_get_longword(buf, start_word); + ata_qword_t high = ata_get_longword(buf, start_word+2); + ata_qword_t qword = high << 32 | low; + return qword; +} + +bool ata_inquiry_checksum_verify(const unsigned char *buf, int buf_len); static inline unsigned char ata_passthrough_flags_2(int offline, int ck_cond, int direction_in, int transfer_block, ata_passthrough_len_spec_e len_spec) { @@ -195,6 +204,10 @@ static inline int cdb_ata_smart_read_data(unsigned char *cdb) return cdb_ata_passthrough_12(cdb, 0xB0, 0xD0, 0xC24F<<8, 1, PT_PROTO_DMA, true, 0); } +static inline int cdb_ata_smart_read_log(unsigned char *cdb, uint8_t log_addr, uint8_t num_pages) +{ + return cdb_ata_passthrough_12(cdb, 0xB0, 0xD5, (0xC24F<<8) | log_addr, num_pages, PT_PROTO_PIO_DATA_IN, true, 0); +} static inline int cdb_ata_smart_read_threshold(unsigned char *cdb) { @@ -206,6 +219,12 @@ static inline int cdb_ata_check_power_mode(unsigned char *cdb) return cdb_ata_passthrough_12(cdb, 0xE5, 0, 0, 0, PT_PROTO_NON_DATA, true, 1); } +static inline int cdb_ata_read_log_ext(unsigned char *cdb, uint16_t block_count, uint16_t page_number, uint8_t log_address) +{ + uint64_t lba = ((page_number & 0xFF00) << 24) | ((page_number & 0xFF) << 8) | log_address; + return cdb_ata_passthrough_16(cdb, 0x2F, 0, lba, block_count, PT_PROTO_PIO_DATA_IN, true, false, 0); +} + /* Parse ATA SMART READ DATA results */ #define MAX_SMART_ATTRS 30 typedef struct ata_smart_attr { @@ -222,7 +241,10 @@ typedef struct ata_smart_thresh { uint8_t threshold; } ata_smart_thresh_t; -static inline uint8_t ata_calc_ata_smart_read_data_checksum(const unsigned char *buf) { +/** Calculate the page checksum for an ATA buffer, this is needed on ATA IDENTIFY DEVICE and in SMART commands. + * We assume the buffer size is 512 always. + */ +static inline uint8_t ata_calc_checksum(const unsigned char *buf) { unsigned val = 0; int i; for (i = 0; i < 511; i++) @@ -230,12 +252,16 @@ static inline uint8_t ata_calc_ata_smart_read_data_checksum(const unsigned char return 0x100 - (val & 0xFF); // We want the complement } +static inline bool ata_checksum_verify(const unsigned char *buf) { + return ata_calc_checksum(buf) == buf[511]; +} + static inline uint8_t ata_get_ata_smart_read_data_checksum(const unsigned char *buf) { return buf[511]; } static inline bool ata_check_ata_smart_read_data_checksum(const unsigned char *buf) { - return ata_get_ata_smart_read_data_checksum(buf) == ata_calc_ata_smart_read_data_checksum(buf); + return ata_checksum_verify(buf); } uint16_t ata_get_ata_smart_read_data_version(const unsigned char *buf); diff --git a/include/ata_parse.h b/include/ata_parse.h index d63f685..0811f62 100644 --- a/include/ata_parse.h +++ b/include/ata_parse.h @@ -2,315 +2,460 @@ #ifndef ATA_PARSE_H #define ATA_PARSE_H #include "ata.h" -static inline bool ata_get_ata_identify_smart_enabled(const char *buf) { +static inline bool ata_get_ata_identify_smart_enabled(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 85); return val & (1 << 0); } -static inline bool ata_get_ata_identify_cfast_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 69); - return val & (1 << 15); -} - -static inline bool ata_get_ata_identify_sct_write_same_supported(const char *buf) { +static inline bool ata_get_ata_identify_sct_write_same_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 206); return val & (1 << 2); } -static inline bool ata_get_ata_identify_lps_misalignment_reporting_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 69); - return val & (1 << 13); -} - -static inline bool ata_get_ata_identify_extended_number_of_user_addressable_sectors(const char *buf) { +static inline bool ata_get_ata_identify_extended_number_of_user_addressable_sectors(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 69); return val & (1 << 3); } -static inline bool ata_get_ata_identify_sense_data_supported(const char *buf) { +static inline bool ata_get_ata_identify_sense_data_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 119); return val & (1 << 6); } -static inline bool ata_get_ata_identify_fields_valid_words_64_70(const char *buf) { +static inline bool ata_get_ata_identify_fields_valid_words_64_70(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 53); return val & (1 << 1); } -static inline bool ata_get_ata_identify_crypto_scramble_supported(const char *buf) { +static inline bool ata_get_ata_identify_crypto_scramble_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 59); return val & (1 << 13); } -static inline bool ata_get_ata_identify_rzat_supported(const char *buf) { +static inline bool ata_get_ata_identify_rzat_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 69); return val & (1 << 5); } -static inline bool ata_get_ata_identify_address_48bit_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 83); - return val & (1 << 10); +static inline ata_qword_t ata_get_ata_identify_extended_num_user_addressable_sectors(const unsigned char *buf) { + return ata_get_qword(buf, 230); +} + +static inline bool ata_get_ata_identify_wwn_64bit_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 84); + return val & (1 << 8); +} + +static inline bool ata_get_ata_identify_standby_timer_values_settable(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 49); + return val & (1 << 13); } -static inline bool ata_get_ata_identify_set_max_set_password_dma_and_set_max_unlock_dma_supported(const char *buf) { +static inline bool ata_get_ata_identify_write_buffer_dma_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 69); + return val & (1 << 10); +} + +static inline void ata_get_ata_identify_fw_rev(const unsigned char *buf, char *out) { + ata_get_string(buf, 23, 26, out); +} + +static inline bool ata_get_ata_identify_sata_software_settings_preservation_enabled(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 79); + return val & (1 << 6); +} + +static inline bool ata_get_ata_identify_sata_device_initiated_power_management_enabled(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 79); + return val & (1 << 3); +} + +static inline bool ata_get_ata_identify_write_uncorrectable_enabled(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 120); + return val & (1 << 2); +} + +static inline bool ata_get_ata_identify_sct_command_transport_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 206); + return val & (1 << 0); +} + +static inline ata_longword_t ata_get_ata_identify_wwn_high(const unsigned char *buf) { + return ata_get_longword(buf, 108); +} + +static inline bool ata_get_ata_identify_supports_sata_gen1_1_5gbps(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); + return val & (1 << 1); +} + +static inline bool ata_get_ata_identify_supports_receipt_of_host_initiated_power_management_requests(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); return val & (1 << 9); } -static inline bool ata_get_ata_identify_volatile_write_cache_supported(const char *buf) { +static inline bool ata_get_ata_identify_supports_receive_fpdma_queued(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 77); + return val & (1 << 6); +} + +static inline bool ata_get_ata_identify_smart_self_test_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 84); + return val & (1 << 1); +} + +static inline bool ata_get_ata_identify_overwrite_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 59); + return val & (1 << 14); +} + +static inline unsigned ata_get_ata_identify_queue_depth(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 75); + return (val >> 0) & ((1<<(4 - 0 + 1)) - 1); +} + +static inline bool ata_get_ata_identify_encrypt_all_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 69); + return val & (1 << 4); +} + +static inline bool ata_get_ata_identify_write_buffer_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 82); + return val & (1 << 12); +} + +static inline bool ata_get_ata_identify_streaming_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 84); + return val & (1 << 4); +} + +static inline bool ata_get_ata_identify_download_microcode_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 83); + return val & (1 << 0); +} + +static inline bool ata_get_ata_identify_response_incomplete(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 0); + return val & (1 << 2); +} + +static inline bool ata_get_ata_identify_sct_feature_control_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 206); + return val & (1 << 4); +} + +static inline bool ata_get_ata_identify_puis_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 83); return val & (1 << 5); } -static inline bool ata_get_ata_identify_standby_timer_values_settable(const char *buf) { - ata_word_t val = ata_get_word(buf, 49); +static inline bool ata_get_ata_identify_supports_read_log_dma_ext_as_read_log_dma(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); + return val & (1 << 15); +} + +static inline void ata_get_ata_identify_serial_number(const unsigned char *buf, char *out) { + ata_get_string(buf, 10, 19, out); +} + +static inline bool ata_get_ata_identify_supports_host_automatic_partial_to_slumber(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); return val & (1 << 13); } -static inline bool ata_get_ata_identify_sata_dma_setup_auto_activation_enabled(const char *buf) { +static inline bool ata_get_ata_identify_cfa_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 83); + return val & (1 << 2); +} + +static inline bool ata_get_ata_identify_sata_in_order_data_delivery_enabled(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 79); + return val & (1 << 4); +} + +static inline bool ata_get_ata_identify_major_version_acs_2(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 80); + return val & (1 << 9); +} + +static inline void ata_get_ata_identify_additional_product_identifier(const unsigned char *buf, char *out) { + ata_get_string(buf, 170, 173, out); +} + +static inline bool ata_get_ata_identify_volatile_write_cache_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 82); + return val & (1 << 5); +} + +static inline bool ata_get_ata_identify_smart_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 82); + return val & (1 << 0); +} + +static inline bool ata_get_ata_identify_sct_data_tables_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 206); + return val & (1 << 5); +} + +static inline bool ata_get_ata_identify_supports_dev_automatic_partial_to_slumber(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); + return val & (1 << 14); +} + +static inline unsigned ata_get_ata_identify_current_negotiated_link_speed(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 77); + return (val >> 1) & ((1<<(3 - 1 + 1)) - 1); +} + +static inline bool ata_get_ata_identify_supports_sata_gen2_3gbps(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); return val & (1 << 2); } -static inline void ata_get_ata_identify_fw_rev(const char *buf, char *out) { - ata_get_string(buf, 23, 26, out); +static inline bool ata_get_ata_identify_read_look_ahead_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 82); + return val & (1 << 6); +} + +static inline bool ata_get_ata_identify_read_buffer_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 82); + return val & (1 << 13); } -static inline bool ata_get_ata_identify_write_buffer_dma_supported(const char *buf) { +static inline bool ata_get_ata_identify_cfast_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 69); + return val & (1 << 15); +} + +static inline bool ata_get_ata_identify_lps_misalignment_reporting_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 69); + return val & (1 << 13); +} + +static inline bool ata_get_ata_identify_supports_ncq_priority(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); + return val & (1 << 12); +} + +static inline bool ata_get_ata_identify_address_48bit_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 83); return val & (1 << 10); } -static inline bool ata_get_ata_identify_major_version_ata_atapi_6(const char *buf) { +static inline bool ata_get_ata_identify_set_max_set_password_dma_and_set_max_unlock_dma_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 69); + return val & (1 << 9); +} + +static inline bool ata_get_ata_identify_apm_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 83); + return val & (1 << 3); +} + +static inline bool ata_get_ata_identify_sata_dma_setup_auto_activation_enabled(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 79); + return val & (1 << 2); +} + +static inline bool ata_get_ata_identify_major_version_ata_atapi_7(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 80); + return val & (1 << 7); +} + +static inline bool ata_get_ata_identify_major_version_ata_atapi_6(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 80); return val & (1 << 6); } -static inline bool ata_get_ata_identify_major_version_ata_atapi_5(const char *buf) { +static inline bool ata_get_ata_identify_major_version_ata_atapi_5(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 80); return val & (1 << 5); } -static inline bool ata_get_ata_identify_sct_error_recovery_control_supported(const char *buf) { +static inline bool ata_get_ata_identify_sct_error_recovery_control_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 206); return val & (1 << 3); } -static inline bool ata_get_ata_identify_block_erase_supported(const char *buf) { +static inline bool ata_get_ata_identify_block_erase_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 59); return val & (1 << 15); } -static inline bool ata_get_ata_identify_sata_software_settings_preservation_enabled(const char *buf) { - ata_word_t val = ata_get_word(buf, 79); - return val & (1 << 6); +static inline bool ata_get_ata_identify_gpl_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 84); + return val & (1 << 5); } -static inline bool ata_get_ata_identify_dma_supported(const char *buf) { +static inline bool ata_get_ata_identify_dma_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 49); return val & (1 << 8); } -static inline bool ata_get_ata_identify_write_uncorrectable_enabled(const char *buf) { - ata_word_t val = ata_get_word(buf, 120); - return val & (1 << 2); -} - -static inline bool ata_get_ata_identify_sct_command_transport_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 206); - return val & (1 << 0); +static inline unsigned ata_get_ata_identify_rotational_rate(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 216); + return (val >> 0) & ((1<<(15 - 0 + 1)) - 1); } -static inline bool ata_get_ata_identify_not_ata_device(const char *buf) { +static inline bool ata_get_ata_identify_not_ata_device(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 0); return val & (1 << 15); } -static inline bool ata_get_ata_identify_read_buffer_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 82); - return val & (1 << 13); +static inline bool ata_get_ata_identify_spin_up_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 83); + return val & (1 << 6); } -static inline bool ata_get_ata_identify_read_buffer_dma_supported(const char *buf) { +static inline bool ata_get_ata_identify_read_buffer_dma_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 69); return val & (1 << 11); } -static inline bool ata_get_ata_identify_address_28bit_supported(const char *buf) { +static inline bool ata_get_ata_identify_address_28bit_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 69); return val & (1 << 6); } -static inline bool ata_get_ata_identify_download_microcode_dma_supported(const char *buf) { +static inline bool ata_get_ata_identify_supports_sata_gen3_6gbps(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); + return val & (1 << 3); +} + +static inline bool ata_get_ata_identify_download_microcode_dma_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 69); return val & (1 << 8); } -static inline bool ata_get_ata_identify_mandatory_power_management_supported(const char *buf) { +static inline bool ata_get_ata_identify_mandatory_power_management_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 82); return val & (1 << 3); } -static inline bool ata_get_ata_identify_fields_valid_word_88(const char *buf) { +static inline bool ata_get_ata_identify_fields_valid_word_88(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 53); return val & (1 << 2); } -static inline bool ata_get_ata_identify_packet_feature_set_supported(const char *buf) { +static inline bool ata_get_ata_identify_packet_feature_set_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 82); return val & (1 << 4); } -static inline bool ata_get_ata_identify_smart_self_test_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 84); - return val & (1 << 1); -} - -static inline bool ata_get_ata_identify_sata_in_order_data_delivery_enabled(const char *buf) { - ata_word_t val = ata_get_word(buf, 79); - return val & (1 << 4); -} - -static inline bool ata_get_ata_identify_major_version_acs_2(const char *buf) { - ata_word_t val = ata_get_word(buf, 80); - return val & (1 << 9); +static inline bool ata_get_ata_identify_nop_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 82); + return val & (1 << 14); } -static inline bool ata_get_ata_identify_encrypt_all_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 69); - return val & (1 << 4); +static inline bool ata_get_ata_identify_supports_ncq_queue_management_commands(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 77); + return val & (1 << 5); } -static inline bool ata_get_ata_identify_iordy_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 49); - return val & (1 << 11); +static inline bool ata_get_ata_identify_write_uncorrectable_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 119); + return val & (1 << 2); } -static inline bool ata_get_ata_identify_nop_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 82); - return val & (1 << 14); +static inline bool ata_get_ata_identify_supports_sata_phy_event_counters_log(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); + return val & (1 << 10); } -static inline bool ata_get_ata_identify_sata_device_initiated_power_management_enabled(const char *buf) { - ata_word_t val = ata_get_word(buf, 79); - return val & (1 << 3); +static inline bool ata_get_ata_identify_supports_ncq(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); + return val & (1 << 8); } -static inline bool ata_get_ata_identify_response_incomplete(const char *buf) { - ata_word_t val = ata_get_word(buf, 0); - return val & (1 << 2); +static inline bool ata_get_ata_identify_supports_ncq_streaming(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 77); + return val & (1 << 4); } -static inline bool ata_get_ata_identify_sata_automatic_partial_to_slumber_transitions_enabled(const char *buf) { +static inline bool ata_get_ata_identify_sata_automatic_partial_to_slumber_transitions_enabled(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 79); return val & (1 << 7); } -static inline bool ata_get_ata_identify_sct_feature_control_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 206); - return val & (1 << 4); +static inline void ata_get_ata_identify_current_media_serial(const unsigned char *buf, char *out) { + ata_get_string(buf, 176, 205, out); } -static inline bool ata_get_ata_identify_major_version_ata_8_acs(const char *buf) { +static inline bool ata_get_ata_identify_major_version_ata_8_acs(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 80); return val & (1 << 8); } -static inline bool ata_get_ata_identify_trusted_computing_supported(const char *buf) { +static inline ata_longword_t ata_get_ata_identify_wwn_low(const unsigned char *buf) { + return ata_get_longword(buf, 110); +} + +static inline bool ata_get_ata_identify_trusted_computing_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 48); return val & (1 << 0); } -static inline bool ata_get_ata_identify_sanitize_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 59); - return val & (1 << 12); +static inline bool ata_get_ata_identify_sata_non_zero_buffer_offsets_enabled(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 79); + return val & (1 << 1); } -static inline bool ata_get_ata_identify_non_volatile_cache(const char *buf) { +static inline bool ata_get_ata_identify_non_volatile_cache(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 69); return val & (1 << 2); } -static inline void ata_get_ata_identify_serial_number(const char *buf, char *out) { - ata_get_string(buf, 10, 19, out); -} - -static inline ata_longword_t ata_get_ata_identify_total_addressable_sectors_28bit(const char *buf) { - return ata_get_longword(buf, 60); +static inline bool ata_get_ata_identify_iordy_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 49); + return val & (1 << 11); } -static inline void ata_get_ata_identify_model(const char *buf, char *out) { - ata_get_string(buf, 27, 46, out); +static inline bool ata_get_ata_identify_sata_hardware_feature_control_enabled(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 79); + return val & (1 << 5); } -static inline bool ata_get_ata_identify_overwrite_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 59); - return val & (1 << 14); +static inline bool ata_get_ata_identify_supports_unload_while_ncq_outstanding(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 76); + return val & (1 << 11); } -static inline bool ata_get_ata_identify_write_uncorrectable_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 119); - return val & (1 << 2); +static inline bool ata_get_ata_identify_security_feature_set_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 82); + return val & (1 << 1); } -static inline bool ata_get_ata_identify_smart_error_logging_supported(const char *buf) { +static inline bool ata_get_ata_identify_smart_error_logging_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 84); return val & (1 << 0); } -static inline bool ata_get_ata_identify_sense_data_enabled(const char *buf) { +static inline bool ata_get_ata_identify_sense_data_enabled(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 120); return val & (1 << 6); } -static inline bool ata_get_ata_identify_smart_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 82); - return val & (1 << 0); -} - -static inline bool ata_get_ata_identify_sct_data_tables_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 206); - return val & (1 << 5); -} - -static inline bool ata_get_ata_identify_major_version_ata_atapi_7(const char *buf) { - ata_word_t val = ata_get_word(buf, 80); - return val & (1 << 7); -} - -static inline bool ata_get_ata_identify_iordy_disable_supported(const char *buf) { +static inline bool ata_get_ata_identify_iordy_disable_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 49); return val & (1 << 10); } -static inline bool ata_get_ata_identify_sata_non_zero_buffer_offsets_enabled(const char *buf) { - ata_word_t val = ata_get_word(buf, 79); - return val & (1 << 1); -} - -static inline bool ata_get_ata_identify_sata_hardware_feature_control_enabled(const char *buf) { - ata_word_t val = ata_get_word(buf, 79); - return val & (1 << 5); +static inline bool ata_get_ata_identify_sanitize_supported(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, 59); + return val & (1 << 12); } -static inline bool ata_get_ata_identify_write_buffer_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 82); - return val & (1 << 12); +static inline void ata_get_ata_identify_model(const unsigned char *buf, char *out) { + ata_get_string(buf, 27, 46, out); } -static inline bool ata_get_ata_identify_drat_supported(const char *buf) { +static inline bool ata_get_ata_identify_drat_supported(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, 69); return val & (1 << 14); } -static inline bool ata_get_ata_identify_read_look_ahead_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 82); - return val & (1 << 6); -} - -static inline bool ata_get_ata_identify_security_feature_set_supported(const char *buf) { - ata_word_t val = ata_get_word(buf, 82); - return val & (1 << 1); +static inline ata_longword_t ata_get_ata_identify_total_addressable_sectors_28bit(const unsigned char *buf) { + return ata_get_longword(buf, 60); } #endif diff --git a/include/parse_extended_inquiry.h b/include/parse_extended_inquiry.h new file mode 100644 index 0000000..f0e7240 --- /dev/null +++ b/include/parse_extended_inquiry.h @@ -0,0 +1,86 @@ +/* Copyright 2015 Baruch Even + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef LIBSCSICMD_EXTENDED_INQUIRY_H +#define LIBSCSICMD_EXTENDED_INQUIRY_H + +#include + +#define EVPD_MIN_LEN 4 + +static inline uint8_t evpd_peripheral_qualifier(uint8_t *data) +{ + return data[0] >> 5; +} + +static inline uint8_t evpd_peripheral_device_type(uint8_t *data) +{ + return data[0] & 0x1F; +} + +static inline uint8_t evpd_page_code(uint8_t *data) +{ + return data[1]; +} + +static inline uint16_t evpd_page_len(uint8_t *data) +{ + return (data[2] << 8) | data[3]; +} + +static inline uint8_t *evpd_page_data(uint8_t *data) +{ + return data + EVPD_MIN_LEN; +} + +static inline bool evpd_is_ascii_page(uint8_t page_code) +{ + return 0x01 <= page_code && page_code <= 0x7F; +} + +/* This should be called with the body of the EVPD data and not the full (i.e. with the output of evpd_page_data()) */ +static inline uint16_t evpd_ascii_len(uint8_t *evpd_body) +{ + return (evpd_body[0] << 8) | evpd_body[1]; +} + +static inline uint8_t *evpd_ascii_data(uint8_t *evpd_body) +{ + return evpd_body + 2; +} + +static inline uint8_t *evpd_ascii_post_data(uint8_t *evpd_body) +{ + return evpd_body + 2 + evpd_ascii_len(evpd_body); +} + +static inline unsigned evpd_ascii_post_data_len(uint8_t *evpd_body, unsigned full_data_len) +{ + return full_data_len - EVPD_MIN_LEN - 2 - evpd_ascii_len(evpd_body); +} + +static inline bool evpd_is_valid(uint8_t *data, unsigned data_len) +{ + if (data_len < EVPD_MIN_LEN) + return false; + + if (evpd_page_len(data) > data_len) + return false; + + return true; +} + +#endif diff --git a/include/parse_log_sense.h b/include/parse_log_sense.h new file mode 100644 index 0000000..326fb55 --- /dev/null +++ b/include/parse_log_sense.h @@ -0,0 +1,156 @@ +/* Copyright 2015 Baruch Even + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef LIBSCSICMD_LOG_SENSE_H +#define LIBSCSICMD_LOG_SENSE_H + +#include "scsicmd_utils.h" +#include +#include + +/* Log Sense Header decode */ + +#define LOG_SENSE_MIN_LEN 4 + +static inline uint8_t log_sense_page_code(uint8_t *data) +{ + return data[0] & 0x3F; +} + +static inline bool log_sense_subpage_format(uint8_t *data) +{ + return data[0] & 0x40; +} + +static inline bool log_sense_data_saved(uint8_t *data) +{ + return data[0] & 0x80; +} + +static inline uint8_t log_sense_subpage_code(uint8_t *data) +{ + return data[1]; +} + +static inline unsigned log_sense_data_len(uint8_t *data) +{ + return get_uint16(data, 2); +} + +static inline uint8_t *log_sense_data(uint8_t *data) +{ + return data + LOG_SENSE_MIN_LEN; +} + +static inline uint8_t *log_sense_data_end(uint8_t *data, unsigned data_len) +{ + return data + safe_len(data, data_len, log_sense_data(data), log_sense_data_len(data)); +} + +static inline bool log_sense_is_valid(uint8_t *data, unsigned data_len) +{ + if (data_len < LOG_SENSE_MIN_LEN) + return false; + if (!log_sense_subpage_format(data) && log_sense_subpage_code(data) != 0) + return false; + if (log_sense_data_len(data) + LOG_SENSE_MIN_LEN < data_len) + return false; + return true; +} + +/* Log Sense Parameter decode */ +#define LOG_SENSE_MIN_PARAM_LEN 4 + +#define LOG_PARAM_FLAG_DU 0x80 +#define LOG_PARAM_FLAG_TSD 0x20 +#define LOG_PARAM_FLAG_ETC 0x10 +#define LOG_PARAM_FLAG_TMC_MASK 0x0C +#define LOG_PARAM_FLAG_FMT_MASK 0x03 + +#define LOG_PARAM_TMC_EVERY_UPDATE 0 +#define LOG_PARAM_TMC_EQUAL 1 +#define LOG_PARAM_TMC_NOT_EQUAL 2 +#define LOG_PARAM_TMC_GREATER 3 + +#define LOG_PARAM_FMT_COUNTER_STOP 0 +#define LOG_PARAM_FMT_ASCII 1 +#define LOG_PARAM_FMT_COUNTER_ROLLOVER 2 +#define LOG_PARAM_FMT_BINARY 2 + +static inline uint16_t log_sense_param_code(uint8_t *param) +{ + return get_uint16(param, 0); +} + +inline static uint8_t log_sense_param_flags(uint8_t *param) +{ + return param[2]; +} + +inline static uint8_t log_sense_param_tmc(uint8_t *param) +{ + return (log_sense_param_flags(param) & LOG_PARAM_FLAG_TMC_MASK) >> 2; +} + +inline static uint8_t log_sense_param_fmt(uint8_t *param) +{ + return log_sense_param_flags(param) & LOG_PARAM_FLAG_FMT_MASK; +} + +static inline unsigned log_sense_param_len(uint8_t *param) +{ + return param[3]; +} + +static inline uint8_t *log_sense_param_data(uint8_t *param) +{ + return param + LOG_SENSE_MIN_PARAM_LEN; +} + +static inline bool log_sense_param_is_valid(uint8_t *data, unsigned data_len, uint8_t *param) +{ + if (param < data) + return false; + + const unsigned param_offset = param - data; + if (param_offset > data_len) + return false; + + if (param_offset + LOG_SENSE_MIN_PARAM_LEN > data_len) + return false; + + if (param_offset + LOG_SENSE_MIN_PARAM_LEN + log_sense_param_len(param) > data_len) + return false; + + return true; +} + +#define for_all_log_sense_params(data, data_len, param) \ + for (param = log_sense_data(data); \ + log_sense_param_is_valid(data, data_len, param); \ + param = param + LOG_SENSE_MIN_PARAM_LEN + log_sense_param_len(param)) + +#define for_all_log_sense_pg_0_supported_pages(data, data_len, supported_page) \ + uint8_t *__tmp; \ + for (__tmp = log_sense_data(data), supported_page = __tmp[0]; __tmp < log_sense_data_end(data, data_len); __tmp++, supported_page = __tmp[0]) + +#define for_all_log_sense_pg_0_supported_subpages(data, data_len, supported_page, supported_subpage) \ + uint8_t *__tmp; \ + for (__tmp = log_sense_data(data), supported_page = __tmp[0], supported_subpage = __tmp[1]; __tmp + 1 < log_sense_data_end(data, data_len); __tmp+=2, supported_page = __tmp[0], supported_subpage = __tmp[1]) + +bool log_sense_page_informational_exceptions(uint8_t *page, unsigned page_len, uint8_t *asc, uint8_t *ascq, uint8_t *temperature); + +#endif diff --git a/include/parse_mode_sense.h b/include/parse_mode_sense.h new file mode 100644 index 0000000..30e6b80 --- /dev/null +++ b/include/parse_mode_sense.h @@ -0,0 +1,228 @@ +/* Copyright 2015 Baruch Even + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef LIBSCSICMD_MODE_SENSE_H +#define LIBSCSICMD_MODE_SENSE_H + +#include "scsicmd_utils.h" + +/* Mode parameter header for the MODE SENSE 6 */ +#define MODE_SENSE_6_MIN_LEN 4u + +static inline unsigned mode_sense_6_data_len(uint8_t *data) +{ + return data[0]; +} + +static inline uint8_t mode_sense_6_medium_type(uint8_t *data) +{ + return data[1]; +} + +static inline uint8_t mode_sense_6_device_specific_param(uint8_t *data) +{ + return data[2]; +} + +static inline uint8_t mode_sense_6_block_descriptor_length(uint8_t *data) +{ + return data[3]; +} + +static inline uint8_t *mode_sense_6_block_descriptor_data(uint8_t *data) +{ + return data + MODE_SENSE_6_MIN_LEN; +} + +static inline uint8_t *mode_sense_6_mode_data(uint8_t *data) +{ + return data + MODE_SENSE_6_MIN_LEN + mode_sense_6_block_descriptor_length(data); +} + +static inline unsigned mode_sense_6_expected_length(uint8_t *data) +{ + return 1 + mode_sense_6_data_len(data); // Add the first byte that is not part of the mode data length +} + +static inline unsigned mode_sense_6_mode_data_len(uint8_t *data) +{ + return mode_sense_6_expected_length(data) - MODE_SENSE_6_MIN_LEN - mode_sense_6_block_descriptor_length(data); +} + +static inline bool mode_sense_6_is_valid_header(uint8_t *data, unsigned data_len) +{ + if (mode_sense_6_data_len(data) < MODE_SENSE_6_MIN_LEN-1) + return false; + if (data_len < (unsigned)(mode_sense_6_data_len(data)) + 1) + return false; + if (mode_sense_6_block_descriptor_length(data) != 0 && + mode_sense_6_block_descriptor_length(data) != 8) + { + return false; + } + if (mode_sense_6_data_len(data) < mode_sense_6_block_descriptor_length(data)) + return false; + return true; +} + +/* Mode parameter header for the MODE SENSE 10 */ +#define MODE_SENSE_10_MIN_LEN 8u + +static inline unsigned mode_sense_10_data_len(uint8_t *data) +{ + return get_uint16(data, 0); +} + +static inline uint8_t mode_sense_10_medium_type(uint8_t *data) +{ + return data[2]; +} + +static inline uint8_t mode_sense_10_device_specific_param(uint8_t *data) +{ + return data[3]; +} + +static inline bool mode_sense_10_long_lba(uint8_t *data) +{ + return data[4] & 1; +} + +/* SPC4 says length is times 8 without long lba and times 16 with it but it seems the value is taken verbatim */ +static inline unsigned mode_sense_10_block_descriptor_length(uint8_t *data) +{ + return get_uint16(data, 6); +} + +static inline uint8_t *mode_sense_10_block_descriptor_data(uint8_t *data) +{ + if (mode_sense_10_block_descriptor_length(data) > 0) + return data + MODE_SENSE_10_MIN_LEN; + else + return NULL; +} + +static inline uint8_t *mode_sense_10_mode_data(uint8_t *data) +{ + return data + MODE_SENSE_10_MIN_LEN + mode_sense_10_block_descriptor_length(data); +} + +static inline unsigned mode_sense_10_expected_length(uint8_t *data) +{ + return 2 + mode_sense_10_data_len(data); // Add the first two bytes that are not part of the mode data length +} + +static inline unsigned mode_sense_10_mode_data_len(uint8_t *data) +{ + return mode_sense_10_expected_length(data) - MODE_SENSE_10_MIN_LEN - mode_sense_10_block_descriptor_length(data); +} + +static inline bool mode_sense_10_is_valid_header(uint8_t *data, unsigned data_len) +{ + if (mode_sense_10_data_len(data) < MODE_SENSE_10_MIN_LEN-2) + return false; + if (data_len < (unsigned)(mode_sense_10_data_len(data)) + 2) + return false; + if (mode_sense_10_block_descriptor_length(data) != 0 && + mode_sense_10_block_descriptor_length(data) != 8) + { + return false; + } + return true; +} + +/* Regular block descriptor (as opposed to long) */ +#define BLOCK_DESCRIPTOR_LENGTH 8 +#define BLOCK_DESCRIPTOR_NUM_BLOCKS_OVERFLOW 0xFFFFFF + +static inline uint8_t block_descriptor_density_code(uint8_t *data) +{ + return data[0]; +} + +static inline uint32_t block_descriptor_num_blocks(uint8_t *data) +{ + return get_uint24(data, 1); +} + +static inline uint32_t block_descriptor_block_length(uint8_t *data) +{ + return get_uint24(data, 5); +} + +/* Mode Sense page data */ +static inline uint8_t mode_sense_data_page_code(uint8_t *data) +{ + return data[0] & 0x3F; +} + +static inline bool mode_sense_data_subpage_format(uint8_t *data) +{ + return data[0] & 0x40; +} + +static inline bool mode_sense_data_parameter_saveable(uint8_t *data) +{ + return data[0] & 0x80; +} + +/* Caller is required to know if this is a subpage format page or not */ +static inline uint8_t mode_sense_data_subpage_code(uint8_t *data) +{ + return data[1]; +} + +static inline unsigned mode_sense_data_page_len(uint8_t *data) +{ + return mode_sense_data_subpage_format(data) ? 3 + (unsigned)(get_uint16(data, 2)) : 2 + (unsigned)(data[1]); +} + +static inline unsigned mode_sense_data_param_len(uint8_t *data) +{ + return mode_sense_data_subpage_format(data) ? get_uint16(data, 2) : data[1]; +} + +static inline uint8_t *mode_sense_data_param(uint8_t *data) +{ + return mode_sense_data_subpage_format(data) ? data + 4 : data + 2; +} + +static inline bool mode_sense_data_param_is_valid(uint8_t *data, unsigned data_len) +{ + if (data_len < 2) + return false; + if (mode_sense_data_page_code(data) == 0) + return false; + if (mode_sense_data_subpage_format(data) && data_len < 4) + return false; + if (data_len < mode_sense_data_page_len(data)) + return false; + return true; +} + + +#define for_all_mode_sense_pages(data, data_len, mode_data, mode_data_len, page, remaining_len) \ + for (remaining_len = mode_data - data + safe_len(data, data_len, mode_data, mode_data_len), page = mode_data; \ + remaining_len >= 3 && mode_sense_data_param_is_valid(page, remaining_len); \ + remaining_len += mode_sense_data_param_len(page), page += mode_sense_data_page_len(page)) + +#define for_all_mode_sense_6_pages(data, data_len, page, remaining_len) \ + for_all_mode_sense_pages(data, data_len, mode_sense_6_mode_data(data), mode_sense_6_mode_data_len(data), page, remaining_len) + +#define for_all_mode_sense_10_pages(data, data_len, page, remaining_len) \ + for_all_mode_sense_pages(data, data_len, mode_sense_10_mode_data(data), mode_sense_10_mode_data_len(data), page, remaining_len) + +#endif diff --git a/include/parse_read_defect_data.h b/include/parse_read_defect_data.h new file mode 100644 index 0000000..5e28d35 --- /dev/null +++ b/include/parse_read_defect_data.h @@ -0,0 +1,187 @@ +/* Copyright 2015 Baruch Even + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef LIBSCSICMD_READ_DEFECT_DATA_H +#define LIBSCSICMD_READ_DEFECT_DATA_H + +#include "scsicmd_utils.h" +#include "scsicmd.h" +#include +#include + +const char *read_defect_data_format_to_str(uint8_t fmt); + +/* READ DEFECT DATA 10 */ + +#define READ_DEFECT_DATA_10_MIN_LEN 4 + +static inline bool read_defect_data_10_is_plist_valid(uint8_t *data) +{ + return data[1] & 0x10; +} + +static inline bool read_defect_data_10_is_glist_valid(uint8_t *data) +{ + return data[1] & 0x08; +} + +static inline uint8_t read_defect_data_10_list_format(uint8_t *data) +{ + return data[1] & 0x07; +} + +static inline uint16_t read_defect_data_10_len(uint8_t *data) +{ + return get_uint16(data, 2); +} + +/* For READ DEFECT DATA 10 the user may ask for only the header and the data is never really transfered, allow for this seperation in the checks. */ +static inline bool read_defect_data_10_hdr_is_valid(uint8_t *data, unsigned data_len) +{ + if (data_len < READ_DEFECT_DATA_10_MIN_LEN) + return false; + if ((read_defect_data_10_len(data) % 4) != 0) + return false; + return true; +} + +static inline bool read_defect_data_10_is_valid(uint8_t *data, unsigned data_len) +{ + if (!read_defect_data_10_hdr_is_valid(data, data_len)) + return false; + if ((unsigned)read_defect_data_10_len(data) + READ_DEFECT_DATA_10_MIN_LEN < data_len) + return false; + return true; +} + +static inline uint8_t *read_defect_data_10_data(uint8_t *data) +{ + return data + READ_DEFECT_DATA_10_MIN_LEN; +} + +/* READ DEFECT DATA 10 */ + +#define READ_DEFECT_DATA_12_MIN_LEN 8 + +static inline bool read_defect_data_12_is_plist_valid(uint8_t *data) +{ + return data[1] & 0x10; +} + +static inline bool read_defect_data_12_is_glist_valid(uint8_t *data) +{ + return data[1] & 0x08; +} + +static inline uint8_t read_defect_data_12_list_format(uint8_t *data) +{ + return data[1] & 0x07; +} + +static inline uint32_t read_defect_data_12_len(uint8_t *data) +{ + return get_uint32(data, 4); +} + +/* For READ DEFECT DATA 10 the user may ask for only the header and the data is never really transfered, allow for this seperation in the checks. */ +static inline bool read_defect_data_12_hdr_is_valid(uint8_t *data, unsigned data_len) +{ + if (data_len < READ_DEFECT_DATA_12_MIN_LEN) + return false; + if ((read_defect_data_12_len(data) % 4) != 0) + return false; + return true; +} + +static inline bool read_defect_data_12_is_valid(uint8_t *data, unsigned data_len) +{ + if (!read_defect_data_12_hdr_is_valid(data, data_len)) + return false; + if (read_defect_data_12_len(data) + READ_DEFECT_DATA_12_MIN_LEN < data_len) + return false; + return true; +} + +static inline uint8_t *read_defect_data_12_data(uint8_t *data) +{ + return data + READ_DEFECT_DATA_12_MIN_LEN; +} + +/* Formats */ + +/* Short format */ +#define FORMAT_ADDRESS_SHORT_LEN 4 +static inline uint32_t format_address_short_lba(uint8_t *data) +{ + return get_uint32(data, 0); +} + +/* Long format */ +#define FORMAT_ADDRESS_LONG_LEN 8 +static inline uint32_t format_address_long_lba(uint8_t *data) +{ + return get_uint64(data, 0); +} + +/* Byte from index */ +#define FORMAT_ADDRESS_BYTE_FROM_INDEX_LEN 8 +static inline uint32_t format_address_byte_from_index_cylinder(uint8_t *data) +{ + return get_uint24(data, 0); +} + +static inline uint8_t format_address_byte_from_index_head(uint8_t *data) +{ + return data[3]; +} + +static inline uint32_t format_address_byte_from_index_bytes(uint8_t *data) +{ + return get_uint32(data, 4); +} +#define FORMAT_ADDRESS_BYTE_FROM_INDEX_ALL_TRACK 0xFFFFFFFF + +/* Physical sector format */ +#define FORMAT_ADDRESS_PHYSICAL_LEN 8 +static inline uint32_t format_address_physical_cylinder(uint8_t *data) +{ + return get_uint24(data, 0); +} + +static inline uint8_t format_address_physical_head(uint8_t *data) +{ + return data[3]; +} + +static inline uint32_t format_address_physical_sector(uint8_t *data) +{ + return get_uint32(data, 4); +} +#define FORMAT_ADDRESS_PHYSICAL_ALL_TRACK 0xFFFFFFFF + +static inline unsigned read_defect_data_fmt_len(address_desc_format_e fmt) +{ + switch (fmt) { + case ADDRESS_FORMAT_SHORT: return FORMAT_ADDRESS_SHORT_LEN; + case ADDRESS_FORMAT_LONG: return FORMAT_ADDRESS_LONG_LEN; + case ADDRESS_FORMAT_INDEX_OFFSET: return FORMAT_ADDRESS_BYTE_FROM_INDEX_LEN; + case ADDRESS_FORMAT_PHYSICAL: return FORMAT_ADDRESS_PHYSICAL_LEN; + case ADDRESS_FORMAT_VENDOR: return 4; + default: return 0; + } +} + +#endif diff --git a/include/parse_receive_diagnostics.h b/include/parse_receive_diagnostics.h new file mode 100644 index 0000000..1b8c840 --- /dev/null +++ b/include/parse_receive_diagnostics.h @@ -0,0 +1,161 @@ +/* Copyright 2015 Baruch Even + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef LIBSCSICMD_RECEIVE_DIAGNOSTICS_H +#define LIBSCSICMD_RECEIVE_DIAGNOSTICS_H + +#include "scsicmd_utils.h" +#include +#include + +#define RECV_DIAG_MIN_LEN 4 + +static inline uint8_t recv_diag_get_page_code(uint8_t *data) +{ + return data[0]; +} + +static inline uint8_t recv_diag_get_page_code_specific(uint8_t *data) +{ + return data[1]; +} + +static inline uint16_t recv_diag_get_len(uint8_t *data) +{ + return (data[2] << 8) | data[3]; +} + +static inline uint8_t *recv_diag_data(uint8_t *data) +{ + return data + RECV_DIAG_MIN_LEN; +} + +static inline bool recv_diag_is_valid(uint8_t *data, unsigned data_len) +{ + if (data_len < RECV_DIAG_MIN_LEN) + return false; + if ((unsigned)recv_diag_get_len(data) + RECV_DIAG_MIN_LEN > data_len) + return false; + return true; +} + +/* SES Page 1 Configuration */ + +static inline bool ses_config_is_valid(uint8_t *data, unsigned data_len) +{ + if (data_len < 8) + return false; + if (recv_diag_get_len(data) < 4) + return false; + return true; +} + +static inline uint8_t ses_config_num_sub_enclosures(uint8_t *data) +{ + return data[1] + 1; // +1 for primary +} + +static inline uint32_t ses_config_generation(uint8_t *data) +{ + return get_uint32(data, 4); +} + +static inline uint8_t *ses_config_sub_enclosure(uint8_t *data) +{ + return data + 8; +} + +/* Enclosure Descriptor */ +static inline uint8_t ses_config_enclosure_descriptor_process_identifier(uint8_t *data) +{ + return (data[0] >> 4) & 0x7; +} + +static inline uint8_t ses_config_enclosure_descriptor_num_processes(uint8_t *data) +{ + return data[0] & 0x7; +} + +static inline uint8_t ses_config_enclosure_descriptor_subenclosure_identifier(uint8_t *data) +{ + return data[1]; +} + +static inline uint8_t ses_config_enclosure_descriptor_num_type_descriptors(uint8_t *data) +{ + return data[2]; +} + +static inline uint8_t ses_config_enclosure_descriptor_len(uint8_t *data) +{ + return data[3]; +} + +static inline uint64_t ses_config_enclosure_descriptor_logical_identifier(uint8_t *data) +{ + return get_uint64(data, 4); +} + +static inline bool ses_config_enclosure_descriptor_is_valid(uint8_t *data, unsigned data_len) +{ + if (data_len < 12) + return false; + if (ses_config_enclosure_descriptor_len(data) < 36 || + ses_config_enclosure_descriptor_len(data) > 252 || + ses_config_enclosure_descriptor_len(data) > data_len) + { + return false; + } + return true; +} + +static inline void _ses_str_cpy(uint8_t *src, unsigned src_len, char *s, unsigned slen) +{ + if (slen > src_len) + slen = src_len; + else + slen--; + + memcpy(s, src, slen); + s[slen] = 0; +} + +static inline void ses_config_enclosure_descriptor_vendor_identifier(uint8_t *data, char *s, unsigned slen) +{ + _ses_str_cpy(data+12, 8, s, slen); +} + +static inline void ses_config_enclosure_descriptor_product_identifier(uint8_t *data, char *s, unsigned slen) +{ + _ses_str_cpy(data+20, 16, s, slen); +} + +static inline void ses_config_enclosure_descriptor_revision_level(uint8_t *data, char *s, unsigned slen) +{ + _ses_str_cpy(data+36, 4, s, slen); +} + +static inline uint8_t *ses_config_enclosure_descriptor_vendor_info(uint8_t *data) +{ + return data + 40; +} + +static inline uint8_t ses_config_enclosure_descriptor_vendor_len(uint8_t *data) +{ + return ses_config_enclosure_descriptor_len(data) + 4 - 40; +} + +#endif diff --git a/include/scsicmd.h b/include/scsicmd.h index b97719f..7c42665 100644 --- a/include/scsicmd.h +++ b/include/scsicmd.h @@ -88,6 +88,31 @@ typedef enum scsi_device_type_e { const char *scsi_device_type_name(scsi_device_type_e dev_type); +#define SCSI_PROTOCOL_IDENTIFIER_LIST \ + X(FC, 0, "Fibre Channel") \ + X(PARALLEL_SCSI, 1, "Parallel SCSI") \ + X(SSA, 2, "SSA") \ + X(IEEE1394, 3, "IEEE 1394") \ + X(SRP, 4, "SCSI Remote DMA") \ + X(ISCSI, 5, "iSCSI") \ + X(SAS, 6, "SAS") \ + X(ADT, 7, "Automation Drive Interface") \ + X(ATA, 8, "ATA/ATAPI") \ + X(RESERVED_9, 9, "Reserved9") \ + X(RESERVED_A, 10, "Reserved10") \ + X(RESERVED_B, 11, "Reserved11") \ + X(RESERVED_C, 12, "Reserved12") \ + X(RESERVED_D, 13, "Reserved13") \ + X(RESERVED_E, 14, "Reserved14") \ + X(NONE, 15, "No Specific Protocol") + +#undef X +#define X(name, val, str) SCSI_PROTOCOL_IDENTIFIER_ ## name, +typedef enum scsi_protocol_identifier_e { + SCSI_PROTOCOL_IDENTIFIER_LIST +} scsi_protocol_identifier_e; +#undef X + typedef struct ata_status_t { uint8_t extend; uint8_t error; @@ -142,14 +167,27 @@ typedef struct sense_info_t { bool scsi_parse_sense(unsigned char *sense, int sense_len, sense_info_t *info); /* inquiry */ + +/** Build a CDB from the inquiry command. + */ int cdb_inquiry(unsigned char *cdb, bool evpd, char page_code, uint16_t alloc_len); + +/** Build a CDB from the simple inquiry command that returns the basic information. + * The size can be up to 256 bytes but in order to be able to handle older SCSI devices it is recommended to use the size of 96 bytes. + */ static inline int cdb_inquiry_simple(unsigned char *cdb, uint16_t alloc_len) { return cdb_inquiry(cdb, 0, 0, alloc_len); } + +/** Parse the simple inquiry page data. */ bool parse_inquiry(unsigned char *buf, unsigned buf_len, int *device_type, scsi_vendor_t vendor, scsi_model_t model, scsi_fw_revision_t rev, scsi_serial_t serial); /* read capacity */ + +// READ CAPACITY 10 expects a buffer of 8 bytes int cdb_read_capacity_10(unsigned char *cdb); bool parse_read_capacity_10(unsigned char *buf, unsigned buf_len, uint32_t *max_lba, uint32_t *block_size); + +// READ CAPACITY 16 allows to set the receive buffer size but it should be at least 32 bytes int cdb_read_capacity_16(unsigned char *cdb, uint32_t alloc_len); bool parse_read_capacity_16(unsigned char *buf, unsigned buf_len, uint64_t *max_lba, uint32_t *block_size, bool *prot_enable, unsigned *p_type, unsigned *p_i_exponent, unsigned *logical_blocks_per_physical_block_exponent, @@ -168,4 +206,44 @@ int cdb_write_16(unsigned char *cdb, bool dpo, bool fua, bool fua_nv, uint64_t l /* log sense */ int cdb_log_sense(unsigned char *cdb, uint8_t page_code, uint8_t subpage_code, uint16_t alloc_len); +/* mode sense */ +typedef enum { + PAGE_CONTROL_CURRENT = 0, + PAGE_CONTROL_CHANGEABLE = 1, + PAGE_CONTROL_DEFAULT = 2, + PAGE_CONTROL_SAVED = 3, +} page_control_e; +int cdb_mode_sense_6(unsigned char *cdb, bool disable_block_descriptor, page_control_e page_control, uint8_t page_code, uint8_t subpage_code, uint8_t alloc_len); +int cdb_mode_sense_10(unsigned char *cdb, bool long_lba_accepted, bool disable_block_descriptor, page_control_e page_control, uint8_t page_code, uint8_t subpage_code, uint16_t alloc_len); + +/* send/receive diagnostics */ +int cdb_receive_diagnostics(unsigned char *cdb, bool page_code_valid, uint8_t page_code, uint16_t alloc_len); + +typedef enum { + SELF_TEST_ZERO = 0, + SELF_TEST_BACKGROUND_SHORT = 1, + SELF_TEST_BACKGROUND_EXTENDED = 2, + SELF_TEST_RESERVED1 = 3, + SELF_TEST_BACKGROUND_ABORT = 4, + SELF_TEST_FOREGROUND_SHORT = 5, + SELF_TEST_FOREGROUND_EXTENDED = 6, + SELF_TEST_RESERVED2 = 7, +} self_test_code_e; +int cdb_send_diagnostics(unsigned char *cdb, self_test_code_e self_test, uint16_t param_len); + +/* read defect data */ +typedef enum { + ADDRESS_FORMAT_SHORT = 0, + ADDRESS_FORMAT_RESERVED_1 = 1, + ADDRESS_FORMAT_RESERVED_2 = 2, + ADDRESS_FORMAT_LONG = 3, + ADDRESS_FORMAT_INDEX_OFFSET = 4, + ADDRESS_FORMAT_PHYSICAL = 5, + ADDRESS_FORMAT_VENDOR = 6, + ADDRESS_FORMAT_RESERVED_3 = 7, +} address_desc_format_e; + +int cdb_read_defect_data_10(unsigned char *cdb, bool plist, bool glist, address_desc_format_e format, uint16_t alloc_len); +int cdb_read_defect_data_12(unsigned char *cdb, bool plist, bool glist, address_desc_format_e format, uint32_t alloc_len); + #endif diff --git a/include/scsicmd_utils.h b/include/scsicmd_utils.h new file mode 100644 index 0000000..a34e0ef --- /dev/null +++ b/include/scsicmd_utils.h @@ -0,0 +1,68 @@ +/* Copyright 2015 Baruch Even + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef LIBSCSICMD_UTILS_H +#define LIBSCSICMD_UTILS_H + +#include + +static inline uint16_t get_uint16(unsigned char *buf, int start) +{ + return (uint16_t)buf[start] << 8 | + (uint16_t)buf[start+1]; +} + +static inline uint32_t get_uint24(unsigned char *buf, int start) +{ + return (uint32_t)buf[start] << 16 | + (uint32_t)buf[start+1] << 8 | + (uint32_t)buf[start+2]; +} + +static inline uint32_t get_uint32(unsigned char *buf, int start) +{ + return (uint32_t)buf[start] << 24 | + (uint32_t)buf[start+1] << 16 | + (uint32_t)buf[start+2] << 8 | + (uint32_t)buf[start+3]; +} + +static inline uint64_t get_uint64(unsigned char *buf, int start) +{ + return (uint64_t)buf[start] << 56 | + (uint64_t)buf[start+1] << 48 | + (uint64_t)buf[start+2] << 40 | + (uint64_t)buf[start+3] << 32 | + (uint64_t)buf[start+4] << 24 | + (uint64_t)buf[start+5] << 16 | + (uint64_t)buf[start+6] << 8 | + (uint64_t)buf[start+7]; +} + +static inline unsigned safe_len(uint8_t *start, unsigned len, uint8_t *subbuf, unsigned subbuf_len) +{ + const int start_offset = subbuf - start; + + if (start_offset < 0 || (unsigned)start_offset > len) + return 0; + + if (subbuf_len + start_offset > len) + return len - start_offset; + else + return subbuf_len; +} + +#endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c10e2eb..e666a3e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1 +1 @@ -add_library(scsicmd STATIC ata.c ata_smart.c cdb.c parse_inquiry.c parse_read_cap.c parse_sense.c str_map.c smartdb/smartdb.c smartdb/smartdb_gen.c) +add_library(scsicmd STATIC ata.c ata_smart.c cdb.c parse_inquiry.c parse_read_cap.c parse_sense.c log_sense.c parse.c str_map.c smartdb/smartdb.c smartdb/smartdb_gen.c) diff --git a/src/ata.c b/src/ata.c index 0bac28e..553d0a0 100644 --- a/src/ata.c +++ b/src/ata.c @@ -18,24 +18,19 @@ #include #include -/* -bool ata_inq_checksum(unsigned char *buf, int buf_len) + +bool ata_inquiry_checksum_verify(const unsigned char *buf, int buf_len) { - char sum; - int idx; + if (buf_len != 512) + return false; if (buf[511] != 0xA5) { // Checksum isn't claimed to be valid, nothing to check here - return 1; - } - - for (idx = 0, sum = 0; idx < buf_len; idx++) { - sum += buf[idx]; + return true; } - return sum == 0; + return ata_checksum_verify(buf); } -*/ bool ata_status_from_scsi_sense(unsigned char *sense, int sense_len, ata_status_t *status) { @@ -76,7 +71,7 @@ bool ata_status_from_scsi_sense(unsigned char *sense, int sense_len, ata_status_ uint16_t ata_get_ata_smart_read_data_version(const unsigned char *buf) { - return ata_get_word((const char *)buf, 0); + return ata_get_word(buf, 0); } int ata_parse_ata_smart_read_data(const unsigned char *buf, ata_smart_attr_t *attrs, int max_attrs) diff --git a/src/cdb.c b/src/cdb.c index a39c969..adca31e 100644 --- a/src/cdb.c +++ b/src/cdb.c @@ -140,3 +140,76 @@ int cdb_log_sense(unsigned char *cdb, uint8_t page_code, uint8_t subpage_code, u set_uint16(cdb, 7, alloc_len); return LEN; } + +int cdb_receive_diagnostics(unsigned char *cdb, bool page_code_valid, uint8_t page_code, uint16_t alloc_len) +{ + const int LEN = 6; + cdb[0] = 0x1C; + cdb[1] = page_code_valid ? 1 : 0; + cdb[2] = page_code; + set_uint16(cdb, 3, alloc_len); + cdb[5] = 0; + return LEN; +} + +int cdb_send_diagnostics(unsigned char *cdb, self_test_code_e self_test, uint16_t param_len) +{ + const int LEN = 6; + cdb[0] = 0x1D; + cdb[1] = self_test << 5; + cdb[2] = 0; + set_uint16(cdb, 3, param_len); + cdb[5] = 0; + return LEN; +} + +int cdb_mode_sense_6(unsigned char *cdb, bool disable_block_descriptor, page_control_e page_control, uint8_t page_code, uint8_t subpage_code, uint8_t alloc_len) +{ + const int LEN = 6; + cdb[0] = 0x1A; + cdb[1] = disable_block_descriptor ? (1<<3) : 0; + cdb[2] = (page_control << 6) | page_code; + cdb[3] = subpage_code; + cdb[4] = alloc_len; + cdb[5] = 0; + return LEN; +} + +int cdb_mode_sense_10(unsigned char *cdb, bool long_lba_accepted, bool disable_block_descriptor, page_control_e page_control, uint8_t page_code, uint8_t subpage_code, uint16_t alloc_len) +{ + const int LEN = 10; + cdb[0] = 0x5A; + cdb[1] = (long_lba_accepted ? 1<<4 : 0) | (disable_block_descriptor ? 1<<3 : 0); + cdb[2] = (page_control << 6) | page_code; + cdb[3] = subpage_code; + cdb[4] = 0; + cdb[5] = 0; + cdb[6] = 0; + set_uint16(cdb, 7, alloc_len); + cdb[9] = 0; + return LEN; +} + +int cdb_read_defect_data_10(unsigned char *cdb, bool plist, bool glist, address_desc_format_e format, uint16_t alloc_len) +{ + const int LEN = 10; + cdb[0] = 0x37; + cdb[1] = 0; + cdb[2] = (plist ? 0x10 : 0) | (glist ? 0x08 : 0) | format; + cdb[3] = cdb[4] = cdb[5] = cdb[6] = 0; + set_uint16(cdb, 7, alloc_len); + cdb[9] = 0; + return LEN; +} + +int cdb_read_defect_data_12(unsigned char *cdb, bool plist, bool glist, address_desc_format_e format, uint32_t alloc_len) +{ + const int LEN = 12; + cdb[0] = 0xB7; + cdb[1] = (plist ? 0x10 : 0) | (glist ? 0x08 : 0) | format; + cdb[2] = cdb[3] = cdb[4] = cdb[5] = 0; + set_uint32(cdb, 6, alloc_len); + cdb[10] = 0; + cdb[11] = 0; + return LEN; +} diff --git a/src/log_sense.c b/src/log_sense.c new file mode 100644 index 0000000..2b16a35 --- /dev/null +++ b/src/log_sense.c @@ -0,0 +1,26 @@ +#include "parse_log_sense.h" + +bool log_sense_page_informational_exceptions(uint8_t *page, unsigned page_len, uint8_t *asc, uint8_t *ascq, uint8_t *temperature) +{ + if (!log_sense_is_valid(page, page_len)) + return false; + if (log_sense_page_code(page) != 0x2F) + return false; + if (log_sense_subpage_format(page) && log_sense_subpage_code(page) != 0) + return false; + + uint8_t *param; + for_all_log_sense_params(page, page_len, param) { + if (log_sense_param_code(param) == 0) { + uint8_t *param_data = log_sense_param_data(param); + *asc = param_data[0]; + *ascq = param_data[1]; + *temperature = param_data[2]; + return true; + } + } + + return false; +} + + diff --git a/src/parse.c b/src/parse.c new file mode 100644 index 0000000..4681be3 --- /dev/null +++ b/src/parse.c @@ -0,0 +1,19 @@ +#include "parse_read_defect_data.h" + +static const char *defect_data_format_str[] = { + "Short", + "Reserved (1)", + "Reserved (2)", + "Long", + "Index", + "Physical", + "Vendor", + "Reserved (7)", +}; + +const char *read_defect_data_format_to_str(uint8_t fmt) +{ + if (fmt > 7) + return "Unknown"; + return defect_data_format_str[fmt]; +} diff --git a/src/parse_inquiry.c b/src/parse_inquiry.c index 1d1e9f0..b2e71bd 100644 --- a/src/parse_inquiry.c +++ b/src/parse_inquiry.c @@ -32,10 +32,6 @@ bool parse_inquiry(unsigned char *buf, unsigned buf_len, int *device_type, scsi_ return false; unsigned char fmt = buf[3] & 0xf; - if (fmt != 2 && fmt != 1) { - fprintf(stderr, "Data not in standard format (%d but expected 2)\n", fmt); - return false; - } int valid_len = buf[4] + 4; diff --git a/src/parse_read_cap.c b/src/parse_read_cap.c index 83be1c5..b6d93a9 100644 --- a/src/parse_read_cap.c +++ b/src/parse_read_cap.c @@ -15,39 +15,20 @@ */ #include "scsicmd.h" +#include "scsicmd_utils.h" #include #include -static inline void get_uint32(unsigned char *buf, int start, uint32_t *val) -{ - *val = (uint32_t)buf[start] << 24 | - (uint32_t)buf[start+1] << 16 | - (uint32_t)buf[start+2] << 8 | - (uint32_t)buf[start+3]; -} - -static inline void get_uint64(unsigned char *buf, int start, uint64_t *val) -{ - *val = (uint64_t)buf[start] << 56 | - (uint64_t)buf[start+1] << 48 | - (uint64_t)buf[start+2] << 40 | - (uint64_t)buf[start+3] << 32 | - (uint64_t)buf[start+4] << 24 | - (uint64_t)buf[start+5] << 16 | - (uint64_t)buf[start+6] << 8 | - (uint64_t)buf[start+7]; -} - bool parse_read_capacity_10(unsigned char *buf, unsigned buf_len, uint32_t *max_lba, uint32_t *block_size) { if (buf_len < 8) return false; if (max_lba) - get_uint32(buf, 0, max_lba); + *max_lba = get_uint32(buf, 0); if (block_size) - get_uint32(buf, 4, block_size); + *block_size = get_uint32(buf, 4); return true; } @@ -59,9 +40,9 @@ bool parse_read_capacity_16(unsigned char *buf, unsigned buf_len, uint64_t *max_ return false; if (max_lba) - get_uint64(buf, 0, max_lba); + *max_lba = get_uint64(buf, 0); if (block_size) - get_uint32(buf, 8, block_size); + *block_size = get_uint32(buf, 8); if (prot_enable) *prot_enable = buf[12] & 1; if (p_type) diff --git a/src/parse_sense.c b/src/parse_sense.c index 94232ae..818def6 100644 --- a/src/parse_sense.c +++ b/src/parse_sense.c @@ -1,52 +1,20 @@ #include "scsicmd.h" +#include "scsicmd_utils.h" #include -static inline uint16_t scsi_get_16(unsigned char *buf, int idx) -{ - return (buf[idx+0] << 8) | - (buf[idx+1]); -} - -static inline uint32_t scsi_get_24(unsigned char *buf, int idx) -{ - return (buf[idx+0] << 16) | - (buf[idx+1] << 8) | - (buf[idx+2]); -} - -static inline uint32_t scsi_get_32(unsigned char *buf, int idx) -{ - return (buf[idx+0] << 24) | - (buf[idx+1] << 16) | - (buf[idx+2] << 8) | - (buf[idx+3]); -} - -static inline uint64_t scsi_get_64(unsigned char *buf, int idx) -{ - return ((uint64_t)buf[idx+0] << 56) | - ((uint64_t)buf[idx+1] << 48) | - ((uint64_t)buf[idx+2] << 40) | - ((uint64_t)buf[idx+3] << 32) | - ((uint64_t)buf[idx+4] << 24) | - ((uint64_t)buf[idx+5] << 16) | - ((uint64_t)buf[idx+6] << 8) | - ((uint64_t)buf[idx+7]); -} - static void parse_sense_key_specific(unsigned char *sks, sense_info_t *info) { info->sense_key_specific_valid = sks[0] & 0x80; if (info->sense_key_specific_valid) { - uint32_t sense_key_specific = scsi_get_24(sks, 0) & 0x007FFFFF; + uint32_t sense_key_specific = get_uint24(sks, 0) & 0x007FFFFF; switch (info->sense_key) { case SENSE_KEY_ILLEGAL_REQUEST: info->sense_key_specific.illegal_request.command_error = sense_key_specific & 0x400000; info->sense_key_specific.illegal_request.bit_pointer_valid = sense_key_specific & 0x080000; info->sense_key_specific.illegal_request.bit_pointer = (sense_key_specific & 0x070000) >> 16; - info->sense_key_specific.illegal_request.command_error = sense_key_specific & 0xFFFF; + info->sense_key_specific.illegal_request.field_pointer = sense_key_specific & 0xFFFF; break; case SENSE_KEY_HARDWARE_ERROR: case SENSE_KEY_MEDIUM_ERROR: @@ -80,7 +48,7 @@ static bool parse_sense_fixed(unsigned char *sense, int sense_len, sense_info_t info->information_valid = sense[0] & 0x80; if (info->information_valid) - info->information = scsi_get_32(sense, 3); + info->information = get_uint32(sense, 3); info->incorrect_len_indicator = sense[2] & 0x20; info->sense_key = sense[2] & 0xF; @@ -88,7 +56,7 @@ static bool parse_sense_fixed(unsigned char *sense, int sense_len, sense_info_t info->ascq = sense[13]; info->cmd_specific_valid = true; - info->cmd_specific = scsi_get_32(sense, 8); + info->cmd_specific = get_uint32(sense, 8); info->fru_code_valid = true; info->fru_code = sense[14]; @@ -96,14 +64,14 @@ static bool parse_sense_fixed(unsigned char *sense, int sense_len, sense_info_t parse_sense_key_specific(sense + 15, info); if (sense_len >= 21) - info->vendor_unique_error = scsi_get_16(sense, 20); + info->vendor_unique_error = get_uint16(sense, 20); //uint8_t additional_sense_len = sense[7]; return true; } -static bool parse_sense_descriptor(unsigned char *sense, int sense_len, sense_info_t *info) +static bool parse_sense_descriptor(unsigned char *sense, unsigned sense_len, sense_info_t *info) { if (sense_len < 8) return false; @@ -112,12 +80,12 @@ static bool parse_sense_descriptor(unsigned char *sense, int sense_len, sense_in info->asc = sense[2]; info->ascq = sense[3]; - uint8_t additional_sense_length = sense[7]; + unsigned additional_sense_length = sense[7]; if (sense_len > additional_sense_length + 8) sense_len = additional_sense_length + 8; - uint8_t idx; - uint8_t desc_len; + unsigned idx; + unsigned desc_len; for (idx = 8; idx < sense_len; idx += desc_len+2) { uint8_t desc_type = sense[idx]; @@ -130,13 +98,13 @@ static bool parse_sense_descriptor(unsigned char *sense, int sense_len, sense_in case 0x00: // Information if (desc_len == 0x0A) { info->information_valid = sense[idx+2] & 0x80; - info->information = scsi_get_64(sense, idx+4); + info->information = get_uint64(sense, idx+4); } break; case 0x01: // Command specific information if (desc_len == 0x0A) { info->cmd_specific_valid = true; - info->cmd_specific = scsi_get_64(sense, idx+4); + info->cmd_specific = get_uint64(sense, idx+4); } break; case 0x02: // Sense key specific @@ -191,7 +159,7 @@ static bool parse_sense_descriptor(unsigned char *sense, int sense_len, sense_in break; case 0x80: // Vendor Unique Unit Error if (desc_len == 0x02) { - info->vendor_unique_error = scsi_get_16(sense, idx+2); + info->vendor_unique_error = get_uint16(sense, idx+2); } break; } diff --git a/structs/ata_identify.yaml b/structs/ata_identify.yaml index 7d682df..e75b24d 100644 --- a/structs/ata_identify.yaml +++ b/structs/ata_identify.yaml @@ -74,8 +74,40 @@ ata_identify: non_volatile_cache: bit: [69, 2] -# queue_depth: -# bits: [75, 0, 4] + queue_depth: + bits: [75, 0, 4] + + supports_read_log_dma_ext_as_read_log_dma: + bit: [76, 15] + supports_dev_automatic_partial_to_slumber: + bit: [76, 14] + supports_host_automatic_partial_to_slumber: + bit: [76, 13] + supports_ncq_priority: + bit: [76, 12] + supports_unload_while_ncq_outstanding: + bit: [76, 11] + supports_sata_phy_event_counters_log: + bit: [76, 10] + supports_receipt_of_host_initiated_power_management_requests: + bit: [76, 9] + supports_ncq: + bit: [76, 8] + supports_sata_gen3_6gbps: + bit: [76, 3] + supports_sata_gen2_3gbps: + bit: [76, 2] + supports_sata_gen1_1_5gbps: + bit: [76, 1] + + supports_receive_fpdma_queued: + bit: [77, 6] + supports_ncq_queue_management_commands: + bit: [77, 5] + supports_ncq_streaming: + bit: [77, 4] + current_negotiated_link_speed: + bits: [77, 1, 3] sata_automatic_partial_to_slumber_transitions_enabled: bit: [79, 7] @@ -127,10 +159,25 @@ ata_identify: address_48bit_supported: bit: [83, 10] - + spin_up_supported: + bit: [83, 6] + puis_supported: + bit: [83, 5] + apm_supported: + bit: [83, 3] + cfa_supported: + bit: [83, 2] + download_microcode_supported: + bit: [83, 0] + + wwn_64bit_supported: + bit: [84, 8] + gpl_supported: + bit: [84, 5] + streaming_supported: + bit: [84, 4] smart_self_test_supported: bit: [84, 1] - smart_error_logging_supported: bit: [84, 0] @@ -161,4 +208,20 @@ ata_identify: sct_command_transport_supported: bit: [206, 0] + rotational_rate: + bits: [216, 0, 15] + + wwn_high: + longword: 108 + wwn_low: + longword: 110 + + additional_product_identifier: + string: [170, 173] + current_media_serial: + string: [176, 205] + + extended_num_user_addressable_sectors: + qword: 230 + # vim:set et ts=4 sw=4: diff --git a/structs/ata_struct_2_c_dump.py b/structs/ata_struct_2_c_dump.py index 6a2ec6c..6e78d40 100755 --- a/structs/ata_struct_2_c_dump.py +++ b/structs/ata_struct_2_c_dump.py @@ -15,14 +15,24 @@ def emit_func_string(name, field, params): print('printf("%%-40s: %%s\\n", "%(field)s", outbuf);' % bit_params) print('}') +def emit_func_bits(name, field, params): + bit_params = dict(name=name, field=field, word_start=int(params[0])) + print('printf("%%-40s: %%u\\n", "%(field)s", ata_get_%(name)s_%(field)s(buf));' % bit_params) + def emit_func_longword(name, field, params): bit_params = dict(name=name, field=field, word_start=int(params)) print('printf("%%-40s: %%u\\n", "%(field)s", ata_get_%(name)s_%(field)s(buf));' % bit_params) +def emit_func_qword(name, field, params): + bit_params = dict(name=name, field=field, word_start=int(params)) + print('printf("%%-40s: %%"PRIu64"\\n", "%(field)s", ata_get_%(name)s_%(field)s(buf));' % bit_params) + kinds = { - 'bit': emit_func_bit, + 'bit': emit_func_bit, + 'bits': emit_func_bits, 'string': emit_func_string, 'longword': emit_func_longword, + 'qword': emit_func_qword, } def emit_header_single(name, struct): @@ -40,7 +50,7 @@ def emit_header_single(name, struct): def emit_header(structs): for name, struct in list(structs.items()): - print('void dump_%s(const char *buf)' % name) + print('void dump_%s(const unsigned char *buf)' % name) print('{') emit_header_single(name, struct) print('}') @@ -50,6 +60,7 @@ def emit_prefix(): print('#include "ata_parse.h"') print('#include "ata_identify_dump.h"') print('#include ') + print('#include ') def emit_suffix(): print('') diff --git a/structs/ata_struct_2_h.py b/structs/ata_struct_2_h.py index d3bae9f..ccadf25 100755 --- a/structs/ata_struct_2_h.py +++ b/structs/ata_struct_2_h.py @@ -5,30 +5,47 @@ def emit_func_bit(name, field, params): bit_params = dict(name=name, field=field, word=int(params[0]), bit=int(params[1])) - print("""static inline bool ata_get_%(name)s_%(field)s(const char *buf) { + print("""static inline bool ata_get_%(name)s_%(field)s(const unsigned char *buf) { ata_word_t val = ata_get_word(buf, %(word)d); return val & (1 << %(bit)d); } """ % bit_params) +def emit_func_bits(name, field, params): + bit_params = dict(name=name, field=field, word=int(params[0]), start_bit=int(params[1]), end_bit=int(params[2])) + print("""static inline unsigned ata_get_%(name)s_%(field)s(const unsigned char *buf) { + ata_word_t val = ata_get_word(buf, %(word)d); + return (val >> %(start_bit)d) & ((1<<(%(end_bit)d - %(start_bit)d + 1)) - 1); +} +""" % bit_params) + def emit_func_string(name, field, params): bit_params = dict(name=name, field=field, word_start=int(params[0]), word_end=int(params[1])) - print("""static inline void ata_get_%(name)s_%(field)s(const char *buf, char *out) { + print("""static inline void ata_get_%(name)s_%(field)s(const unsigned char *buf, char *out) { ata_get_string(buf, %(word_start)d, %(word_end)d, out); } """ % bit_params) def emit_func_longword(name, field, params): bit_params = dict(name=name, field=field, word_start=int(params)) - print("""static inline ata_longword_t ata_get_%(name)s_%(field)s(const char *buf) { + print("""static inline ata_longword_t ata_get_%(name)s_%(field)s(const unsigned char *buf) { return ata_get_longword(buf, %(word_start)d); } """ % bit_params) +def emit_func_qword(name, field, params): + bit_params = dict(name=name, field=field, word_start=int(params)) + print("""static inline ata_qword_t ata_get_%(name)s_%(field)s(const unsigned char *buf) { + return ata_get_qword(buf, %(word_start)d); +} +""" % bit_params) + kinds = { 'bit': emit_func_bit, + 'bits': emit_func_bits, 'string': emit_func_string, 'longword': emit_func_longword, + 'qword': emit_func_qword, } def emit_header_single(name, struct): diff --git a/structs/ata_struct_2_h_dump.py b/structs/ata_struct_2_h_dump.py index 43e82d1..53096b3 100755 --- a/structs/ata_struct_2_h_dump.py +++ b/structs/ata_struct_2_h_dump.py @@ -5,7 +5,7 @@ def emit_header(structs): for name, struct in list(structs.items()): - print('void dump_%s(const char *buf);' % name) + print('void dump_%s(const unsigned char *buf);' % name) def emit_prefix(): print('#ifndef _DUMP_H_') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5b9bc30..f5f8f62 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,6 +24,15 @@ target_link_libraries(scsi_inquiry testlib scsicmd) add_executable(scsi_log_sense scsi_log_sense.c) target_link_libraries(scsi_log_sense testlib scsicmd) +add_executable(parse_scsi parse_scsi.c) +target_link_libraries(parse_scsi testlib scsicmd) + +add_executable(scsi_mode_sense scsi_mode_sense.c) +target_link_libraries(scsi_mode_sense testlib scsicmd) + +add_executable(scsi_receive_diagnostics scsi_receive_diagnostics.c) +target_link_libraries(scsi_receive_diagnostics testlib scsicmd) + add_executable(scsi_read_capacity_10 scsi_read_capacity_10.c) target_link_libraries(scsi_read_capacity_10 testlib scsicmd) @@ -32,3 +41,6 @@ target_link_libraries(scsi_read_capacity_16 testlib scsicmd) add_executable(sense_decode sense_decode.c) target_link_libraries(sense_decode testlib scsicmd) + +add_executable(collect_raw_data collect_raw_data.c) +target_link_libraries(collect_raw_data testlib scsicmd) diff --git a/test/ata_identify.c b/test/ata_identify.c index 4fe1e88..544e016 100644 --- a/test/ata_identify.c +++ b/test/ata_identify.c @@ -54,7 +54,7 @@ void do_command(int fd) } if (!sense) - dump_ata_identify((char *)buf); + dump_ata_identify(buf); else printf("error while reading ATA IDENTIFY, nothing to show\n"); } diff --git a/test/ata_smart_read_data.c b/test/ata_smart_read_data.c index 62fc947..6ec156f 100644 --- a/test/ata_smart_read_data.c +++ b/test/ata_smart_read_data.c @@ -17,6 +17,7 @@ #include "ata.h" #include "ata_parse.h" #include "ata_smart.h" +#include "sense_dump.h" #include "main.h" #include "smartdb.h" #include @@ -47,7 +48,7 @@ static bool read_data(int fd, unsigned char *buf, int buf_len) response_dump(buf, sizeof(buf)); printf("Page checksum read: %02X\n", ata_get_ata_smart_read_data_checksum(buf)); - printf("Page checksum calc: %02X\n", ata_calc_ata_smart_read_data_checksum(buf)); + printf("Page checksum calc: %02X\n", ata_calc_checksum(buf)); printf("Page checksum matches: %s\n", ata_check_ata_smart_read_data_checksum(buf) ? "true" : "false"); printf("Page version: %04Xh\n", ata_get_ata_smart_read_data_version(buf)); if (ata_get_ata_smart_read_data_version(buf) != 0x10) { @@ -82,7 +83,7 @@ static bool read_threshold(int fd, unsigned char *buf, int buf_len) response_dump(buf, sizeof(buf)); printf("Page checksum read: %02X\n", ata_get_ata_smart_read_data_checksum(buf)); - printf("Page checksum calc: %02X\n", ata_calc_ata_smart_read_data_checksum(buf)); + printf("Page checksum calc: %02X\n", ata_calc_checksum(buf)); printf("Page checksum matches: %s\n", ata_check_ata_smart_read_data_checksum(buf) ? "true" : "false"); printf("Page version: %04Xh\n", ata_get_ata_smart_read_data_version(buf)); if (ata_get_ata_smart_read_data_version(buf) != 0x10) { diff --git a/test/collect_raw_data.c b/test/collect_raw_data.c new file mode 100644 index 0000000..2ddac6d --- /dev/null +++ b/test/collect_raw_data.c @@ -0,0 +1,531 @@ +/* Copyright 2013 Baruch Even + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "scsicmd.h" +#include "ata.h" + +#include "main.h" +#include "sense_dump.h" +#include "scsicmd_utils.h" +#include "parse_extended_inquiry.h" +#include "parse_receive_diagnostics.h" +#include "parse_log_sense.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static bool is_ata; + +static void hex_dump(uint8_t *data, uint16_t len) +{ + uint16_t i; + + if (data == NULL || len == 0) + return; + + printf("%02x", data[0]); + for (i = 1; i < len; i++) { + printf(" %02x", data[i]); + } +} + +static void emit_data_csv(uint8_t *cdb, uint8_t cdb_len, uint8_t *sense, uint8_t sense_len, uint8_t *buf, uint16_t buf_len) +{ + putchar(','); + hex_dump(cdb, cdb_len); + putchar(','); + hex_dump(sense, sense_len); + putchar(','); + hex_dump(buf, buf_len); + putchar('\n'); +} + +static int simple_command(int fd, uint8_t *cdb, unsigned cdb_len, uint8_t *buf, unsigned buf_len) +{ + memset(buf, 0, buf_len); + + bool ret = submit_cmd(fd, cdb, cdb_len, buf, buf_len, buf_len ? SG_DXFER_FROM_DEV : SG_DXFER_NONE); + if (!ret) { + printf("Failed to submit command,\n"); + return -1; + } + + unsigned char *sense = NULL; + unsigned sense_len = 0; + ret = read_response_buf(fd, &sense, &sense_len, &buf_len); + + emit_data_csv(cdb, cdb_len, sense, sense_len, buf, buf_len); + + if (sense_len > 0) { + sense_info_t sense_info; + bool sense_parsed = scsi_parse_sense(sense, sense_len, &sense_info); + if (sense_parsed && sense_info.sense_key == SENSE_KEY_RECOVERED_ERROR) + return buf_len; + return -1; + } + return buf_len; +} + +static void do_simple_inquiry(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[128]; + unsigned cdb_len = cdb_inquiry_simple(cdb, 96); + int buf_len; + + buf_len = simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); + + int device_type; + scsi_vendor_t vendor; + scsi_model_t model; + scsi_fw_revision_t rev; + scsi_serial_t serial; + if (parse_inquiry(buf, buf_len, &device_type, vendor, model, rev, serial) && + strncmp(vendor, "ATA", 3) == 0) + { + is_ata = true; + } +} + +static void dump_evpd(int fd, uint8_t evpd_page) +{ + unsigned char cdb[32]; + unsigned char buf[512]; + unsigned cdb_len = cdb_inquiry(cdb, true, evpd_page, sizeof(buf)); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_extended_inquiry(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[512]; + unsigned cdb_len = cdb_inquiry(cdb, true, 0, sizeof(buf)); + int buf_len; + + buf_len = simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); + + if (buf_len > 0 && evpd_is_valid(buf, buf_len)) { + uint16_t max_page_idx = evpd_page_len(buf) + 4; + uint16_t i; + for (i = 4; i < max_page_idx; i++) + dump_evpd(fd, buf[i]); + } +} + +static void dump_log_sense(int fd, uint8_t page, uint8_t subpage) +{ + unsigned char cdb[32]; + unsigned char buf[16*1024]; + unsigned cdb_len = cdb_log_sense(cdb, page, subpage, sizeof(buf)); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_log_sense(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[16*1024]; + unsigned cdb_len = cdb_log_sense(cdb, 0, 0, sizeof(buf)); + int buf_len; + + buf_len = simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); + + if (buf_len < 0) { + printf("error while reading log sense list, nothing to show\n"); + return; + } + + if (!log_sense_is_valid(buf, buf_len)) { + printf("log sense page is invalid\n"); + return; + } + + if (buf[0] != 0 || buf[1] != 0) { + printf("expected to receive log page 0 subpage 0\n"); + return; + } + + uint16_t num_pages = get_uint16(buf, 2); + uint16_t i; + for (i = 0; i < num_pages; i++) { + dump_log_sense(fd, buf[4 + i], 0); + } + + cdb_len = cdb_log_sense(cdb, 0, 0xff, sizeof(buf)); + buf_len = simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); + + if (buf_len < 0) { + printf("error while reading list of log subpages, nothing to show\n"); + return; + } + + if (!log_sense_is_valid(buf, buf_len)) { + printf("log sense list must have at least 4 bytes\n"); + return; + } + + if (buf[0] != 0x40 || buf[1] != 0xFF) { + printf("expected to receive log page 0 (spf=1) subpage 0xFF\n"); + return; + } + + num_pages = get_uint16(buf, 2); + for (i = 0; i < num_pages; i++) { + uint8_t page = buf[4 + i*2] & 0x3F; + uint8_t subpage = buf[4 + i*2 + 1]; + if (subpage == 0) { + printf("Skipping page %02X subpage %02X since subpage is 00 it was already retrieved above\n", page, subpage); + continue; + } + dump_log_sense(fd, page, subpage); + } +} + +static void do_mode_sense_10_type(int fd, bool long_lba, bool disable_block_desc, page_control_e page_control) +{ + unsigned char cdb[32]; + unsigned char buf[4096]; + unsigned cdb_len = cdb_mode_sense_10(cdb, long_lba, disable_block_desc, page_control, 0x3F, 0xFF, sizeof(buf)); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_mode_sense_10(int fd) +{ + do_mode_sense_10_type(fd, true, true, PAGE_CONTROL_CURRENT); + do_mode_sense_10_type(fd, true, true, PAGE_CONTROL_CHANGEABLE); + do_mode_sense_10_type(fd, true, true, PAGE_CONTROL_DEFAULT); + do_mode_sense_10_type(fd, true, true, PAGE_CONTROL_SAVED); + + do_mode_sense_10_type(fd, false, true, PAGE_CONTROL_CURRENT); + do_mode_sense_10_type(fd, false, true, PAGE_CONTROL_CHANGEABLE); + do_mode_sense_10_type(fd, false, true, PAGE_CONTROL_DEFAULT); + do_mode_sense_10_type(fd, false, true, PAGE_CONTROL_SAVED); + + do_mode_sense_10_type(fd, false, false, PAGE_CONTROL_CURRENT); + do_mode_sense_10_type(fd, false, false, PAGE_CONTROL_CHANGEABLE); + do_mode_sense_10_type(fd, false, false, PAGE_CONTROL_DEFAULT); + do_mode_sense_10_type(fd, false, false, PAGE_CONTROL_SAVED); + + do_mode_sense_10_type(fd, true, false, PAGE_CONTROL_CURRENT); + do_mode_sense_10_type(fd, true, false, PAGE_CONTROL_CHANGEABLE); + do_mode_sense_10_type(fd, true, false, PAGE_CONTROL_DEFAULT); + do_mode_sense_10_type(fd, true, false, PAGE_CONTROL_SAVED); +} + +static void do_mode_sense_6_type(int fd, bool disable_block_desc, page_control_e page_control) +{ + unsigned char cdb[32]; + unsigned char buf[255]; + unsigned cdb_len = cdb_mode_sense_6(cdb, disable_block_desc, page_control, 0x3F, 0xFF, sizeof(buf)); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_mode_sense_6(int fd) +{ + do_mode_sense_6_type(fd, true, PAGE_CONTROL_CURRENT); + do_mode_sense_6_type(fd, true, PAGE_CONTROL_CHANGEABLE); + do_mode_sense_6_type(fd, true, PAGE_CONTROL_DEFAULT); + do_mode_sense_6_type(fd, true, PAGE_CONTROL_SAVED); + + do_mode_sense_6_type(fd, false, PAGE_CONTROL_CURRENT); + do_mode_sense_6_type(fd, false, PAGE_CONTROL_CHANGEABLE); + do_mode_sense_6_type(fd, false, PAGE_CONTROL_DEFAULT); + do_mode_sense_6_type(fd, false, PAGE_CONTROL_SAVED); +} + +static void do_mode_sense(int fd) +{ + do_mode_sense_10(fd); + do_mode_sense_6(fd); +} + +static void dump_rcv_diag_page(int fd, uint8_t page) +{ + unsigned char cdb[32]; + unsigned char buf[16*1024]; + unsigned cdb_len = cdb_receive_diagnostics(cdb, true, page, sizeof(buf)); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_receive_diagnostic(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[16*1024]; + unsigned cdb_len = cdb_receive_diagnostics(cdb, true, 0, sizeof(buf)); + int buf_len; + + buf_len = simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); + + if (buf_len < 0) { + printf("error while reading response buffer, nothing to show\n"); + return; + } + + if (recv_diag_is_valid(buf, buf_len)) { + printf("receive diagnostics list must have at least 4 bytes\n"); + return; + } + + if (recv_diag_get_page_code(buf) != 0) { + printf("expected to receive receive diagnostics page 0\n"); + return; + } + + uint16_t num_pages = recv_diag_get_len(buf); + uint16_t i; + for (i = 0; i < num_pages; i++) { + dump_rcv_diag_page(fd, buf[4 + i]); + } +} + +static void do_read_capacity_10(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[8]; + unsigned cdb_len = cdb_read_capacity_10(cdb); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_read_capacity_16(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[512]; + unsigned cdb_len = cdb_read_capacity_16(cdb, sizeof(buf)); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_read_capacity(int fd) +{ + do_read_capacity_10(fd); + do_read_capacity_16(fd); +} + +static void do_read_defect_data_10(int fd, bool plist, bool glist, uint8_t format, bool count_only) +{ + unsigned char cdb[32]; + unsigned char buf[512]; + unsigned cdb_len = cdb_read_defect_data_10(cdb, plist, glist, format, count_only ? 8 : sizeof(buf)); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_read_defect_data_10_all(int fd, uint8_t format) +{ + do_read_defect_data_10(fd, true, false, format, true); + do_read_defect_data_10(fd, true, false, format, false); + do_read_defect_data_10(fd, false, true, format, true); + do_read_defect_data_10(fd, false, true, format, false); +} + +static void do_read_defect_data_12(int fd, bool plist, bool glist, uint8_t format, bool count_only) +{ + unsigned char cdb[32]; + unsigned char buf[512]; + unsigned cdb_len = cdb_read_defect_data_12(cdb, plist, glist, format, count_only ? 8 : sizeof(buf)); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_read_defect_data_12_all(int fd, uint8_t format) +{ + do_read_defect_data_12(fd, true, false, format, true); + do_read_defect_data_12(fd, true, false, format, false); + do_read_defect_data_12(fd, false, true, format, true); + do_read_defect_data_12(fd, false, true, format, false); +} + +static void do_read_defect_data(int fd) +{ + uint8_t format; + + for (format = 0; format < 8; format++) + do_read_defect_data_10_all(fd, format); + + for (format = 0; format < 8; format++) + do_read_defect_data_12_all(fd, format); +} + +static void do_ata_identify(int fd) +{ + uint8_t cdb[32]; + int cdb_len; + uint8_t buf[512]; + + cdb_len = cdb_ata_identify(cdb); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_ata_identify_16(int fd) +{ + uint8_t cdb[32]; + int cdb_len; + uint8_t buf[512]; + + cdb_len = cdb_ata_identify_16(cdb); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_ata_smart_return_status(int fd) +{ + uint8_t cdb[32]; + int cdb_len; + uint8_t buf[512]; + + cdb_len = cdb_ata_smart_return_status(cdb); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_ata_smart_read_data(int fd) +{ + uint8_t cdb[32]; + int cdb_len; + uint8_t buf[512]; + + cdb_len = cdb_ata_smart_read_data(cdb); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static void do_ata_smart_read_threshold(int fd) +{ + uint8_t cdb[32]; + int cdb_len; + uint8_t buf[512]; + + cdb_len = cdb_ata_smart_read_threshold(cdb); + + simple_command(fd, cdb, cdb_len, buf, sizeof(buf)); +} + +static int do_ata_read_log_ext_page(int fd, uint8_t *buf, unsigned buf_sz, unsigned log_addr, unsigned page) +{ + uint8_t cdb[32]; + int cdb_len; + + cdb_len = cdb_ata_read_log_ext(cdb, 1, page, log_addr); + return simple_command(fd, cdb, cdb_len, buf, buf_sz); +} + +static void do_ata_read_log_ext(int fd) +{ + uint8_t __attribute__((aligned(512))) buf[512]; + uint8_t __attribute__((aligned(512))) buf_data[512]; + unsigned log_addr; + + do_ata_read_log_ext_page(fd, buf, sizeof(buf), 0, 0); + + // Validate the page is valid + if (buf[0] != 1 || buf[1] != 0) + return; + + for (log_addr = 1; log_addr < sizeof(buf)/2; log_addr++) { + unsigned num_pages = ata_get_word(buf, log_addr); + if (num_pages) { + unsigned page; + for (page = 0; page < num_pages; page++) { + printf("READ LOG EXT log addr %02X page %u/%u\n", log_addr, page, num_pages); + int ret = do_ata_read_log_ext_page(fd, buf_data, sizeof(buf_data), log_addr, page); + if (ret < 0) + break; + } + } + } +} + +static int do_ata_smart_read_log_addr(int fd, unsigned char *buf, unsigned buf_sz, uint8_t log_addr, uint8_t block_count) +{ + uint8_t cdb[32]; + int cdb_len; + + cdb_len = cdb_ata_smart_read_log(cdb, log_addr, block_count); + return simple_command(fd, cdb, cdb_len, buf, buf_sz); +} + +static void do_ata_smart_read_log(int fd) +{ + unsigned log_addr; + uint8_t __attribute__((aligned(512))) buf[512]; + uint8_t __attribute__((aligned(512))) buf_data[512*256]; + + int ret = do_ata_smart_read_log_addr(fd, buf, sizeof(buf), 0, 1); + if (ret < (int)sizeof(buf)) + return; + + // Validate the page is valid + if (buf[0] != 1 || buf[1] != 0) + return; + + for (log_addr = 1; log_addr < 255; log_addr++) { + unsigned num_pages = buf[log_addr*2]; + if (num_pages > 0) { + printf("SMART READ LOG log addr %02X pages %u\n", log_addr, num_pages); + fflush(stdout); + do_ata_smart_read_log_addr(fd, buf_data, 512*num_pages, log_addr, num_pages); + } + } +} + +static void do_ata_check_power_mode(int fd) +{ + uint8_t cdb[32]; + int cdb_len; + + printf("Check power mode\n"); + cdb_len = cdb_ata_check_power_mode(cdb); + simple_command(fd, cdb, cdb_len, NULL, 0); +} + +void do_command(int fd) +{ + debug = 0; + is_ata = false; + + printf("msg,cdb,sense,data\n"); + do_read_capacity(fd); + do_simple_inquiry(fd); + do_extended_inquiry(fd); + do_log_sense(fd); + do_mode_sense(fd); + do_receive_diagnostic(fd); + do_read_defect_data(fd); + + if (is_ata) { + do_ata_identify(fd); + do_ata_identify_16(fd); + do_ata_check_power_mode(fd); + do_ata_smart_return_status(fd); + do_ata_smart_read_data(fd); + do_ata_smart_read_threshold(fd); + do_ata_read_log_ext(fd); + do_ata_smart_read_log(fd); + } +} diff --git a/test/main.c b/test/main.c index e8d9791..c476838 100644 --- a/test/main.c +++ b/test/main.c @@ -29,10 +29,15 @@ static unsigned char sense[128]; +int debug = 1; + bool submit_cmd(int fd, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_len, int dxfer_dir) { sg_io_hdr_t hdr; + if (debug) + cdb_dump(cdb, cdb_len); + memset(&hdr, 0, sizeof(hdr)); hdr.interface_id = 'S'; @@ -48,8 +53,6 @@ bool submit_cmd(int fd, unsigned char *cdb, unsigned cdb_len, unsigned char *buf hdr.pack_id = 0; hdr.usr_ptr = 0; - printf("sbp: %p\n", hdr.sbp); - ssize_t ret = write(fd, &hdr, sizeof(hdr)); return ret == sizeof(hdr); } @@ -77,8 +80,10 @@ bool read_response_buf(int fd, unsigned char **sensep, unsigned *sense_len, unsi *sensep = sense; *sense_len = hdr.sb_len_wr; - printf("sense data:\n"); - sense_dump(sense, hdr.sb_len_wr); + if (debug) { + printf("sense data:\n"); + sense_dump(sense, hdr.sb_len_wr); + } } if (buf_read) *buf_read = hdr.dxfer_len - hdr.resid; diff --git a/test/main.h b/test/main.h index 854046d..49e0836 100644 --- a/test/main.h +++ b/test/main.h @@ -3,6 +3,8 @@ #include +extern int debug; + /** Do the command that we want to test on the open disk interface. */ void do_command(int fd); bool submit_cmd(int fd, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_len, int dxfer_dir); @@ -13,6 +15,4 @@ static inline bool read_response(int fd, unsigned char **sense, unsigned *sense_ return read_response_buf(fd, sense, sense_len, NULL); } -void response_dump(unsigned char *buf, int buf_len); - #endif diff --git a/test/parse_scsi.c b/test/parse_scsi.c new file mode 100644 index 0000000..c39138f --- /dev/null +++ b/test/parse_scsi.c @@ -0,0 +1,746 @@ +#include +#include +#include +#include +#include +#include + +#include "parse_log_sense.h" +#include "parse_mode_sense.h" +#include "parse_extended_inquiry.h" +#include "parse_read_defect_data.h" +#include "parse_receive_diagnostics.h" +#include "scsicmd.h" +#include "sense_dump.h" + +#ifndef __AFL_LOOP +#define __AFL_LOOP(count) 1 +#endif + +static char *csvtok_last; + +static void csvtok_reset(void) +{ + csvtok_last = NULL; +} + +static char *csvtok(char *start) +{ + if (start) + csvtok_last = start; + + if (!csvtok_last) + return NULL; + + char *ret = csvtok_last; + for (; *csvtok_last && *csvtok_last != ','; csvtok_last++) + ; + if (*csvtok_last) { + *csvtok_last = 0; + csvtok_last++; + } + else + csvtok_last = NULL; + return ret; +} + +static unsigned char char2val(unsigned char ch) +{ + if (ch >= '0' && ch <= '9') + return ch - '0'; + else if (ch >= 'a' && ch <= 'f') + return ch - 'a' + 10; + else if (ch >= 'A' && ch <= 'F') + return ch - 'A' + 10; + else + return 0; +} + +static void print_hex(uint8_t *buf, unsigned buf_len) +{ + unsigned i; + for (i = 0; i < buf_len; i++) { + printf("%02x ", buf[i]); + } + printf("\n"); +} + +static unsigned char *parse_hex(char *str, int *len_out) +{ + char buf[64*1024]; + const unsigned buf_size = sizeof(buf); + unsigned char ch; + unsigned len = 0; + bool top_char = true; + + *len_out = -1; + + for (; *str && len < buf_size; str++) { + if (isspace(*str)) { + if (!top_char) { + printf("Leftover character\n"); + return NULL; + } + } else if (isxdigit(*str)) { + if (top_char) { + ch = char2val(*str); + top_char = false; + } else { + buf[len++] = (ch<<4) | char2val(*str); + top_char = true; + } + } else { + printf("Unknown character '%c'\n", *str); + return NULL; + } + } + + // For valgrind and AFL, copy the data to a malloc buffer to easily detect out of bounds accesses + unsigned char *out = malloc(len); + memcpy(out, buf, len); + *len_out = len; + return out; +} + +static inline const char *yes_no(bool val) +{ + return val ? "yes" : "no"; +} + +static void unparsed_data(uint8_t *buf, unsigned buf_len, uint8_t *start, unsigned total_len) +{ + const unsigned len = safe_len(start, total_len, buf, buf_len); + printf("Unparsed data: "); + print_hex(buf, len); +} + +static void parse_log_sense_param_informational_exceptions(uint16_t param_code, uint8_t *param, uint8_t param_len) +{ + switch (param_code) { + case 0: + printf("Information Exceptions ASC: %02X\n", param[0]); + printf("Information Exceptions ASCQ: %02X\n", param[1]); + printf("Temperature: %u\n", param[2]); + if (param_len > 3) + unparsed_data(param+3, param_len-3, param, param_len); + break; + default: + unparsed_data(param, param_len, param, param_len); + } +} + +static void parse_log_sense_param_ascii(uint8_t *param, unsigned param_len) +{ + uint8_t *ascii = log_sense_param_data(param); + unsigned ascii_len = log_sense_param_len(param); + ascii_len = safe_len(param, param_len, ascii, ascii_len); + + printf("ASCII (%u): '", ascii_len); + for (; ascii_len > 0; ascii_len--, ascii++) + putchar(*ascii); + printf("'\n"); +} + +static void parse_log_sense_param_counter(uint8_t *param, unsigned param_len) +{ + uint8_t *data = log_sense_param_data(param); + unsigned data_len = log_sense_param_len(param); + + switch (data_len) { + case 2: + printf("Counter 16bit: %u\n", get_uint16(data, 0)); + break; + case 4: + printf("Counter 32bit: %u\n", get_uint32(data, 0)); + break; + case 8: + printf("Counter 64bit: %lu\n", get_uint64(data, 0)); + break; + default: + printf("Counter %d bytes\n", data_len); + unparsed_data(data, data_len, param, param_len); + break; + } +} + +static void parse_log_sense_param(uint8_t page, uint8_t subpage, uint16_t param_code, uint8_t *param, uint8_t param_len) +{ + (void)subpage; + + switch (page) { + case 0x2F: parse_log_sense_param_informational_exceptions(param_code, log_sense_param_data(param), log_sense_param_len(param)); break; + /* TODO: parse more LOG SENSE pages */ + default: + switch (log_sense_param_fmt(param)) { + case LOG_PARAM_FMT_COUNTER_STOP: + case LOG_PARAM_FMT_COUNTER_ROLLOVER: + parse_log_sense_param_counter(param, param_len); + break; + case LOG_PARAM_FMT_ASCII: + parse_log_sense_param_ascii(param, param_len); + break; + default: + unparsed_data(param, param_len, param, param_len); + break; + } + break; + } +} + +static int parse_log_sense(unsigned char *data, unsigned data_len) +{ + printf("Log Sense\n"); + if (data_len < LOG_SENSE_MIN_LEN) { + printf("Insufficient data in log sense to begin parsing\n"); + return 1; + } + printf("Log Sense Page Code: 0x%02x\n", log_sense_page_code(data)); + printf("Log Sense Subpage format: %s\n", yes_no(log_sense_subpage_format(data))); + if (log_sense_subpage_format(data)) + printf("Log Sense Subpage: 0x%02x\n", log_sense_subpage_code(data)); + printf("Log Sense Data Saved: %s\n", yes_no(log_sense_data_saved(data))); + printf("Log Sense Data Length: %u\n", log_sense_data_len(data)); + + if (log_sense_page_code(data) == 0) { + if (!log_sense_subpage_format(data)) { + printf("Supported Log Pages:\n"); + uint8_t supported_page; + for_all_log_sense_pg_0_supported_pages(data, data_len, supported_page) { + printf("\t%02X\n", supported_page & 0x3F); + } + } else if (log_sense_subpage_code(data) == 0xFF) { + printf("Supported Log Subpages:\n"); + uint8_t supported_page, supported_subpage; + for_all_log_sense_pg_0_supported_subpages(data, data_len, supported_page, supported_subpage) { + printf("\t%02X %02X\n", supported_page & 0x3F, supported_subpage); + } + } else { + printf("Unknown supported log page combination"); + unparsed_data(log_sense_data(data), log_sense_data_len(data), data, data_len); + } + } else { + uint8_t *param; + for_all_log_sense_params(data, data_len, param) { + putchar('\n'); + printf("Log Sense Param Code: 0x%04x\n", log_sense_param_code(param)); + printf("Log Sense Param Len: %u\n", log_sense_param_len(param)); + printf("Log Sense Param format: %u\n", log_sense_param_fmt(param)); + parse_log_sense_param(log_sense_page_code(data), log_sense_subpage_code(data), log_sense_param_code(param), param, log_sense_param_len(param) + 4); + } + } + + return 0; +} + +static int parse_read_cap_10(unsigned char *data, unsigned data_len) +{ + uint32_t max_lba; + uint32_t block_size; + bool parsed = parse_read_capacity_10(data, data_len, &max_lba, &block_size); + + printf("Read Capacity 10\n"); + if (!parsed) { + unparsed_data(data, data_len, data, data_len); + return 1; + } + + printf("Max LBA: %u\n", max_lba); + printf("Block Size: %u\n", block_size); + + if (data_len > 8) + unparsed_data(data+8, data_len-8, data, data_len); + return 0; +} + +static int parse_read_cap_16(unsigned char *data, unsigned data_len) +{ + uint64_t max_lba; + uint32_t block_size; + bool prot_enable, thin_provisioning_enabled, thin_provisioning_zero; + unsigned p_type, p_i_exponent, logical_blocks_per_physical_block_exponent, lowest_aligned_lba; + + printf("Read Capacity 16\n"); + + bool parsed = parse_read_capacity_16(data, data_len, &max_lba, &block_size, &prot_enable, + &p_type, &p_i_exponent, &logical_blocks_per_physical_block_exponent, + &thin_provisioning_enabled, &thin_provisioning_zero, &lowest_aligned_lba); + + if (!parsed) { + unparsed_data(data, data_len, data, data_len); + return 1; + } + + printf("Max LBA: %lu\n", max_lba); + printf("Block Size: %u\n", block_size); + printf("Protection enabled: %s\n", yes_no(prot_enable)); + printf("Thin Provisioning enabled: %s\n", yes_no(thin_provisioning_enabled)); + printf("Thin Provisioning zero: %s\n", yes_no(thin_provisioning_zero)); + printf("P Type: %u\n", p_type); + printf("Pi Exponent: %u\n", p_i_exponent); + printf("Logical blocks per physical block exponent: %u\n", logical_blocks_per_physical_block_exponent); + printf("Lowest aligned LBA: %u\n", lowest_aligned_lba); + + return 0; +} + +static int parse_extended_inquiry_data(uint8_t *data, unsigned data_len) +{ + printf("Extended Inquiry\n"); + + if (data_len < EVPD_MIN_LEN) { + printf("Not enough data for EVPD header\n"); + unparsed_data(data, data_len, data, data_len); + return 1; + } + + printf("Peripheral Qualifier: %d\n", evpd_peripheral_qualifier(data)); + printf("Peripheral Device Type: %d\n", evpd_peripheral_device_type(data)); + printf("EVPD page code: 0x%02X\n", evpd_page_code(data)); + printf("EVPD data len: %u\n", evpd_page_len(data)); + + if (!evpd_is_valid(data, data_len)) + return 0; + + uint8_t *page_data = evpd_page_data(data); + + if (evpd_is_ascii_page(evpd_page_code(data))) { + printf("ASCII len: %u\n", evpd_ascii_len(page_data)); + printf("ASCII string: '%*s'\n", evpd_ascii_len(page_data), evpd_ascii_data(page_data)); + if (evpd_ascii_post_data_len(page_data, data_len) > 0) + unparsed_data(evpd_ascii_post_data(page_data), evpd_ascii_post_data_len(page_data, data_len), data, data_len); + } else { + /* TODO: parse more of the extended inquiry pages */ + unparsed_data(page_data, evpd_page_len(data), data, data_len); + } + return 0; +} + +static int parse_simple_inquiry_data(uint8_t *data, unsigned data_len) +{ + int device_type; + scsi_vendor_t vendor; + scsi_model_t model; + scsi_fw_revision_t rev; + scsi_serial_t serial; + bool parsed = parse_inquiry(data, data_len, &device_type, vendor, model, rev, serial); + + printf("Simple Inquiry\n"); + + if (!parsed) { + unparsed_data(data, data_len, data, data_len); + return 1; + } + + printf("Device Type: %d\n", device_type); + printf("Vendor: %s\n", vendor); + printf("Model: %s\n", model); + printf("FW Revision: %s\n", rev); + printf("Serial: %s\n", serial); + return 0; +} + +static int parse_inquiry_data(uint8_t *cdb, unsigned cdb_len, uint8_t *data, unsigned data_len) +{ + if (cdb_len < 6) + return 1; + + if (cdb[1] & 1) + return parse_extended_inquiry_data(data, data_len); + else + return parse_simple_inquiry_data(data, data_len); +} + +static void parse_mode_sense_block_descriptor(uint8_t *data, unsigned data_len) +{ + if (data_len != BLOCK_DESCRIPTOR_LENGTH) { + printf("Unknown block descriptor\n"); + unparsed_data(data, data_len, data, data_len); + return; + } + + printf("Density code: %u\n", block_descriptor_density_code(data)); + printf("Num blocks: %u\n", block_descriptor_num_blocks(data)); + printf("Block length: %u\n", block_descriptor_block_length(data)); +} + +static void parse_mode_sense_data_page(uint8_t *data, unsigned data_len) +{ + bool subpage_format = mode_sense_data_subpage_format(data); + printf("\nPage code: 0x%02x\n", mode_sense_data_page_code(data)); + + if (subpage_format) + printf("Subpage code: 0x%02x\n", mode_sense_data_subpage_code(data)); + printf("Page Saveable: %s\n", yes_no(mode_sense_data_parameter_saveable(data))); + + printf("Page len: %u\n", mode_sense_data_param_len(data)); + /* TODO: Parse the mode sense data */ + unparsed_data(mode_sense_data_param(data), mode_sense_data_param_len(data), data, data_len); +} + +static int parse_mode_sense_10(uint8_t *data, unsigned data_len) +{ + printf("Mode Sense 10\n"); + + if (data_len < MODE_SENSE_10_MIN_LEN) { + printf("Not enough data for MODE SENSE header\n"); + unparsed_data(data, data_len, data, data_len); + return 1; + } + + printf("Mode Sense 10 data length: %u\n", mode_sense_10_data_len(data)); + printf("Mode Sense 10 medium type: %u\n", mode_sense_10_medium_type(data)); + printf("Mode Sense 10 Device specific param: %u\n", mode_sense_10_device_specific_param(data)); + printf("Mode Sense 10 Long LBA: %s\n", yes_no(mode_sense_10_long_lba(data))); + printf("Mode Sense 10 Block descriptor length: %u\n", mode_sense_10_block_descriptor_length(data)); + + if (data_len < mode_sense_10_expected_length(data)) { + printf("Not enough data to parse full data\n"); + unparsed_data(data + MODE_SENSE_10_MIN_LEN, data_len - MODE_SENSE_10_MIN_LEN, data, data_len); + return 1; + } + + if (mode_sense_10_block_descriptor_length(data) > 0) { + const unsigned safe_desc_len = safe_len(data, data_len, mode_sense_10_block_descriptor_data(data), mode_sense_10_block_descriptor_length(data)); + parse_mode_sense_block_descriptor(mode_sense_10_block_descriptor_data(data), safe_desc_len); + } + + unsigned remaining_len; + uint8_t *mode_page; + for_all_mode_sense_10_pages(data, data_len, mode_page, remaining_len) { + printf("\nRemaining len: %u\n", remaining_len); + parse_mode_sense_data_page(mode_page, remaining_len); + } + return 0; +} + +static int parse_mode_sense_6(uint8_t *data, unsigned data_len) +{ + printf("Mode Sense 6\n"); + + if (data_len < MODE_SENSE_6_MIN_LEN) { + printf("Not enough data for MODE SENSE 6 header\n"); + unparsed_data(data, data_len, data, data_len); + return 1; + } + + printf("Mode Sense 6 data length: %u\n", mode_sense_6_data_len(data)); + printf("Mode Sense 6 medium type: %u\n", mode_sense_6_medium_type(data)); + printf("Mode Sense 6 Device specific param: %u\n", mode_sense_6_device_specific_param(data)); + printf("Mode Sense 6 Block descriptor length: %u\n", mode_sense_6_block_descriptor_length(data)); + + if (data_len < mode_sense_6_expected_length(data)) { + printf("Not enough data to parse full data\n"); + unparsed_data(data + MODE_SENSE_6_MIN_LEN, data_len - MODE_SENSE_6_MIN_LEN, data, data_len); + return 1; + } + + if (!mode_sense_6_is_valid_header(data, data_len)) { + printf("Bad data in mode sense header\n"); + return 1; + } + + if (mode_sense_6_block_descriptor_length(data) > 0) { + unsigned safe_desc_len = safe_len(data, data_len, mode_sense_6_block_descriptor_data(data), mode_sense_6_block_descriptor_length(data)); + parse_mode_sense_block_descriptor(mode_sense_6_block_descriptor_data(data), safe_desc_len); + } + + unsigned remaining_len; + uint8_t *mode_page; + for_all_mode_sense_6_pages(data, data_len, mode_page, remaining_len) { + printf("Remaining len: %u\n", remaining_len); + parse_mode_sense_data_page(mode_page, remaining_len); + } + return 0; +} + +static void read_defect_data_format(address_desc_format_e fmt, uint8_t *data, unsigned len) +{ + const unsigned fmt_len = read_defect_data_fmt_len(fmt); + if (fmt_len == 0) { + printf("Unknown format to decode\n"); + unparsed_data(data, len, data, len); + return; + } + for (; len > fmt_len; data += fmt_len, len -= fmt_len) { + switch (fmt) { + case ADDRESS_FORMAT_SHORT: + printf("\t%u\n", get_uint32(data, 0)); + break; + case ADDRESS_FORMAT_LONG: + printf("\t%lu\n", get_uint64(data, 0)); + break; + case ADDRESS_FORMAT_INDEX_OFFSET: + printf("\tC=%u H=%u B=%u\n", + format_address_byte_from_index_cylinder(data), + format_address_byte_from_index_head(data), + format_address_byte_from_index_bytes(data)); + break; + case ADDRESS_FORMAT_PHYSICAL: + printf("\tC=%u H=%u S=%u\n", + format_address_physical_cylinder(data), + format_address_physical_head(data), + format_address_physical_sector(data)); + break; + case ADDRESS_FORMAT_VENDOR: + printf("\t%08x\n", get_uint32(data, 0)); + break; + default: + break; + } + } +} + +static int parse_read_defect_data_10(uint8_t *data, unsigned data_len) +{ + printf("Read Defect Data 10\n"); + + if (!read_defect_data_10_hdr_is_valid(data, data_len)) { + printf("Header is not valid\n"); + unparsed_data(data, data_len, data, data_len); + return 1; +} + + printf("Plist: %s\n", yes_no(read_defect_data_10_is_plist_valid(data))); + printf("Glist: %s\n", yes_no(read_defect_data_10_is_glist_valid(data))); + printf("Format: %s\n", read_defect_data_format_to_str(read_defect_data_10_list_format(data))); + printf("Len: %u\n", read_defect_data_10_len(data)); + + if (!read_defect_data_10_is_valid(data, data_len)) + return 0; + + if (data_len > 0) { + const unsigned len = safe_len(data, data_len, read_defect_data_10_data(data), read_defect_data_10_len(data)); + read_defect_data_format(read_defect_data_10_list_format(data), read_defect_data_10_data(data), len); + } + return 0; +} + +static int parse_read_defect_data_12(uint8_t *data, unsigned data_len) +{ + printf("Read Defect Data 12\n"); + + if (!read_defect_data_12_hdr_is_valid(data, data_len)) { + printf("Header is not valid\n"); + unparsed_data(data, data_len, data, data_len); + return 1; + } + + printf("Plist: %s\n", yes_no(read_defect_data_12_is_plist_valid(data))); + printf("Glist: %s\n", yes_no(read_defect_data_12_is_glist_valid(data))); + printf("Format: %s\n", read_defect_data_format_to_str(read_defect_data_12_list_format(data))); + printf("Len: %u\n", read_defect_data_12_len(data)); + + if (!read_defect_data_12_is_valid(data, data_len)) + return 0; + + if (data_len > 0) { + const unsigned len = safe_len(data, data_len, read_defect_data_10_data(data), read_defect_data_10_len(data)); + read_defect_data_format(read_defect_data_12_list_format(data), read_defect_data_12_data(data), len); + } + return 0; +} + +static void parse_receive_diagnostic_results_pg_0(uint8_t *data, unsigned data_len) +{ + printf("Supported Receive Diagnostic Results pages:\n"); + for (; data_len > 0; data_len--, data++) + printf("\t0x%02x\n", data[0]); +} + +static unsigned parse_enclosure_descriptor(uint8_t *data, unsigned data_len) +{ + char name[16]; + + if (!ses_config_enclosure_descriptor_is_valid(data, data_len)) + return data_len; + + printf("\nProcess identifier: %u\n", ses_config_enclosure_descriptor_process_identifier(data)); + printf("Num processes: %u\n", ses_config_enclosure_descriptor_num_processes(data)); + printf("Subenclosure identifier: %u\n", ses_config_enclosure_descriptor_subenclosure_identifier(data)); + printf("Num Type Descriptors: %u\n", ses_config_enclosure_descriptor_num_type_descriptors(data)); + printf("Enclosure descriptor len: %u\n", ses_config_enclosure_descriptor_len(data)); + printf("Logical identified: %016lx\n", ses_config_enclosure_descriptor_logical_identifier(data)); + + ses_config_enclosure_descriptor_vendor_identifier(data, name, sizeof(name)); + printf("Vendor identifier: %s\n", name); + + ses_config_enclosure_descriptor_product_identifier(data, name, sizeof(name)); + printf("Product identifier: %s\n", name); + + ses_config_enclosure_descriptor_revision_level(data, name, sizeof(name)); + printf("Revision level: %s\n", name); + + printf("Vendor info len: %u\n", ses_config_enclosure_descriptor_vendor_len(data)); + if (ses_config_enclosure_descriptor_vendor_len(data) > 0) + unparsed_data(ses_config_enclosure_descriptor_vendor_info(data), ses_config_enclosure_descriptor_vendor_len(data), data, data_len); + + return ses_config_enclosure_descriptor_len(data) + 4; +} + +static void parse_receive_diagnostic_results_pg_1(uint8_t *data, unsigned data_len) +{ + unsigned parsed_len = 8; + unsigned num_enclosures; + + if (!ses_config_is_valid(data, data_len)) + return; + + printf("SES config page:\n"); + num_enclosures = ses_config_num_sub_enclosures(data); + printf("Num subenclosures: %u\n", num_enclosures); + printf("Generation code: %u\n", ses_config_generation(data)); + + for (; num_enclosures > 0 && parsed_len < data_len; num_enclosures--) + parsed_len += parse_enclosure_descriptor(ses_config_sub_enclosure(data), data_len-parsed_len); + + /* TODO: There can be additional enclosures and type descriptors and strings */ + unparsed_data(data + parsed_len, data_len - parsed_len, data, data_len); +} + +static int parse_receive_diagnostic_results(uint8_t *data, unsigned data_len) +{ + printf("Receive Diagnostic Results\n"); + + if (!recv_diag_is_valid(data, data_len)) { + printf("Data is not valid\n"); + return 1; + } + + printf("Page code: 0x%02X\n", recv_diag_get_page_code(data)); + printf("Page code specific: 0x%02x\n", recv_diag_get_page_code_specific(data)); + printf("Len: %u\n", recv_diag_get_len(data)); + + switch (recv_diag_get_page_code(data)) { + case 0: + parse_receive_diagnostic_results_pg_0(recv_diag_data(data), safe_len(data, data_len, recv_diag_data(data), recv_diag_get_len(data))); + break; + case 1: + parse_receive_diagnostic_results_pg_1(data, data_len); + break; + default: + unparsed_data(recv_diag_data(data), recv_diag_get_len(data), data, data_len); /* TODO: parse SES pages */ + break; + } + return 0; +} + +static void process_data(char *cdb_src, char *sense_src, char *data_src) +{ + unsigned char *cdb = NULL; + unsigned char *sense = NULL; + unsigned char *data = NULL; + int cdb_len, sense_len, data_len; + + printf("CDB: %s\n", cdb_src); + printf("Sense: %s\n", sense_src); + printf("Data: %s\n", data_src); + + if (cdb_src == NULL || sense_src == NULL || data_src == NULL) { + printf("Input csv is invalid\n"); + return; + } + + cdb = parse_hex(cdb_src, &cdb_len); + sense = parse_hex(sense_src, &sense_len); + data = parse_hex(data_src, &data_len); + + printf("CDB Len: %d\n", cdb_len); + printf("Sense Len: %d\n", sense_len); + printf("Data Len: %d\n", data_len); + + if (cdb_len < 0) { + printf("Failed to parse CDB\n"); + goto Exit; + } + if (sense_len < 0) { + printf("Failed to parse SENSE\n"); + goto Exit; + } + if (data_len < 0) { + printf("Failed to parse DATA\n"); + goto Exit; + } + + if (sense_len > 0) { + printf("Sense data indicates an error, not parsing data\n"); + sense_dump(sense, sense_len); + goto Exit; + } + + switch (cdb[0]) { + case 0x4D: parse_log_sense(data, data_len); break; + case 0x25: parse_read_cap_10(data, data_len); break; + case 0x9E: parse_read_cap_16(data, data_len); break; + case 0x12: parse_inquiry_data(cdb, cdb_len, data, data_len); break; + case 0x5A: parse_mode_sense_10(data, data_len); break; + case 0x1A: parse_mode_sense_6(data, data_len); break; + case 0x1C: parse_receive_diagnostic_results(data, data_len); break; + case 0x37: parse_read_defect_data_10(data, data_len); break; + case 0xB7: parse_read_defect_data_12(data, data_len); break; + default: + printf("Unsupported CDB opcode %02X\n", cdb[0]); + unparsed_data(data, data_len, data, data_len); + break; + } + +Exit: + free(cdb); + free(sense); + free(data); +} + +static ssize_t read_newline(char *buf, size_t buf_sz) +{ + ssize_t data_read = 0; + + while (data_read < (ssize_t)buf_sz) { + int ch = getchar(); + if (ch == EOF) + break; + + if (ch == '\n' || ch == '\r') + return data_read; + + buf[data_read++] = ch; + } + + return data_read; +} + +int main(int argc, char **argv) +{ + char *cdb_src, *sense_src, *data_src; + + if (argc != 4 && argc != 1) { + printf("Usage: %s \"cdb\" \"sense\" \"data\"\n", argv[0]); + return 1; + } + + if (argc == 1) { + while (__AFL_LOOP(30000)) { + char buf[64*1024]; + memset(buf, 0, sizeof(buf)); + int ret = read_newline(buf, sizeof(buf)); + if (ret <= 0) { + printf("Insufficient input\n"); + return 1; + } + buf[ret] = 0; + + csvtok_reset(); + csvtok(buf); + cdb_src = csvtok(NULL); + sense_src = csvtok(NULL); + data_src = csvtok(NULL); + process_data(cdb_src, sense_src, data_src); + printf("=================================================================================\n"); + } + } else { + cdb_src = argv[1]; + sense_src = argv[2]; + data_src = argv[3]; + process_data(cdb_src, sense_src, data_src); + } + + return 0; +} diff --git a/test/samples/breakout.py b/test/samples/breakout.py new file mode 100755 index 0000000..12ccb88 --- /dev/null +++ b/test/samples/breakout.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +import sys +import subprocess + +files = { + ',4d ' : 'log_sense', + ',25 ' : 'read_cap_10', + ',9e ' : 'read_cap_16', + ',12 ' : 'inquiry', + ',5a ' : 'mode_sense_10', + ',1a ' : 'mode_sense_6', + ',37 ' : 'read_defect_data_10', + ',b7 ' : 'read_defect_data_12', + ',1c ' : 'receive_diagnostics', +} + +for key in files.keys(): + filename = files[key] + '.csv.bz2' + f = subprocess.Popen(['/bin/bzip2', '-z', '-c', '-9'], stdin=subprocess.PIPE, stdout=file(filename, 'w')) + if f is None: + print 'Failed to create process for', filename + files[key] = f + +for line in sys.stdin: + prefix = line[0:4] + f = files.get(prefix, None) + if f is None: + print '"%s"' % prefix + continue + f.stdin.write(line) + +for key in files.keys(): + print 'Closing', key + files[key].stdin.close() + files[key].wait() + print 'Done' diff --git a/test/samples/parse_file.py b/test/samples/parse_file.py new file mode 100755 index 0000000..a383476 --- /dev/null +++ b/test/samples/parse_file.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +import sys +import csv +import os + +def parse_file(f): + c = csv.reader(f) + for line in c: + msg = line[0] + if msg != '': continue + if len(line) != 4: continue + + cdb = line[1] + sense = line[2] + data = line[3] + + print('Parsing CDB: %s' % cdb) + print('Parsing Sense: %s' % sense) + print('Parsing Data: %s' % data) + sys.stdout.flush() + sys.stderr.flush() + os.system('../parse_scsi "%s" "%s" "%s"' % (cdb, sense, data)) + sys.stdout.flush() + sys.stderr.flush() + print('=========================================================================\n') + +if len(sys.argv) > 1: + for filename in sys.argv[1:]: + print('Parsing file %s' % filename) + f = file(filename, 'r') + parse_file(f) + print('Done') + print('') +else: + parse_file(sys.stdin) diff --git a/test/scsi_inquiry.c b/test/scsi_inquiry.c index 21dc6da..eadabf5 100644 --- a/test/scsi_inquiry.c +++ b/test/scsi_inquiry.c @@ -16,6 +16,8 @@ #include "scsicmd.h" #include "main.h" +#include "sense_dump.h" +#include "parse_extended_inquiry.h" #include #include #include @@ -25,13 +27,45 @@ #include #include #include +#include -void do_command(int fd) +static void dump_evpd_ascii(unsigned char *data, uint16_t data_len) +{ + const uint16_t ascii_len = (data[0] << 8) | data[1]; + bool not_in_string = true; + uint16_t i; + + printf("ASCII len: %u\n", ascii_len); + printf("ASCII data: \""); + for (i = 2; i < ascii_len + 2; i++) + putchar(data[i]); + printf("\"\n"); + + for (; i < data_len; i++) { + if (isprint(data[i])) { + if (not_in_string) { + printf("Vendor string: \""); + not_in_string = false; + } + putchar(data[i]); + } else { + if (!not_in_string) { + printf("\"\n"); + not_in_string = true; + } + } + } + if (!not_in_string) + printf("\"\n"); +} + +static void dump_evpd(int fd, uint8_t page) { unsigned char cdb[32]; unsigned char buf[512] ; - unsigned cdb_len = cdb_inquiry_simple(cdb, sizeof(buf)); + unsigned cdb_len = cdb_inquiry(cdb, true, page, sizeof(buf)); + printf("\n\nExtended Inquiry Page %u (%02x):\n", page, page); bool ret = submit_cmd(fd, cdb, cdb_len, buf, sizeof(buf), SG_DXFER_FROM_DEV); if (!ret) { fprintf(stderr, "Failed to submit command\n"); @@ -50,6 +84,84 @@ void do_command(int fd) printf("Read %u bytes\n", buf_len); + response_dump(buf, buf_len); + + if (buf_len < EVPD_MIN_LEN) { + printf("Buffer returned is too small, got %d expected minimum of %d", buf_len, EVPD_MIN_LEN); + return; + } + + if (page >= 0x01 && page <= 0x7F) { + dump_evpd_ascii(evpd_page_data(buf), evpd_page_len(buf)); + } +} + +static void do_extended_inquiry(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[512] ; + unsigned cdb_len = cdb_inquiry(cdb, true, 0, sizeof(buf)); + + printf("\n\nExtended Inquiry:\n"); + bool ret = submit_cmd(fd, cdb, cdb_len, buf, sizeof(buf), SG_DXFER_FROM_DEV); + if (!ret) { + fprintf(stderr, "Failed to submit command\n"); + return; + } + + unsigned char *sense = NULL; + unsigned sense_len = 0; + unsigned buf_len = 0; + ret = read_response_buf(fd, &sense, &sense_len, &buf_len); + + if (sense) { + printf("error while reading response buffer, nothing to show\n"); + return; + } + + printf("Read %u bytes\n", buf_len); + + response_dump(buf, buf_len); + + if (buf_len < EVPD_MIN_LEN) { + printf("Buffer returned is too small, got %d expected minimum of %d", buf_len, EVPD_MIN_LEN); + return; + } + + printf("Peripheral Qualifier: %u\n", evpd_peripheral_qualifier(buf)); + printf("Peripheral Device Type: %u\n", evpd_peripheral_device_type(buf)); + + uint16_t max_page_idx = evpd_page_len(buf) + 4; + uint16_t i; + for (i = 4; i < max_page_idx; i++) + dump_evpd(fd, buf[i]); +} + +static void do_simple_inquiry(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[512] ; + unsigned cdb_len = cdb_inquiry_simple(cdb, 96); + + bool ret = submit_cmd(fd, cdb, cdb_len, buf, sizeof(buf), SG_DXFER_FROM_DEV); + if (!ret) { + fprintf(stderr, "Failed to submit command\n"); + return; + } + + unsigned char *sense = NULL; + unsigned sense_len = 0; + unsigned buf_len = 0; + ret = read_response_buf(fd, &sense, &sense_len, &buf_len); + + if (sense) { + printf("error while reading response buffer, nothing to show\n"); + return; + } + + printf("Read %u bytes\n", buf_len); + response_dump(buf, buf_len); + int device_type; scsi_vendor_t vendor; scsi_model_t model; @@ -67,3 +179,9 @@ void do_command(int fd) printf("Rev: %s\n", rev); printf("Serial: %s\n", serial); } + +void do_command(int fd) +{ + do_simple_inquiry(fd); + do_extended_inquiry(fd); +} diff --git a/test/scsi_log_sense.c b/test/scsi_log_sense.c index 1c545fa..083a009 100644 --- a/test/scsi_log_sense.c +++ b/test/scsi_log_sense.c @@ -15,7 +15,10 @@ */ #include "scsicmd.h" +#include "scsicmd_utils.h" + #include "main.h" +#include "sense_dump.h" #include #include #include @@ -26,12 +29,6 @@ #include #include -static inline uint16_t get_uint16(unsigned char *buf, int start) -{ - return (uint16_t)buf[start] << 8 | - (uint16_t)buf[start+1]; -} - static void dump_page(int fd, uint8_t page, uint8_t subpage) { unsigned char cdb[32]; diff --git a/test/scsi_mode_sense.c b/test/scsi_mode_sense.c new file mode 100644 index 0000000..e911e58 --- /dev/null +++ b/test/scsi_mode_sense.c @@ -0,0 +1,95 @@ +/* Copyright 2014 Baruch Even + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "scsicmd.h" +#include "main.h" +#include "sense_dump.h" +#include "parse_mode_sense.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void do_command(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[4096]; + unsigned cdb_len = cdb_mode_sense_10(cdb, true, false, PAGE_CONTROL_CURRENT, 0x3F, 0xFF, sizeof(buf)); + + memset(buf, 0, sizeof(buf)); + printf("List all supported pages\n"); + bool ret = submit_cmd(fd, cdb, cdb_len, buf, sizeof(buf), SG_DXFER_FROM_DEV); + if (!ret) { + fprintf(stderr, "Failed to submit command\n"); + return; + } + + unsigned char *sense = NULL; + unsigned sense_len = 0; + unsigned buf_len = 0; + ret = read_response_buf(fd, &sense, &sense_len, &buf_len); + + if (sense) { + printf("error while reading response buffer, nothing to show\n"); + return; + } + + printf("Read %u bytes\n", buf_len); + response_dump(buf, buf_len); + + if (buf_len < MODE_SENSE_10_MIN_LEN) { + printf("Returned data is too short, expected a minimum of %u bytes and got only %u\n", MODE_SENSE_10_MIN_LEN, buf_len); + return; + } + + printf("Mode data len: %u\n", mode_sense_10_data_len(buf)); + printf("Medium Type: %u\n", mode_sense_10_medium_type(buf)); + printf("Device specific param: %u\n", mode_sense_10_device_specific_param(buf)); + printf("Long LBA: %s\n", mode_sense_10_long_lba(buf) ? "yes" : "no"); + printf("Block Descriptor length: %u\n", mode_sense_10_block_descriptor_length(buf)); + + if (buf_len < MODE_SENSE_10_MIN_LEN + mode_sense_10_block_descriptor_length(buf)) + { + printf("Not enough data for the block descriptor length\n"); + return; + } + + if (mode_sense_10_long_lba(buf)) { + printf("Don't know how to parse the block descriptor for a long lba yet\n"); + } else { + uint8_t *bdb = mode_sense_10_block_descriptor_data(buf); + + putchar('\n'); + printf("Density code: %u\n", block_descriptor_density_code(bdb)); + printf("Num blocks: %u\n", block_descriptor_num_blocks(bdb)); + printf("Block length: %u\n", block_descriptor_block_length(bdb)); + } + + if (buf_len < MODE_SENSE_10_MIN_LEN + mode_sense_10_block_descriptor_length(buf) + mode_sense_10_data_len(buf)) + { + printf("Not enough data for the mode data length\n"); + return; + } + + putchar('\n'); + //uint8_t *mode_data = mode_sense_10_mode_data(buf); + +} diff --git a/test/scsi_receive_diagnostics.c b/test/scsi_receive_diagnostics.c new file mode 100644 index 0000000..3238c5a --- /dev/null +++ b/test/scsi_receive_diagnostics.c @@ -0,0 +1,101 @@ +/* Copyright 2014 Baruch Even + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "scsicmd.h" +#include "parse_receive_diagnostics.h" +#include "main.h" +#include "sense_dump.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void dump_page(int fd, uint8_t page) +{ + unsigned char cdb[32]; + unsigned char buf[16*1024]; + unsigned cdb_len = cdb_receive_diagnostics(cdb, true, page, sizeof(buf)); + + printf("List page %02X\n", page); + bool ret = submit_cmd(fd, cdb, cdb_len, buf, sizeof(buf), SG_DXFER_FROM_DEV); + if (!ret) { + fprintf(stderr, "Failed to submit command\n"); + return; + } + + unsigned char *sense = NULL; + unsigned sense_len = 0; + unsigned buf_len = 0; + ret = read_response_buf(fd, &sense, &sense_len, &buf_len); + + if (sense) { + printf("error while reading response buffer, nothing to show\n"); + return; + } + + printf("Read %u bytes\n", buf_len); + response_dump(buf, buf_len); + printf("\n"); +} + +void do_command(int fd) +{ + unsigned char cdb[32]; + unsigned char buf[16*1024]; + unsigned cdb_len = cdb_receive_diagnostics(cdb, true, 0, sizeof(buf)); + + printf("List all supported pages\n"); + bool ret = submit_cmd(fd, cdb, cdb_len, buf, sizeof(buf), SG_DXFER_FROM_DEV); + if (!ret) { + fprintf(stderr, "Failed to submit command\n"); + return; + } + + unsigned char *sense = NULL; + unsigned sense_len = 0; + unsigned buf_len = 0; + ret = read_response_buf(fd, &sense, &sense_len, &buf_len); + + if (sense) { + printf("error while reading response buffer, nothing to show\n"); + return; + } + + printf("Read %u bytes\n", buf_len); + response_dump(buf, buf_len); + + if (buf_len < RECV_DIAG_MIN_LEN) { + printf("receive diagnostics list must have at least 4 bytes\n"); + return; + } + + if (recv_diag_get_page_code(buf) != 0) { + printf("expected to receive receive diagnostics page 0\n"); + return; + } + + uint16_t num_pages = recv_diag_get_len(buf); + uint16_t i; + for (i = 0; i < num_pages; i++) { + dump_page(fd, buf[4 + i]); + } +} diff --git a/test/sense_dump.c b/test/sense_dump.c index 308abf2..bb180e1 100644 --- a/test/sense_dump.c +++ b/test/sense_dump.c @@ -3,6 +3,17 @@ #include #include +void cdb_dump(unsigned char *cdb, int cdb_len) +{ + int i; + + printf("CDB: "); + for (i = 0; i < cdb_len; i++) { + printf("%02x ", cdb[i]); + } + printf("\n"); +} + void response_dump(unsigned char *buf, int buf_len) { int i; diff --git a/test/sense_dump.h b/test/sense_dump.h index f19e4bb..38fec9e 100644 --- a/test/sense_dump.h +++ b/test/sense_dump.h @@ -3,5 +3,6 @@ void sense_dump(unsigned char *sense, int sense_len); void response_dump(unsigned char *buf, int buf_len); +void cdb_dump(unsigned char *cdb, int cdb_len); #endif