File version: C-code: Assembler-code:  

5.00.2195.7640: PXLATE CreateXlateObject(
HANDLE      hcmXform,
LONG        lIcmMode,
XEPALOBJ    palSrc,
XEPALOBJ    palDestSurf,
XEPALOBJ    palSrcDC,
XEPALOBJ    palDestDC,
ULONG       iForeDst,
ULONG       iBackDst,
ULONG       iBackSrc,
ULONG       flCreateFlag
){
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
/*
Allocates an xlate and sets it up.

Arguments:
palSrc        - src surface palette
palDestSurf   - dst surface palette
palSrcDC      - src DC palette
palDestDC     - dst DC palette
iForeDst      - For Mono->Color this is
                what a 0 goes to
iBackDst      - For Mono->Color this is
                what a 1 goes to
iBackSrc      - For Color->Mono this is
                the color that goes to 1,
                all other colors go to 0.

History:
02-May-1991 -by- ...
*/
// set up the frame pointer
000E216B|push ebp
000E216C|mov ebp, esp
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // nop
000B032D|mov edi, edi

// set up the frame pointer
000B032F|push ebp
000B0330|mov ebp, esp
6.0.6003.20665: // nop
000B3A20|mov edi, edi

// set up the frame pointer
000B3A22|push ebp
000B3A23|mov ebp, esp
6.0.6003.20785: // nop
000B3C70|mov edi, edi

// set up the frame pointer
000B3C72|push ebp
000B3C73|mov ebp, esp

5.00.2195.7640:
ASSERTGDI(
palDestDC.bValid(),
"CreateXlateObject recieved bad ppalDstDC,
bug in GDI"
);

ASSERTGDI(
palSrc.bValid() || palDestSurf.bValid(),
"CreateXlaetObject recieved bad ppalSrc,
bug in GDI"
);

ASSERTGDI(
palSrc.ppalGet() != palDestSurf.ppalGet(),
"Didn't recognize ident quickly"
);
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
ULONG ulTemp;
000E216E|sub esp, 0C  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B0335|sub esp, 0C
6.0.6003.20665: 000B3A28|sub esp, 0C
6.0.6003.20785: 000B3C78|sub esp, 0C

5.00.2195.7640:
- no c code -
// save some registers
000E2174|push ebx
000E2175|push esi
000E2176|push edi
 
5.00.2196.0001V1: // save some registers
000E2171|push ebx
000E2172|push esi
000E2173|push edi
5.00.2196.0001V2: // save some registers
000E2174|push ebx
000E2175|push esi
000E2176|push edi
6.0.6002.18005: // save some registers
000B0346|push esi
000B035A|push ebx
000B035B|push edi
6.0.6003.20665: // save some registers
000B3A2B|push esi
000B3A2C|push edi
000B3A53|push ebx
6.0.6003.20785: // save some registers
000B3C7B|push esi
000B3C7C|push edi
000B3CA3|push ebx

5.00.2195.7640:
// cEntry == 0 means the source palette is an
// RGB/Bitfields type.
// An invalid palette means it's a compatible
// bitmap on a palette managed device.

ULONG cEntry = (
palSrc.bValid() ? palSrc.cEntries() : 256
);
// bug: Some of the following code paths assume,
// that they can write up to 256 entries.
// If this is not the case, we have a buffer overrun.
000E2171|mov eax, dword ptr [ebp+10]

// if: !palSrc
// then: jump to: 000E2180

000E2177|test eax, eax
000E2179|je short 000E2180

000E217B|mov eax, dword ptr [eax+14]
000E217E|jmp short 000E2185

000E2180|mov eax, 100

// cEntry = eax
000E2186|mov dword ptr [ebp-4], eax
 
5.00.2196.0001V1:
// cEntry == 0 means the source palette is an
// RGB/Bitfields type.
// An invalid palette means it's a compatible
// bitmap on a palette managed device.

ULONG cEntry = 256;
000E2174|mov eax, 0x100
000E2179|jmp 000E2185
000E217B|nop
000E217C|nop
000E217D|nop
000E217E|nop
000E217F|nop
000E2180|nop
000E2181|nop
000E2182|nop
000E2183|nop
000E2184|nop

// cEntry = eax
000E2186|mov dword ptr ss:[ebp-4], eax
 
5.00.2196.0001V2:
// cEntry == 0 means the source palette is an
// RGB/Bitfields type.
// An invalid palette means it's a compatible
// bitmap on a palette managed device.

ULONG cEntry = (
palSrc.bValid() ? palSrc.cEntries() : 256
);
000E2171|mov eax, dword ptr [ebp+10]

// if: !palSrc
// then: jump to: 000E2180

000E2177|test eax, eax
000E2179|je short 000E2180

000E217B|mov eax, dword ptr [eax+14]
000E217E|jmp short 000E2185

000E2180|mov eax, 100

// cEntry = eax
000E2186|mov dword ptr [ebp-4], eax
 
6.0.6002.18005:
// cEntry == 0 means the source palette is an
// RGB/Bitfields type.
// An invalid palette means it's a compatible
// bitmap on a palette managed device.

ULONG cEntry = (
palSrc.bValid() ? palSrc.cEntries() : 256
);
// bug: Some of the following code paths assume,
// that they can write up to 256 entries.
// If this is not the case, we have a buffer overrun.
000B0332|mov eax, dword ptr ss:[ebp+10]

// if: !palSrc
// then: jump to: 000B0341

000B0338|test eax, eax
000B033A|je short 000B0341

000B033C|mov eax, dword ptr [eax+14]
000B033F|jmp short 000B0346

000B0341|mov eax, 100

// cEntry = eax
000B0348|mov dword ptr [ebp-4], eax
6.0.6003.20665: 000B3A25|mov eax, dword ptr [ebp+10]
000B3A2D|xor edi, edi

// if: !palSrc
// then: jump to: 000B3A38

000B3A2F|cmp eax, edi
000B3A31|je short 000B3A38

000B3A33|mov eax, dword ptr [eax+14]
000B3A36|jmp short 000B3A3D

000B3A38|mov eax, 100

// cEntry = eax
000B3A3E|mov dword ptr ss:[ebp-4], eax
6.0.6003.20785: 000B3C75|mov eax, dword ptr [ebp+10]
000B3C7D|xor edi, edi

// if: !palSrc
// then: jump to: 000B3C88

000B3C7F|cmp eax, edi
000B3C81|je short 000B3C88

000B3C83|mov eax, dword ptr [eax+14]
000B3C86|jmp short 000B3C8D

000B3C88|mov eax, 100

// cEntry = eax
000B3C8E|mov dword ptr [ebp-4], eax

5.00.2195.7640:
// Allocate room for the structure.
PXLATE pxlate = pCreateXlate(cEntry);
000E2185|push eax
000E2189|call 0000EDC9
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B0347|push eax
000B034B|call 000B0881
6.0.6003.20665: 000B3A3D|push eax
000B3A41|call 000B3F89
6.0.6003.20785: 000B3C8D|push eax
000B3C91|call 000B41D9

5.00.2195.7640:
...
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
// Ok, lets build the translate vector.
if(
!palSrc.bValid() || (
palSrc.bIsPalManaged() && (
ptransFore == ptransCurrent ||
flCreateFlag & XLATE_USE_FOREGROUND
)
)
){
// bug related note: In this code branch palSrc
// might be valid and cEntry might be smaller
// than 256|d.
// if: !palSrc
// then: jump to: 000E2482

000E2205|mov edx, dword ptr [ebp+10]
000E221A|test edx, edx
000E221F|je 000E2482

// if: !palSrc.bIsPalManaged()
// then: jump to: 000E2240

000E2225|mov ecx, dword ptr [edx+10]
000E2228|test ch, 08
000E222B|je short 000E2240

// if: ptransFore == ptransCurrent
// then: jump to: 000E2482

000E2211|mov eax, dword ptr [edi+30]
000E2214|mov dword ptr [ebp+0C], eax
000E2217|mov eax, dword ptr [edi+34]
000E222D|cmp dword ptr [ebp+0C], eax
000E2230|je 000E2482

// if: flCreateFlag & XLATE_USE_FOREGROUND
// then: jump to: 000E2482

000E2236|test byte ptr [ebp+2D], 40
000E223A|jne 000E2482
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // if: !palSrc
// then: jump to: 000B0664

000B03CF|mov edx, dword ptr [ebp+10]
000B03D2|test edx, edx
000B03E9|je 000B0664

// if: !palSrc.bIsPalManaged()
// then: jump to: 000B040E

000B03EF|mov ecx, dword ptr [edx+10]
000B03F2|test cx, 0800
000B03F7|je short 000B040E

// if: ptransFore == ptransCurrent
// then: jump to: 000B0664

000B03DD|mov eax, dword ptr [ebx+30]
000B03E0|mov dword ptr [ebp+1C], eax
000B03E3|mov eax, dword ptr [ebx+34]
000B03E3|mov eax, dword ptr [ebx+34]
000B03F9|cmp dword ptr [ebp+1C], eax
000B03FC|je 000B0664

// if: flCreateFlag & XLATE_USE_FOREGROUND
// then: jump to: 000B0664

000B0402|test word ptr [ebp+2C], 4000
000B0408|jne 000B0664
6.0.6003.20665: // if: !palSrc
// then: jump to: 000B3D67

000B3AD9|mov edx, dword ptr [ebp+10]
000B3ADC|test edx, edx
000B3AE4|je 000B3D67

// if: !palSrc.bIsPalManaged()
// then: jump to: 000B3B05

000B3A7F|mov ecx, 800
000B3AEA|mov edx, dword ptr [edx+10]
000B3AED|test ecx, edx
000B3AEF|je short 000B3B05

// if: ptransFore == ptransCurrent
// then: jump to: 000B3D67

000B3AD3|mov eax, dword ptr [edx+30]
000B3AD6|mov edi, dword ptr [edx+34]
000B3AF1|cmp eax, edi
000B3AF3|je 000B3D67

// if: flCreateFlag & XLATE_USE_FOREGROUND
// then: jump to: 000B3D67

000B3AF9|test word ptr [ebp+2C], 4000
000B3AFF|jne 000B3D67
6.0.6003.20785: // if: !palSrc
// then: jump to: 000B3FB7

000B3D29|mov edx, dword ptr [ebp+10]
000B3D2C|test edx, edx
000B3D34|je 000B3FB7

// if: !palSrc.bIsPalManaged()
// then: jump to: 000B3D55

000B3CCF|mov ecx, 800
000B3D3A|mov edx, dword ptr [edx+10]
000B3D3D|test ecx, edx
000B3D3F|je short 000B3D55

// if: ptransFore == ptransCurrent
// then: jump to: 000B3FB7

000B3D23|mov eax, dword ptr [edx+30]
000B3D26|mov edi, dword ptr [edx+34]
000B3D41|cmp eax, edi
000B3D43|je 000B3FB7

// if: flCreateFlag & XLATE_USE_FOREGROUND
// then: jump to: 000B3FB7

000B3D49|test word ptr [ebp+2C], 4000
000B3D4F|jne 000B3FB7

5.00.2195.7640:
...
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
// The source is a compatible bitmap on a
// palette managed device or the screen
// with Dst DC palette having been realized
// in the foreground.
//
// We start out assuming an identity blt.
// This means, that the color translation
// is:
//    color on dest. surface = color of src. surf.
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
...
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
ASSERTGDI(
cEntry == 256,
"ERROR xlate too small"
);
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
// bug related note: This is a code snippet,
// where a buffer overrun might happen.

for(
ulTemp = 0;
ulTemp < 256;
ulTemp++
){
pxlate->ai[ulTemp] = ulTemp;
}
000E249F|xor eax, eax
000E24A1|lea ecx, [esi+3C]

// 000E24A4|- beginning of the loop -

000E24A4|mov dword ptr [ecx], eax
000E24A6|inc eax
000E24A7|add ecx, 4

// if: eax < 256|d
// then: jump to: beginning of the loop

000E24AA|cmp eax, 100
000E24AF|jb short 000E24A4
 
5.00.2196.0001V1:
5.00.2196.0001V2:
for(
ulTemp = 0;
ulTemp < cEntry;
ulTemp++
){
pxlate->ai[ulTemp] = ulTemp;
}
// ulTemp = cEntry
000E249F|mov eax, [ebp-4]

// jump to: before the substraction
000E24A2|jmp 000E24A8

// 000E24A4|- beginning of the loop -

000E24A4|mov dword ptr [esi+3C+(eax*4)], eax

// 000E24A8|- before the substraction -

// can't use "decrement"; it doesn't set cf
// ulTemp--

000E24A8|sub eax, 1|d

// if: eax < cEntry
// then: jump to: beginning of the loop

000E24AB|jae short 000E24A4

000E24AD|nop
000E24AE|nop
000E24AF|nop
000E24B0|nop
 
6.0.6002.18005:
// bug related note: This is a code snippet,
// where a buffer overrun might happen.

for(
ulTemp = 0;
ulTemp < 256;
ulTemp++
){
pxlate->ai[ulTemp] = ulTemp;
}
000B067E|xor eax, eax
000B0680|lea ecx, [esi+3C]

// 000B0683|- beginning of the loop -

000B0683|mov dword ptr [ecx], eax
000B0685|inc eax
000B0686|add ecx, 4

// if: eax < 256|d
// then: jump to: beginning of the loop

000B0689|cmp eax, 100
000B068E|jb short 000B0683
 
6.0.6003.20665: 000B3D81|xor eax, eax
000B3D83|lea ecx, [esi+3C]

// 000B3D86|- beginning of the loop -

000B3D86|mov dword ptr [ecx], eax
000B3D88|inc eax
000B3D89|add ecx, 4

// if: eax < 256|d
// then: jump to: beginning of the loop

000B3D8C|cmp eax, 100
000B3D91|jb short 000B3D86
6.0.6003.20785: 000B3FD1|xor eax, eax
000B3FD3|lea ecx, [esi+3C]

// 000B3FD6|- beginning of the loop -

000B3FD6|mov dword ptr [ecx], eax
000B3FD8|inc eax
000B3FD9|add ecx, 4

// if: eax < 256|d
// then: jump to: beginning of the loop

000B3FDC|cmp eax, 100
000B3FE1|jb short 000B3FD6

5.00.2195.7640:
if(!palDestSurf.bValid()){
// Compatible bitmap to compatible bitmap
// on palette managed device. Both are
// relevant to the foreground realize of
// the DestDC palette so the xlate is
// identity.

...
000E24B1|test ebx, ebx
000E24B3|je short 000E24F2

000E24F2|...
000E24F6|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B0690|test edi, edi
000B0692|je short 000B06C1

000B06C1|...
000B06C5|jmp 000B0864
6.0.6003.20665: 000B3D93|mov eax, dword ptr [ebp+14]
000B3D96|test eax, eax
000B3D98|je short 000B3DCC

000B3DCC|...
000B3DD0|jmp 000B3F6C
6.0.6003.20785: 000B3FE3|mov eax, dword ptr [ebp+14]
000B3FE6|test eax, eax
000B3FE8|je short 000B401C

000B401C|...
000B4020|jmp 000B41BC

5.00.2195.7640:
}else if(
palDestSurf.bIsPalDibsection() &&
bEqualRGB_In_Palette(
palDestSurf,
palDestDC
)
){
// If you blt from a compatible bitmap to a
// DIBSECTION it will be identity if the
// RGB's of both the DC palette and the
// DIBSECTION's palette are the same. We do
// this special check so that if they
// contain duplicates we still get an
// identity xlate.

...
000E24B5|test byte ptr [ebx+11], 80
000E24B9|je short 000E24DE

000E24BB|push edi
000E24BC|push ebx
000E24BD|call 00048E90

000E24C2|test eax, eax
000E24C4|jne short 000E24F2

000E24F2|...
000E24F6|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B0694|test word ptr [edi+10], 8000
000B069A|je short 000B06CA

000B069C|push ebx
000B069D|push edi
000B069E|call 000A3E77

000B06A3|test eax, eax
000B06A5|jne short 000B06C1

000B06C1|...
000B06C5|jmp 000B0864
6.0.6003.20665: 000B3D9A|mov edi, 8000
000B3D9F|test dword ptr [eax+10], edi
000B3DA2|je short 000B3DD8

000B3DA4|push dword ptr [ebp+1C]
000B3DA7|push eax
000B3DA8|call 000A76B8

000B3DAD|test eax, eax
000B3DAF|jne short 000B3DCC

000B3DCC|...
000B3DD0|jmp 000B3F6C
6.0.6003.20785: 000B3FEA|mov edi, 8000
000B3FEF|test dword ptr [eax+10], edi
000B3FF2|je short 000B4028

000B3FF4|push dword ptr [ebp+1C]
000B3FF7|push eax
000B3FF8|call 000A78C4

000B3FFD|test eax, eax
000B3FFF|jne short 000B401C

000B401C|...
000B4020|jmp 000B41BC

5.00.2195.7640:
}else if(
palDestSurf.bIsPalDibsection() &&
palSrc.bValid() &&
bEqualRGB_In_Palette(
palDestSurf,
palSrc
)
){
...
000E24C6|test byte ptr [ebx+11], 80
000E24CD|je short 000E24DE

// if: !palSrc
// then: jump to: 000E24DE

000E24CA|mov edx, dword ptr [ebp+10]
000E24CF|test edx, edx
000E24D1|je short 000E24DE

000E24D3|push edx
000E24D4|push ebx
000E24D5|call 00048E90

000E24DA|test eax, eax
000E24DC|jne short 000E24F2

000E24F2|...
000E24F6|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B06A7|test word ptr [edi+10], 8000
000B06B0|je short 000B06CA

// if: !palSrc
// then: jump to: 000B06CA

000B06AD|mov edx, dword ptr [ebp+10]
000B06B2|test edx, edx
000B06B4|je short 000B06CA

000B06B6|push edx
000B06B7|push edi
000B06B8|call 000A3E77

000B06BD|test eax, eax
000B06BF|je short 000B06CA

000B06C1|...
000B06C5|jmp 000B0864
6.0.6003.20665: // eax = address(palDestDC)
000B3DB1|mov eax, dword ptr [ebp+14]

000B3DB4|test dword ptr [eax+10], edi
000B3DB7|je short 000B3DD8

// if: !palSrc
// then: jump to: 000B3DD8

000B3DB9|cmp dword ptr [ebp+10], 0
000B3DBD|je short 000B3DD8

000B3DBF|push dword ptr [ebp+10]
000B3DC2|push eax
000B3DC3|call 000A76B8

000B3DC8|test eax, eax
000B3DCA|je short 000B3DD5

000B3DCC|...
000B3DD0|jmp 000B3F6C
6.0.6003.20785: // eax = address(palDestDC)
000B4001|mov eax, dword ptr [ebp+14]

000B4004|test dword ptr [eax+10], edi
000B4007|je short 000B4028

// if: !palSrc
// then: jump to: 000B3DD8

000B4009|cmp dword ptr [ebp+10], 0
000B400D|je short 000B4028

000B400F|push dword ptr [ebp+10]
000B4012|push eax
000B4013|call 000A78C4

000B4018|test eax, eax
000B401A|je short 000B4025

000B401C|...
000B4020|jmp 000B41BC

5.00.2195.7640:
}else if(palDestSurf.bIsPalManaged()){
// Compatible bitmap to the screen on a
// palette managed device. The compatible
// bitmaps colors are defined as the
// foreground realization of the
// destination DC's palette.
//
// If the Dst DC's palette is realized in
// the foreground it's identity.
//
// Otherwise we translate from the current
// to the foreground indices.
000E24DE|mov eax, dword ptr [ebx+10]
000E24E1|test ah, 08
000E24E4|je 000E257E
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B06CA|mov eax, dword ptr [edi+10]
000B06CD|test ax, 0800
000B06D1|je short 000B0751
6.0.6003.20665: 000B3DD8|mov ecx, dword ptr [eax+10]
000B3DDB|test cx, 0800
000B3DE0|je short 000B3E56
6.0.6003.20785: 000B4028|mov ecx, dword ptr [eax+10]
000B402B|test cx, 0800
000B4030|je short 000B40A6

5.00.2195.7640:
if(ptransCurrent == ptransFore){
// It's in the foreground or not
// realized yet so it's identity.

// Not realized case also hits on
// default logical palette.

...
000E24EA|mov eax, dword ptr [ebp+0C]
000E24ED|cmp dword ptr [ebp+8], eax
000E24F0|jne short 000E24FB

000E24F2|...
000E24F6|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B06D3|mov eax, dword ptr [ebp+1C]
000B06D6|cmp dword ptr [ebp+0C], eax
000B06D9|je short 000B06C1

000B06C1|...
000B06C5|jmp 000B0864
6.0.6003.20665: 000B3DE2|mov edx, dword ptr [ebp+8]
000B3DE5|mov ecx, dword ptr [ebp+0C]
000B3DE8|cmp edx, ecx
000B3DEA|je short 000B3DCC

000B3DCC|...
000B3DD0|jmp 000B3F6C
6.0.6003.20785: 000B4032|mov edx, dword ptr [ebp+8]
000B4035|mov ecx, dword ptr [ebp+0C]
000B4038|cmp edx, ecx
000B403A|je short 000B401C

000B401C|...
000B4020|jmp 000B41BC

5.00.2195.7640:
}else{
// It's foreground to current
// translation.


ASSERTGDI(
ptransFore != ptransCurrent,
"Should have been identity,
never get here"
);

ASSERTGDI(
ptransFore,
"ERROR this should not have
got here Fore"
);

ASSERTGDI(
ptransCurrent,
"ERROR this should not have
got here Current"
);

- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
// bug related note: This is a code
// snippet, where a buffer overrun
// might happen.

for(
ulTemp = 0;
ulTemp < palDestDC.cEntries();
ulTemp++
){
pxlate->ai[
ptransFore->ajVector[
ulTemp
]
] = (ULONG)(
ptransCurrent->ajVector[
ulTemp
]
);
}
// if: palDestDC.cEntries <= 0,
// then: jump to: end of the loop

000E24FB|cmp dword ptr [edi+14], 0
000E24FF|jbe short 000E2533

// ulTemp = ptransFore + 4
000E2501|mov ecx, dword ptr [ebp+0C]
000E250B|lea eax, [ecx+4]

// [ebp+10] = ptransCurrent - ptransFore
000E2504|mov edx, dword ptr [ebp+8]
000E2509|sub edx, ecx
000E2512|mov dword ptr [ebp+10], edx

// [ebp+1C] = -4 - ptransFore
000E2507|push -4
000E250E|pop ecx
000E250F|sub ecx, dword ptr [ebp+0C]
000E2515|mov dword ptr [ebp+1C], ecx

...

// 000E251A|- beginning of the loop -

// edx = ptransCurrent - ptransFore
000E251A|mov edx, dword ptr [ebp+10]

// ecx = ptransCurrent->ajVector[ulTemp]
000E251D|movzx ecx, byte ptr [eax+edx]

// edx = ptransFore->ajVector[ulTemp]
000E2521|movzx edx, byte ptr [eax]

// pxlate->ai[edx] = ecx
000E2525|mov dword ptr [edx*4+esi+3C], ecx

// ulTemp++
000E2524|inc eax

// ecx = -4 - ptransFore + ulTemp
000E2529|mov ecx, dword ptr [ebp+1C]
000E252C|add ecx, eax

// if: ecx < palDestDC.cEntries,
// then: jump to: beginning of the loop

000E252E|cmp ecx, dword ptr [edi+14]
000E2531|jb short 000E251A

// 000E2533|- end of the loop -
 
5.00.2196.0001V1:
5.00.2196.0001V2:
for(
ulTemp = 0;
ulTemp < min(
palDestDC.cEntries(),
cEntry
);
ulTemp++
){
pxlate->ai[
ptransFore->ajVector[
ulTemp
]
] = (ULONG)(
ptransCurrent->ajVector[
ulTemp
]
);
}
// ulTemp = min(
//    palDestDC.cEntries(),
//    cEntry
// ) [start]
// eax = palDestDC.cEntries()
000E24FB|mov eax, dword ptr [edi+14]

// if: eax <= cEntry
// then: jump to: end of the min block

000E24FE|cmp eax, [ebp-4]
000E2501|jbe 000E2506

// eax = cEntry
000E2503|mov eax, [ebp-4]

// 000E2506|- end of the min block -
// ulTemp = min(
//    palDestDC.cEntries(),
//    cEntry
// ) [end]


// jump to: before the substraction
000E2506|jmp 000E251A

// 000E2508|- beginning of the loop -

// ecx = address(ptransCurrent)
000E2508|mov ecx, dword ptr [ebp+8]

// ecx = ptransCurrent->ajVector[ulTemp]
000E250B|movzx ecx, byte ptr [ecx+4]

// edx = address(ptransFore)
000E250F|mov edx, dword ptr [ebp+C]

// edx = ptransFore->ajVector[ulTemp]
000E2512|movzx edx, byte ptr [edx+4]

// pxlate->ai[edx] = ecx
000E2516|mov dword ptr [edx*4+esi+3C], ecx

// 000E251A|- before the substraction -

// can't use "decrement"; it doesn't set cf
// ulTemp--

000E251A|sub eax, 1|d

// if: eax >= 0|d
// then: jump to: beginning of the loop

000E251D|jae 000E2508

// 000E251F|- end of the loop -

000E251F|jmp 000E2533
000E2521|nop
000E2522|nop
000E2523|nop
000E2524|nop
000E2525|nop
000E2526|nop
000E2527|nop
000E2528|nop
000E2529|nop
000E252A|nop
000E252B|nop
000E252C|nop
000E252D|nop
000E252E|nop
000E252F|nop
000E2530|nop
000E2531|nop
000E2532|nop
 
6.0.6002.18005:
// bug related note: This is a code
// snippet, where a buffer overrun
// might happen.

for(
ulTemp = 0;
ulTemp < palDestDC.cEntries();
ulTemp++
){
pxlate->ai[
ptransFore->ajVector[
ulTemp
]
] = (ULONG)(
ptransCurrent->ajVector[
ulTemp
]
);
}
// if: palDestDC.cEntries <= 0,
// then: jump to: end of the loop

000B06DB|cmp dword ptr [ebx+14], 0
000B06DF|jbe short 000B0712

// ulTemp = ptransFore + 4
000B06E4|mov ecx, eax
000B06E8|lea eax, [ecx+4]

// [ebp+10] = ptransCurrent - ptransFore
000B06E1|mov edx, dword ptr [ebp+0C]
000B06E6|sub edx, ecx
000B06F1|mov dword ptr [ebp+10], edx

// [ebp+2C] = -4 - ptransFore
000B06EB|push -4
000B06ED|pop ecx
000B06EE|sub ecx, dword ptr [ebp+1C]
000B06F4|mov dword ptr [ebp+2C], ecx

...

// 000B06FC|- beginning of the loop -

// edx = ptransCurrent - ptransFore
000B06F9|mov edx, dword ptr [ebp+10]

// ecx = ptransCurrent->ajVector[ulTemp]
000B06FC|movzx ecx, byte ptr [eax+edx]

// edx = ptransFore->ajVector[ulTemp]
000B0700|movzx edx, byte ptr [eax]

// pxlate->ai[edx] = ecx
000B0703|mov dword ptr [edx*4+esi+3C], ecx

// ulTemp++
000B070A|inc eax

// ecx = -4 - ptransFore + ulTemp
000B0707|mov ecx, dword ptr [ebp+2C]
000B070B|add ecx, eax

// if: ecx < palDestDC.cEntries,
// then: jump to: beginning of the loop

000B070D|cmp ecx, dword ptr [ebx+14]
000B0710|jb short 000B06F9

// 000B0712|- end of the loop -
 
6.0.6003.20665: // edi = address(palDestDC)
000B3DEC|mov edi, dword ptr [ebp+1C]

// if: palDestDC.cEntries <= 0,
// then: jump to: end of the loop

000B3DEF|cmp dword ptr [edi+14], 0
000B3DF3|jbe short 000B3E19

// ulTemp = ptransFore + 4
000B3DFA|lea eax, [ecx+4]

// edx = ptransCurrent - ptransFore
000B3DF8|sub edx, ecx

// edi = -4 - ptransFore
000B3DF5|push -4
000B3DF7|pop edi
000B3DFD|sub edi, ecx

// 000B3DFF|- beginning of the loop -

// ecx = ptransCurrent->ajVector[ulTemp]
000B3DFF|movzx ecx, byte ptr [eax+edx]

// ebx = ptransFore->ajVector[ulTemp]
000B3E03|movzx ebx, byte ptr [eax]

// pxlate->ai[ebx] = ecx
000B3E06|mov dword ptr [ebx*4+esi+3C], ecx

// ulTemp++
000B3E0D|inc eax

// ebx = address(palDestDC)
000B3E0A|mov ebx, dword ptr [ebp+1C]

// ecx = ulTemp
000B3E0E|lea ecx, [eax+edi]

// if: ulTemp < palDestDC.cEntries,
// then: jump to: beginning of the loop

000B3E11|cmp ecx, dword ptr [ebx+14]
000B3E14|jb short 000B3DFF

// 000B3E16|- end of the loop -
6.0.6003.20785: // edi = address(palDestDC)
000B403C|mov edi, dword ptr [ebp+1C]

// if: palDestDC.cEntries <= 0,
// then: jump to: end of the loop

000B403F|cmp dword ptr [edi+14], 0
000B4043|jbe short 000B4069

// ulTemp = ptransFore + 4
000B404A|lea eax, [ecx+4]

// edx = ptransCurrent - ptransFore
000B4048|sub edx, ecx

// edi = -4 - ptransFore
000B4045|push -4
000B4047|pop edi
000B404D|sub edi, ecx

// 000B404F|- beginning of the loop -

// ecx = ptransCurrent->ajVector[ulTemp]
000B404F|movzx ecx, byte ptr [eax+edx]

// ebx = ptransFore->ajVector[ulTemp]
000B4053|movzx ebx, byte ptr [eax]

// pxlate->ai[ebx] = ecx
000B4056|mov dword ptr [ebx*4+esi+3C], ecx

// ulTemp++
000B405D|inc eax

// ebx = address(palDestDC)
000B405A|mov ebx, dword ptr [ebp+1C]

// ecx = ulTemp
000B405E|lea ecx, [eax+edi]

// if: ulTemp < palDestDC.cEntries,
// then: jump to: beginning of the loop

000B4061|cmp ecx, dword ptr [ebx+14]
000B4064|jb short 000B404F

// 000B4066|- end of the loop -

5.00.2195.7640:
// Now map the default colors that
// are really there, independent of
// logical palette.

if(palDestSurf.bIsNoStatic()){
000E2533|mov ebx, dword ptr [ebx+10]
000E2536|test bh, 10
000E2539|je short 000E254E
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B0712|mov edi, dword ptr [edi+10]
000B0715|test di, 1000
000B071A|jne 000B04CB
6.0.6003.20665: // eax = address(palDestSurf)
000B3E16|mov eax, dword ptr [ebp+14]

000B3E19|mov eax, dword ptr [eax+10]
000B3E1C|test ax, 1000
000B3E20|jne 000B3BCD
6.0.6003.20785: // eax = address(palDestSurf)
000B4066|mov eax, dword ptr [ebp+14]

000B4069|mov eax, dword ptr [eax+10]
000B406C|test ax, 1000
000B4070|jne 000B3E1D

5.00.2195.7640:
// bug related note: This is a
// code snippet, where a buffer
// overrun might happen.


// Only black and white are
// here.

pxlate->ai[0] = 0;
pxlate->ai[255] = 255;
000E253B|and dword ptr [esi+3C], 00000000
000E253F|mov dword ptr [esi+3C+(FF*4)], FF
000E2549|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// Only black and white are
// here.

pxlate->ai[0] = 0;
pxlate->ai[cEntry - 1] = 255;
// ecx = 0
000E253B|xor dword ecx, ecx

// pxlate->ai[0] = 0
000E253D|mov ptr [esi+3C], ecx

// eax = cEntry
000E2540|mov dword eax, ptr [ebp-4]

// cl = FF|h
000E2543|mov byte cl, FF

// pxlate->ai[cEntry - 1] = FF|h
000E2545|mov dword ptr [esi+3C+(eax*4)-4], ecx

000E2549|jmp 000E2677
 
6.0.6002.18005:
// bug related note: This is a
// code snippet, where a buffer
// overrun might happen.


// Only black and white are
// here.

pxlate->ai[0] = 0;
pxlate->ai[255] = 255;
000B04CB|and dword ptr [esi+3C], 00000000
000B04CF|mov dword ptr [esi+3C+(FF*4)], 0FF
000B04D9|jmp 000B0864
 
6.0.6003.20665: 000B3BCD|and dword ptr ds:[esi+3C], 00000000
000B3BD1|mov dword ptr ds:[esi+3C+(FF*4)], 0FF
000B3BDB|jmp 000B3F6C
6.0.6003.20785: 000B3E1D|and dword ptr ds:[esi+3C], 00000000
000B3E21|mov dword ptr ds:[esi+3C+(FF*4)], 0FF
000B3E2B|jmp 000B41BC

5.00.2195.7640:
}else if(
!palDestSurf.bIsNoStatic256()
){
000E254E|test ebx, 00010000
000E2554|jne 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B0720|test edi, 00010000
000B0726|jne 000B0864
6.0.6003.20665: 000B3E26|test eax, 00010000
000B3E2B|jne 000B3F6C
6.0.6003.20785: 000B4076|test eax, 00010000
000B407B|jne 000B41BC

5.00.2195.7640:
// All the 20 holy colors are here.
// Fix them up.

for(
ulTemp = 0;
ulTemp < 10;
ulTemp++
){
pxlate->ai[
ulTemp
] = ulTemp;

// bug related note: This
// is a code snippet,
// where a buffer overrun
// might happen.

pxlate->ai[
ulTemp + 246
] = ulTemp + 246;
}
// ulTemp = 0
000E255A|xor ecx, ecx

000E255C|lea eax, [esi+3C|h+(4|d*246|d)]

// 000E2562|- beginning of the loop -

000E2562|lea edx, [ecx+246|d]
000E2568|mov dword ptr [eax-(4|d*246|d)], ecx
000E256E|mov dword ptr [eax], edx

000E2571|add eax, 4

// ulTemp++
000E2570|inc ecx

// if: ulTemp < 10|d,
// then: jump to: beginning of the loop

000E2574|cmp ecx, 0A
000E2577|jb short 000E2562

// 000E2579|- end of the loop -

000E2579|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// Some of the default/10 + 10 holy
// colors are here. Fix what exists.

for(
ulTemp = 0;
ulTemp < 256;
ulTemp++
){
if(ulTemp == 10){
// One small step for the CPU,
// but one giant leap for the
// loop.

ulTemp = 246;
}

if(ulTemp >= cEntry){
break;
}

pxlate->ai[
ulTemp
] = ulTemp;
}
// ulTemp = 0
000E255A|xor ecx, ecx

// 000E255C|- beginning of the loop -

// if: ulTemp != 10|d,
// then: jump to: after the overwrite

000E255C|cmp cl, 0A
000E255F|jne short 000E2563

// ulTemp = 246|d
000E2561|mov cl, 246|d

// 000E2563|- after the overwrite -

// if: ulTemp >= cEntry,
// then: jump to: end of the loop

000E2563|cmp ecx, [ebp-4]
000E2566|jae 000E2572

// pxlate->ai[ulTemp] = ulTemp
000E2568|mov dword [esi+3C|h+(4|d*ecx)], ecx

// ulTemp++
000E256C|inc ecx

// if: ulTemp < 256|,
// then: jump to: beginning of the loop

000E256D|cmp ch, 1
000E2570|jb 000E255C

// 000E2572|- end of the loop -

000E2572|jmp 000E2677

000E2577|nop
000E2578|nop
000E2579|nop
000E257A|nop
000E257B|nop
000E257C|nop
000E257D|nop
 
6.0.6002.18005:
// All the 20 holy colors are here.
// Fix them up.

for(
ulTemp = 0;
ulTemp < 10;
ulTemp++
){
pxlate->ai[
ulTemp
] = ulTemp;

// bug related note: This
// is a code snippet,
// where a buffer overrun
// might happen.

pxlate->ai[
ulTemp + 246
] = ulTemp + 246;
}
// ulTemp = 0
000B072C|xor ecx, ecx

000B072E|lea eax, [esi+3C|h+(4|d*246|d)]

// 000B0734|- beginning of the loop

000B0734|lea edx, [ecx+246|d]
000B073A|mov dword ptr [eax-(4|d*246|d)], ecx
000B0740|mov dword ptr [eax], edx

000B0743|add eax, 4

// ulTemp++
000B0742|inc ecx

// if: ulTemp >= 10|d,
// then: jump to: 000B0864

000B0746|cmp ecx, A
000B0749|jae 000B0864

// jump to: beginning of the loop
000B074F|jmp short 000B0734
 
6.0.6003.20665: // ulTemp = 0
000B3E31|xor ecx, ecx

000B3E33|lea eax, [esi+3C|h+(4|d*246|d)]

// 000B3E39|- beginning of the loop

000B3E39|lea edx, [ecx+246|d]
000B3E3F|mov dword ptr [eax-(4|d*246|d)], ecx
000B3E45|mov dword ptr [eax], edx

000B3E48|add eax, 4

// ulTemp++
000B3E47|inc ecx

// if: ulTemp >= 10|d,
// then: jump to: 000B3F6C

000B3E4B|cmp ecx, A
000B3E4E|jae 000B3F6C

// jump to: beginning of the loop
000B3E54|jmp short 000B3E39
6.0.6003.20785: // ulTemp = 0
000B4081|xor ecx, ecx

000B4083|lea eax, [esi+3C|h+(4|d*246|d)]

// 000B4089|- beginning of the loop

000B4089|lea edx, [ecx+246|d]
000B408F|mov dword ptr [eax-(4|d*246|d)], ecx
000B4095|mov dword ptr [eax], edx

000B4098|add eax, 4

// ulTemp++
000B4097|inc ecx

// if: ulTemp >= 10|d,
// then: jump to: 000B41BC

000B409B|cmp ecx, A
000B409E|jae 000B41BC

// jump to: beginning of the loop
000B40A4|jmp short 000B4089

5.00.2195.7640:
}
}
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
}else if(palDestSurf.bIsMonochrome()){
000E257E|test ah, 20
000E2581|mov ecx, 100
000E2586|je short 000E25B2
 
5.00.2196.0001V1:
5.00.2196.0001V2: 000E257E|test ah, 20

// ecx = cEntry
000E2581|mov ecx, [ebp-4]

000E2584|nop
000E2585|nop

000E2586|je short 000E25B2
 
6.0.6002.18005: 000B0751|test ax, 2000
000B0755|je short 000B078D
 
6.0.6003.20665: 000B3E56|test cx, 2000
000B3E5B|je short 000B3E93
6.0.6003.20785: 000B40A6|test cx, 2000
000B40AB|je short 000B40E3

5.00.2195.7640:
// bug related note: This is a code snippet,
// where a buffer overrun might happen.

RtlZeroMemory(
pxlate->ai,
256 * sizeof(ULONG)
);
000E2588|xor eax, eax
000E258A|lea edi, [esi+3C]
000E258F|rep stos dword ptr [edi]
 
5.00.2196.0001V1:
5.00.2196.0001V2:
RtlZeroMemory(
pxlate->ai,
cEntry * sizeof(ULONG)
);
 
6.0.6002.18005:
// bug related note: This is a code snippet,
// where a buffer overrun might happen.

RtlZeroMemory(
pxlate->ai,
256 * sizeof(ULONG)
);
000B0757|push (4|d*256|d)
000B075F|push 0
000B075C|lea eax, [esi+3C]
000B0761|push eax
000B0762|call 000C6981
000B076A|add esp, 0C
 
6.0.6003.20665: 000B3E5D|push (4|d*256|d)
000B3E65|push 0
000B3E62|lea eax, [esi+3C]
000B3E67|push eax
000B3E68|call 000CA242
000B3E70|add esp, 0C
6.0.6003.20785: 000B40AD|push (4|d*256|d)
000B40B5|push 0
000B40B2|lea eax, [esi+3C]
000B40B7|push eax
000B40B8|call 000CA497
000B40C0|add esp, 0C

5.00.2195.7640:
ulTemp = ulGetNearestIndexFromColorref(
palSrc,
palSrcDC,
iBackSrc,
1
);
// ebx = 1
000E258D|push 1
000E2594|pop ebx

000E2595|push ebx

000E2591|mov edi, dword ptr [ebp+28]
000E2596|push edi

000E2597|push dword ptr [ebp+18]
000E259A|push dword ptr [ebp+10]

000E259D|call 00107888
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // ebx = 1
000B076D|xor ebx, ebx
000B076F|inc ebx

000B0770|push ebx

000B0767|mov edi, dword ptr [ebp+28]
000B0771|push edi

000B0772|push dword ptr [ebp+18]
000B0775|push dword ptr [ebp+10]

000B0778|call 0006BCC3
6.0.6003.20665: // ebx = 1
000B3E73|xor ebx, ebx
000B3E75|inc ebx

000B3E76|push ebx

000B3E6D|mov edi, dword ptr [ebp+28]
000B3E77|push edi

000B3E78|push dword ptr [ebp+18]
000B3E7B|push dword ptr [ebp+10]

000B3E7E|call 0006E4E2
6.0.6003.20785: // ebx = 1
000B40C3|xor ebx, ebx
000B40C5|inc ebx

000B40C6|push ebx

000B40BD|mov edi, dword ptr [ebp+28]
000B40C7|push edi

000B40C8|push dword ptr [ebp+18]
000B40CB|push dword ptr [ebp+10]

000B40CE|call 0006E582

5.00.2195.7640:
// check if it's ">=",
// not ">" like the string says

ASSERTGDI(
ulTemp < 256,
"ERROR palSrc invalid -
ulGetNearest is > 256"
);
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
pxlate->vSetIndex(
ulTemp,
1
);

...
000E25A2|mov dword ptr [eax*4+esi+3C], ebx

...

000E25AD|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B077D|mov dword ptr [eax*4+esi+3C], ebx

...

000B0788|jmp 000B0864
6.0.6003.20665: 000B3E83|mov dword ptr [eax*4+esi+3C], ebx

...

000B3E8E|jmp 000B3F6C
6.0.6003.20785: 000B40D3|mov dword ptr [eax*4+esi+3C], ebx

...

000B40DE|jmp 000B41BC

5.00.2195.7640:
}else{
// Blting from palette-managed bitmap to
// non-palette managed surface.
//
// Do all the non-default colors that are
// realized.
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
// If the dest is 256 entries we will just
// leave the identity xlate as the initial
// state.

if(palDestSurf.cEntries() != 256){
000E25B2|cmp dword ptr [ebx+14], ecx
000E25B5|je short 000E25C1
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// If the dest has the same number of
// entries like cEntry is set, then we
// will just leave the identity xlate as
// the initial state.

if(palDestSurf.cEntries() != cEntry){
 
6.0.6002.18005:
// If the dest is 256 entries we will just
// leave the identity xlate as the initial
// state.

if(palDestSurf.cEntries() != 256){
000B078D|cmp dword ptr [edi+14], 100
000B0794|je short 000B07A9
 
6.0.6003.20665: 000B3E93|cmp dword ptr [eax+14], 100
000B3E9A|je short 000B3EB2
6.0.6003.20785: 000B40E3|cmp dword ptr [eax+14], 100
000B40EA|je short 000B4102

5.00.2195.7640:
// Otherwise we 0 it out so we don't
// have a translation index left
// that's potentially bigger than the
// destination palette.


// bug related note: This is a code
// snippet, where a buffer overrun
// might happen.

RtlZeroMemory(
pxlate->ai,
256 * sizeof(ULONG)
);
}
000E25B7|xor eax, eax
000E25B9|lea edi, [esi+3C]
000E25BC|rep stos dword ptr [edi]

// edi = address(palDestDC)
000E25BE|mov edi, dword ptr [ebp+1C]
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// Otherwise we 0 it out so we don't
// have a translation index left
// that's potentially bigger than the
// destination palette.

RtlZeroMemory(
pxlate->ai,
cEntry * sizeof(ULONG)
);
}
 
6.0.6002.18005:
// Otherwise we 0 it out so we don't
// have a translation index left
// that's potentially bigger than the
// destination palette.


// bug related note: This is a code
// snippet, where a buffer overrun
// might happen.

RtlZeroMemory(
pxlate->ai,
256 * sizeof(ULONG)
);
}
000B0796|push 400
000B079E|push 0
000B079B|lea eax, [esi+3C]
000B07A0|push eax
000B07A1|call 000C6981
000B07A6|add esp, 0C
 
6.0.6003.20665: 000B3E9C|push 400
000B3EA4|push 0
000B3EA1|lea eax, [esi+3C]
000B3EA6|push eax
000B3EA7|call 000CA242
000B3EAC|mov eax, dword ptr [ebp+14]
000B3EAF|add esp, 0C
6.0.6003.20785: 000B40EC|push 400
000B40F4|push 0
000B40F1|lea eax, [esi+3C]
000B40F6|push eax
000B40F7|call 000CA497
000B40FC|mov eax, dword ptr [ebp+14]
000B40FF|add esp, 0C

5.00.2195.7640:
// We need to fill in where the default
// colors map.

for(
ulTemp = 0;
ulTemp < 10;
ulTemp++
){
pxlate->ai[ulTemp] = (
palDestSurf.ulGet­Nearest­From­Palentry(
logDefaultPal.palPalEntry[
ulTemp
]
)
);

// bug related note: This is a code
// snippet, where a buffer overrun might
// happen.

pxlate->ai[ulTemp + 246] = (
palDestSurf.ulGet­Nearest­From­Palentry(
logDefaultPal.palPalEntry[
ulTemp+10
]
)
);
}
// [ebp+20] = address(pxlate->ai[246|d])
000E25C1|lea eax, [esi+3C|h+(4|d*246|d)]]
000E25CE|mov dword ptr [ebp+20], eax

// [ebp+1C|h] = address(
//    logDefaultPal.palPalEntry[10|d]
// )

000E25C7|mov dword ptr [ebp+1C], A0179284

// 000E25D1|- beginning of the loop -

000E25D1|mov eax, dword ptr [ebp+1C]
000E25D6|mov edx, dword ptr [eax-(4|d*10|d)]

// ecx = address(palDestSurf)
000E25D4|mov ecx, ebx

// call palDestSurf.ulGet­Nearest­From­Palentry
000E25D9|call dword ptr [ebx+3C]

// pxlate->ai[
//    ulTemp
// ] = returned value

000E25DC|mov ecx, dword ptr [ebp+20]
000E25DF|mov dword ptr [ecx-(4|d*246|d)], eax

000E25E5|mov eax, dword ptr [ebp+1C]
000E25EA|mov edx, dword ptr [eax]

// ecx = address(palDestSurf)
000E25E8|mov ecx, ebx

// call palDestSurf.ulGet­Nearest­From­Palentry
000E25EC|call dword ptr [ebx+3C]

// pxlate->ai[
//    ulTemp + 246
// ] = returned value

000E25EF|mov ecx, dword ptr [ebp+20]
000E2601|mov dword ptr [ecx], eax

000E25F2|add dword ptr [ebp+1C], 4
000E25F6|add dword ptr [ebp+20], 4

// if: [ebp+1C|h] < address(
//    logDefaultPal.palPalEntry[20|d]
// )
// then: jump to: beginning of the loop

000E25FA|cmp dword ptr [ebp+1C], A01792AC
000E2603|jb short 000E25D1

// 000E2605|- end of the loop -
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// We need to fill in where the
// default/10 + 10 holy colors map.

for(
ulTemp = 0;
ulTemp < 256|d;
ulTemp++
){
if(ulTemp == 10|d){
ulTemp = 246|d;
}

if(ulTemp >= cEntry){
break;
}

if(ulTemp < 10|d){
temp = logDefaultPal.palPalEntry[
ulTemp
];
}else{
temp = logDefaultPal.palPalEntry[
  ulTemp
- 246|d
+ 10|d
]
}

temp = (
palDestSurf.ulGet­Nearest­From­Palentry(
temp
)
);

pxlate->ai[ulTemp] = temp;
}
// save edi
000E25C1|push edi

// ulTemp = 0|d
000E25C2|xor edi, edi

// 000E25C4|- beginning of the loop -

// if: ulTemp != 10|d
// then: jump to: after the overwrite

000E25C4|cmp edi, 10|d
000E25C7|jne 000E25CE

// ulTemp = 246|d
000E25C9|mov edi, 246|d

// 000E25CE|- after the overwrite -

// if: ulTemp >= cEntry
// then: jump to: end of the loop

000E25CE|cmp edi, [ebp-4]
000E25D1|jae 000E25F9

// ecx = address(palDestSurf)
000E25D3|mov ecx, ebx

// if: ulTemp < 10|d
// then: edx = logDefaultPal.palPalEntry[
//    ulTemp
// ]

000E25D5|cmp edi, 10|d
000E25D8|jae 000E25E3
000E25DA|mov edx, [(edi*4|d)+A017925C]
000E25E1|jmp 000E25EA
// else: edx = logDefaultPal.palPalEntry[
//     ulTemp
//    -246|d
//    +10|d
// ]

000E25E3|mov edx, [
     (edi*4|d)
    -(4|d*246|d)
    +(4|d*10|d)
    +A017925C
]

// call palDestSurf.ulGet­Nearest­From­Palentry
000E25EA|call dword ptr [ebx+3C]

// pxlate->ai[ulTemp] = returned value
000E25ED|mov [esi+3C|h+(4|d*edi)], eax

// ulTemp++
000E25F1|inc edi

// if: ulTemp < 256|d
// then: jump to: beginning of the loop

000E25F2|cmp di, 256|d
000E25F7|jb 000E25C4

// 000E25F9|end of the loop

// restore edi
000E25F9|pop edi

000E25FA|jmp 000E2605
000E25FC|nop
000E25FD|nop
000E25FE|nop
000E25FF|nop
000E2600|nop
000E2601|nop
000E2602|nop
000E2603|nop
000E2604|nop
 
6.0.6002.18005:
// We need to fill in where the default
// colors map.

for(
ulTemp = 0;
ulTemp < 10;
ulTemp++
){
pxlate->ai[ulTemp] = (
palDestSurf.ulGet­Nearest­From­Palentry(
logDefaultPal.palPalEntry[
ulTemp
]
)
);

// bug related note: This is a code
// snippet, where a buffer overrun might
// happen.

pxlate->ai[ulTemp + 246] = (
palDestSurf.ulGet­Nearest­From­Palentry(
logDefaultPal.palPalEntry[
ulTemp+10
]
)
);
}
000B07A9|and dword ptr [ebp+20], 0
000B07AD|lea eax, [esi+414]
000B07B3|mov dword ptr [ebp+24], eax

// 000B07B6|- beginning of the loop -

000B07B6|mov eax, dword ptr [ebp+20]
000B07B9|mov edx, dword ptr [eax+BF9D1264]
000B07BF|mov ecx, edi
000B07C1|call dword ptr [edi+3C]

// pxlate->ai[
//    ulTemp
// ] = returned value

000B07C4|mov ecx, dword ptr [ebp+24]
000B07C7|mov dword ptr [ecx-3D8], eax

000B07CD|mov eax, dword ptr [ebp+20]
000B07D0|mov edx, dword ptr [eax+BF9D128C]
000B07D6|mov ecx, edi
000B07D8|call dword ptr [edi+3C]

// pxlate->ai[
//    ulTemp + 246
// ] = returned value

000B07DB|mov ecx, dword ptr [ebp+24]
000B07EA|mov dword ptr [ecx], eax

000B07E2|add dword ptr [ebp+24], 4
000B07DE|add dword ptr [ebp+20], 4

000B07E6|cmp dword ptr [ebp+20], 28
000B07EC|jb short 000B07B6

// 000B07EE|- end of the loop -
 
6.0.6003.20665: 000B3EB8|xor ebx, ebx
000B3EBA|jmp short 000B3EBF

// 000B3EBC|- beginning of the loop -

000B3EBC|mov eax, dword ptr [ebp+14]
000B3EBF|push dword ptr [ebx+BF9DD364]
000B3EC5|lea ecx, [ebp+14]
000B3EC8|push dword ptr [eax+3C]
000B3ECB|call 0017B570

// pxlate->ai[
//    ulTemp
// ] = returned value

000B3ED0|mov dword ptr [edi-3D8], eax

000B3ED6|push dword ptr [ebx+BF9DD38C]
000B3EDC|mov eax, dword ptr [ebp+14]
000B3EDF|push dword ptr [eax+3C]
000B3EE2|lea ecx, [ebp+14]
000B3EE5|call 0017B570

// pxlate->ai[
//    ulTemp + 246
// ] = returned value

000B3EEA|mov dword ptr [edi], eax

000B3EEC|add ebx, 4
000B3EEF|add edi, 4

000B3EF2|cmp ebx, 28
000B3EF5|jb short 000B3EBC

// 000B3EF7|- end of the loop -
6.0.6003.20785: 000B4102|lea edi, [esi+414]
000B4108|xor ebx, ebx
000B410A|jmp short 000B410F

// 000B410C|- beginning of the loop -

000B410C|mov eax, dword ptr [ebp+14]
000B410F|push dword ptr [ebx+BF9DE364]
000B4115|lea ecx, [ebp+14]
000B4118|push dword ptr [eax+3C]
000B411B|call 0017B98B

// pxlate->ai[
//    ulTemp
// ] = returned value

000B4120|mov dword ptr [edi-3D8], eax

000B4126|push dword ptr [ebx+BF9DE38C]
000B412C|mov eax, dword ptr [ebp+14]
000B412F|push dword ptr [eax+3C]
000B4132|lea ecx, [ebp+14]
000B4135|call 0017B98B

// pxlate->ai[
//    ulTemp + 246
// ] = returned value

000B413A|mov dword ptr [edi], eax

000B413C|add ebx, 4
000B413F|add edi, 4

000B4142|cmp ebx, 28
000B4145|jb short 000B410C

// 000B4147|- end of the loop -

5.00.2195.7640:
if(flCreateFlag & XLATE_USE_SURFACE_PAL){
000E2605|test byte ptr [ebp+2D], 20
000E2609|je short 000E2641
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B07EE|test word ptr [ebp+2C], 2000
000B07F4|je short 000B082F
6.0.6003.20665: // edi = 0|d
000B3EF7xor edi, edi

000B3EF9|test word ptr [ebp+2C], 2000
000B3EFF|je short 000B3F37
6.0.6003.20785: // edi = 0|d
000B4147|xor edi, edi

000B4149|test word ptr [ebp+2C], 2000
000B414F|je short 000B4187

5.00.2195.7640:
// Map directly to destination
// surface palette from source
// surface palette.

for(
ulTemp = 0;
ulTemp < palSrc.cEntries();
ulTemp++
){
pxlate->ai[
ulTemp
] = palDestSurf.ulGet­Nearest­From­Palentry(
palSrc.palentryGet(
ulTemp
)
);
}

...
// eax = address(palSrc)
000E260B|mov eax, dword ptr [ebp+10]

// ulTemp = 0
000E260E|xor edi, edi

// if: palSrc.cEntries == 0
// then: jump to: end of the loop

000E2610|cmp dword ptr [eax+14], edi
000E2613|jbe short 000E263B

// eax = address(pxlate->ai)
000E2615|lea eax, [esi+3C]

000E2618|mov dword ptr [ebp+1C], eax

// 000E261B|- beginning of the loop -

000E261B|mov eax, dword ptr [ebp+10]
000E261E|mov ecx, ebx
000E2620|mov eax, dword ptr [eax+4C]

// edx = palSrc.palentryGet(ulTemp)
000E2623|mov edx, dword ptr [edi*4+eax]

// call palDestSurf.ulGet­Nearest­From­Palentry
000E2626|call dword ptr [ebx+3C]

000E2629|mov ecx, dword ptr [ebp+1C]
000E262C|add dword ptr [ebp+1C], 4
000E2630|inc edi
000E2631|mov dword ptr [ecx], eax
000E2633|mov eax, dword ptr [ebp+10]

// if: ulTemp < palSrc.cEntries()
// then: jump to: beginning of the loop

000E2636|cmp edi, dword ptr [eax+14]
000E2639|jb short 000E261B

// 000E263B|- end of the loop -

...

000E263F|jmp short 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // eax = address(palSrc)
000B07F6|mov eax, dword ptr [ebp+10]

// if: palSrc.cEntries == 0
// then: jump to: end of the loop

000B07F9|xor ebx, ebx
000B07FB|cmp dword ptr [eax+14], ebx
000B07FE|jbe short 000B0826

000B0800|lea eax, [esi+3C]
000B0803|mov dword ptr [ebp+2C], eax

// 000B0806|- beginning of the loop -

000B0806|mov eax, dword ptr [ebp+10]
000B0809|mov eax, dword ptr [eax+4C]
000B080C|mov edx, dword ptr [ebx*4+eax]
000B080F|mov ecx, edi

// call palDestSurf.ulGet­Nearest­From­Palentry
000B0811|call dword ptr [edi+3C]

000B0814|mov ecx, dword ptr [ebp+2C]
000B0817|add dword ptr [ebp+2C], 4
000B081B|mov dword ptr [ecx], eax
000B081D|mov eax, dword ptr [ebp+10]
000B0820|inc ebx

// if: ulTemp < palSrc.cEntries()
// then: jump to: beginning of the loop

000B0821|cmp ebx, dword ptr [eax+14]
000B0824|jb short 000B0806

// 000B0826|- end of the loop -

...

000B082D|jmp short 000B0864
6.0.6003.20665: // eax = address(palSrc)
000B3F01|mov eax, dword ptr [ebp+10]

// if: palSrc.cEntries == 0
// then: jump to: end of the loop

000B3F04|cmp dword ptr [eax+14], edi
000B3F07|jbe short 000B3F2E

000B3F09|lea ebx, [esi+3C]

// 000B3F0C|- beginning of the loop -

000B3F0C|mov eax, dword ptr [eax+4C]
000B3F0F|push dword ptr [edi*4+eax]
000B3F12|mov eax, dword ptr [ebp+14]
000B3F15|push dword ptr [eax+3C]
000B3F18|lea ecx, [ebp+14]
000B3F1B|call 0017B570

000B3F20|mov dword ptr [ebx], eax
000B3F22|mov eax, dword ptr [ebp+10]
000B3F25|inc edi
000B3F26|add ebx, 4

// if: ulTemp < palSrc.cEntries()
// then: jump to: beginning of the loop

000B3F29|cmp edi, dword ptr [eax+14]
000B3F2C|jb short 000B3F0C

// 000B3F2E|- end of the loop -

...

000B3F35|jmp short 000B3F6C
6.0.6003.20785: // eax = address(palSrc)
000B4151|mov eax, dword ptr [ebp+10]

// if: palSrc.cEntries == 0
// then: jump to: end of the loop

000B4154|cmp dword ptr [eax+14], edi
000B4157|jbe short 000B417E

000B4159|lea ebx, [esi+3C]

// 000B415C|- beginning of the loop -

000B415C|mov eax, dword ptr [eax+4C]
000B415F|push dword ptr [edi*4+eax]
000B4162|mov eax, dword ptr [ebp+14]
000B4165|push dword ptr [eax+3C]
000B4168|lea ecx, [ebp+14]
000B416B|call 0017B98B

000B4170|mov dword ptr [ebx], eax
000B4172|mov eax, dword ptr [ebp+10]
000B4175|inc edi
000B4176|add ebx, 4

// if: ulTemp < palSrc.cEntries()
// then: jump to: beginning of the loop

000B4179|cmp edi, dword ptr [eax+14]
000B417C|jb short 000B415C

// 000B417E|- end of the loop -

...

000B4185|jmp short 000B41BC

5.00.2195.7640:
}else{
// Go through DC palette and then map to
// destination surface palette.


if(ptransFore){
// if: !ptransFore
// then: jump to: 000E2677

000E2641|cmp dword ptr [ebp+0C], 0
000E2645|je short 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // if: !ptransFore
// then: jump to: 000B0864

000B082F|xor eax, eax
000B0831|cmp dword ptr [ebp+1C], eax
000B0834|je short 000B0864
6.0.6003.20665: // if: !ptransFore
// then: jump to: 000B0864

000B3F37|mov ebx, dword ptr [ebp+0C]
000B3F3A|cmp ebx, edi
000B3F3C|je short 000B3F6C
6.0.6003.20785: // if: !ptransFore
// then: jump to: 000B0864

000B4187|mov ebx, dword ptr [ebp+0C]
000B418A|cmp ebx, edi
000B418C|je short 000B41BC

5.00.2195.7640:
// bug related note: This is a code
// snippet, where a buffer overrun
// might happen.


for(
ulTemp = 0;
ulTemp < palDestDC.cEntries();
ulTemp++
){
pxlate->ai[
ptransFore->ajVector[ulTemp]
] = palDestSurf.ulGet­Nearest­From­Palentry(
palDestDC.palentryGet(ulTemp)
);
}
}
}
}
// ulTemp = 0|d
000E2647|and dword ptr [ebp+10], 0

// if: !palDestDC.cEntries()
// then: jump to: end of the loop

000E264B|cmp dword ptr [edi+14], 0
000E264F|jbe short 000E2677

// 000E2651|- beginning of the loop -

// ecx = ulTemp
000E2654|mov ecx, dword ptr [ebp+10]

// edx = palDestDC.palentryGet(ulTemp)
000E2651|mov eax, dword ptr [edi+4C]
000E2657|mov edx, dword ptr [(ecx*4)+eax]

000E265A|mov ecx, ebx

000E265C|call dword ptr [ebx+3C]

// ecx = ulTemp
000E265F|mov ecx, dword ptr [ebp+10]

// edx = address(ptransFore)
000E2662|mov edx, dword ptr [ebp+0C]

// edx = ptransFore->ajVector[ulTemp]
000E2665|movzx edx, byte ptr [edx+ecx+4]

// pxlate->ai[edx] = returned value
000E266B|mov dword ptr [(edx*4)+esi+3C], eax

// ulTemp++
000E266A|inc ecx
000E2672|mov dword ptr [ebp+10], ecx

// if: ulTemp < palDestDC.cEntries()
// then: jump to: beginning of the loop

000E266F|cmp ecx, dword ptr [edi+14]
000E2675|jb short 000E2651

// 000E2677|- end of the loop -
 
5.00.2196.0001V1:
5.00.2196.0001V2:
for(
ulTemp = 0;
ulTemp < min(
palDestDC.cEntries(),
cEntry
);
ulTemp++
){
pxlate->ai[
ptransFore->ajVector[ulTemp]
] = palDestSurf.ulGet­Nearest­From­Palentry(
palDestDC.palentryGet(ulTemp)
);
}
}
}
}
// save edi
000E2647|push edi

