?? ??? ?std::ifstream ifs(datfile.c_str(), std::ifstream::in | std::ifstream::binary);
?? ??? ?if (!ifs.is_open()) {
?? ??? ??? ?LOG_ERROR("cant open dat file: " << datfile);
?? ??? ??? ?return ErrArgument;
?? ??? ?}
?? ??? ?std::vector<uint8_t> real_bytes3(48, 0);
?? ??? ?ifs.seekg(0, ifs.beg);
?? ??? ?ifs.read(reinterpret_cast<char*>(&real_bytes3[0]), 48);
?? ??? ?std::vector<uint8_t> real_bytes4(48, 0);
?? ??? ?ifs.seekg(-880, ifs.beg);
?? ??? ?ifs.read(reinterpret_cast<char*>(&real_bytes4[0]), 48);
?? ??? ?std::vector<uint8_t> real_bytes5(48, 0);
?? ??? ?ifs.seekg(0, ifs.beg);
?? ??? ?ifs.read(reinterpret_cast<char*>(&real_bytes5[0]), 48);
real_bytes4和real_bytes5读取出来的全是0. 意味着读取失败。
问题出在
??ifs.seekg(-880, ifs.beg);
不能越界。
?
?
?