본문 바로가기

프로그래밍/미분류

[번역] ROP코드만 보고 해석하기

반응형

http://groups.google.com/group/microsoft.public.development.device.drivers/msg/67e084bd105c0eb6?dmode=source

From: "Maxim S. Shatskih" <ma...@storagecraft.com>
References: <OLokCZG1EHA.1524@TK2MSFTNGP09.phx.gbl>
Subject: Re: raster operation codes
Date: Sun, 28 Nov 2004 00:14:21 +0300
Lines: 55
Organization: StorageCraft
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <eX2ShXM1EHA.1300@TK2MSFTNGP14.phx.gbl>
Newsgroups: microsoft.public.development.device.drivers
NNTP-Posting-Host: ppp3-129.pppoe.mtu-net.ru 81.195.3.129
Path: g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.freenet.de!151.189.20.20.MISMATCH!newsfeed.arcor.de!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl

    First the binary ROPs. They are 4bit values.

   우선 바이너리 ROP (ROP2)는 4비트 값이다.

    There are 4 possible combinations of Src and Dst bits  - S=1:D=1, S=0:D=1,
S=1:D=0, S=0:D=0. Each bit position in the binary ROP means - whether the
result bit will be 1 for such a combination of Src and Dst bits, or will be 0.
So, 4 bits in binary ROP, which is 16 values.

   소스와 데스티네이션 비트에 대해 4가지 조합이 있다. S=1:D=1, S=0:D=1,
S=1:D=0, S=0:D=0. 바이너리 ROP의 각 비트는 이 조합에 대한 결과가 1인지 0
인지를 나타낸다. 그래서 바이너리 ROP는 4비트이고, 16가지 값이 있다.

    Samples:
    샘플 :

    a) BLACK. Result bits are always 0, regardless of Src and Dst. So, 0000 -
ROP code 0x0.
    a) BLACK. 결과는 Src, Dst에 상관 없이 0이다. 그래서, 0000 - ROP code 0x0

    b) WHITE. Result bits are always 1, regardless of Src and Dst. So, 1111 -
ROP code 0xf.

    b) WHITE. 결과는 Src, Dst에 상관없이 1이다. 그래서 1111 - ROP code 0xf

    c) NOP. Result bits are 1 if Dst is 1 and 0 if Dst is 0, Src is irrelevant. So, 1010 - ROP code 0xa.

    c) NOP. 결과는 Dst가 1이면 0, Dst가 0이면 1이고 Src는 상관이 없다. 그래서 1010 - ROP code 0xa.

    d) COPY. Result bits are 1 if Src is 1 and 0 if Src is 0, Dst is irrelevant. So, 1100 - ROP code 0xc.

    d) COPY. 결과는 Src가 1이면 1, Src가 0이면 0이 되고 Dst와는 상관이 없다. 그래서 1100 - ROP code 0xc.

    e) AND. Result bit is 1 only if both Src and Dst are 1, and 0 otherwise. So, 1000 - ROP code 0x8.

    e) AND. 결과는 Src와 Dst가 모두 1일 때에만 1이고 다른 조합은 모두 0. 그래서  1000 - ROP code 0x8.

    f) OR. Result bit is 0 only if both Src and Dst are 0, and 1 otherwise. So,
1110 - ROP code 0xe.

    f) OR. 결과는 Src와 Dst가 0일 때에만 0, 나머지는 모두 1. 그래서 1110 - ROP code 0xe.

    g) XOR. Result bit is 0 if Src and Dst are the same, and 1 otherwise. So,
0110 - ROP code 0x6.

    g) XOR. 결과는 Src와 Dst가 같을 때에는 0, 나머지는 1. 그래서 0110 - ROP code 0x6.

    The ROP2 codes from WINGDI.H are biased up by 1.

    WINGDI.H의 ROP2 코드는 위 값에서 1씩 더했다.

    Now the ternary ROPs. A byte, senior nibble is ROP2 for Pat = 1, junior
is - ROP2 for Pat = 0. So, the pattern-less ROP3 have the same both nibbles -
like 0xcc for SRCCOPY and 0x88 for SRCAND.

    ROP 3는. 위쪽 니블은 Pat 가 1일 때의 ROP2 이고, 아래 니블은 Pat 가 0
일 때의 ROP2이다. 그래서, 패턴에 상관없는 ROP3 는 위아래 니블이 동일하다.
SRCCOPY 는 0xcc이고, SRCAND는 0x88이다.

    PATCOPY has 0xf0 - 1 if Pat is 1, 0 otherwise. And so on.

    PATCOPY는 0xf0 이고, Pat이 1이면 1, 아니면 0이다.

    The other bytes in ROP3 values from WINGDI.H are not known to me, possibly they are the legacy from Win16 due to some internal Win16's stuff.

   WINGDI.H에 있는 ROP3 값의 다른 바이트는 잘 모르겠다. 아마 Win16에서 Win16 내부와 관련있는 무엇이 남아있는 게 아닐까?

-- 
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com

번역 DwYoon

728x90