// ulTemp = min(
//    palDestDC.cEntries(),
//    cEntry
// ) [start]
// edi = palDestDC.cEntries()
000E2648|mov edi, dword ptr [edi+14]

// if: palDestDC.cEntries() <= cEntry
// then: jump to: end of the min block

000E264B|cmp edi, [ebp-4]
000E264E|jbe 000E2653

// edi = cEntry
000E2650|mov edi, [ebp-4]

// 000E2653|- end of the min block -
// ulTemp = min(
//    palDestDC.cEntries(),
//    cEntry
// ) [end]


// jump to: before the substraction
000E2653|jmp 000E266F

// 000E2655|- beginning of the loop -

// edx = palDestDC.palentryGet(ulTemp)
000E2655|mov edx, [esp]
000E2658|mov edx, [edx+4C]
000E265B|mov edx, [(edi*4)+edx]

000E265E|mov ecx, ebx

000E2660|call dword ptr [ebx+3C]

// edx = address(ptransFore)
000E2663|mov edx, dword ptr [ebp+0C]

// edx = ptransFore->ajVector[ulTemp]
000E2666|movzx edx, byte ptr [edx+edi+4]

// pxlate->ai[edx] = returned value
000E266B|mov dword ptr [(edx*4)+esi+3C], eax

// 000E266F|- before the substraction -

