Daniel Roberson
  • Posts
  • About
  • Notes
  • Projects
  • Time
  • Posts
    About
    Notes
    Projects
    Time

main function

0001-01-01

In a computer program, the main function is typically the starting point of a program.

On other platforms, main functions may be named differently. For example DllMain is used to designate the main function of a DLL and WinMain is the main function of a Windows GUI application.

C/C++

int main(int argc, char *argv[], char *envp[]) { ... }

Python

if __name__ == "__main__":
   do stuff

Links to this note

  • armouringtheelf-grugq_scut2001
  • argc
  • designandimplementationofuserlandexec-grugq2004
  • envp
  • Main Index
  • metasploit shellcode grows up: encrypted and authenticated C shells-pace2019
  • PE entry redirection
  • argv
  • Main Index - M
  • TLS takes precedence over main()
  • WinMain

Recent Posts

Linux Persistence: Modular Software

2025-04-17 DFIR CTF persistence linux persistence apache asterisk

Linux Persistence: Web Shells

2025-04-16 DFIR persistence webshell linux persistence webshell apache nginx PHP

Linux Persistence: Rootkits

2025-04-15 DFIR persistence rootkit LKM linux persistence LKM rootkit LD_PRELOAD kprobe ftrace ld.so hooking

Linux Persistence: Processes

2025-04-11 DFIR persistence processes linux persistence processes

Defanging Linux LKM Rootkits With cleanup_module()

2025-04-05 Linux LKM rootkits EDR hooks incident response Linux LKM rootkit


Home

About

Notes

Projects

Time

© All rights reserved. Powered by Hugo and Erblog.