Code: Show/Hide :0041BEF9 8D0480 lea eax, dword[eax+4*eax]
:0041BEFC 8D0480 lea eax, dword[eax+4*eax] |
Quote: |
lea eax, dword[eax+4*eax] |
Code: Show/Hide lea eax, dword[eax+4*eax]
lea eax, dword[eax+4*eax] |
Code: Show/Hide :0041BEEF 99 cdq
:0041BEF0 F7F9 idiv ecx ; } :0041BEF2 8BC2 mov eax, edx ; } modulus |
Code: Show/Hide :0041BF34 3BCD cmp ecx, ebp
:0041BF36 8BF1 mov esi, ecx :0041BF38 7F06 jg 0041BF40 :0041BF3A 8DB1FFFFFF7F lea esi, dword[ecx+7FFFFFFF] |
Code: Show/Hide if (s > 0x7fffffff) s += 0x7fffffff; |
Code: Show/Hide :0041BF34 3BCD cmp ecx, ebp
:0041BF36 8BF1 mov esi, ecx :0041BF38 7F06 jg 0041BF40 :0041BF3A 8DB1FFFFFF7F lea esi, dword[ecx+7FFFFFFF] |
Code: Show/Hide /*
cmp ecx, ebp mov esi, ecx jg 0041BF40 lea esi, dword[ecx+7FFFFFFF] */ seed = nseed; if (nseed <= 0) seed += 0x7FFFFFFF; |
Code: Show/Hide // :0041BF40
a = seed; /* cdq xor eax, edx sub eax, edx and eax, 00000003 xor eax, edx */ d = (a < 0) ? 0xFFFFFFFF : 0; //cdq a ^= d; a -= d; a &= 1; a ^= d; /* mov ebx,eax ... sub ebx,edx neg ebx ... sbb ebx,ebx */ b = (a - d == 0) ? -1 : 0; b &= 17; //get 000X000X |
Code: Show/Hide DWORD ssRNG (DWORD seed)
{ DWORD s; s = (DWORD)(((__int64)seed * 0x834E0B5F) >> 48); s += s >> 31; s = ((seed % 0x1F31D) * 16807) - (s * 2836) + 123; if (!s || s > 0x7fffffff) // (LONG)s <= 0 s += 0x7fffffff; return (s); } |
Code: Show/Hide inline int SS_prng(int seed)
{ int nseed, temp; /* mov eax, esi ; esi = seed mov ecx, 0001F31D cdq idiv ecx ; } mov eax, edx ; } modulus shl eax, 03 sub eax, edx lea eax, dword[eax+4*eax] lea eax, dword[eax+4*eax] shl eax, 04 add eax, edx lea eax, dword[eax+2*eax] lea ecx, dword[edx+2*eax] */ nseed = (seed % DIV_C) * 16807; /* mov eax, 834E0B5F imul esi add edx, esi sar edx, 10 mov eax, edx shr eax, 1F add edx, eax lea eax, dword[edx+8*edx] shl eax, 03 sub eax, edx lea eax, dword[eax+4*eax] shl eax, 1 sub eax, edx shl eax, 02 sub ecx, eax */ temp = IMULHIDWORD(MULT_C, seed) + seed; temp = (temp >> 16) + (temp >> 31); //aka the sign bit nseed -= (temp * 2836); nseed += 123; /* cmp ecx, ebp ;above, ebp = 0 mov esi, ecx jg 0041BF40 lea esi, dword[ecx+7FFFFFFF] */ seed = nseed; if (nseed <= 0) seed += 0x7FFFFFFF; return seed; } |
Code: Show/Hide :0041C2AF 64890D00000000 mov dword fs:[00000000], ecx |
Code: Show/Hide /* 0041C256 to 0041C25A */
if (newseed <= 0) newseed = newseed + 0x7fffffff; |
Quote: |
0xffffffff to 0x7fffffff |
Code: Show/Hide mov edi,[000467E20]
mov eax,[edi][00004] mov edx,[edi][0000C] mov ecx,[eax][00018] |
Code: Show/Hide mov edi,[000467E20]
mov eax,[edi][00004] mov edx,[edi][0000C] mov ecx,[eax][00018] xor ecx,edx |
Code: Show/Hide /*
mov eax,[edi][00004] mov edx,[edi][0000C] mov ecx,[eax][00018] mov eax,010624DD3 xor ecx,edx movsx edx,w,[00047DD34] imul ecx,edx imul ecx sar edx,006 mov eax,edx shr eax,01F add edx,eax */ ecx = global5.offset1[6] ^ global5.offset3; //num players?! edx = settings.PrizeFactor / 1000 * ecx; edx += (edx >> 31); |
Code: Show/Hide /*
mov eax,000000400 sub eax,ecx cdq sub eax,edx */ eax = 1024 - ecx; eax -= (eax < 0) ? -1 : 0; |
Code: Show/Hide // calculate timestamp (straight from subspace)
Uint32 loword = getShort(msg, 2); Uint32 timestamp = h->getHostTime() & 0x7FFFFFFF; if ((timestamp & 0x0000FFFF) >= loword) { timestamp &= 0xFFFF0000; } else { timestamp &= 0xFFFF0000; timestamp -= 0x00010000; } timestamp |= loword; // fill in the low word |
Code: Show/Hide Uint32 timestamp = (Uint32)h->getHostTime();
if (LOWORD(timestamp) < pkt->timestamp) timestamp -= 0x00010000; timestamp = HIWORD(timestamp) | (Uint32)pkt->timestamp; |
Juan Skills wrote: |
Basic, C/C++, Java, JavaScript, Maxscript, Perl, PHP, SQL, 6502 8086 8088, DOS, UNIX. |
also wrote: |
Adobe After Effects, Adobe Photoshop, Autdodesk Animator Pro, Autodesk Animator Studio, Autodesk 3D Studio, Autodesk 3D Studio Max, Alias Power Animator, Alias|Wavefront Maya, Debabilizer Pro, Deluxe Paint, Deluxe Animate |
xor eax wrote: |
As for the “mov eax,0” versus “xor eax, eax” I have to say that both operations takes same time on pentium but they didn’t on lower x86 machines, that’s why old school programmers will always use xor. |
Mr Ekted wrote: |
[..]
Also: "mov eax,0" takes something like 6 bytes to encode, whereas "xor eax,eax" takes 2. |
xor eax wrote: |
My alias wasn’t xor eax, I used to be Coconut emulator at that time. |
xor eax wrote: |
I have read in Merv’s page that Cyan fixed a tiny encryption problem. I think it couldn’t have happened using the original asm code that I supplied. |
Ekted wrote: |
Oh oh. This is an old can of worms. |
Cyan~Fire wrote: |
I thought you had disappeared into the SS Hall of Fame never to return. |
Mr Ekted wrote: |
I'm pretty sure all the getShort() get Long() getCrap() stuff was just a carry-over from the original VB code. |
xor eax wrote: |
Yes, be sure all the GetCrap() comes from VB. |
CypherJF wrote: |
This topic has gone way off course. |