// can't use "decrement"; it doesn't set cf
// ulTemp--

000E266F|sub edi, 1|d

// if: ulTemp >= 0|d
// then: jump to: beginning of the loop

000E2672|jae 000E2655

// 000E2674|- end of the loop -

// restore edi
000E2674|pop edi

000E2675|nop
000E2676|nop
 
6.0.6002.18005:
// bug related note: This is a code
// snippet, where a buffer overrun
// might happen.


for(
ulTemp = 0;
ulTemp < palDestDC.cEntries();
ulTemp++
){
pxlate->ai[
ptransFore->ajVector[ulTemp]
] = palDestSurf.ulGet­Nearest­From­Palentry(
palDestDC.palentryGet(ulTemp)
);
}
}
}
}
// ulTemp = 0|d
000B0839|mov dword ptr [ebp+10], eax

// if: !palDestDC.cEntries()
// then: jump to: end of the loop

000B0836|cmp dword ptr [ebx+14], eax
000B083C|jbe short 000B0864

// 000B083E|- beginning of the loop -

000B083E|mov eax, dword ptr [ebx+4C]
000B0841|mov ecx, dword ptr [ebp+10]
000B0844|mov edx, dword ptr [ecx*4+eax]
000B0847|mov ecx, edi
000B0849|call dword ptr [edi+3C]

