Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Syntax error: '{' missing before __fastcall.

While working on a project, I encountered this error (Syntax error: '{' missing before __fastcall.) on the following line of code:

Code
#ifndef _MODULES_H_
#define _MODULES_H_

#include "definizioni.h"
#include "utils.h"

PPEB __fastcall ModGetPEB();  // <- the faulty line of code
long long __fastcall ModGetBase(wchar_t mName);
wchar_t __fastcall ModGetPath(wchar_t mName);
long long __fastcall ModGetFunc(long long ModBase, BYTE FuncName);

#endif // !_MODULES_H_

The first thing I tried to do was checking if there was a missing ';' in utils.h or some sort of syntax error that caused the problem, no luck: everything seems ok.
Then I checked if there were syntax errors somewhere else in the code when ModGetPEB() gets called: again none.

Unless someone has a better idea, I might go line per line in the code to find the syntax error, I don't want to because the program is pretty big and this is like finding a needle in a soccer pitch.
Well I'd need to know what PPEB is and how its defined.
May you be given directions by software engineer document writers.
(Sep 16, 2020 05:41 AM)saltycracker Wrote:  Well I'd need to know what PPEB is and how its defined.

Code
typedef struct _PEB
{
    BYTE InheritedAddrSpace;
    BYTE ReadImgFileExecOptions;
    BYTE Debugged;
    BYTE SpareBool;
    long long Mutant;
    long long ImgBaseAddress;
    PPEB_LDR_DATA LDR;

} PEB, *PPEB;

this is inside utils.h
I know the GCC's C compiler had the option to produce a file with all the header files expanded in place..

Maybe you could explore that option with your compiler. Note: I can't remember the flag for that option.

https://stackoverflow.com/questions/4900...processing
May you be given directions by software engineer document writers.
(Sep 16, 2020 05:59 AM)saltycracker Wrote:  I know the GCC's C compiler had the option to produce a file with all the header files expanded in place..

Maybe you could explore that option with your compiler. Note: I can't remember the flag for that option.

https://stackoverflow.com/questions/4900...processing

Sure I will try, many thanks! ^^
Gcc uses __attribute__((fastcall)) to define fastcalll calling convention.
Try #define __attribute__((fastcall)) __fastcall


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by simmerJul 30, 2021 10:08 AM 7 227 Jul 30, 2021 10:08 AM
Last Post: simmer
[Java] by blackcoder00Mar 11, 2019 07:20 AM 5 238 Mar 11, 2019 07:20 AM
Last Post: blackcoder00
[Python] by ZakMay 2, 2018 05:26 AM 2 114 May 2, 2018 05:26 AM
Last Post: F.A.S.T