Posted a patch for MS10-076. I'm not really sure how to test it so if anyone knows that would be helpful, but I have it installed with no problems so far.
;==========================================================================
; MS10-076 patches ported to Windows 2000 SP4
;==========================================================================
; -------------------------------------------------------------------------
; _ULongLongToULong@12
;
; Direct copy
; -------------------------------------------------------------------------
$66FD21C0:
8BFF mov edi, edi
55 push ebp
8BEC mov ebp, esp
8B4D10 mov ecx, [ebp+0x10]
8309FF or [ecx], 0xFFFFFFFF
837D0C00 cmp [ebp+0x0C], 0x00000000
B816020780 mov eax, 0x80070216
770E ja $66FD21E4
8B5508 mov edx, [ebp+0x08]
7205 jc $66FD21E0
83FAFF cmp edx, -0x00000001
7704 ja $66FD21E4
$66FD21E0:
8911 mov [ecx], edx
33C0 xor eax, eax
$66FD21E4:
5D pop ebp
C20C00 ret 0x0000000C
; -------------------------------------------------------------------------
; _ULongAdd@12
;
; Direct copy
; -------------------------------------------------------------------------
$66FD21EC:
8BFF mov edi, edi
55 push ebp
8BEC mov ebp, esp
8B4D0C mov ecx, [ebp+0x0C]
8B5510 mov edx, [ebp+0x10]
830AFF or [edx], 0xFFFFFFFF
56 push esi
8B7508 mov esi, [ebp+0x08]
03CE add ecx, esi
3BCE cmp ecx, esi
B816020780 mov eax, 0x80070216
5E pop esi
7204 jc $66FD220E
890A mov [edx], ecx
33C0 xor eax, eax
$66FD220E:
5D pop ebp
C20C00 ret 0x0000000C
; -------------------------------------------------------------------------
; _ULongSub@12
;
; Direct copy
; -------------------------------------------------------------------------
$66FD2214:
8BFF mov edi, edi
55 push ebp
8BEC mov ebp, esp
8B5510 mov edx, [ebp+0x10]
8B4D08 mov ecx, [ebp+0x08]
830AFF or [edx], 0xFFFFFFFF
3B4D0C cmp ecx, [ebp+0x0C]
B816020780 mov eax, 0x80070216
7207 jc $66FD2233
2B4D0C sub ecx, [ebp+0x0C]
33C0 xor eax, eax
890A mov [edx], ecx
$66FD2233:
5D pop ebp
C20C00 ret 0x0000000C
; -------------------------------------------------------------------------
; (2k) sub_66FCC5D9 (SP3) sub_73CF51E8 (patch) sub_73CF52CD
; -------------------------------------------------------------------------
$66FCC6A4:
E9935B0000 jmp $66FD223C
; -------------------------------------------------------------------------
$66FCC905:
; Have to switch the order of these two instructions
; So we can skip the PUSH instruction
68F90C0000 push $0CF9
8B7D08 mov edi, [ebp+8] ; arg_0
; -------------------------------------------------------------------------
$66FD223C:
56 push esi
FF7704 push dword ptr [edi+4]
0FB7F0 movzx esi, ax
8975F0 mov [ebp-$10], esi ; var_10
E84D8FFFFF call $66FCB198
837D0C00 cmp [ebp+$C], 0 ; arg_4
89C1 mov ecx, eax
668B4702 mov ax, [edi+2]
660FB6D4 movzx dx, ah
88C6 mov dh, al
89D0 mov eax, edx
7541 jnz $66FD22A0
8D5602 lea edx, [esi+2]
39D1 cmp ecx, edx
722F jb $66FD2295
6685C0 test ax, ax
7C2A jl $66FD2295
85C9 test ecx, ecx
7C26 jl $66FD2295
0FBFC0 movsx eax, ax
8D55DC lea edx, [ebp-$24] ; var_24
52 push edx
F7E1 mul ecx
52 push edx
50 push eax
E841FFFFFF call $66FD21C0 ; _ULongLongToULong@12
85C0 test eax, eax
7C12 jl $66FD2295
8D45DC lea eax, [ebp-$24] ; var_24
50 push eax
6A08 push 8
FF75DC push [ebp-$24] ; var_24
E85BFFFFFF call $66FD21EC ; _ULongAdd@12
85C0 test eax, eax
7D0B jge $66FD22A0
$66FD2295:
5E pop esi
68200D0000 push $0D20
E96AA6FFFF jmp $66FCC90A ; @L23A
$66FD22A0:
5E pop esi
8B45F0 mov eax, [ebp-$10] ; var_10
03C0 add eax, eax
E9FEA3FFFF jmp $66FCC6A9
; -------------------------------------------------------------------------
$66FCC74E:
FF7524 push [ebp+$24] ; arg_1C (edi on XP)
FF75DC push [ebp-$24] ; var_24 (push 1 on XP)
8B7520 mov esi, [ebp+$20]
56 push esi ; arg_18 (push 2 on XP)
8B5D1C mov ebx, [ebp+$1C]
53 push ebx ; arg_14 (ebx on XP)
FF7508 push [ebp+8] ; arg_0 (esi on XP)
E873F2FFFF call $66FCB9D7
EB19 jmp $66FCC77F
nop (25)
$66FCC77F:
; Original code resumes here
; -------------------------------------------------------------------------
; (2k) sub_66FD0867 (SP3) sub_73CF8AED (patch) sub_73CF8C26
;
; Possible overflow prevention patch
; -------------------------------------------------------------------------
$66FD0A0C:
72E7 jb $66FD09F5 ; Switch to unsigned
$66FD09EF:
761D jbe $66FD0A0E ; Switch to unsigned
$66FD08A6:
0FB7F8 movzx edi, ax ; Switch to unsigned
$66FD08EA:
7324 jae $66FD0910 ; Switch to unsigned
$66FD0902:
0FB775EC movzx esi, word ptr [ebp-$14] ; Switch to unsigned var_14
; -------------------------------------------------------------------------
; (2k) sub_66FCBF10 (SP3) sub_73CF4C91 (patch) sub_73CF4C95
;
; Variable mappings
;
; alias xp (old) xp (new) 2k
; --------------------------------------------
; var_C var_C var_C var_1C
; var_14 var_14 var_14 var_10
; var_24 ------ var_24 var_50
; var_AA var_10 var_18 var_8
; var_BB var_18 var_20 var_18
; var_CC var_20 var_2C var_2C
; var_DD var_24 var_30 var_24
; var_EE var_30 var_34 var_30/3C
; var_FF var_2C var_38 var_3C
; var_GG var_44 var_48 var_38
; var_HH var_34 var_3C var_40
; var_II var_1C var_28 var_20
; var_JJ var_38 var_10 var_14
; var_KK var_28 var_44 var_28
; var_LL var_40 var_1C var_4C
; var_MM var_3C var_40 var_44
; -------------------------------------------------------------------------
$66FCBF13:
83EC50 sub esp, 50h
$66FCBF49:
E862630000 jmp $66FD22B0
$66FD22B0:
E8C2BFFFFF call $66FCE277 ; _memcpyHuge@12
897DE4 mov [ebp-$1C], edi ; var_1C (C)
8365B000 and [ebp-$50], 0 ; var_50 (24)
E98D9CFFFF jmp $66FCBF4E
; -------------------------------------------------------------------------
$66FCBF94:
E82B630000 jmp $66FD22C4
$66FD22C4:
8945B4 mov [ebp-$4C], eax ; var_4C (LL)
6685C0 test ax, ax
0F85C99CFFFF jnz $66FCBF99
6A02 push 2
8D7E06 lea edi, [esi+6]
57 push edi
FF7508 push [ebp+8] ; arg_0
E86C9AFFFF call $66FCBD4A
33C0 xor eax, eax
E928A1FFFF jmp $66FCC40D ; exit
; -------------------------------------------------------------------------
$66FCBFC4:
837D0C00 cmp [ebp+$C], 0 ; arg_4
90 nop
$66FCBFCF:
E914630000 jmp $66FD22E8
90 nop
$66FD22E8:
757C jnz $66FD2366
0FB77DB4 movzx edi, word ptr [ebp-$4C] ; var_4C (LL)
8D45DC lea eax, [ebp-$24] ; var_24 (DD)
50 push eax
6A01 push 1
57 push edi
E81AFFFFFF call $66FD2214 ; _ULongSub@12
85C0 test eax, eax
7C59 jl $66FD2357
8B45DC mov eax, [ebp-$24] ; var_24 (DD)
6A04 push 4
59 pop ecx
F7E1 mul ecx
8D4DDC lea ecx, [ebp-$24] ; var_24 (DD)
51 push ecx
52 push edx
50 push eax
E8AFFEFFFF call $66FD21C0 ; _ULongLongToULong@12
85C0 test eax, eax
7C42 jl $66FD2357
8D45C8 lea eax, [ebp-$38] ; var_38 (GG)
50 push eax
6A00 push 0
89F8 mov eax, edi
99 cdq
6A02 push 2
52 push edx
50 push eax
E8B9ECFEFF call $66FC0FE0 ; __allmul
52 push edx
50 push eax
E892FEFFFF call $66FD21C0 ; _ULongLongToULong@12
85C0 test eax, eax
7C25 jl $66FD2357
8D45B0 lea eax, [ebp-$50] ; var_50 (24)
50 push eax
FF75C8 push [ebp-$38] ; var_38 (GG)
FF75DC push [ebp-$24] ; var_24 (DD)
E8ABFEFFFF call $66FD21EC ; _ULongAdd@12
85C0 test eax, eax
7C12 jl $66FD2357
8D45B0 lea eax, [ebp-$50] ; var_50 (24)
50 push eax
6A0A push $A
FF75B0 push [ebp-$50] ; var_50 (24)
E899FEFFFF call $66FD21EC ; _ULongAdd@12
85C0 test eax, eax
7D0C jge $66FD2363
$66FD2357:
8B4508 mov eax, [ebp+8] ; arg_0
8B4034 mov eax, [eax+$34]
50 push eax
E8178AFFFF call $66FCAD7A
$66FD2363:
8B4DF0 mov ecx, [ebp-$10] ; var_10 (14)
$66FD2366:
8365BC00 and [ebp-$44], 0 ; var_44 (MM)
66817DB40000 cmp word ptr [ebp-$4C], 0 ; var_4C (LL)
0F8670A0FFFF jbe $66FCC3E6
E95F9CFFFF jmp $66FCBFDA
; -------------------------------------------------------------------------
$66FCC0AB:
90 nop
90 nop
90 nop
$66FCC0B3:
D1E9 shr ecx, 1
; -------------------------------------------------------------------------
$66FCC118:
E963620000 jmp $66FD2380
90 nop
90 nop
90 nop
90 nop
$66FD2380:
E89FC9FFFF call $66FCED24
3B7DB0 cmp edi, [ebp-$50] ; var_50 (24)
897DC8 mov [ebp-$38], edi ; var_38 (GG)
8945D0 mov [ebp-$30], eax ; var_30 (EE)
72C7 jb $66FD2357 ; see above
8D4DE4 lea ecx, [ebp-$1C] ; var_1C (C)
51 push ecx
6A00 push 0
8945C0 mov [ebp-$40], eax ; var_40 (HH)
99 cdq
6A06 push 6
52 push edx
50 push eax
E83DECFEFF call $66FC0FE0 ; __allmul
52 push edx
50 push eax
E816FEFFFF call $66FD21C0 ; _ULongLongToULong@12
85C0 test eax, eax
7CA9 jl $66FD2357 ; see above
8D45E4 lea eax, [ebp-$1C] ; var_1C (C)
50 push eax
6A04 push 4
FF75E4 push [ebp-$1C] ; var_1C (C)
E830FEFFFF call $66FD21EC ; _ULongAdd@12
85C0 test eax, eax
7C97 jl $66FD2357 ; see above
8D45E4 lea eax, [ebp-$1C] ; var_1C (C)
50 push eax
57 push edi
FF75E4 push [ebp-$1C] ; var_1C (C)
E81FFEFFFF call $66FD21EC ; _ULongAdd@12
85C0 test eax, eax
7C86 jl $66FD2357 ; see above
FF7520 push [ebp+$20] ; arg_18
FF75E4 push [ebp-$1C] ; var_1C (C)
FF751C push [ebp+$1C] ; arg_14
FF7518 push [ebp+$18] ; arg_10
FF7508 push [ebp+8] ; arg_0
E8F295FFFF call $66FCB9D7
8B4DC8 mov ecx, [ebp-$38] ; var_38 (GG)
8B75EC mov esi, [ebp-$14] ; var_14 (JJ)
8B4518 mov eax, [ebp+$18] ; arg_10
8B00 mov eax, [eax]
03451C add eax, [ebp+$1C] ; arg_14
8945D8 mov [ebp-$28], eax ; var_28 (KK)
8D3401 lea esi, [ecx+eax]
8B45D0 mov eax, [ebp-$30] ; var_30 (EE)
50 push eax
E91F9DFFFF jmp $66FCC121
$66FCC15A:
8B45E0 mov eax, [ebp-$20] ; var_20 (II)
8B75C0 mov esi, [ebp-$40] ; var_40 (HH)
EB34 jmp $66FCC196
; -------------------------------------------------------------------------
$66FCC208:
90 nop ; NOP out the push because we're switching
90 nop ; to an unsigned divide using a shr
$66FCC265:
C1E803 shr eax, 3 ; Unsigned divide by 8
90 nop
$66FCC3A7:
C1E803 shr eax, 3 ; Unsigned divide by 8
90 nop
90 nop
90 nop
$66FCC3BA:
90 nop ; NOP out the push because we're switching
90 nop ; to an unsigned divide using a shr
$66FCC3BF:
C1E803 shr eax, 3 ; Unsigned divide by 8
90 nop
; -------------------------------------------------------------------------
$66FCC3CB:
nop (10)
This post has been edited by WildBill: 11 November 2010 - 08:54 PM