000B084C|mov ecx, dword ptr [ebp+10]
000B084F|mov edx, dword ptr [ebp+1C]
000B0852|movzx edx, byte ptr [ecx+edx+4]
000B0858|mov dword ptr [edx*4+esi+3C], eax

000B0857|inc ecx
000B085F|mov dword ptr [ebp+10], ecx

// if: ulTemp < palDestDC.cEntries()
// then: jump to: beginning of the loop

000B085C|cmp ecx, dword ptr [ebx+14]
000B0862|jb short 000B083E

// 000B0864|- end of the loop -
 
6.0.6003.20665: // if: !palDestDC.cEntries()
// then: jump to: end of the loop

000B3F3E|mov eax, dword ptr [ebp+1C]
000B3F41|cmp dword ptr [eax+14], edi
000B3F44|jbe short 000B3F6C

// 000B3F46|- beginning of the loop -

000B3F46|mov eax, dword ptr [eax+4C]
000B3F49|push dword ptr [edi*4+eax]
000B3F4C|mov eax, dword ptr [ebp+14]
000B3F4F|push dword ptr [eax+3C]
000B3F52|lea ecx, [ebp+14]
000B3F55|call 0017B570

000B3F5A|movzx ecx, byte ptr [edi+ebx+4]
000B3F5F|mov dword ptr [ecx*4+esi+3C], eax

000B3F66|inc edi

// if: ulTemp < palDestDC.cEntries()
// then: jump to: beginning of the loop

000B3F63|mov eax, dword ptr [ebp+1C]
000B3F67|cmp edi, dword ptr [eax+14]
000B3F6A|jb short 000B3F46

000B3F6C|- end of the loop -
6.0.6003.20785: // if: !palDestDC.cEntries()
// then: jump to: end of the loop

000B418E|mov eax, dword ptr [ebp+1C]
000B4191|cmp dword ptr [eax+14], edi
000B4194|jbe short 000B41BC

// 000B4196|- beginning of the loop -

000B4196|mov eax, dword ptr [eax+4C]
000B4199|push dword ptr [edi*4+eax]
000B419C|mov eax, dword ptr [ebp+14]
000B419F|push dword ptr [eax+3C]
000B41A2|lea ecx, [ebp+14]
000B41A5|call 0017B98B

000B41AA|movzx ecx, byte ptr [edi+ebx+4]
000B41AF|mov dword ptr [ecx*4+esi+3C], eax

000B41B6|inc edi

// if: ulTemp < palDestDC.cEntries()
// then: jump to: beginning of the loop

000B41B3|mov eax, dword ptr [ebp+1C]
000B41B7|cmp edi, dword ptr [eax+14]
000B41BA|jb short 000B4196

// 000B41BC|- end of the loop -

