Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am trying to compile a C++ program, and I keep on getting the following errors. I am using Cygwin, and of course GCC. I have checked to make sure there are no syntax errors.
-------- ERRORS -------------
In file included from main.c:25:
main.h:37: parse error before '*' token
main.h:37: `uint32_t' declared as function returning a function
main.h:55: parse error before "get_cipher_func"
main.h:55: warning: no semicolon at end of struct or union
main.h:56: warning: data definition has no type or storage class
main.h:58: parse error before '}' token
In file included from main.c:26:
ssl2.h:55: field `cipher' declared as a function
ssl2.h:56: field `ciphers' declared as a function
ssl2.h:62: parse error before "host"
ssl2.h:63: parse error before "host"
main.c:33: field `func_addr' declared as a function
main.c:41: warning: initialization makes pointer from integer without a cast
main.c:46: warning: initialization makes pointer from integer without a cast
main.c:52: warning: initialization makes pointer from integer without a cast
main.c:58: warning: initialization makes pointer from integer without a cast
main.c:64: warning: initialization makes pointer from integer without a cast
main.c:69: warning: initialization makes pointer from integer without a cast
main.c:74: warning: initialization makes pointer from integer without a cast
main.c:79: warning: initialization makes pointer from integer without a cast
main.c:84: warning: initialization makes pointer from integer without a cast
main.c:89: warning: initialization makes pointer from integer without a cast
main.c:95: warning: initialization makes pointer from integer without a cast
main.c:101: warning: initialization makes pointer from integer without a cast
main.c:106: warning: initialization makes pointer from integer without a cast
main.c:111: warning: initialization makes pointer from integer without a cast
main.c:116: warning: initialization makes pointer from integer without a cast
main.c:121: warning: initialization makes pointer from integer without a cast
main.c:126: warning: initialization makes pointer from integer without a cast
main.c:131: warning: initialization makes pointer from integer without a cast
main.c:136: warning: initialization makes pointer from integer without a cast
main.c:141: warning: initialization makes pointer from integer without a cast
main.c:146: warning: initialization makes pointer from integer without a cast
main.c:151: warning: initialization makes pointer from integer without a cast
main.c: In function `info_leak':
main.c:238: dereferencing pointer to incomplete type
main.c:238: dereferencing pointer to incomplete type
main.c:249: dereferencing pointer to incomplete type
main.c:250: dereferencing pointer to incomplete type
main.c: In function `send_shellcode':
main.c:274: dereferencing pointer to incomplete type
main.c:294: dereferencing pointer to incomplete type
main.c:294: dereferencing pointer to incomplete type
main.c:314: dereferencing pointer to incomplete type
main.c:314: dereferencing pointer to incomplete type
main.c:333: dereferencing pointer to incomplete type
main.c:333: dereferencing pointer to incomplete type
main.c: In function `main':
main.c:369: `in_addr_t' undeclared (first use in this function)
main.c:369: (Each undeclared identifier is reported only once
main.c:369: for each function it appears in.)
main.c:369: parse error before "host"
main.c:437: `host' undeclared (first use in this function)
main.c:437: parse error before ')' token
----------- END ERRORS ------------------------- Start Code --------------
/* host to big endian conversions */
#define htobes(i, p) if ( (((uint8_t*)p)[0] = (((i) >> 8) & 0xff)) | \
(((uint8_t*)p)[1] = ((i) & 0xff)) ) {}#define htobel(i, p) if ( (((uint8_t*)p)[0] = (((i) >> 24) & 0xff)) | \
(((uint8_t*)p)[1] = (((i) >> 16) & 0xff)) | \
(((uint8_t*)p)[2] = (((i) >> 8) & 0xff)) | \
(((uint8_t*)p)[3] = ((i) & 0xff)) ) {}/* host to little endian conversions */
#define htoles(i, p) if ( (((uint8_t*)p)[1] = (((i) >> 8) & 0xff)) | \
(((uint8_t*)p)[0] = ((i) & 0xff)) ) {}#define htolel(i, p) if ( (((uint8_t*)p)[3] = (((i) >> 24) & 0xff)) | \
(((uint8_t*)p)[2] = (((i) >> 16) & 0xff)) | \
(((uint8_t*)p)[1] = (((i) >> 8) & 0xff)) | \
(((uint8_t*)p)[0] = ((i) & 0xff)) ) {}/* big endian to host conversions */
#define betohs(p) ( (((uint32_t)((uint8_t*)p)[0]) << 8) | \
(((uint32_t)((uint8_t*)p)[1])) )#define betohl(p) ( (((uint32_t)((uint8_t*)p)[0]) << 24) | \
(((uint32_t)((uint8_t*)p)[1]) << 16) | \
(((uint32_t)((uint8_t*)p)[2]) << 8) | \
(((uint32_t)((uint8_t*)p)[3])) )/* little endian to host conversions */
#define letohs(p) ( (((uint32_t)((uint8_t*)p)[1]) << 8) | \
(((uint32_t)((uint8_t*)p)[0])) )#define letohl(p) ( (((uint32_t)((uint8_t*)p)[3]) << 24) | \
(((uint32_t)((uint8_t*)p)[2]) << 16) | \
(((uint32_t)((uint8_t*)p)[1]) << 8) | \
(((uint32_t)((uint8_t*)p)[0])) )typedef uint32_t (*get_cipher_func)(unsigned char*, int);
typedef int (*build_shellcode_func)(unsigned char*, int, int, uint32_t, uint32_t, uint32_t);/* This structure defines a target architecture */
struct architecture {
char* desc; /* description */unsigned char* overwrite_session_id_length;
int overwrite_session_id_length_len;/* stage2 shellcode */
unsigned char* shellcode_stage2;
int shellcode_stage2_len;/* the tag written by the stage1 shellcode */
unsigned char* tag;
int tag_len;get_cipher_func get_cipher;
get_cipher_func get_ciphers;
build_shellcode_func build_shellcode;
};/* EOF */
------------- End Code ----------------

Looks like you have problems with the declarations.
get_cipher - a function pointer or whatever it is suppose to be... you got it wrong either way.
When you fix that you will get rid of most of your parcing errors.
And check your pointers

Try adding the definitions for uint32_t and uint8_t before your typedefs. Looks like it doesn't know what uint32_t is. Probably something like
typedef unsigned long uint32_t;

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |