3 ms·
argv[0] is independent of the executable path. In fact there’s a common “trick” on Unix systems where you offer one binary and it figures out what it is suppose
by saagarjha 4y ago
argv[0] is independent of the executable path. In fact there’s a common “trick” on Unix systems where you offer one binary and it figures out what it is supposed to be by peeking at argv[0]. Also, you’re allowed to freely modify argv, so if anyone reads it by scanning your stack it’ll get the new value.