How to properly call a function from a trigger in Arma 3.

Calling a function from a trigger in Arma 3 can be very tricky, this is how I managed to do it. commanderDead = { [’task2′,’SUCCEEDED’] call BIS_fnc_taskSetState; { _x setMarkerPos getPos house1; } forEach ["hqMarker", "hqCircle"]; [player, player, opfor, ["LOP_AFR_OPF_Infantry_IED","LOP_AFR_OPF_Infantry_Corpsman","LOP_AFR_OPF_Infantry_GL","LOP_AFR_OPF_Infantry_Rifleman_4","LOP_AFR_OPF_Infantry_Rifleman_4","LOP_AFR_OPF_Infantry_AR_Asst_2","LOP_AFR_OPF_Infantry_AT","LOP_AFR_OPF_Infantry_Rifleman_8","LOP_AFR_OPF_Infantry_Rifleman_5"], 16, 120] spawn BIS_fnc_spawnEnemy; private _attack = [] spawn KER_fnc_attackers; };   man2 = createTrigger … Read more

How to write a Hello World program in C that does not use main().

This simple program is a Hello World example that does not use the main() function. This is certainly possible in a C program. #define syscall(a, D, S, d) __asm__ __volatile__("syscall" : : "a"(a), "D"(D), "S"(S), "d"(d))   void _start(void) { syscall(1, 1, "Hello, World\n", 14); syscall(60, 0, 0, 0); }#define syscall(a, D, S, d) __asm__ … Read more

Linux buffer overflow vulnerability. Why strcpy() is a bad idea in C.

There has been a story floating around the Internet that Linux was vulnerable to a buffer overflow when a USB device with a name longer than 80 characters was plugged in. They were using strcpy(3) to receive the data string containing the name of the device, but that is vulnerable to attack, it is better … Read more