In Cpp, a grammar that uses Pointer as a function?

Asked 2 years ago, Updated 2 years ago, 53 views

Hello.

It's Cpp Newbie, but there's a grammar I've never seen before, and I'm not sure how to search for it, so I'm posting a question like this.

It's nothing but, like the title of the question, the data is Pointer type, but it's used like a function, so I'm asking because it's questionable. If you have any grammatical terms or related documents, please leave a link!

// The code in question...
llvm::Function * function_call;

// This?
function_call(FindIntrinsic(module, "__remill_function_call"))
// // static llvm::Function *FindIntrinsic(llvm::Module *module,
//                                     //                                     const char *name)

I can't really imagine what grammar it is and what it means.

The Pointer variable function_call of the function type. Do function_call(Function)?

I think it's a very natural grammar (from the perspective of CPP players...) I don't know what it is. Pointer is callable like a function () and uses the factor as the corresponding pointer type? Copy the memory value????????? ㅠㅠㅠ

c++ syntax

2022-09-20 22:17

1 Answers

I searched for the code you posted, and found that within https://github.com/lifting-bits/remill No matter how many times I search for Class Function.Please understand that I can't answer correctly because I can't find it.

void test(int a)
{
        printf("welcome to %d\n", a);
        system("/bin/sh");
}

int main()
{
        void (*func)();
        func = (long *)test;
        func(1);
}

Even if the initially defined func is not expressed as having a parameter, it can be called even if the parameter of the function execution function is present. The above is an example.

I answered you rambling, and I hope it helps. I don't know anything about nose.

Additional) Looking at the activity details, you seem to be a master, so I deleted unnecessary information.


2022-09-20 22:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.