Finnaly, a working version, optimised!

This commit is contained in:
Afonso Clerigo Mendes de Sousa 2025-02-28 19:40:42 +00:00
parent dfd25f897c
commit 4c16c8b953
3 changed files with 17 additions and 18 deletions

BIN
KeyMaster

Binary file not shown.

Binary file not shown.

View File

@ -180,6 +180,8 @@ int main(void)
req.level = 0; req.level = 0;
send(sockfd, &req, sizeof(req), 0); send(sockfd, &req, sizeof(req), 0);
recv(sockfd, &req, sizeof(req), 0);
if (req.level == -1) if (req.level == -1)
{ {
printf("No passwords found\n"); printf("No passwords found\n");
@ -187,26 +189,23 @@ int main(void)
else else
{ {
// Debug the response // Debug the response
printf("Level: %d\tKey: %s\n", req.level, req.key); for (size_t i = 0; i < req.level; i++)
}
/* for (int i = 0; i < 256; i++)
{
Request req1;
req1.type = 0;
memset(&req1.key, 0, sizeof(req1.key));
req1.ID = 0;
req1.level = i;
send(sockfd, &req1, sizeof(req1), 0);
// Receive response from the server
recv(sockfd, &req1, sizeof(req1), 0);
if (req1.level != -1 && strlen(req1.key) > 0)
{ {
printf("Level: %d\tKey: %s\n", req1.level, req1.key); Request req1;
req1.type = 0;
memset(&req1.key, 0, sizeof(req1.key));
req1.ID = 1;
req1.level = req.key[i];
send(sockfd, &req1, sizeof(req1), 0);
recv(sockfd, &req1, sizeof(req1), 0);
if (req1.level != -1 && strlen(req1.key) > 0)
{
printf("Level: %d\tKey: %s\n", req1.level, req1.key);
}
} }
} */ }
printf("<------->\n\n"); printf("<------->\n\n");
choice = prompNormalRequest(">> "); choice = prompNormalRequest(">> ");