5.00.2195.7640:
}else if(
palSrc.bIsPalDibsection() && (
(
palDestSurf.bValid() &&
palDestSurf.bIsPalDibsection() &&
bEqualRGB_In_Palette(
palSrc,
palDestSurf
)
) || (
(
!palDestSurf.bValid() || (
palDestSurf.bIsPalManaged() &&
ptransFore == ptransCurrent
)
) && bEqualRGB_In_Palette(
palSrc,
palDestDC
)
)
)
){
// if: !palSrc.bIsPalDibsection()
// then: jump to: 000E229C

000E2240|mov eax, 8000
000E2245|test eax, ecx
000E2247|je short 000E229C

// if: !palDestSurf.bValid()
// then: jump to: 000E2274

000E2249|test ebx, ebx
000E224B|je short 000E2274

// if: !palDestSurf.bIsPalDibsection()
// then: jump to: 000E2262

000E224D|test dword ptr [ebx+10], eax
000E2250|je short 000E2262

// bEqualRGB_In_Palette(palSrc, palDestSurf)
000E2252|push ebx
000E2253|push dword ptr [ebp+10]
000E2256|call 00048E90

// if: returned value
// then: jump to: 000E2281

000E225B|test eax, eax
000E225D|jne short 000E2281

// edx = address(palSrc)
000E225F|mov edx, dword ptr [ebp+10]

if: !palDestSurf.bValid()
then: jump to: 000E2274

000E2262|test ebx, ebx
000E2264|je short 000E2274

// if: !palDestSurf.bIsPalManaged()
// then: jump to: 000E229C

000E2266|test byte ptr [ebx+11], 08
000E226A|je short 000E229C

// if: ptransFore != ptransCurrent
// then: jump to: 000E229C

000E226C|mov eax, dword ptr [ebp+8]
000E226F|cmp dword ptr [ebp+0C], eax
000E2272|jne short 000E229C

// bEqualRGB_In_Palette(palSrc, palDestDC)
000E2274|push edi
000E2275|push dword ptr [ebp+10]
000E2278|call 00048E90

// if: !returned value
// then: jump to: 000E2299

000E227D|test eax, eax
000E227F|je short 000E2299
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // if: !palSrc.bIsPalDibsection()
// then: jump to: 000B0468

000B040E|mov eax, 8000
000B0413|test eax, ecx
000B0415|je short 000B0468

// if: !palDestSurf.bValid()
// then: jump to: 000B0440

000B0417|test edi, edi
000B0419|je short 000B0440

// if: !palDestSurf.bIsPalDibsection()
// then: jump to: 000B0430

000B041B|test dword ptr [edi+10], eax
000B041E|je short 000B0430

// bEqualRGB_In_Palette(palSrc, palDestSurf)
000B0420|push edi
000B0421|push dword ptr [ebp+10]
000B0424|call 000A3E77

// if: returned value
// then: jump to: 000B044D

000B0429|test eax, eax
000B042B|jne short 000B044D

// edx = address(palSrc)
000B042D|mov edx, dword ptr [ebp+10]

// if: !palDestSurf.bIsPalManaged()
// then: jump to: 000B0468

000B0430|test word ptr [edi+10], 0800
000B0436|je short 000B0468

// if: ptransFore != ptransCurrent
// then: jump to: 000B0468

000B0438|mov eax, dword ptr [ebp+0C]
000B043B|cmp dword ptr [ebp+1C], eax
000B043E|jne short 000B0468

// bEqualRGB_In_Palette(palSrc, palDestDC)
000B0440|push ebx
000B0441|push dword ptr [ebp+10]
000B0444|call 000A3E77

// if: !returned value
// then: jump to: 000B0465

000B0449|test eax, eax
000B044B|je short 000B0465
6.0.6003.20665: // eax = address(palDestSurf)
000B3B05|mov eax, dword ptr [ebp+14]

// if: !palSrc.bIsPalDibsection()
// then: jump to: 000B3B68

000B3B08|mov edi, 8000
000B3B0D|test edi, edx
000B3B0F|je short 000B3B68

// if: !palDestSurf.bValid()
// then: jump to: 000B3B3E

000B3B11|test eax, eax
000B3B13|je short 000B3B3E

// if: !palDestSurf.bIsPalDibsection()
// then: jump to: 000B3B2A

000B3B15|test dword ptr [eax+10], edi
000B3B18|je short 000B3B2A

// bEqualRGB_In_Palette(palSrc, palDestSurf)
000B3B1A|push eax
000B3B1B|push dword ptr [ebp+10]
000B3B1E|call 000A76B8

// if: returned value
// then: jump to: 000B3B4D

000B3B23|test eax, eax
000B3B25|jne short 000B3B4D

// eax = address(palDestSurf)
000B3B27|mov eax, dword ptr [ebp+14]

if: !palDestSurf.bValid()
then: jump to: 000B3B3E

000B3B2A|test eax, eax
000B3B2C|je short 000B3B3E

// if: !palDestSurf.bIsPalManaged()
// then: jump to: 000B3B68

000B3B2E|test word ptr [eax+10], 0800
000B3B34|je short 000B3B68

// if: ptransFore != ptransCurrent
// then: jump to: 000B3B68

000B3B36|mov ecx, dword ptr [ebp+0C]
000B3B39|cmp ecx, dword ptr [ebp+8]
000B3B3C|jne short 000B3B68

// bEqualRGB_In_Palette(palSrc, palDestDC)
000B3B3E|push dword ptr [ebp+1C]
000B3B41|push dword ptr [ebp+10]
000B3B44|call 000A76B8

// if: !returned value
// then: jump to: 000B3B65

000B3B49|test eax, eax
000B3B4B|je short 000B3B65
6.0.6003.20785: // eax = address(palDestSurf)
000B3D55|mov eax, dword ptr [ebp+14]

// if: !palSrc.bIsPalDibsection()
// then: jump to: 000B3B68

000B3D58|mov edi, 8000
000B3D5D|test edi, edx
000B3D5F|je short 000B3DB8

// if: !palDestSurf.bValid()
// then: jump to: 000B3D8E

000B3D61|test eax, eax
000B3D63|je short 000B3D8E

// if: !palDestSurf.bIsPalDibsection()
// then: jump to: 000B3D7A

000B3D65|test dword ptr [eax+10], edi
000B3D68|je short 000B3D7A

// bEqualRGB_In_Palette(palSrc, palDestSurf)
000B3D6A|push eax
000B3D6B|push dword ptr [ebp+10]
000B3D6E|call 000A78C4

// if: returned value
// then: jump to: 000B3D9D

000B3D73|test eax, eax
000B3D75|jne short 000B3D9D

// eax = address(palDestSurf)
000B3D77|mov eax, dword ptr [ebp+14]

if: !palDestSurf.bValid()
then: jump to: 000B3D8E

000B3D7A|test eax, eax
000B3D7C|je short 000B3D8E

// if: !palDestSurf.bIsPalManaged()
// then: jump to: 000B3DB8

000B3D7E|test word ptr [eax+10], 0800
000B3D84|je short 000B3DB8

// if: ptransFore != ptransCurrent
// then: jump to: 000B3DB8

000B3D86|mov ecx, dword ptr [ebp+0C]
000B3D89|cmp ecx, dword ptr [ebp+8]
000B3D8C|jne short 000B3DB8

// bEqualRGB_In_Palette(palSrc, palDestDC)
000B3D8E|push dword ptr [ebp+1C]
000B3D91|push dword ptr [ebp+10]
000B3D94|call 000A78C4

// if: !returned value
// then: jump to: 000B3DB5

000B3D99|test eax, eax
000B3D9B|je short 000B3DB5

5.00.2195.7640:
// Blting from a Dibsection &&
// ((To another Dibsection with ident palette) ||
//  (((To a compatible palette managed bitmap) ||
//    (To a palette managed screen with the DstDc's
//     logical palette realized in the foreground)) &&
//   (the dst logical palette == Dibsection's palette)
// ))
//
// This is identity. We do this special check so even
// if there are duplicate colors in the palette we
// still get identity.


// bug related note: This is a code snippet, where a
// buffer overrun might happen.

for(
ulTemp = 0;
ulTemp < 256;
ulTemp++
){
pxlate->ai[ulTemp] = ulTemp;
}

...
// ulTemp = 0
000E2281|xor ecx, ecx

000E2283|lea eax, [esi+3C]

// 000E2286|- beginning of the loop -

// pxlate->ai[ulTemp] = ulTemp
000E2286|mov dword ptr [eax], ecx

000E2288|inc ecx
000E2289|add eax, 4

// if: ulTemp < 256
// then: jump to: beginning of the loop

000E228C|cmp ecx, 100
000E2292|jb short 000E2286

// 000E2294|- end of the loop -

000E2294|jmp 000E24F2
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// Blting from a Dibsection &&
// ((To another Dibsection with ident palette) ||
// (((To a compatible palette managed bitmap) ||
// (To a palette managed screen with the DstDc's
// logical palette realized in the foreground)) &&
// (the dst logical palette == Dibsection's palette)
// ))
//
// This is identity. We do this special check so even
// if there are duplicate colors in the palette we
// still get identity.

for(
ulTemp = 0;
ulTemp < cEntry;
ulTemp++
){
pxlate->ai[ulTemp] = ulTemp;
}

...
// ulTemp = cEntry
000E2281|mov eax, [ebp-4]

// jump to: before the substraction
000E2284|jmp 000E228A

// 000E2286|- beginning of the loop -

000E2286|mov dword ptr [esi+3C+(eax*4)], eax

// 000E228A|- before the substraction -

// can't use "decrement"; it doesn't set cf
// ulTemp--

000E228A|sub eax, 1|d

// if: eax < cEntry
// then: jump to: beginning of the loop

000E228D|jae short 000E2286

000E228F|jmp 000E24F2
000E2294|nop
000E2295|nop
000E2296|nop
000E2297|nop
000E2298|nop
 
6.0.6002.18005:
// Blting from a Dibsection &&
// ((To another Dibsection with ident palette) ||
// (((To a compatible palette managed bitmap) ||
// (To a palette managed screen with the DstDc's
// logical palette realized in the foreground)) &&
// (the dst logical palette == Dibsection's palette)
// ))
//
// This is identity. We do this special check so even
// if there are duplicate colors in the palette we
// still get identity.


// bug related note: This is a code snippet, where a
// buffer overrun might happen.

for(
ulTemp = 0;
ulTemp < 256;
ulTemp++
){
pxlate->ai[ulTemp] = ulTemp;
}

...
// ulTemp = 0
000B044D|xor ecx, ecx

000B044F|lea eax, [esi+3C]

// 000B0452|- beginning of the loop -

// pxlate->ai[ulTemp] = ulTemp
000B0452|mov dword ptr ds:[eax], ecx

000B0454|inc ecx
000B0455|add eax, 4

// if: ulTemp < 256
// then: jump to: beginning of the loop

000B0458|cmp ecx, 100
000B045E|jb short 000B0452

// 000B0460|- end of the loop -

000B0460|jmp 000B06C1
 
6.0.6003.20665: // ulTemp = 0
000B3B4D|xor ecx, ecx

000B3B4F|lea eax, [esi+3C]

// 000B3B52|- beginning of the loop -

// pxlate->ai[ulTemp] = ulTemp
000B3B52|mov dword ptr [eax], ecx

000B3B54|inc ecx
000B3B55|add eax, 4

// if: ulTemp < 256
// then: jump to: beginning of the loop

000B3B58|cmp ecx, 100
000B3B5E|jb short 000B3B52

// 000B3B60|- end of the loop -

000B3B60|jmp 000B3DCC
6.0.6003.20785: // ulTemp = 0
000B3D9D|xor ecx, ecx

000B3D9F|lea eax, [esi+3C]

// 000B3DA2|- beginning of the loop -

// pxlate->ai[ulTemp] = ulTemp
000B3DA2|mov dword ptr [eax], ecx

000B3DA4|inc ecx
000B3DA5|add eax, 4

// if: ulTemp < 256
// then: jump to: beginning of the loop

000B3DA8|cmp ecx, 100
000B3DAE|jb short 000B3DA2

// 000B3DB0|- end of the loop -

000B3DB0|jmp 000B401C

5.00.2195.7640:
}else if(
palSrc.bIsPalManaged() &&
!palDestSurf.bValid()
){
// if: !palSrc.bIsPalManaged()
// then: jump to: 000E2330

000E2299|mov edx, dword ptr [ebp+10]
000E229C|mov eax, dword ptr [edx+10]
000E229F|test ah, 08
000E22A2|je 000E2330

// if: palDestSurf.bValid()
// then: jump to: 000E2330

000E22A8|test ebx, ebx
000E22AA|jne 000E2330
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // if: !palSrc.bIsPalManaged()
// then: jump to: 000B050E

000B0465|mov edx, dword ptr [ebp+10]
000B0468|mov eax, dword ptr [edx+10]
000B046B|test ax, 0800
000B046F|je 000B050E

// if: palDestSurf.bValid()
// then: jump to: 000B050E

000B0475|test edi, edi
000B0477|jne 000B050E
6.0.6003.20665: // if: !palSrc.bIsPalManaged()
// then: jump to: 000B3C10

000B3B65|mov eax, dword ptr [ebp+14]
000B3B68|mov ecx, dword ptr [ebp+10]
000B3B6B|mov edx, dword ptr [ecx+10]
000B3B6E|test dx, 0800
000B3B73|je 000B3C10

// if: palDestSurf.bValid()
// then: jump to: 000B3C10

000B3B79|test eax, eax
000B3B7B|jne 000B3C10
6.0.6003.20785: // if: !palSrc.bIsPalManaged()
// then: jump to: 000B3E60

000B3DB5|mov eax, dword ptr [ebp+14]
000B3DB8|mov ecx, dword ptr [ebp+10]
000B3DBB|mov edx, dword ptr [ecx+10]
000B3DBE|test dx, 0800
000B3DC3|je 000B3E60

// if: palDestSurf.bValid()
// then: jump to: 000B3E60

000B3DC9|test eax, eax
000B3DCB|jne 000B3E60

5.00.2195.7640:
// We are blting from the screen to a compatible
// bitmap on a palette managed device where the
// screen is realized in the background.

// Make it identity by default.


// bug related note: This is a code snippet,
// where a buffer overrun might happen.

for(
ulTemp = 0;
ulTemp < 256;
ulTemp++
){
pxlate->ai[ulTemp] = ulTemp;
}
// ulTemp = 0
000E22B0|xor eax, eax

000E22B2|lea ecx, [esi+3C]

// 000E22B5|- beginning of the loop -

// pxlate->ai[ulTemp] = ulTemp
000E22B5|mov dword ptr [ecx], eax

000E22B7|inc eax
000E22B8|add ecx, 4

// if: ulTemp < 256|d
// then: jump to: beginning of the loop

000E22BB|cmp eax, 100
000E22C0|jb short 000E22B5

// 000E22C2|- end of the loop -
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// We are blting from the screen to a compatible
// bitmap on a palette managed device where the
// screen is realized in the background.

// Make it identity by default.

for(
ulTemp = 0;
ulTemp < cEntry;
ulTemp++
){
pxlate->ai[ulTemp] = ulTemp;
}
// ulTemp = cEntry
000E22B0|mov eax, [ebp-4]

// jump to: before the substraction
000E22B3|jmp 000E22B9

// 000E22B5|- beginning of the loop -

000E22B5|mov dword ptr [esi+3C+(eax*4)], eax

// 000E22B9|- before the substraction -

// can't use "decrement"; it doesn't set cf
// ulTemp--

000E22B9|sub eax, 1|d

// if: eax < cEntry
// then: jump to: beginning of the loop

000E22BC|jae short 000E22B5

// 000E22BE|- end of the loop -

000E22BE|nop
000E22BF|nop
000E22C0|nop
000E22C1|nop
 
6.0.6002.18005:
// We are blting from the screen to a compatible
// bitmap on a palette managed device where the
// screen is realized in the background.

// Make it identity by default.


// bug related note: This is a code snippet,
// where a buffer overrun might happen.

for(
ulTemp = 0;
ulTemp < 256;
ulTemp++
){
pxlate->ai[ulTemp] = ulTemp;
}
// ulTemp = 0
000B047D|xor eax, eax

000B047F|lea ecx, [esi+3C]

// 000B0482|- beginning of the loop -

// pxlate->ai[ulTemp] = ulTemp
000B0482|mov dword ptr [ecx], eax

000B0484|inc eax
000B0485|add ecx, 4

// if: ulTemp < 256|d
// then: jump to: beginning of the loop

000B0488|cmp eax, 100
000B048D|jb short 000B0482

// 000B048F|- end of the loop -
 
6.0.6003.20665: 000B3B81|lea ecx, [esi+3C]

// 000B3B84|- beginning of the loop -

// pxlate->ai[ulTemp] = ulTemp
000B3B84|mov dword ptr [ecx], eax

000B3B86|inc eax
000B3B87|add ecx, 4

// if: ulTemp < 256|d
// then: jump to: beginning of the loop

000B3B8A|cmp eax, 100
000B3B8F|jb short 000B3B84

// 000B3B91|- end of the loop -
6.0.6003.20785: 000B3DD1|lea ecx, [esi+3C]

// 000B3DD4|- beginning of the loop -

// pxlate->ai[ulTemp] = ulTemp
000B3DD4|mov dword ptr [ecx], eax

000B3DD6|inc eax
000B3DD7|add ecx, 4

// if: ulTemp < 256|d
// then: jump to: beginning of the loop

000B3DDA|cmp eax, 100
000B3DDF|jb short 000B3DD4

// 000B3DE1|- end of the loop -

5.00.2195.7640:
// We are blting background to foreground.
// i.e. we are blting current realize to
// foreground realize.


ASSERTGDI(
pxlate->cEntries == 256,
"ERROR xlate too small"
);

ASSERTGDI(
ptransFore != ptransCurrent,
"Should have been identity, never get here"
);

ASSERTGDI(
ptransFore != NULL,
"ERROR this should not have got here Fore"
);

ASSERTGDI(
ptransCurrent != NULL,
"ERROR this should not have got here Current"
);
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
// bug related note: This is a code
// snippet, where a buffer overrun
// might happen.

for(
ulTemp = 0;
ulTemp < palDestDC.cEntries();
ulTemp++
){
pxlate->ai[
ptransCurrent->ajVector[ulTemp]
] = ptransFore->ajVector[ulTemp];
}
// if: !palDestDC.cEntries()
// then: jump to: 000E22F5

000E22C2|cmp dword ptr [edi+14], 0
000E22C6|jbe short 000E22F5

// edx = address(ptransCurrent)
000E22C8|mov edx, dword ptr [ebp+8]

// eax = address(ptransCurrent) + 4|d
000E22D2|lea eax, [edx+4]

// ecx = address(ptransFore) - address(ptransCurrent)
000E22CB|mov ecx, dword ptr [ebp+0C]
000E22D0|sub ecx, edx

// [ebp+1C] = -4|d - address(ptransCurrent)
000E22CE|push -4
000E22D5|pop edx
000E22D6|sub edx, dword ptr [ebp+8]
000E22D9|mov dword ptr [ebp+1C], edx

// 000E22DC|- beginning of the loop -

000E22DC|movzx ebx, byte ptr [eax]
000E22DF|movzx edx, byte ptr [eax+ecx]
000E22E3|mov dword ptr [ebx*4+esi+3C], edx

000E22EA|inc eax

// edx = ulTemp
000E22E7|mov edx, dword ptr [ebp+1C]
000E22EB|add edx, eax

// if: ulTemp < palDestDC.cEntries()
// then: jump to: beginning of the loop

000E22ED|cmp edx, dword ptr [edi+14]
000E22F0|jb short 000E22DC

// 000E22F2|- end of the loop -
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// bug related note: This is a code
// snippet, where a buffer overrun
// might happen.

for(
ulTemp = 0;
ulTemp < min(
palDestDC.cEntries(),
cEntry
);
ulTemp++
){
pxlate->ai[
ptransCurrent->ajVector[ulTemp]
] = ptransFore->ajVector[ulTemp];
}
// ulTemp = min(
//    palDestDC.cEntries(),
//    cEntry
// ) [start]
// eax = palDestDC.cEntries()
000E22C2|mov eax, dword ptr [edi+14]

// if: eax <= cEntry
// then: jump to: end of the min block

000E22C5|cmp eax, [ebp-4]
000E22C8|jbe 000E22CD

// eax = cEntry
000E22CA|mov eax, [ebp-4]

// 000E22CD|- end of the min block -
// ulTemp = min(
//    palDestDC.cEntries(),
//    cEntry
// ) [end]


// jump to: before the substraction
000E22CD|jmp 000E22E1

// 000E22CF|- beginning of the loop -

// ecx = address(ptransCurrent)
000E22CF|mov ecx, dword ptr [ebp+8]

// ecx = ptransCurrent->ajVector[ulTemp]
000E22D2|movzx ecx, byte ptr [ecx+4]

// edx = address(ptransFore)
000E22D6|mov edx, dword ptr [ebp+C]

// edx = ptransFore->ajVector[ulTemp]
000E22D9|movzx edx, byte ptr [edx+4]

// pxlate->ai[ecx] = edx
000E22DD|mov dword ptr [ecx*4+esi+3C], edx

// 000E22E1|- before the substraction -

// can't use "decrement"; it doesn't set cf
// ulTemp--

000E22E1|sub eax, 1|d

// if: eax >= 0|d
// then: jump to: beginning of the loop

000E22E4|jae 000E22CF

// 000E22E6|- end of the loop -

000E22E6|jmp 000E22F2
000E22E8|nop
000E22E9|nop
000E22EA|nop
000E22EB|nop
000E22EC|nop
000E22ED|nop
000E22EE|nop
000E22EF|nop
000E22F0|nop
000E22F1|nop
 
6.0.6002.18005:
// bug related note: This is a code
// snippet, where a buffer overrun
// might happen.

for(
ulTemp = 0;
ulTemp < palDestDC.cEntries();
ulTemp++
){
pxlate->ai[
ptransCurrent->ajVector[ulTemp]
] = ptransFore->ajVector[ulTemp];
}
// if: !palDestDC.cEntries()
// then: jump to: 000B04C2

000B048F|cmp dword ptr [ebx+14], 0
000B0493|jbe short 000B04C2

000B0495|mov edx, dword ptr [ebp+0C]
000B0498|mov ecx, dword ptr [ebp+1C]
000B049B|lea eax, [edx+4]
000B049E|sub ecx, edx
000B04A0|push -4
000B04A2|pop edx
000B04A3|sub edx, dword ptr [ebp+0C]
000B04A6|mov dword ptr [ebp+2C], edx

// 000B04A9|- beginning of the loop -

000B04A9|movzx edx, byte ptr [eax+ecx]
000B04AD|movzx edi, byte ptr [eax]
000B04B0|mov dword ptr [edi*4+esi+3C], edx
000B04B4|mov edx, dword ptr [ebp+2C]
000B04B7|inc eax
000B04B8|add edx, eax

// if: ulTemp < palDestDC.cEntries()
// then: jump to: beginning of the loop

000B04BA|cmp edx, dword ptr [ebx+14]
000B04BD|jb short 000B04A9
 
6.0.6003.20665: // if: !palDestDC.cEntries()
// then: jump to: 000B3BC1

000B3B91|mov eax, dword ptr [ebp+1C]
000B3B94|cmp dword ptr [eax+14], 0
000B3B98|jbe short 000B3BC1

// edi = address(ptransCurrent)
000B3B9A|mov edi, dword ptr [ebp+8]

// ecx = address(ptransFore) - address(ptransCurrent)
000B3B9D|mov ecx, dword ptr [ebp+0C]
000B3BA3|sub ecx, edi

000B3BA0|push -4
000B3BA2|pop edx
000B3BA8|sub edx, edi

000B3BA5|lea eax, [edi+4]

// 000B3BAA|- beginning of the loop -

000B3BAA|movzx edi, byte ptr [eax+ecx]
000B3BAE|movzx ebx, byte ptr [eax]
000B3BB1|mov dword ptr [ebx*4+esi+3C], edi
000B3BB5|mov ebx, dword ptr [ebp+1C]
000B3BB8|inc eax

// edi = ulTemp
000B3BB9|lea edi, [edx+eax]

// if: ulTemp < palDestDC.cEntries()
// then: jump to: beginning of the loop

000B3BBC|cmp edi, dword ptr [ebx+14]
000B3BBF|jb short 000B3BAA

000B3BC1|- end of the loop -
6.0.6003.20785: // if: !palDestDC.cEntries()
// then: jump to: 000B3E11

000B3DE1|mov eax, dword ptr [ebp+1C]
000B3DE4|cmp dword ptr [eax+14], 0
000B3DE8|jbe short 000B3E11

000B3DEA|mov edi, dword ptr [ebp+8]
000B3DED|mov ecx, dword ptr [ebp+0C]
000B3DF0|push -4
000B3DF2|pop edx
000B3DF3|sub ecx, edi
000B3DF5|lea eax, [edi+4]
000B3DF8|sub edx, edi

// 000B3DFA|- beginning of the loop -

000B3DFA|movzx edi, byte ptr [eax+ecx]
000B3DFE|movzx ebx, byte ptr [eax]
000B3E01|mov dword ptr [ebx*4+esi+3C], edi
000B3E05|mov ebx, dword ptr [ebp+1C]
000B3E08|inc eax
000B3E09|lea edi, [edx+eax]

// if: ulTemp < palDestDC.cEntries()
// then: jump to: beginning of the loop

000B3E0C|cmp edi, dword ptr [ebx+14]
000B3E0F|jb short 000B3DFA

000B3E11|- end of the loop -

5.00.2195.7640:
// Now map the default colors that
// are really there, independent of
// logical palette realization.

if(palSrc.bIsNoStatic()){
000E22F2|mov edx, dword ptr [ebp+10]
000E22F5|mov eax, dword ptr [edx+10]
000E22F8|test ah, 10
000E22FB|jne 000E253B
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B04BF|mov edx, dword ptr [ebp+10]
000B04C2|mov eax, dword ptr [edx+10]
000B04C5|test ax, 1000
000B04C9|je short 000B04DE
6.0.6003.20665: 000B3BC1|mov eax, dword ptr [ebp+10]
000B3BC4|mov eax, dword ptr [eax+10]
000B3BC7|test ax, 1000
000B3BCB|je short 000B3BE0
6.0.6003.20785: 000B3E11|mov eax, dword ptr [ebp+10]
000B3E14|mov eax, dword ptr [eax+10]
000B3E17|test ax, 1000
000B3E1B|je short 000B3E30

5.00.2195.7640:
// bug related note: This is a
// code snippet, where a buffer
// overrun might happen.


// Only black and white are
// here.

pxlate->ai[0] = 0;
pxlate->ai[255] = 255;
000E253B|and dword ptr [esi+3C], 00000000
000E253F|mov dword ptr [esi+3C+(FF*4)], FF
000E2549|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// Only black and white are
// here.

pxlate->ai[0] = 0;
pxlate->ai[cEntry - 1] = 255;
// ecx = 0
000E253B|xor dword ecx, ecx

// pxlate->ai[0] = 0
000E253D|mov ptr [esi+3C], ecx

// eax = cEntry
000E2540|mov dword eax, ptr [ebp-4]

// cl = FF|h
000E2543|mov byte cl, FF

// pxlate->ai[cEntry - 1] = FF|h
000E2545|mov dword ptr [esi+3C+(eax*4)-4], ecx

000E2549|jmp 000E2677
 
6.0.6002.18005:
// bug related note: This is a
// code snippet, where a buffer
// overrun might happen.


// Only black and white are
// here.

pxlate->ai[0] = 0;
pxlate->ai[255] = 255;
000B04CB|and dword ptr [esi+3C], 00000000
000B04CF|mov dword ptr [esi+3C+(FF*4)], 0FF
000B04D9|jmp 000B0864
 
6.0.6003.20665: 000B3BCD|and dword ptr ds:[esi+3C], 00000000
000B3BD1|mov dword ptr ds:[esi+3C+(FF*4)], 0FF
000B3BDB|jmp 000B3F6C
6.0.6003.20785: 000B3E1D|and dword ptr ds:[esi+3C], 00000000
000B3E21|mov dword ptr ds:[esi+3C+(FF*4)], 0FF
000B3E2B|jmp 000B41BC

5.00.2195.7640:
}else if(!palSrc.bIsNoStatic256()){
000E2301|test eax, 00010000
000E2306|jne 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B04DE|test eax, 00010000
000B04E3|jne 000B0864
6.0.6003.20665: 000B3BE0|test eax, 00010000
000B3BE5|jne 000B3F6C
6.0.6003.20785: 000B3E30|test eax, 00010000
000B3E35|jne 000B41BC

5.00.2195.7640:
// All the 20 holy colors are here.
// Fix them up.

for(
ulTemp = 0;
ulTemp < 10;
ulTemp++
){
pxlate->ai[
ulTemp
] = ulTemp;

// bug related note: This
// is a code snippet,
// where a buffer overrun
// might happen.

pxlate->ai[
ulTemp + 246
] = ulTemp + 246;
}
// ulTemp = 0
000E230C|xor ecx, ecx

000E230E|lea eax, [esi+3C|h+(4|d*246|d)]

// 000E2314|- beginning of the loop -

000E2314|lea edx, [ecx+246|d]
000E231A|mov dword ptr [eax-(4|d*246|d)], ecx
000E2320|mov dword ptr [eax], edx

000E2323|add eax, 4

// ulTemp++
000E2322|inc ecx

// if: ulTemp < 10|d,
// then: jump to: beginning of the loop

000E2326|cmp ecx, 0A
000E2329|jb short 000E2314

// 000E2579|- end of the loop -

000E232B|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
go to: 000E255A
000E230C|jmp 000E255A

000E2311|nop
000E2312|nop
000E2313|nop
000E2314|nop
000E2315|nop
000E2316|nop
000E2317|nop
000E2318|nop
000E2319|nop
000E231A|nop
000E231B|nop
000E231C|nop
000E231D|nop
000E231E|nop
000E231F|nop
000E2320|nop
000E2321|nop
000E2322|nop
000E2323|nop
000E2324|nop
000E2325|nop
000E2327|nop
000E2328|nop
000E2329|nop
000E232A|nop
000E232B|nop
000E232C|nop
000E232D|nop
000E232E|nop
000E232F|nop
 
6.0.6002.18005:
// All the 20 holy colors are here.
// Fix them up.

for(
ulTemp = 0;
ulTemp < 10;
ulTemp++
){
pxlate->ai[
ulTemp
] = ulTemp;

// bug related note: This
// is a code snippet,
// where a buffer overrun
// might happen.

pxlate->ai[
ulTemp + 246
] = ulTemp + 246;
}
// ulTemp = 0
000B04E9|xor ecx, ecx

000B04EB|lea eax, [esi+3C|h+(4|d*246|d)]

// 000B04F1|- beginning of the loop

000B04F1|lea edx, [ecx+246|d]
000B04F7|mov dword ptr [eax-(4|d*246|d)], ecx
000B04FD|mov dword ptr [eax], edx

000B0500|add eax, 4

// ulTemp++
000B04FF|inc ecx

// if: ulTemp >= 10|d,
// then: jump to: 000B0864

000B0503|cmp ecx, 0A
000B0506|jae 000B0864

// jump to: beginning of the loop
000B050C|jmp short 000B04F1
 
6.0.6003.20665: // ulTemp = 0
000B3BEB|xor ecx, ecx

000B3BED|lea eax, [esi+3C|h+(4|d*246|d)]

// 000B3BF3|- beginning of the loop

000B3BF3|lea edx, [ecx+246|d]
000B3BF9|mov dword ptr [eax-(4|d*246|d)], ecx
000B3BFF|mov dword ptr [eax], edx

000B3C02|add eax, 4

// ulTemp++
000B3C01|inc ecx

// if: ulTemp >= 10|d,
// then: jump to: 000B3F6C

000B3C05|cmp ecx, 0A
000B3C08|jae 000B3F6C

// jump to: beginning of the loop
000B3C0E|jmp short 000B3BF3
6.0.6003.20785: // ulTemp = 0
000B3E3B|xor ecx, ecx

000B3E3D|lea eax, [esi+414]

// 000B3E43|- beginning of the loop

000B3E43|lea edx, [ecx+246|d]
000B3E49|mov dword ptr [eax-(4|d*246|d)], ecx
000B3E4F|mov dword ptr [eax], edx

000B3E52|add eax, 4

// ulTemp++
000B3E51|inc ecx

// if: ulTemp >= 10|d,
// then: jump to: 000B41BC

000B3E55|cmp ecx, 0A
000B3E58|jae 000B41BC

// jump to: beginning of the loop
000B3E5E|jmp short 000B3E43

5.00.2195.7640:
}
}else if(palSrc.bIsMonochrome()){
000E2330|mov ecx, 2000
000E2335|test ecx, eax
000E2337|je short 000E2396
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B050E|mov ecx, 2000
000B0513|test ecx, eax
000B0515|je short 000B0577
6.0.6003.20665: 000B3C10|mov ecx, 2000
000B3C15|test ecx, edx
000B3C17|je short 000B3C79
6.0.6003.20785: 000B3E60|mov ecx, 2000
000B3E65|test ecx, edx
000B3E67|je short 000B3EC9

5.00.2195.7640:
if(
palDestSurf &&
palDestSurf.bIsMonochrome()
){
// if: !palDestSurf
// then: jump to: 000E2352

000E2339|test ebx, ebx
000E233B|je short 000E2352

// if: !palDestSurf.bIsMonochrome()
// then: jump to: 000E2352

000E233D|test dword ptr [ebx+10], ecx
000E2340|je short 000E2352
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // if: !palDestSurf
// then: jump to: 000B0530

000B0517|test edi, edi
000B0519|je short 000B0530

// if: !palDestSurf.bIsMonochrome()
// then: jump to: 000B0530

000B051B|test dword ptr [edi+10], ecx
000B051E|je short 000B0530
6.0.6003.20665: // if: !palDestSurf
// then: jump to: 000B3C32

000B3C19|test eax, eax
000B3C1B|je short 000B3C32

// if: !palDestSurf.bIsMonochrome()
// then: jump to: 000B3C32

000B3C1D|test dword ptr [eax+10], ecx
000B3C20|je short 000B3C32
6.0.6003.20785: // if: !palDestSurf
// then: jump to: 000B3E82

000B3E69|test eax, eax
000B3E6B|je short 000B3E82

// if: !palDestSurf.bIsMonochrome()
// then: jump to: 000B3E82

000B3E6D|test dword ptr [eax+10], ecx
000B3E70|je short 000B3E82

5.00.2195.7640:
// It's identity blt.

// bug related note: This is a code snippet,
// where a buffer overrun might happen.
// However, it is unlikely.


pxlate->vSetIndex(
0,
0
);

pxlate->vSetIndex(
1,
1
);
000E2342|and dword ptr [esi+3C], 0
000E2346|mov dword ptr [esi+40], 1

000E234D|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// It's identity blt.

// The chance, that we will have a buffer
// overrun in this code path is low.
// However, we don't take chances in kernel
// mode.
//
// Also, we should set
// pxlate->flXlate->XO_TRIVIAL.
//
// To do this, we set the number of entries,
// which need to be defined, to
// min(cEntry, 2) and then we jump to the
// code, that does everything for us.


ulTemp = min(
cEntry,
2|d
);

go to: 000E228A
// ulTemp = min(
//    cEntry,
//    2|d
// ) [start]
// eax = cEntry
000E2342|mov eax, [ebp-4]

// if: eax <= 2|d
// then: jump to: end of the min block

000E2345|cmp eax, 2|d
000E2348|jbe 000E234D

// eax = 2|d
000E234A|push 2|d
000E234C|pop eax

// 000E234D|- end of the min block -
// ulTemp = min(
//    cEntry,
//    2|d
// ) [end]


000E234D|jmp 000E228A
 
6.0.6002.18005:
// It's identity blt.

// bug related note: This is a code snippet,
// where a buffer overrun might happen.
// However, it is unlikely.


pxlate->vSetIndex(
0,
0
);

pxlate->vSetIndex(
1,
1
);
000B0520|and dword ptr [esi+3C], 0
000B0524|mov dword ptr [esi+40], 1

000B052B|jmp 000B0864
 
6.0.6003.20665: 000B3C22|and dword ptr [esi+3C], 0
000B3C26|mov dword ptr [esi+40], 1

000B3C2D|jmp 000B3F6C
6.0.6003.20785: 000B3E72|and dword ptr [esi+3C], 0
000B3E76|mov dword ptr [esi+40], 1

000B3E7D|jmp 000B41BC

5.00.2195.7640:
}else{
if(bCMYKColor){
000E2352|cmp dword ptr [ebp-8], 0
000E2356|je short 000E2363
 
5.00.2196.0001V1:
5.00.2196.0001V2:
}else{
pxlate->iForeDst = iForeDst;
pxlate->iBackDst = iBackDst;

if(bCMYKColor){
000E2352|mov ecx, dword ptr [ebp+20]
000E2355|mov dword ptr [esi+18], ecx

000E2358|mov eax, dword ptr [ebp+24]
000E235B|mov dword ptr [esi+1C], eax

000E235E|cmp dword ptr [ebp-8], 0
000E2362|je short 000E2367
 
6.0.6002.18005:
}else{
if(bCMYKColor){
000B0530|cmp dword ptr [ebp-8], 0
000B0534|je short 000B0541
 
6.0.6003.20665: 000B3C34|mov edi, dword ptr [ebp+20]

000B3C32|test ebx, ebx
000B3C37|je short 000B3C44
6.0.6003.20785: 000B3E84|mov edi, dword ptr [ebp+20]

000B3E82|test ebx, ebx
000B3E87|je short 000B3E94

5.00.2195.7640:
// bug related note: This is a code
// snippet, where a buffer overrun might
// happen. However, it is unlikely.


pxlate->vSetIndex(
0,
iForeDst
);

pxlate->vSetIndex(
1,
iBackDst
);
000E2358|mov eax, dword ptr [ebp+20]
000E235B|mov dword ptr [esi+3C], eax

000E235E|mov eax, dword ptr [ebp+24]

000E2361|jmp short 000E237E

000E237E|mov dword ptr [esi+40], eax
 
5.00.2196.0001V1:
5.00.2196.0001V2:
// Store the values, which need to be
// stored at a temporary location for
// now. They will be stored in
// pxlate->ai later if there is
// enough space to do so.


temp_0 = iForeDst;
temp_1 = iBackDst;
// temp_0 = iForeDst
000E2364|push ecx

// temp_1 = iBackDst is already the case,
// because the value is already in eax


000E2365|jmp 000E237E
 
6.0.6002.18005:
// bug related note: This is a code
// snippet, where a buffer overrun might
// happen. However, it is unlikely.


pxlate->vSetIndex(
0,
iForeDst
);

pxlate->vSetIndex(
1,
iBackDst
);
000B0536|mov eax, dword ptr [ebp+20]
000B0539|mov dword ptr [esi+3C], eax

000B053C|mov eax, dword ptr [ebp+24]

000B053F|jmp short 000B055C

000B055C|mov dword ptr [esi+40], eax
 
6.0.6003.20665: 000B3C3C|mov dword ptr [esi+3C], edi

000B3C39|mov ebx, dword ptr [ebp+24]
000B3C3F|mov dword ptr [esi+40], ebx

000B3C42|jmp short 000B3C67
6.0.6003.20785: 000B3E8C|mov dword ptr [esi+3C], edi

000B3E89|mov ebx, dword ptr [ebp+24]
000B3E8F|mov dword ptr [esi+40], ebx

000B3E92|jmp short 000B3EB7

5.00.2195.7640:
}else{
// bug related note: This is a code
// snippet, where a buffer overrun might
// happen. However, it is unlikely.


pxlate->vSetIndex(
0,
ulGetNearestIndexFromColorref(
palDestSurf,
palDestDC,
iForeDst,
1
)
);

pxlate->vSetIndex(
1,
ulGetNearestIndexFromColorref(
palDestSurf,
palDestDC,
iBackDst,
1
)
);
}
000E2363|push 1
000E2365|push dword ptr [ebp+20]
000E2368|push edi
000E2369|push ebx
000E236A|call 00107888

// pxlate->ai[0] = returned value
000E2371|mov dword ptr ds:[esi+3C], eax

000E236F|push 1
000E2374|push dword ptr [ebp+24]
000E2377|push edi
000E2378|push ebx
000E2379|call 00107888

// pxlate->ai[1] = returned value
000E237E|mov dword ptr ds:[esi+40], eax
 
5.00.2196.0001V1:
5.00.2196.0001V2:
}else{
// Store the values, which need to be
// stored at a temporary location for
// now. They will be stored in
// pxlate->ai later if there is
// enough space to do so.


temp_0 = ulGetNearestIndexFromColorref(
palDestSurf,
palDestDC,
iForeDst,
1
);

temp_1 = ulGetNearestIndexFromColorref(
palDestSurf,
palDestDC,
iBackDst,
1
);
}
000E2367|push 1
000E2369|push ecx
000E236A|push edi
000E236B|push ebx
000E236C|call 00107888

// push(returned value)
000E2371|push eax

000E2372|push 1
000E2374|push push dword ptr [ebp+24]
000E2377|push edi
000E2378|push ebx
000E2379|call 00107888

// the returned value stays in eax for now
 
6.0.6002.18005:
}else{
// bug related note: This is a code
// snippet, where a buffer overrun might
// happen. However, it is unlikely.


pxlate->vSetIndex(
0,
ulGetNearestIndexFromColorref(
palDestSurf,
palDestDC,
iForeDst,
1
)
);

pxlate->vSetIndex(
1,
ulGetNearestIndexFromColorref(
palDestSurf,
palDestDC,
iBackDst,
1
)
);
}
000B0541|push 1
000B0543|push dword ptr [ebp+20]
000B0546|push ebx
000B0547|push edi
000B0548|call 0006BCC3

// pxlate->ai[0] = returned value
000B0552|mov dword ptr [esi+3C], eax

000B054D|push 1
000B054F|push dword ptr [ebp+24]
000B0555|push ebx
000B0556|push edi
000B0557|call 0006BCC3

// pxlate->ai[1] = returned value
000B055C|mov dword ptr [esi+40], eax
 
6.0.6003.20665: 000B3C44|push 1
000B3C46|push edi
000B3C47|push dword ptr [ebp+1C]
000B3C4A|push eax
000B3C4B|call 0006E4E2

// pxlate->ai[0] = returned value
000B3C56|mov dword ptr [esi+3C], eax

000B3C53|push 1
000B3C50|mov ebx, dword ptr [ebp+24]
000B3C55|push ebx
000B3C59|push dword ptr [ebp+1C]
000B3C5C|push dword ptr [ebp+14]
000B3C5F|call 0006E4E2

// pxlate->ai[1] = returned value
000B3C64|mov dword ptr [esi+40], eax
6.0.6003.20785: 000B3E94|push 1
000B3E96|push edi
000B3E97|push dword ptr [ebp+1C]
000B3E9A|push eax
000B3E9B|call 0006E582

// pxlate->ai[0] = returned value
000B3EA6|mov dword ptr [esi+3C], eax

000B3EA3|push 1
000B3EA0|mov ebx, dword ptr [ebp+24]
000B3EA5|push ebx
000B3EA9|push dword ptr [ebp+1C]
000B3EAC|push dword ptr [ebp+14]
000B3EAF|call 0006E582

// pxlate->ai[1] = returned value
000B3EB4|mov dword ptr [esi+40], eax

5.00.2195.7640:
// XLATE_FROM_MONO is set so we know to look at
// colors in cache code for getting a hit.


pxlate->flPrivate |= XLATE_FROM_MONO;
pxlate->iForeDst = iForeDst;
pxlate->iBackDst = iBackDst;
}
000E2384|or byte ptr [esi+39], 1

000E2381|mov eax, dword ptr [ebp+20]
000E2388|mov dword ptr [esi+18], eax

000E238B|mov eax, dword ptr [ebp+24]
000E238E|mov dword ptr [esi+1C], eax

000E2391|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
if(cEntry >= 1){
pxlate->ai[0] = temp_0;
}

if(cEntry > 1){
pxlate->ai[1] = temp_1;
}

// XLATE_FROM_MONO is set so we know to look at
// colors in cache code for getting a hit.


pxlate->flPrivate |= XLATE_FROM_MONO;
}
// ecx = temp_0
000E237E|pop ecx

