Я полный n00b до C и пытался найти ошибки, но не смог выяснить, что нужно изменить, чтобы это работало. Я пытаюсь скомпилировать файл exploitdb. c (764. c). Следуя этому руководству , я внес все изменения, но он все равно не скомпилируется.
Ошибка:
$gcc exploit2.c -o 764 -lcrypto
exploit2.c: In function ‘send_ssl_packet’:
exploit2.c:641:27: error: assignment of read-only location ‘*p’
641 | #define s2n(s,c) ((c[0]=(unsigned char)(((s)>> 8)&0xff), c[1]=(unsigned char)(((s) )&0xff)),c+=2)
| ^
exploit2.c:908:2: note: in expansion of macro ‘s2n’
908 | s2n(tot_len, p);
| ^~~
exploit2.c:641:65: error: assignment of read-only location ‘*(p + 1)’
641 | #define s2n(s,c) ((c[0]=(unsigned char)(((s)>> 8)&0xff), c[1]=(unsigned char)(((s) )&0xff)),c+=2)
| ^
exploit2.c:908:2: note: in expansion of macro ‘s2n’
908 | s2n(tot_len, p);
| ^~~
exploit2.c:920:13: warning: passing argument 1 of ‘MD5_Final’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
920 | MD5_Final(p, &ctx);
| ^
In file included from exploit2.c:27:
/usr/include/openssl/md5.h:42:30: note: expected ‘unsigned char *’ but argument is of type ‘const unsigned char *’
42 | int MD5_Final(unsigned char *md, MD5_CTX *c);
| ~~~~~~~~~~~~~~~^~
exploit2.c:924:10: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
924 | memcpy(p, rec, rec_len);
| ^
In file included from exploit2.c:17:
/usr/include/string.h:43:14: note: expected ‘void * restrict’ but argument is of type ‘const unsigned char *’
43 | extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
| ^~~~~~
exploit2.c:931:10: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
931 | memcpy(p, rec, rec_len);
| ^
In file included from exploit2.c:17:
/usr/include/string.h:43:14: note: expected ‘void * restrict’ but argument is of type ‘const unsigned char *’
43 | extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
Любой Помощь будет принята с благодарностью.