Updated to finnaly show existing passwords.

This commit is contained in:
Afonso Clerigo Mendes de Sousa 2025-02-27 20:56:00 +00:00
parent ad2ff3304a
commit 2a743c971b
3 changed files with 11 additions and 10 deletions

BIN
KeyMaster

Binary file not shown.

Binary file not shown.

View File

@ -169,21 +169,22 @@ int main(void)
printf("\nList of existing passwords:\n<------->\n"); printf("\nList of existing passwords:\n<------->\n");
Request req; Request req;
for (size_t i = 0; i < 254; i++) for (int i = 0; i < 256; i++)
{ {
// Send a request with type 0 (REQUEST) Request req1;
req.type = 0; req1.type = 0;
memset(&req, 0, sizeof(req)); memset(&req1.key, 0, sizeof(req1.key));
req.ID = 0; req1.ID = 0;
req.level = (int)i; req1.level = i;
send(sockfd, &req, sizeof(Request), 0);
send(sockfd, &req1, sizeof(req1), 0);
// Receive response from the server // Receive response from the server
recv(sockfd, &req, sizeof(req), 0); recv(sockfd, &req1, sizeof(req1), 0);
if (req.level != -1) if (req1.level != -1 && strlen(req1.key) > 0)
{ {
printf("Level: %d\tKey: %s\n", req.level, req.key); printf("Level: %d\tKey: %s\n", req1.level, req1.key);
} }
} }