// eax = temp_1 is already the case,
// because the value is already in eax


// if: cEntry < 1|d
// then: jump to: 000E2388

000E237F|cmp [ebp-4], 1|d
000E2383|jb 000E2388

// pxlate->ai[0] = temp_0
000E2385|mov [esi+3C|h], ecx

// if: cEntry <= 1|d
// then: jump to: 000E238D

000E2388|jbe 000E238D

// pxlate->ai[1] = temp_1
000E238A|mov [esi+3C|h+4|h], eax

// pxlate->flPrivate |= XLATE_FROM_MONO
000E238D|or byte ptr [esi+39], 1

000E2391|jmp 000E2677
 
6.0.6002.18005:
// XLATE_FROM_MONO is set so we know to look at
// colors in cache code for getting a hit.


pxlate->flPrivate |= XLATE_FROM_MONO;
pxlate->iForeDst = iForeDst;
pxlate->iBackDst = iBackDst;
}
000B0562|or dword ptr [esi+38], 00000100

000B055F|mov eax, dword ptr [ebp+20]
000B0569|mov dword ptr [esi+18], eax

000B056C|mov eax, dword ptr [ebp+24]
000B056F|mov dword ptr [esi+1C], eax

000B0572|jmp 000B0864
 
6.0.6003.20665: 000B3C67|or dword ptr [esi+38], 00000100

