update print_all_p
to handle multi line passwords/nots
This commit is contained in:
parent
375bd753e9
commit
12905ad6b7
@ -272,13 +272,36 @@ void arg_print_all_p(Buffer &decrypted_buffer, std::string &user_pass)
|
||||
Index *index = (Index *)decrypted_buffer.buffer;
|
||||
LoginInfo *pass = (LoginInfo *)(decrypted_buffer.buffer + sizeof(Index));
|
||||
|
||||
std::vector<size_t> notes;
|
||||
printf("\n");
|
||||
|
||||
auto is_note = [](const uint8_t *c)
|
||||
{ while(*c!='\0'){if(*c == '\n') return true;c++;} return false; };
|
||||
|
||||
for (size_t i = 0; i < index->count; i++)
|
||||
{
|
||||
const uint8_t *p = decrypted_buffer.buffer + pass[i].password + index->offset;
|
||||
if (is_note(p))
|
||||
{
|
||||
notes.push_back(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("label: %-20s\t", decrypted_buffer.buffer + pass[i].label + index->offset);
|
||||
printf("username: %-30s\t", decrypted_buffer.buffer + pass[i].username + index->offset);
|
||||
printf("password: %s\n", decrypted_buffer.buffer + pass[i].password + index->offset);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < notes.size(); i++)
|
||||
{
|
||||
size_t j = notes[i];
|
||||
printf("\n");
|
||||
printf("-----------------------------------------------------------------------------------------------------------\n");
|
||||
printf("label: %-20s\t", decrypted_buffer.buffer + pass[j].label + index->offset);
|
||||
printf("username: %-30s\t", decrypted_buffer.buffer + pass[j].username + index->offset);
|
||||
printf("-----------------------------------------------------------------------------------------------------------\n");
|
||||
printf("%s", decrypted_buffer.buffer + pass[j].password + index->offset);
|
||||
}
|
||||
}
|
||||
|
||||
void arg_change(Buffer &decrypted_buffer, Buffer &encrypted_buffer, std::string &user_pass)
|
||||
|
Loading…
x
Reference in New Issue
Block a user