# lookin **Repository Path**: GalaxyG/lookin ## Basic Information - **Project Name**: lookin - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2024-08-04 - **Last Updated**: 2024-08-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Lookin ====== ## Build from source Install LLVM: ``` sudo apt install clang-13 llvm-13 llvm-13-dev llvm-13-tools ``` Go to source directory and build with cmake: ``` mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=/path/to/install .. make make install ``` ## Quick start Rebuild the source code with compiler tclang: ``` CC=/path/to/install/tclang CXX=/path/to/install/tclang ``` Then run the application with runtime library: ``` LD_PRELOAD=/path/to/install/liblkinData.so ``` For usage, refer to README in example directory. ## Example Take a look at a simple program of computing greatest common divisor. ``` int gcd(int a, int b) { int r = 1; while(r!=0){ r = a % b; a = b; b = r; } return a; } int main() { srand((unsigned)time(NULL)); for (int i=0;i<10;++i) { int a = rand()%100; int b = rand()%100; (void)gcd(a,b); } return 0; } ``` Compile directly: ``` cd example make ``` Run directly and there is no output: ``` ./test ``` Then rebuild with lookin: ``` cd example export CC=/path/to/install/tclang make ``` And run again: ``` LD_PRELOAD=/path/to/install/liblkinData.so ./test ``` Output is as follows: ``` main gcd 31 54 gcd_ret 1 gcd 62 5 gcd_ret 1 gcd 99 84 gcd_ret 3 gcd 12 89 gcd_ret 1 gcd 26 80 gcd_ret 2 gcd 22 81 gcd_ret 1 gcd 84 98 gcd_ret 14 gcd 61 13 gcd_ret 1 gcd 41 78 gcd_ret 1 gcd 33 48 gcd_ret 3 main_ret 0 ``` Now, each function name and integer arguments are printed.