000B3C6E|mov dword ptr [esi+18], edi
000B3C71|mov dword ptr [esi+1C], ebx

000B3C74|jmp 000B3F6C
6.0.6003.20785: 000B3EB7|or dword ptr [esi+38], 00000100

000B3EBE|mov dword ptr [esi+18], edi
000B3EC1|mov dword ptr [esi+1C], ebx

000B3EC4|jmp 000B41BC

5.00.2195.7640:
}else if(!cEntry){
// Src is a RGB/Bitfields palette.

// bug related note: In this code branch
// no entries should be stored in
// pxlate->ai, because we announce 0|d
// entries. However, technically there
// is enough space to store 1|d entry,
// because the size of pxlate->ai is
// always at least 1|d.
000E2396|mov ecx, dword ptr [ebp-4]
000E2399|test ecx, ecx
000E239B|jne short 000E23D4
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B0577|mov ecx, dword ptr [ebp-4]
000B057A|test ecx, ecx
000B057C|jne short 000B05B7
6.0.6003.20665: 000B3C79|mov edx, dword ptr [ebp-4]
000B3C7C|test edx, edx
000B3C7E|jne short 000B3CB6
6.0.6003.20785: 000B3EC9|mov edx, dword ptr [ebp-4]
000B3ECC|test edx, edx
000B3ECE|jne short 000B3F06

5.00.2195.7640:
ASSERTGDI(
!palSrc.cEntries(),
"ERROR how could this happen"
);
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
if(
palDestSurf &&
palDestSurf.bIsMonochrome()
){
000E239D|test ebx, ebx
000E239F|je 000E2677

000E23A5|test byte ptr [ebx+11], 20
000E23A9|je 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B057E|test edi, edi
000B0580|je 000B0864

000B0586|test word ptr [edi+10], 2000
000B058C|je 000B0864
6.0.6003.20665: 000B3C80|test eax, eax
000B3C82|je 000B3F6C

000B3C88|test dword ptr [eax+10], ecx
000B3C8B|je 000B3F6C
6.0.6003.20785: 000B3ED0|test eax, eax
000B3ED2|je 000B41BC

000B3ED8|test dword ptr [eax+10], ecx
000B3EDB|je 000B41BC

5.00.2195.7640:
// Put the color the Background of the source
// matches in pulXlate[0]

pxlate->ai[0] = ulGetNearestIndexFromColorref(
palSrc,
palSrcDC,
iBackSrc,
1
);

pxlate->flXlate |= XO_TO_MONO;
pxlate->iBackSrc = iBackSrc;

// The S3 and other snazzy drivers look at
// this and get the color out of slot 0 when
// XO_TO_MONO is set to get way better
// performance in WinBench.

pxlate->pulXlate = pxlate->ai;
}
000E23B2|push 1
000E23AF|mov ebx, dword ptr [ebp+28]
000E23B4|push ebx
000E23B8|push dword ptr [ebp+18]
000E23BB|push dword ptr [ebp+10]
000E23BE|call 00107888

// pxlate->ai[0] = returned value
000E23B5|lea edi, [esi+3C]
000E23C7|mov dword ptr [edi], eax

000E23C3|or dword ptr [esi+4], 4

000E23C9|mov dword ptr [esi+14], ebx

// pxlate->pulXlate = pxlate->ai
000E23CC|mov dword ptr [esi+10], edi

000E23CF|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B0595|push 1
000B0592|mov ebx, dword ptr [ebp+28]
000B0597|push ebx
000B0598|push dword ptr [ebp+18]
000B059E|push dword ptr [ebp+10]
000B05A1|call 0006BCC3

// pxlate->ai[0] = returned value
000B059B|lea edi, [esi+3C]
000B05AA|mov dword ptr [edi], eax

000B05A6|or dword ptr [esi+4], 4

000B05AC|mov dword ptr [esi+14], ebx

// pxlate->pulXlate = pxlate->ai
000B05AF|mov dword ptr [esi+10], edi

000B05B2|jmp 000B0864
6.0.6003.20665: 000B3C94|push 1
000B3C91|mov ebx, dword ptr [ebp+28]
000B3C96|push ebx
000B3C97|push dword ptr [ebp+18]
000B3C9D|push dword ptr [ebp+10]
000B3CA0|call 0006E4E2

// pxlate->ai[0] = returned value
000B3C9A|lea edi, [esi+3C]
000B3CA9|mov dword ptr [edi], eax

000B3CA5|or dword ptr [esi+4], 4

000B3CAB|mov dword ptr [esi+14], ebx

// pxlate->pulXlate = pxlate->ai
000B3CAE|mov dword ptr [esi+10], edi

000B3CB1|jmp 000B3F6C
6.0.6003.20785: 000B3EE4|push 1
000B3EE1|mov ebx, dword ptr [ebp+28]
000B3EE6|push ebx
000B3EE7|push dword ptr [ebp+18]
000B3EED|push dword ptr [ebp+10]
000B3EF0|call 0006E582

// pxlate->ai[0] = returned value
000B3EEA|lea edi, [esi+3C]
000B3EF9|mov dword ptr [edi], eax

000B3EF5|or dword ptr [esi+4], 4

000B3EFB|mov dword ptr [esi+14], ebx

// pxlate->pulXlate = pxlate->ai
000B3EFE|mov dword ptr [esi+10], edi

000B3F01|jmp 000B41BC

5.00.2195.7640:
}else{
// Src is a regular indexed palette, it wouldn't have
// duplicating entries in it so we don't need to check
// for the Dibsection case. This is like a palette for
// a 16 color VGA or a printer or a SetDIBitsToDevice.
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
if(
palDestSurf.bValid() &&
palDestSurf.bIsMonochrome()
){
000E23D4|test ebx, ebx
000E23D6|mov eax, 2000
000E23DB|je short 000E23EA

000E23DD|test dword ptr [ebx+10], eax
000E23E0|je short 000E23EA
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B05B7|test edi, edi
000B05B9|mov eax, 2000
000B05BE|je short 000B05D1

000B05C0|test dword ptr [edi+10], eax
000B05C3|je short 000B05D1
6.0.6003.20665: 000B3CB6|test eax, eax
000B3CB8|je short 000B3CCA

000B3CBA|test dword ptr [eax+10], ecx
000B3CBD|je short 000B3CCA
6.0.6003.20785: 000B3F06|test eax, eax
000B3F08|je short 000B3F1A

000B3F0A|test dword ptr [eax+10], ecx
000B3F0D|je short 000B3F1A

5.00.2195.7640:
RtlZeroMemory(
pxlate->ai,
cEntry * sizeof(ULONG)
);

temp = ulGetNearestIndexFromColorref(
palSrc,
palSrcDC,
iBackSrc,
1
);

ASSERTGDI(
cEntry < pxlate->cEntries,
"ERROR this is not in range"
);

pxlate->vSetIndex(
temp,
1
);

pxlate->flXlate |= XO_TO_MONO;
pxlate->iBackSrc = iBackSrc;
000E23E2|mov ecx, dword ptr [ebp-4]

000E23E5|jmp 000E2588
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B05C5|mov eax, dword ptr [ebp-4]
000B05C8|shl eax, 2
000B05CB|push eax

000B05CC|jmp 000B075C
6.0.6003.20665: 000B3CBF|mov eax, edx
000B3CC1|shl eax, 2
000B3CC4|push eax

000B3CC5|jmp 000B3E62
6.0.6003.20785: 000B3F0F|mov eax, edx
000B3F11|shl eax, 2
000B3F14|push eax

000B3F15|jmp 000B40B2

5.00.2195.7640:
}else{
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
if(bCMYKColor){
000E23EA|cmp dword ptr [ebp-8], 0
000E23EE|je short 000E240C
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B05D1|cmp dword ptr [ebp-8], 0
000B05D5|je short 000B05F1
6.0.6003.20665: 000B3CCA|test ebx, ebx
000B3CCC|je short 000B3CED
6.0.6003.20785: 000B3F1A|test ebx, ebx
000B3F1C|je short 000B3F3D

5.00.2195.7640:
// Copy source CMYK color table to index table.

ulTemp = cEntry

while(ulTemp--){
pxlate->ai[ulTemp] = (
palSrc.ulEntryGet(ulTemp)
);
}
000E23F0|dec ecx
000E23F1|lea eax, [ecx*4+esi+3C]

// 000E23F5|- beginning of the loop -

000E23F5|mov edi, dword ptr [edx+4C]
000E23F8|mov edi, dword ptr [ecx*4+edi]
000E23FB|mov dword ptr [eax], edi
000E23FD|mov edi, ecx
000E23FF|dec ecx
000E2400|sub eax, 4

000E2403|test edi, edi
000E2405|jne short 000E23F5

// 000E2407|- end of the loop -

000E2407|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: 000B05D7|lea eax, [ecx*4+esi+3C]

// 000B05DB|- beginning of the loop -

000B05DB|mov edi, dword ptr [edx+4C]
000B05DE|dec ecx
000B05DF|mov edi, dword ptr [ecx*4+edi]
000B05E2|sub eax, 4
000B05E7|mov dword ptr [eax], edi

000B05E5|test ecx, ecx
000B05E9|je 000B0864

000B05EF|jmp short 000B05DB

// 000B05F1|- end of the loop -
6.0.6003.20665: 000B3CCE|mov ecx, dword ptr [ebp-4]
000B3CD1|lea eax, [edx*4+esi+3C]

// 000B3CD5|- beginning of the loop -

000B3CD5|mov edx, dword ptr [ebp+10]
000B3CD8|mov edx, dword ptr [edx+4C]
000B3CDB|dec ecx
000B3CDC|mov edx, dword ptr [ecx*4+edx]
000B3CDF|sub eax, 4
000B3CE4|mov dword ptr [eax], edx

000B3CE2|test ecx, ecx
000B3CE6|jne short 000B3CD5

// 000B3CE8|- end of the loop -

000B3CE8|jmp 000B3F6C
6.0.6003.20785: 000B3F1E|mov ecx, dword ptr [ebp-4]
000B3F21|lea eax, [edx*4+esi+3C]

// 000B3F25|- beginning of the loop -

000B3F25|mov edx, dword ptr [ebp+10]
000B3F28|mov edx, dword ptr [edx+4C]
000B3F2B|dec ecx
000B3F2C|mov edx, dword ptr [ecx*4+edx]
000B3F2F|sub eax, 4
000B3F34|mov dword ptr [eax], edx

000B3F32|test ecx, ecx
000B3F36|jne short 000B3F25

// 000B3F38|- end of the loop -

000B3F38|jmp 000B41BC

5.00.2195.7640:
}else{
- no assembler code -  
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
// If the destination is palette managed,
// map to logical palette and then
// translate to physical indices
// accordingly. Otherwise map to the
// physical palette directly.


PPALETTE ppalTemp;

if(
bPalManaged &&
!(flCreateFlag & XLATE_USE_SURFACE_PAL)
){
ppalTemp = palDestDC.ppalGet();
}else{
ppalTemp = palDestSurf.ppalGet();

if(flCreateFlag & XLATE_USE_SURFACE_PAL){
pxlate->flPrivate |= (
XLATE_USE_SURFACE_PAL
);
}
}

XEPALOBJ palTemp(ppalTemp);
// if: !bPalManaged
// then: jump to: 000E2421

000E240C|cmp dword ptr [ebp+14], 0
000E2410|je short 000E2421

000E2412|mov edx, dword ptr [ebp+2C]
000E2415|and edx, eax
000E2417|mov dword ptr [ebp+20], edx

// if: flCreateFlag & XLATE_USE_SURFACE_PAL
// then: jump to: 000E2421

000E241A|jne short 000E2421

// if(...){
// ppalTemp = palDestDC
000E241C|mov dword ptr [ebp+1C], edi

000E241F|jmp short 000E2431
// }else{
// ppalTemp = palDestSurf
000E2424|mov dword ptr [ebp+1C], ebx

000E2421|mov edx, dword ptr [ebp+2C]
000E2427|and edx, eax
000E2429|mov dword ptr [ebp+20], edx

// if: !(flCreateFlag & XLATE_USE_SURFACE_PAL)
// then: jump to: 000E2431

000E242C|je short 000E2431

// pxlate->flPrivate |= LATE_USE_SURFACE_PAL
000E242E|or dword ptr [esi+38], eax
// }
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // if: !bPalManaged
// then: jump to: 000B0606

000B05F1|cmp dword ptr [ebp+8], 0
000B05F5|je short 000B0606

000B05F7|mov edx, dword ptr [ebp+2C]
000B05FA|and edx, eax
000B05FC|mov dword ptr [ebp+24], edx

// if: flCreateFlag & XLATE_USE_SURFACE_PAL
// then: jump to: 000B0606

000B05FF|jne short 000B0606

// if(...){
// ppalTemp = palDestDC
000B0601|mov dword ptr [ebp+20], ebx

000B0604|jmp short 000B0616
// }else{
// ppalTemp = palDestSurf
000B060B|mov dword ptr [ebp+20], edi

000B0606|mov edx, dword ptr [ebp+2C]
000B0609|and edx, eax
000B060E|mov dword ptr [ebp+24], edx

// if: !(flCreateFlag & XLATE_USE_SURFACE_PAL)
// then: jump to: 000B0616

000B0611|je short 000B0616

// pxlate->flPrivate |= LATE_USE_SURFACE_PAL
000B0613|or dword ptr [esi+38], eax
// }
6.0.6003.20665: // if: !bPalManaged
// then: jump to: 000B3D02

000B3CED|cmp dword ptr [ebp-8], 0
000B3CF1|je short 000B3D02

000B3CF3|mov edx, dword ptr [ebp+2C]
000B3CF6|and edx, ecx
000B3CF8|mov dword ptr [ebp+28], edx

// if: flCreateFlag & XLATE_USE_SURFACE_PAL
// then: jump to: 000B3D02

000B3CFB|jne short 000B3D02

// if(...){
// eax = palDestDC
000B3CFD|mov eax, dword ptr [ebp+1C]

000B3D00|jmp short 000B3D0F
// }else{
// eax = palDestSurf is already the case,
// because the value is already in eax


000B3D02|mov edx, dword ptr [ebp+2C]
000B3D05|and edx, ecx
000B3D07|mov dword ptr [ebp+28], edx

// if: !(flCreateFlag & XLATE_USE_SURFACE_PAL)
// then: jump to: 000B3D0F

000B3D0A|je short 000B3D0F

// pxlate->flPrivate |= LATE_USE_SURFACE_PAL
000B3D0C|or dword ptr [esi+38], ecx
// }

// ppalTemp = eax
000B3D0F|mov dword ptr [ebp+2C], eax
6.0.6003.20785: // if: !bPalManaged
// then: jump to: 000B3F52

000B3F3D|cmp dword ptr [ebp-8], 0
000B3F41|je short 000B3F52

000B3F43|mov edx, dword ptr [ebp+2C]
000B3F46|and edx, ecx
000B3F48|mov dword ptr [ebp+28], edx

// if: flCreateFlag & XLATE_USE_SURFACE_PAL
// then: jump to: 000B3F52

000B3F4B|jne short 000B3F52

// if(...){
// eax = palDestDC
000B3F4D|mov eax, dword ptr [ebp+1C]

000B3F50|jmp short 000B3F5F
// }else{
// eax = palDestSurf is already the case,
// because the value is already in eax


000B3F52|mov edx, dword ptr [ebp+2C]
000B3F55|and edx, ecx
000B3F57|mov dword ptr [ebp+28], edx

// if: !(flCreateFlag & XLATE_USE_SURFACE_PAL)
// then: jump to: 000B3F5F

000B3F5A|je short 000B3F5F

// pxlate->flPrivate |= LATE_USE_SURFACE_PAL
000B3F5C|or dword ptr [esi+38], ecx
// }

// ppalTemp = eax
000B3F5F|mov dword ptr [ebp+2C], eax

5.00.2195.7640:
// By modifying cEntry this code is asking for
// trouble. Technically this code works because
// this function will not use cEntry anymore
// once this code is executed. However, any
// future modifications to this function will
// be harder if we always need to keep in mind,
// that the value in cEntry is lost.

while(cEntry--){
pxlate->ai[cEntry] = (
palTemp.ulGetNearestFromPalentry(
palSrc.palentryGet(cEntry)
)
);
}
// cEntry--
000E2431|dec ecx
000E2432|mov dword ptr [ebp-4], ecx

// edi = address(pxlate->ai[cEntry])
000E2435|lea edi, [ecx*4+esi+3C]

// 000E2439|- beginning of the loop -

// eax = address(palSrc)
000E2439|mov eax, dword ptr [ebp+10]

// ecx = cEntry
000E243C|mov ecx, dword ptr [ebp-4]

// edx = palSrc.palentryGet(cEntry)
000E243F|mov eax, dword ptr [eax+4C]
000E2442|mov edx, dword ptr [ecx*4+eax]

// ecx = ppalTemp
000E2445|mov ecx, dword ptr [ebp+1C]

000E2448|call dword ptr [ecx+3C]

// pxlate->ai[cEntry] = returned value
000E244B|mov dword ptr [edi], eax

// eax = cEntry
000E244D|mov eax, dword ptr [ebp-4]

// cEntry--
000E2450|dec dword ptr [ebp-4]

// edi = address(pxlate->ai[cEntry])
000E2453|sub edi, 4

// if: cEntry + 1
// then: jump to: beginning of the loop

000E2456|test eax, eax
000E2458|jne short 000E2439

// 000E245A|- end of the loop -
 
5.00.2196.0001V1:
5.00.2196.0001V2:
for(
ulTemp = 0;
ulTemp < cEntry;
ulTemp++
){
pxlate->ai[ulTemp] = (
palTemp.ulGetNearestFromPalentry(
palSrc.palentryGet(ulTemp)
)
);
}
// save edi
000E2431|push edi

// ulTemp = cEntry
000E2432|mov edi, [ebp-4]

// jump to: before the substraction
000E2435|jmp 000E244A

// 000E2437|- beginning of the loop -

// ecx = ppalTemp
000E2437|mov ecx, dword ptr [ebp+1C]

// edx = address(palSrc)
000E243A|mov edx, dword ptr [ebp+10]

// edx = palSrc.palentryGet(ulTemp)
000E243D|mov edx, dword ptr [edx+4C]
000E2440|mov edx, dword ptr [edi*4+edx]

000E2443|call dword ptr [ecx+3C]

// pxlate->ai[ulTemp] = returned value
000E2446|mov dword ptr [esi+3C+(edi*4)], eax

// 000E244A|- before the substraction -

// can't use "decrement"; it doesn't set cf
// ulTemp--

000E244A|sub edi, 1|d

// if: ulTemp >= 0|d
// then: jump to: beginning of the loop

000E244D|jae 000E2437

// 000E244F|- end of the loop -

// restore edi
000E244F|pop edi

// eax = 0|d
000E2450|xor eax, eax

000E2452|jmp 000E245A
000E2454|nop
000E2455|nop
000E2456|nop
000E2457|nop
000E2458|nop
000E2459|nop
 
6.0.6002.18005:
// By modifying cEntry this code is asking for
// trouble. Technically this code works because
// this function will not use cEntry anymore
// once this code is executed. However, any
// future modifications to this function will
// be harder if we always need to keep in mind,
// that the value in cEntry is lost.

while(cEntry--){
pxlate->ai[cEntry] = (
palTemp.ulGetNearestFromPalentry(
palSrc.palentryGet(cEntry)
)
);
}
// ebx = address(pxlate->ai[cEntry])
000B0616|lea ebx, [ecx*4+esi+3C]

// 000B061A|- beginning of the loop -

// cEntry--
000B061A|dec dword ptr [ebp-4]

// ebx = address(pxlate->ai[cEntry])
000B062C|sub ebx, 4

// eax = address(palSrc)
000B061D|mov eax, dword ptr [ebp+10]

// ecx = cEntry
000B0623|mov ecx, dword ptr [ebp-4]

// edx = palSrc.palentryGet(cEntry)
000B0620|mov eax, dword ptr [eax+4C]
000B0626|mov edx, dword ptr [ecx*4+eax]

// ecx = ppalTemp
000B0629|mov ecx, dword ptr [ebp+20]

000B062F|call dword ptr [ecx+3C]

// pxlate->ai[cEntry] = returned value
000B0636|mov dword ptr [ebx], eax

// if: cEntry
// then: jump to: beginning of the loop

000B0632|cmp dword ptr [ebp-4], 0
000B0638|jne short 000B061A

// 000B063A|- end of the loop -
 
6.0.6003.20665:
for(
ulTemp = 0;
ulTemp < cEntry;
ulTemp++
){
pxlate->ai[ulTemp] = (
palTemp.ulGetNearestFromPalentry(
palSrc.palentryGet(ulTemp)
)
);
}
// ulTemp = cEntry
000B3D12|mov eax, dword ptr [ebp-4]
000B3D19|mov ebx, eax

// edi = address(pxlate->ai[cEntry])
000B3D15|lea edi, [eax*4+esi+3C]

// 000B3D1B|- beginning of the loop -

// ulTemp--
000B3D21|dec ebx

// edi = address(pxlate->ai[ulTemp])
000B3D2E|sub edi, 4

// eax = address(palSrc)
000B3D1B|mov eax, dword ptr [ebp+10]

// push(palSrc.palentryGet(ulTemp))
000B3D1E|mov eax, dword ptr [eax+4C]
000B3D22|push dword ptr [ebx*4+eax]

// push(address(palTemp->ai))
000B3D25|mov eax, dword ptr [ebp+2C]
000B3D28|push dword ptr [eax+3C]

// ecx = ppalTemp
000B3D2B|lea ecx, [ebp+2C]

000B3D31|call 0017B570

// pxlate->ai[ulTemp] = returned value
000B3D38|mov dword ptr [edi], eax

// if: ulTemp
// then: jump to: beginning of the loop

000B3D36|test ebx, ebx
000B3D3A|jne short 000B3D1B

// 000B3D3C|- end of the loop -
6.0.6003.20785: // ulTemp = cEntry
000B3F62|mov eax, dword ptr [ebp-4]
000B3F69|mov ebx, eax

// edi = address(pxlate->ai[cEntry])
000B3F65|lea edi, [eax*4+esi+3C]

// 000B3F6B|- beginning of the loop -

// ulTemp--
000B3F71|dec ebx

// edi = address(pxlate->ai[ulTemp])
000B3F7E|sub edi, 4

// eax = address(palSrc)
000B3F6B|mov eax, dword ptr [ebp+10]

// push(palSrc.palentryGet(ulTemp))
000B3F6E|mov eax, dword ptr [eax+4C]
000B3F72|push dword ptr [ebx*4+eax]

// push(address(palTemp->ai))
000B3F75|mov eax, dword ptr [ebp+2C]
000B3F78|push dword ptr [eax+3C]

// ecx = ppalTemp
000B3F7B|lea ecx, [ebp+2C]

000B3F81|call 0017B98B

// pxlate->ai[ulTemp] = returned value
000B3F88|mov dword ptr [edi], eax

// if: ulTemp
// then: jump to: beginning of the loop

000B3F86|test ebx, ebx
000B3F8A|jne short 000B3F6B

5.00.2195.7640:
if(
bPalManaged &&
!(flCreateFlag & XLATE_USE_SURFACE_PAL)
){
// if: !bPalManaged
// then: jump to: 000E2677

000E245A|cmp dword ptr [ebp+14], eax
000E245D|je 000E2677

// if: flCreateFlag & XLATE_USE_SURFACE_PAL
// then: jump to: 000E2677

000E2463|cmp dword ptr [ebp+20], eax
000E2466|jne 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // if: !bPalManaged
// then: jump to: 000B0864

000B063A|cmp dword ptr [ebp+8], 0
000B063E|je 000B0864

// if: flCreateFlag & XLATE_USE_SURFACE_PAL
// then: jump to: 000B0864

000B0644|cmp dword ptr [ebp+24], 0
000B0648|jne 000B0864
6.0.6003.20665: // eax = 0|d
000B3D3C|xor eax, eax

// if: !bPalManaged
// then: jump to: 000B3F6C

000B3D3E|cmp dword ptr [ebp-8], eax
000B3D41|je 000B3F6C

// if: flCreateFlag & XLATE_USE_SURFACE_PAL
// then: jump to: 000B3F6C

000B3D47|cmp dword ptr [ebp+28], eax
000B3D4A|jne 000B3F6C
6.0.6003.20785: // eax = 0|d
000B3F8C|xor eax, eax

// if: !bPalManaged
// then: jump to: 000B41BC

000B3F8E|cmp dword ptr [ebp-8], eax
000B3F91|je 000B41BC

// if: flCreateFlag & XLATE_USE_SURFACE_PAL
// then: jump to: 000B41BC

000B3F97|cmp dword ptr [ebp+28], eax
000B3F9A|jne 000B41BC

5.00.2195.7640:
// Map from DC palette to surface palette.

if(palDestSurf.bValid()){
temp = ptransCurrent;
}else{
temp = ptransFore;
}

pxlate->vMapNewXlate(
temp
);
// temp = address(ptransCurrent)
000E246C|mov edx, dword ptr [ebp+8]

// if: palDestSurf.bValid()
// then: jump to: 000E2476

000E246F|test ebx, ebx
000E2471|jne short 000E2476

// temp = address(ptransFore)
000E2473|mov edx, dword ptr [ebp+0C]

// ecx = address(pxlate)
000E2476|mov ecx, esi

000E2478|call 00036258

000E247D|jmp 000E2677
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // temp = address(ptransCurrent)
000B0650|mov edx, dword ptr [ebp+0C]

// if: palDestSurf.bValid()
// then: jump to: 000B0658

000B064E|test edi, edi
000B0653|jne short 000B0658

// temp = address(ptransFore)
000B0655|mov edx, dword ptr [ebp+1C]

// ecx = address(pxlate)
000B0658|mov ecx, esi

000B065A|call 00174598

000B065F|jmp 000B0864
6.0.6003.20665: // temp = address(ptransCurrent)
000B3D53|mov edx, dword ptr [ebp+8]

// if: palDestSurf.bValid()
// then: jump to: 000B3D5B

000B3D50|cmp dword ptr [ebp+14], eax
000B3D56|jne short 000B3D5B

// temp = address(ptransFore)
000B3D58|mov edx, dword ptr [ebp+0C]

// ecx = address(pxlate)
000B3D5B|mov ecx, esi

000B3D5D|call 0017D419

000B3D62|jmp 000B3F6C
6.0.6003.20785: // temp = address(ptransCurrent)
000B3FA3|mov edx, dword ptr [ebp+8]

// if: palDestSurf.bValid()
// then: jump to: 000B3FAB

000B3FA0|cmp dword ptr [ebp+14], eax
000B3FA6|jne short 000B3FAB

// temp = address(ptransFore)
000B3FA8|mov edx, dword ptr [ebp+0C]

// ecx = address(pxlate)
000B3FAB|mov ecx, esi

000B3FAD|call 0017D834

000B3FB2|jmp 000B41BC

5.00.2195.7640:
}
}
}
}

