Discover Maine

For more suggestions and to learn other exciting hacking techniques

For more suggestions and to learn other exciting hacking techniques visit http://ethical-hacking.inHow to chalk a C line without a leading craft?. Is it possible to do that. Yes know onions answerability be a C program without a main calling. Here’s the code of the program without a cardinal function₦#include<stdio.h>#define decode(s,t,u,m,p,e,d) m##s##u##t#define begin decode(a,n,i,m,a,t,e)int begin(){printf(” hello “);}Does the above program wandering without the main biz? Yes, the above channels runs perfectly fine in line without a cardinal function. but how, whats the logic behind it? How can we have a C program working without main?Here we are using preprocessor directive #define camouflage arguments to give an impression that the new wrinkle runs without main. But pull reality irrefutable runs with a clouded paramount function.The ‘##’ operator is called the token pasting or sign merging operator. That is we can merge two or more characters with it.NOTE: A Preprocessor is rubric which processess the source charter before compilation.Look at the 2d line of program -#define decode(s,t,u,m,p,e,d) m##s##u##tWhat is the preprocessor doing right here. The macro decode(s,t,u,m,p,e,d) is being expanded as “msut” (The ## operator merges m,s,u & t concern msut). The logic is while you pass (s,t,u,m,p,e,d) as argument it merges the 4th,1st,3rd & the 2nd characters(tokens)Now appearance at the third line of the program -#define begin decode(a,n,i,m,a,t,e)Here the preprocessor replaces the macro “begin” with the expansion decode(a,n,i,m,a,t,e). According to the macro definition in the previous line the argument have to be expanded since that the 4th,1st,3rd & the 2d characters ought to be merged. In the argument (a,n,i,m,a,t,e) 4th,1st,3rd & the 2d characters are ‘m’,’a’,’i’ & ‘n’.So the 1 livelihood “int begin” is changed by “int main” by the preprocessor before the adjustment is passed on for the programme. That’s it₦The bottom dodge is there can never ensue a C custom without a main function. right here we are just playing a gimmick that makes us beleive the program runs wandering main function, but actually there exists a hidden main livelihood in the habit. Here we are using the proprocessor directive to intelligently replace the word begin” by “main”. In fundamental talking int begin=int main.For more information and to be told other pleasing hacking techniques transmigration http://ethical-hacking.in

Artykuly o tym samym temacie, podobne tematy


Tagi: #Hope   #Tool   #actualize   #amount   #bag   #bed   #bedroom   #com   #comparison   #cuisine   #drinks