今天和一道题玩了捉迷藏

同步: https://zhufn.fun/archives/今天和一道题玩了捉迷藏(xxxorrr)/
当你在main中找不到程序逻辑的时候,如何考虑?

  1. 有没有注册异常处理程序。还有像__cxa_atexit 这样退出时执行的函数。

  2. __lib_start_main的参数中有用于初始化的函数。顺便贴一下它的定义:

    int __libc_start_main(
    	int (*main) (int, char * *, char * *), 
    	int argc, 
    	char * * ubp_av, 
    	void (*init) (void), 
    	void (*fini) (void), 
    	void (*rtld_fini) (void), 
    	void (* stack_end)
    );
    

    • performing any necessary security checks if the effective user ID is
    not the same as the real user ID.
    • initialize the threading subsystem.
    • registering the rtld_fini to release resources when this dynamic shared object exits (or is unloaded).
    • registering the fini handler to run at program exit.
    • calling the initializer function (**init*)().
    • calling main() with appropriate arguments.
    • calling exit() with the return value from main().

  3. 通过字符串或字节数组的交叉引用,可以找出隐藏的操作。

所以当你遇到了灵异事件的时候,不要惊慌,不然连个难度1的题的隐藏操作都找不出来。
cnblogs

posted @ 2023-02-14 17:54  ZhuFN  阅读(24)  评论(0编辑  收藏  举报