pxlate->vCheckForTrivial();

unknown_object->unknown_function();

return(pxlate);
}
// ecx = address(pxlate)
000E2677|mov ecx, esi

// call pxlate->vCheckForTrivial()
000E2679|call 0000EE53

// ecx = unknown_object
000E267E|mov ecx, dword ptr [ebp-0C]

// unknown_object->unknown_function()
000E2681|call 000B6889

// return value = address(pxlate)
000E2686|mov eax, esi

// restore some registers
000E2688|pop edi
000E2689|pop esi
000E268A|pop ebx

// restore the frame pointer
000E268B|leave

// return and throw the input parameters
// from the stack

000E268C|retn 28
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005: // ecx = address(pxlate)
000B0864|mov ecx, esi

// call pxlate->vCheckForTrivial()
000B0866|call 000B097E

// ecx = unknown_object
000B086B|mov ecx, dword ptr [ebp-0C]

// unknown_object->unknown_function()
000B086E|call 000C8D7B

// return value = address(pxlate)
000B0874|mov eax, esi

// restore some registers
000B0873|pop edi
000B0876|pop ebx
000B0877|pop esi

// restore the frame pointer
000B0878|leave

// return and throw the input parameters
// from the stack

000B0879|retn 28
6.0.6003.20665: // ecx = address(pxlate)
000B3F6C|mov ecx, esi

// call pxlate->vCheckForTrivial()
000B3F6E|call 000B4086

// ecx = unknown_object
000B3F73|mov ecx, dword ptr [ebp-0C]

// unknown_object->unknown_function()
000B3F76|call 000CC679

// return value = address(pxlate)
000B3F7B|mov eax, esi

// restore some registers
000B3F7D|pop ebx
000B3F7E|pop edi
000B3F7F|pop esi

// restore the frame pointer
000B3F80|leave

// return and throw the input parameters
// from the stack

000B3F81|retn 28
6.0.6003.20785: // ecx = address(pxlate)
000B41BC|mov ecx, esi

// call pxlate->vCheckForTrivial()
000B41BE|call 000B42D6

// ecx = unknown_object
000B41C3|mov ecx, dword ptr [ebp-0C]

// unknown_object->unknown_function()
000B41C6|call 000CC8C9

// return value = address(pxlate)
000B41CB|mov eax, esi

// restore some registers
000B41CD|pop ebx
000B41CE|pop edi
000B41CF|pop esi

// restore the frame pointer
000B41D0|leave

// return and throw the input parameters
// from the stack

000B41D1|retn 28

5.00.2195.7640: PXLATE pCreateXlate(
ULONG ulNumEntries
){
/*
This allocates an xlate object with ulNumEntries.

Returns:
The pointer to the xlate object,
NULL for failure.

History:
17-May-1991 -by- ...
*/

temp = (
  sizeof(XLATE)
+ sizeof(ULONG) * ulNumEntries
)

pxlate = 0;

if(temp){
// Allocate room for the XLATE.
PXLATE pxlate = (PXLATE)PALLOCNOZ(
temp,
'tlxG'
);
)
// save a register
0000EDC9|push ebx

// ebx = ulNumEntries
0000EDCA|mov ebx, dword ptr [esp+8]

// save some registers
0000EDCE|push ebp
0000EDCF|push esi
0000EDDD|push edi

// eax = ulNumEntries * sizeof(ULONG)
// eax =+ sizeof(XLATE)

0000EDD0|lea eax, [ebx*4+40]

// ebp = esi = 0
0000EDD7|xor ebp, ebp
0000EDD9|xor esi, esi

// if: eax == 0
// then: jump to: after the call

0000EDDB|cmp eax, ebp
0000EDDE|je short 0000EDEE

// push(0)
0000EDE0|push ebp

// push('tlxG')
0000EDE1|push 746C7847

// push(eax)
0000EDE6|push eax

0000EDE7|call 00081296

// esi = returned value = address(pxlate)
0000EDEC|mov esi, eax

// 0000EDEE|- after the call -
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:  
6.0.6003.20665:  
6.0.6003.20785:  

5.00.2195.7640:
...
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785:

5.00.2195.7640:
return(pxlate);
}
 
5.00.2196.0001V1:
5.00.2196.0001V2:
6.0.6002.18005:
6.0.6003.20665:
6.0.6003.20785: