I used the ZMyInfo class to retrieve the Account Username, even though it's found in CommandLineA as well.
Code:char *GetUsername() { char *szTemp0 = StrStrA(GetCommandLineA(), "k8e:"), *szTemp1 = StrStrA(szTemp0, "=") + 1; char *szTemp2 = StrStrA(szTemp1, "&"); size_t szTemp3 = szTemp2 - szTemp1; void *lpTemp4 = operator new(szTemp3 + 1); char *szAccount = (char*)lpTemp4; *((BYTE*)lpTemp4 + szTemp3) = 0; memcpy(lpTemp4, szTemp1, szTemp3); return szAccount; }
Last edited by Pacifidlog; 09-12-11 at 04:20 PM.