Finnaly, a working version, optimised!
This commit is contained in:
parent
dfd25f897c
commit
4c16c8b953
BIN
bin/KeyMaster
BIN
bin/KeyMaster
Binary file not shown.
15
src/main.c
15
src/main.c
@ -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;
|
Request req1;
|
||||||
|
|
||||||
req1.type = 0;
|
req1.type = 0;
|
||||||
memset(&req1.key, 0, sizeof(req1.key));
|
memset(&req1.key, 0, sizeof(req1.key));
|
||||||
req1.ID = 0;
|
req1.ID = 1;
|
||||||
req1.level = i;
|
req1.level = req.key[i];
|
||||||
|
|
||||||
send(sockfd, &req1, sizeof(req1), 0);
|
send(sockfd, &req1, sizeof(req1), 0);
|
||||||
|
|
||||||
// Receive response from the server
|
|
||||||
recv(sockfd, &req1, sizeof(req1), 0);
|
recv(sockfd, &req1, sizeof(req1), 0);
|
||||||
if (req1.level != -1 && strlen(req1.key) > 0)
|
if (req1.level != -1 && strlen(req1.key) > 0)
|
||||||
{
|
{
|
||||||
printf("Level: %d\tKey: %s\n", req1.level, req1.key);
|
printf("Level: %d\tKey: %s\n", req1.level, req1.key);
|
||||||
}
|
}
|
||||||
} */
|
}
|
||||||
|
}
|
||||||
|
|
||||||
printf("<------->\n\n");
|
printf("<------->\n\n");
|
||||||
choice = prompNormalRequest(">> ");
|
choice = prompNormalRequest(">> ");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user