IDAFTAP

IDAFTAP is a series of (reverse engineering) puzzles by ~elly.
Warning: explanations and solutions inside!

IDAFTAP 0

This program interprets the command line argument as a base-3 number and checks whether it equals 52992 (the value of IDAFTAP). The twist is that the digit value is the ASCII distance from A squared: Σi=0n (ord(ci)-ord(A))2 ·3n-1-i=52992 (There's also a rule against presumably space characters, though my solutions with lower case letters didn't work either.)

The upside is that digit values may be much larger than 0, 1, 2 (normal values for base 3); the downside is that this forms a Diophantine equation with multiple quadratic terms, which are terrible to deal with. In fact, when you put the equation into Z3 for a fixed number of letters (even locking in 4 of 7 letters), it takes a lot longer than just brute-forcing inputs.

...so let's just switch to brute force. And while we're at it, let's try finding actual words. One word did not yield any results. One word plus a few random characters or two concatenated words yield plenty, like ELLEISM.

Overflows

Alternatively, we can abuse the fact that the program uses 32-bit integers to find solutions for 52992+k·232. Various approaches are available, like picking a starting phrase and appending lots of As or repeating a single letter or repeating a string. Picking a starting phrase (prefix) followed by "A"s reduces the problem to: v·3k=52992 (mod232)  k=dlog3(v-1·52992) (mod232) where v is the value of the prefix. Finding the inverse v-1 is easy with the Euclidean algorithm. Finding the discrete logarithm is a bit trickier, but can be done with sheer brute force because there's only 232 multiplications to test (but Baby-step giant-step is easy to implement).
Note that 52992=13·32·28 and neither 2 nor 13 come up in the generator set of 3, so the prefix

i=0n v·3li=52992  (mod232)

IDAFTAP 1

CHCHHHADDDP