ever_boy_ wrote:
So, we have the fixed positions, which are sent within the packet (30 - 39). And we have the real digits (0 - 9). When we click on a digit, the clients send the position (34), instead of the digit itself (7).
kLabMouse wrote:Edit: You can just place a BP on the part of "case" that forms and sends the packet. that way you can check what functions transmutates the PIN code itself, and what is used as input.
What BP?
IC. Then the Generator of that table should in in Incoming packets parser function.
"BP" -- means BreakPoint.
There two Functions in each class "Login" and "Game", one is for Receiving network messages, the other for receiving user messages and send packets.
ever_boy_ wrote:
using perl instead of the asm function. edit: or maybe importing this value into perl somehow.
If we get this, I'll figure out the rest.
Leave me the Client binary somewhere I will try to digg it a bit on Monday.
class CSecondPwdRandom {
public:
CSecondPwdRandom(int dwSeed) {
m_holdrand = dwSeed;
m_mulfactor = 13464;
m_addfactor = 8917556;
};
void Randomize(char *cStr, int dwStrLen) {
if (dwStrLen >= 1) {
int k = 2;
for (int pos = 1; pos <= dwStrLen; pos++) {
m_holdrand = m_addfactor + m_mulfactor * m_holdrand;
int replace_pos = pRandom->m_holdrand % k;
if (pos != replace_pos) {
swap (cStr[pos], cStr[replace_pos]);
};
k++;
};
};
};
int m_holdrand;
int m_mulfactor;
int m_addfactor;
};
bool CSecondPasswdMgr::RandNumSeq(char *out_szRet, int in_nOutStrSize, unsigned long in_dwSeed, char const *in_pbyKeyPadIdx, int in_nIdxSize) {
if (! in_dwSeed)
return false;
if (! in_pbyKeyPadIdx)
return false;
char szKeyPad[10];
memcpy_s(szKeyPad, 10, "0123456789", sizeof(szKeyPad));
CSecondPwdRandom *cPwdRandom = new CSecondPwdRandom(in_dwSeed);
cPwdRandom->Randomize(&szKeyPad, sizeof(szKeyPad));
for (int i = 0; i < 4; i++) {
out_szRet[i] = szKeyPad[in_pbyKeyPadIdx[i]];
};
out_szRet[4] = 0;
return true;
};
I could been not too accurate about CSecondPwdRandom::Randomize function. But you can get the general idea on how things work.
The original code is actually a std::random_shuffle with custom "my_random" function provided. But because Optimizer is enabled, it looks RLY ugly inside.