81

(6 відповідей, залишених у Системне програмування)

На жаль, не маю звички коментувати подібного розміру сирці. Час пройде, всеодно не допоможе, окрім відладчика) Тут же пара функцій..

82

(10 відповідей, залишених у Системне програмування)

Швидше з таблицями, але не економно по пам'яті. По цифрам не знаю, не заміряв.

83

(10 відповідей, залишених у Системне програмування)

main.asm

format pe console

section '.code' import readable writeable executable

include 'win32ax.inc'

library     msvcrt, 'msvcrt.dll',\
            advapi32, 'advapi32.dll'

import      msvcrt,\
            printf, 'printf',\
            getchar, 'getchar',\
            memcpy, 'memcpy',\
            memcmp, 'memcmp'

import      advapi32,\
            RtlGenRandom, 'SystemFunction036'


;   -----------------------------------
    include ''

    struct aes_context
        ksch    rb 240
        rnd     rb 1
    ends
;   -----------------------------------

    SZ = 5 * 16

proc print, lab, buf, sz
    locals
        frmt_byte db '%02X ', 0
        frmt_text db '%s: ', 0
    endl

    cinvoke printf, addr frmt_text, [lab]

    mov esi, [buf]
    xor ecx, ecx

@@: push ecx

    and ecx, 0xF
    jne .next
    cinvoke printf, next_line

.next:
    movzx eax, byte[esi]
    cinvoke printf, addr frmt_byte, eax

    pop ecx
    inc ecx
    inc esi

    cmp ecx, [sz]
    jne @b

    cinvoke printf, two_next_line

    ret
endp

proc rnd, buf, sz_buf
    locals
        pRandomBuffer rd 1
    endl

    mov edi, [buf]
    xor ecx, ecx
@@: push ecx

    invoke RtlGenRandom, addr pRandomBuffer, 4
    cmp eax, 0
    je .err

    mov eax, [pRandomBuffer]
    xor edx, edx
    mov ecx, 255
    div ecx
    mov eax, edx
    jmp .fin

.err:
    xor eax, eax
    dec eax
.fin:

    mov byte[edi], al

    pop ecx

    inc edi
    inc ecx
    cmp ecx, [sz_buf]
    jl @b

    ret
endp


entry $

;    xor ecx, ecx
;@@: push ecx

    stdcall rnd, input, SZ

    stdcall rnd, key, 32

    stdcall rnd, iv_enc, 16
    cinvoke memcpy, iv_dec, iv_enc, 16


    stdcall print, text_key, key, 32
    stdcall print, text_iv, iv_enc, 16
    stdcall print, text_input, input, SZ

    stdcall aes_set_key, key, 32, ctx

    stdcall aes256_cbc, input, dec_input, 5, iv_enc, ctx, AES_ENCRYPT

    stdcall print, text_dec_input, dec_input, SZ

    stdcall aes256_cbc, dec_input, dec_output, 5, iv_dec, ctx, AES_DECRYPT
    
    stdcall print, text_dec_output, dec_output, SZ

;    cinvoke memcmp, input, dec_output, SZ
;    cmp eax, 0
;    jne not_eq

;    cinvoke printf, equally
;    jmp fin

;not_eq:
;    cinvoke printf, not_equal
;    cinvoke getchar

;fin:
;    pop ecx
;    inc ecx
;    cmp ecx, 40
;    jl @b

;    cinvoke printf, finish
    cinvoke getchar

    xor eax, eax
    ret


    equally                 db 'memcmp: equally', 13, 10, 0
    not_equal               db 'memcmp: not equal', 13, 10, 0
    finish                  db 13, 10, 'finish ok!', 13, 10, 0

    text_input              db 'input', 0
    input                   rb SZ

    text_key                db 'key', 0
    key                     rb 32

    text_iv                 db 'iv', 0
    iv_enc                  rb 16
    iv_dec                  rb 16

    text_dec_input          db 'dec_input', 0
    dec_input               rb SZ

    text_dec_output         db 'dec_output', 0
    dec_output              rb SZ

    ctx                     aes_context

    next_line               db 13, 10, 0
    two_next_line           db 13, 10, 13, 10, 0

84

(10 відповідей, залишених у Системне програмування)

aes256 (with tables).asm

    AES_ENCRYPT = 0
    AES_DECRYPT = 1

aes256_cbc:
    push ebp
    mov ebp, esp
    mov eax, dword[ebp + 1Ch]
    sub eax, 0h
    je @02
    sub eax, 1h
    jne @03
    push dword[ebp + 18h]
    mov edx, dword[ebp + 0Ch]
    push dword[ebp + 14h]
    mov ecx, dword[ebp + 8h]
    push dword[ebp + 10h]
    call @34
    jmp @03

@02:
    push dword[ebp + 18h]
    mov edx, dword[ebp + 0Ch]
    push dword[ebp + 14h]
    mov ecx, dword[ebp + 8h]
    push dword[ebp + 10h]
    call @28

@03:
    pop ebp
    ret 18h

@04:
    push ebp
    mov ebp, esp
    push esi
    mov esi, dword[ebp + 8h]
    sub edx, esi
    push edi
    push 4h
    sub ecx, esi
    pop edi

@05:
    mov eax, dword[esi + edx]
    xor eax, dword[esi]
    mov dword[esi + ecx], eax
    lea esi, [esi + 4h]
    sub edi, 1h
    jne @05
    pop edi
    pop esi
    pop ebp
    ret 4h

@06:
    push esi
    push 4h
    sub edx, ecx
    pop esi

@07:
    mov eax, dword[ecx + edx]
    xor dword[ecx], eax
    lea ecx, [ecx + 4h]
    sub esi, 1h
    jne @07
    pop esi
    ret

@08:
    mov edx, ecx
    movzx eax, byte[edx]
    mov cl, byte[edx + 1h]
    mov al, byte[eax + _402310h]
    mov byte[edx], al
    movzx eax, byte[edx + 4h]
    mov al, byte[eax + _402310h]
    mov byte[edx + 4h], al
    movzx eax, byte[edx + 8h]
    mov al, byte[eax + _402310h]
    mov byte[edx + 8h], al
    movzx eax, byte[edx + 0Ch]
    mov al, byte[eax + _402310h]
    mov byte[edx + 0Ch], al
    movzx eax, byte[edx + 5h]
    mov al, byte[eax + _402310h]
    mov byte[edx + 1h], al
    movzx eax, byte[edx + 9h]
    mov al, byte[eax + _402310h]
    mov byte[edx + 5h], al
    movzx eax, byte[edx + 0Dh]
    mov al, byte[eax + _402310h]
    mov byte[edx + 9h], al
    movzx eax, cl
    mov cl, byte[edx + 2h]
    mov al, byte[eax + _402310h]
    mov byte[edx + 0Dh], al
    movzx eax, byte[edx + 0Ah]
    mov al, byte[eax + _402310h]
    mov byte[edx + 2h], al
    movzx eax, cl
    mov cl, byte[edx + 6h]
    mov al, byte[eax + _402310h]
    mov byte[edx + 0Ah], al
    movzx eax, byte[edx + 0Eh]
    mov al, byte[eax + _402310h]
    mov byte[edx + 6h], al
    movzx eax, cl
    mov cl, byte[edx + 0Fh]
    mov al, byte[eax + _402310h]
    mov byte[edx + 0Eh], al
    movzx eax, byte[edx + 0Bh]
    mov al, byte[eax + _402310h]
    mov byte[edx + 0Fh], al
    movzx eax, byte[edx + 7h]
    mov al, byte[eax + _402310h]
    mov byte[edx + 0Bh], al
    movzx eax, byte[edx + 3h]
    mov al, byte[eax + _402310h]
    mov byte[edx + 7h], al
    movzx eax, cl
    mov al, byte[eax + _402310h]
    mov byte[edx + 3h], al
    ret

@09:
    mov edx, ecx
    movzx eax, byte[edx]
    mov cl, byte[edx + 0Dh]
    mov al, byte[eax + _402410h]
    mov byte[edx], al
    movzx eax, byte[edx + 4h]
    mov al, byte[eax + _402410h]
    mov byte[edx + 4h], al
    movzx eax, byte[edx + 8h]
    mov al, byte[eax + _402410h]
    mov byte[edx + 8h], al
    movzx eax, byte[edx + 0Ch]
    mov al, byte[eax + _402410h]
    mov byte[edx + 0Ch], al
    movzx eax, byte[edx + 9h]
    mov al, byte[eax + _402410h]
    mov byte[edx + 0Dh], al
    movzx eax, byte[edx + 5h]
    mov al, byte[eax + _402410h]
    mov byte[edx + 9h], al
    movzx eax, byte[edx + 1h]
    mov al, byte[eax + _402410h]
    mov byte[edx + 5h], al
    movzx eax, cl
    mov cl, byte[edx + 2h]
    mov al, byte[eax + _402410h]
    mov byte[edx + 1h], al
    movzx eax, byte[edx + 0Ah]
    mov al, byte[eax + _402410h]
    mov byte[edx + 2h], al
    movzx eax, cl
    mov cl, byte[edx + 6h]
    mov al, byte[eax + _402410h]
    mov byte[edx + 0Ah], al
    movzx eax, byte[edx + 0Eh]
    mov al, byte[eax + _402410h]
    mov byte[edx + 6h], al
    movzx eax, cl
    mov cl, byte[edx + 3h]
    mov al, byte[eax + _402410h]
    mov byte[edx + 0Eh], al
    movzx eax, byte[edx + 7h]
    mov al, byte[eax + _402410h]
    mov byte[edx + 3h], al
    movzx eax, byte[edx + 0Bh]
    mov al, byte[eax + _402410h]
    mov byte[edx + 7h], al
    movzx eax, byte[edx + 0Fh]
    mov al, byte[eax + _402410h]
    mov byte[edx + 0Bh], al
    movzx eax, cl
    mov al, byte[eax + _402410h]
    mov byte[edx + 0Fh], al
    ret

@10:
    push ebp
    mov ebp, esp
    sub esp, 1Ch
    mov eax, ecx
    mov dword[ebp - 4h], eax
    push ebx
    push esi
    mov esi, eax
    push edi
    lea edi, [ebp - 1Ch]
    movsd
    movsd
    movsd
    movsd
    mov eax, dword[ebp - 1Ch]
    movzx edx, al
    mov eax, dword[ebp - 18h]
    shr eax, 8h
    movzx ebx, al
    mov eax, dword[ebp - 14h]
    mov edi, dword[ebp - 10h]
    shr eax, 10h
    movzx esi, al
    mov al, byte[ebx + _402510h]
    xor al, byte[edx + _402610h]
    shr edi, 18h
    mov ah, byte[esi + _402310h]
    mov dword[ebp - 8h], edx
    mov edx, dword[ebp - 4h]
    mov cl, byte[edi + _402310h]
    xor al, cl
    xor al, ah
    mov byte[edx], al
    mov edx, dword[ebp - 8h]
    mov al, byte[esi + _402510h]
    xor al, byte[ebx + _402610h]
    mov dl, byte[edx + _402310h]
    xor al, dl
    xor al, cl
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 1h], al
    mov cl, byte[ebx + _402310h]
    mov al, byte[edi + _402510h]
    xor al, byte[esi + _402610h]
    mov ebx, dword[ebp - 4h]
    xor al, cl
    xor al, dl
    mov edx, dword[ebp - 8h]
    mov byte[ebx + 2h], al
    mov al, byte[edi + _402610h]
    xor al, byte[edx + _402510h]
    xor al, cl
    mov edi, dword[ebp - 1Ch]
    xor al, ah
    shr edi, 18h
    mov byte[ebx + 3h], al
    mov eax, dword[ebp - 18h]
    movzx edx, al
    mov eax, dword[ebp - 14h]
    mov bl, byte[edi + _402310h]
    shr eax, 8h
    movzx ecx, al
    mov eax, dword[ebp - 10h]
    shr eax, 10h
    movzx esi, al
    mov al, byte[ecx + _402510h]
    xor al, byte[edx + _402610h]
    mov dword[ebp - 8h], edx
    mov ah, byte[esi + _402310h]
    mov edx, dword[ebp - 4h]
    xor al, ah
    xor al, bl
    mov byte[edx + 4h], al
    mov edx, dword[ebp - 8h]
    mov al, byte[esi + _402510h]
    xor al, byte[ecx + _402610h]
    mov cl, byte[ecx + _402310h]
    mov dl, byte[edx + _402310h]
    xor al, dl
    xor al, bl
    mov ebx, dword[ebp - 4h]
    mov byte[ebx + 5h], al
    mov al, byte[esi + _402610h]
    xor al, byte[edi + _402510h]
    xor al, cl
    xor al, dl
    mov edx, dword[ebp - 8h]
    mov byte[ebx + 6h], al
    mov al, byte[edi + _402610h]
    mov edi, dword[ebp - 18h]
    xor al, byte[edx + _402510h]
    xor al, cl
    shr edi, 18h
    xor al, ah
    mov dword[ebp - 8h], edi
    mov byte[ebx + 7h], al
    mov eax, dword[ebp - 1Ch]
    shr eax, 10h
    movzx esi, al
    mov eax, dword[ebp - 14h]
    movzx edx, al
    mov eax, dword[ebp - 10h]
    shr eax, 8h
    movzx ecx, al
    mov bl, byte[edi + _402310h]
    mov bh, byte[esi + _402310h]
    mov edi, dword[ebp - 4h]
    mov al, byte[ecx + _402510h]
    xor al, byte[edx + _402610h]
    xor al, bl
    mov dword[ebp - 0Ch], edx
    mov dl, byte[edx + _402310h]
    xor al, bh
    mov byte[edi + 8h], al
    mov al, byte[ecx + _402610h]
    xor al, byte[esi + _402510h]
    xor al, dl
    mov cl, byte[ecx + _402310h]
    xor al, bl
    mov byte[edi + 9h], al
    mov edi, dword[ebp - 8h]
    mov al, byte[edi + _402510h]
    xor al, byte[esi + _402610h]
    xor al, cl
    xor al, dl
    mov edx, dword[ebp - 4h]
    mov byte[edx + 0Ah], al
    mov edx, dword[ebp - 0Ch]
    mov al, byte[edi + _402610h]
    xor al, byte[edx + _402510h]
    mov edx, dword[ebp - 4h]
    xor al, cl
    mov ecx, dword[ebp - 10h]
    xor al, bh
    movzx ebx, cl
    mov ecx, dword[ebp - 14h]
    mov byte[edx + 0Bh], al
    mov eax, dword[ebp - 1Ch]
    shr eax, 8h
    movzx edi, al
    mov eax, dword[ebp - 18h]
    shr eax, 10h
    movzx esi, al
    mov al, byte[ebx + _402610h]
    xor al, byte[edi + _402510h]
    shr ecx, 18h
    mov ah, byte[esi + _402310h]
    mov dword[ebp - 0Ch], ecx
    mov cl, byte[ecx + _402310h]
    xor al, cl
    xor al, ah
    mov byte[edx + 0Ch], al
    mov al, byte[esi + _402510h]
    xor al, byte[edi + _402610h]
    mov dl, byte[ebx + _402310h]
    xor al, dl
    xor al, cl
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 0Dh], al
    mov cl, byte[edi + _402310h]
    mov edi, dword[ebp - 0Ch]
    mov al, byte[edi + _402510h]
    xor al, byte[esi + _402610h]
    xor al, cl
    xor al, dl
    mov edx, dword[ebp - 4h]
    mov byte[edx + 0Eh], al
    mov al, byte[edi + _402610h]
    xor al, byte[ebx + _402510h]
    pop edi
    xor al, cl
    xor al, ah
    pop esi
    mov byte[edx + 0Fh], al
    pop ebx
    leave
    ret

@11:
    push ebp
    mov ebp, esp
    sub esp, 14h
    mov eax, ecx
    push ebx
    push esi
    mov esi, eax
    mov dword[ebp - 4h], eax
    push edi
    lea edi, [ebp - 14h]
    movsd
    movsd
    movsd
    movsd
    mov edx, dword[ebp - 14h]
    mov ebx, edx
    movzx esi, dl
    mov eax, edx
    shr eax, 10h
    movzx edi, al
    shr edx, 8h
    movzx eax, byte[esi + _402110h]
    movzx edx, dl
    shr ebx, 18h
    movzx ecx, byte[edx + _402710h]
    xor ecx, eax
    movzx eax, byte[edi + _402210h]
    xor ecx, eax
    movzx eax, byte[ebx + _402010h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx], al
    movzx eax, byte[esi + _402010h]
    movzx ecx, byte[edx + _402110h]
    xor ecx, eax
    movzx eax, byte[edi + _402710h]
    xor ecx, eax
    movzx eax, byte[ebx + _402210h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 5h], al
    movzx eax, byte[esi + _402210h]
    movzx ecx, byte[edx + _402010h]
    xor ecx, eax
    movzx eax, byte[edi + _402110h]
    xor ecx, eax
    movzx eax, byte[ebx + _402710h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 0Ah], al
    movzx eax, byte[esi + _402710h]
    movzx ecx, byte[edx + _402210h]
    xor ecx, eax
    movzx eax, byte[edi + _402010h]
    xor ecx, eax
    movzx eax, byte[ebx + _402110h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 0Fh], al
    mov ecx, dword[ebp - 10h]
    mov ebx, ecx
    movzx esi, cl
    mov eax, ecx
    shr ecx, 8h
    shr eax, 10h
    movzx edx, cl
    movzx edi, al
    movzx eax, byte[esi + _402110h]
    shr ebx, 18h
    movzx ecx, byte[edx + _402710h]
    xor ecx, eax
    movzx eax, byte[edi + _402210h]
    xor ecx, eax
    movzx eax, byte[ebx + _402010h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 4h], al
    movzx ecx, byte[edx + _402110h]
    movzx eax, byte[esi + _402010h]
    xor ecx, eax
    movzx eax, byte[edi + _402710h]
    xor ecx, eax
    movzx eax, byte[ebx + _402210h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 9h], al
    movzx eax, byte[esi + _402210h]
    movzx ecx, byte[edx + _402010h]
    xor ecx, eax
    movzx eax, byte[edi + _402110h]
    xor ecx, eax
    movzx eax, byte[ebx + _402710h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 0Eh], al
    movzx eax, byte[esi + _402710h]
    movzx ecx, byte[edx + _402210h]
    xor ecx, eax
    movzx eax, byte[edi + _402010h]
    xor ecx, eax
    movzx eax, byte[ebx + _402110h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 3h], al
    mov ecx, dword[ebp - 0Ch]
    mov ebx, ecx
    movzx esi, cl
    mov eax, ecx
    shr ecx, 8h
    movzx edx, cl
    shr eax, 10h
    movzx edi, al
    movzx eax, byte[esi + _402110h]
    movzx ecx, byte[edx + _402710h]
    xor ecx, eax
    shr ebx, 18h
    movzx eax, byte[edi + _402210h]
    xor ecx, eax
    movzx eax, byte[ebx + _402010h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 8h], al
    movzx eax, byte[esi + _402010h]
    movzx ecx, byte[edx + _402110h]
    xor ecx, eax
    movzx eax, byte[edi + _402710h]
    xor ecx, eax
    movzx eax, byte[ebx + _402210h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 0Dh], al
    movzx eax, byte[esi + _402210h]
    movzx ecx, byte[edx + _402010h]
    xor ecx, eax
    movzx eax, byte[edi + _402110h]
    xor ecx, eax
    movzx eax, byte[ebx + _402710h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 2h], al
    movzx eax, byte[esi + _402710h]
    movzx ecx, byte[edx + _402210h]
    xor ecx, eax
    movzx eax, byte[edi + _402010h]
    xor ecx, eax
    movzx eax, byte[ebx + _402110h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 7h], al
    mov ecx, dword[ebp - 8h]
    mov ebx, ecx
    shr ebx, 18h
    mov eax, ecx
    movzx esi, cl
    shr ecx, 8h
    movzx edx, cl
    shr eax, 10h
    movzx edi, al
    movzx eax, byte[esi + _402110h]
    movzx ecx, byte[edx + _402710h]
    xor ecx, eax
    movzx eax, byte[edi + _402210h]
    xor ecx, eax
    movzx eax, byte[ebx + _402010h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 0Ch], al
    movzx eax, byte[esi + _402010h]
    movzx ecx, byte[edx + _402110h]
    xor ecx, eax
    movzx eax, byte[edi + _402710h]
    xor ecx, eax
    movzx eax, byte[ebx + _402210h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 1h], al
    movzx eax, byte[esi + _402210h]
    movzx ecx, byte[edx + _402010h]
    xor ecx, eax
    movzx eax, byte[edi + _402110h]
    xor ecx, eax
    movzx eax, byte[ebx + _402710h]
    xor ecx, eax
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 6h], al
    movzx eax, byte[esi + _402710h]
    movzx ecx, byte[edx + _402210h]
    xor ecx, eax
    movzx eax, byte[edi + _402010h]
    xor ecx, eax
    movzx eax, byte[ebx + _402110h]
    xor ecx, eax
    pop edi
    pop esi
    pop ebx
    mov al, byte[ecx + _402410h]
    mov ecx, dword[ebp - 4h]
    mov byte[ecx + 0Bh], al
    leave
    ret

aes_set_key:
    push ebp
    mov ebp, esp
    push ecx
    push ecx
    movzx eax, byte[ebp + 0Ch]
    push ebx
    sub eax, 10h
    je @15
    sub eax, 8h
    je @14
    sub eax, 8h
    je @13
    sub eax, 60h
    je @15
    sub eax, 40h
    je @14
    sub eax, 40h
    je @13
    mov eax, dword[ebp + 10h]
    mov byte[eax + 0F0h], 0h
    or al, 0FFh
    jmp @21

@13:
    mov bl, 20h
    jmp @16

@14:
    mov bl, 18h
    jmp @16

@15:
    mov bl, 10h

@16:
    push esi
    mov esi, dword[ebp + 10h]
    movzx eax, bl
    push eax
    push dword[ebp + 8h]
    mov dword[ebp - 8h], eax
    push esi
    call @42
    mov bh, bl
    mov byte[ebp - 3h], bl
    add bh, 1Ch
    mov byte[ebp - 2h], 1h
    shl bh, 2h
    add esp, 0Ch
    mov al, bh
    shr al, 4h
    dec al
    mov byte[esi + 0F0h], al
    mov al, bl
    cmp bl, bh
    jae @20
    xor ch, ch
    mov byte[ebp - 4h], ch
    push edi

@17:
    movzx edi, al
    mov al, byte[esi + edi - 3h]
    mov byte[ebp + 0Fh], al
    mov al, byte[esi + edi - 2h]
    mov byte[ebp + 13h], al
    mov al, byte[esi + edi - 1h]
    mov byte[ebp + 0Bh], al
    mov eax, edi
    cdq
    idiv dword[ebp - 8h]
    mov cl, byte[esi + edi - 4h]
    mov byte[ebp - 1h], cl
    test edx, edx
    jne @22
    movzx eax, byte[ebp + 0Fh]
    mov dl, byte[ebp - 2h]
    mov al, byte[eax + _402310h]
    xor al, dl
    mov byte[ebp - 1h], al
    movzx eax, byte[ebp + 13h]
    mov al, byte[eax + _402310h]
    mov byte[ebp + 0Fh], al
    movzx eax, byte[ebp + 0Bh]
    mov al, byte[eax + _402310h]
    mov byte[ebp + 13h], al
    movzx eax, cl
    mov al, byte[eax + _402310h]
    mov byte[ebp + 0Bh], al
    mov al, dl
    shr al, 7h
    add dl, dl
    movzx eax, al
    imul eax, eax, 1Bh
    xor dl, al
    mov byte[ebp - 2h], dl

@18:
    mov dl, byte[ebp - 1h]

@19:
    mov ah, byte[ebp + 0Bh]
    movzx ecx, ch
    mov al, byte[esi + ecx]
    xor al, dl
    mov byte[esi + edi], al
    mov al, byte[esi + ecx + 1h]
    xor al, byte[ebp + 0Fh]
    mov byte[esi + edi + 1h], al
    mov al, byte[esi + ecx + 2h]
    xor al, byte[ebp + 13h]
    mov byte[esi + edi + 2h], al
    mov al, byte[esi + ecx + 3h]
    mov ch, byte[ebp - 4h]
    xor al, ah
    mov byte[esi + edi + 3h], al
    add ch, 4h
    mov al, byte[ebp - 3h]
    add al, 4h
    mov byte[ebp - 4h], ch
    mov byte[ebp - 3h], al
    cmp al, bh
    jb @17
    pop edi

@20:
    xor al, al
    pop esi

@21:
    pop ebx
    leave
    ret 0Ch

@22:
    cmp bl, 18h
    jbe @18
    cmp edx, 10h
    jne @18
    movzx eax, cl
    mov dl, byte[eax + _402310h]
    movzx eax, byte[ebp + 0Fh]
    mov al, byte[eax + _402310h]
    mov byte[ebp + 0Fh], al
    movzx eax, byte[ebp + 13h]
    mov al, byte[eax + _402310h]
    mov byte[ebp + 13h], al
    movzx eax, byte[ebp + 0Bh]
    mov al, byte[eax + _402310h]
    mov byte[ebp + 0Bh], al
    jmp @19

@23:
    push ebp
    mov ebp, esp
    sub esp, 14h
    push ebx
    push esi
    mov esi, dword[ebp + 8h]
    mov dword[ebp - 4h], edx
    mov bl, byte[esi + 0F0h]
    test bl, bl
    je @26
    mov edx, ecx
    lea ecx, [ebp - 14h]
    push esi
    call @04
    mov byte[ebp + 8h], 1h
    cmp bl, 1h
    jbe @25
    dec bl
    movzx eax, bl
    mov ebx, eax
    inc al
    push edi
    lea edi, [esi + 10h]
    mov dword[ebp + 8h], eax

@24:
    lea ecx, [ebp - 14h]
    call @10
    mov edx, edi
    lea ecx, [ebp - 14h]
    call @06
    add edi, 10h
    sub ebx, 1h
    jne @24
    pop edi

@25:
    lea ecx, [ebp - 14h]
    call @08
    mov ecx, dword[ebp + 8h]
    lea edx, [ebp - 14h]
    movzx eax, cl
    mov ecx, dword[ebp - 4h]
    shl eax, 4h
    add eax, esi
    push eax
    call @04
    xor al, al
    jmp @27

@26:
    or al, 0FFh

@27:
    pop esi
    pop ebx
    leave
    ret 4h

@28:
    push ebp
    mov ebp, esp
    push ecx
    push ecx
    mov eax, dword[ebp + 8h]
    mov dword[ebp - 8h], edx
    push ebx
    push esi
    push edi
    mov edi, edx
    test eax, eax
    je @31
    mov ebx, dword[ebp + 0Ch]
    sub ecx, ebx
    mov dword[ebp - 4h], ecx

@29:
    dec eax
    mov ecx, ebx
    mov ebx, dword[ebp - 4h]
    push 4h
    mov dword[ebp + 8h], eax
    pop edx

@30:
    mov eax, dword[ecx + ebx]
    xor dword[ecx], eax
    lea ecx, [ecx + 4h]
    sub edx, 1h
    jne @30
    mov ebx, dword[ebp + 0Ch]
    mov edx, ebx
    push dword[ebp + 10h]
    mov ecx, ebx
    call @23
    test al, al
    jne @33
    add dword[ebp - 4h], 10h
    mov esi, ebx
    mov eax, dword[ebp + 8h]
    movsd
    movsd
    movsd
    movsd
    mov edi, dword[ebp - 8h]
    add edi, 10h
    mov dword[ebp - 8h], edi
    test eax, eax
    jne @29

@31:
    xor al, al

@32:
    pop edi
    pop esi
    pop ebx
    leave
    ret 0Ch

@33:
    mov al, 1h
    jmp @32

@34:
    push ebp
    mov ebp, esp
    sub esp, 30h
    mov eax, dword[ebp + 8h]
    mov dword[ebp - 0Ch], ecx
    push ebx
    mov ebx, edx
    mov edx, ecx
    mov dword[ebp - 8h], ebx
    push esi
    push edi
    test eax, eax
    je @39
    mov ecx, dword[ebp + 0Ch]
    sub ecx, ebx
    mov dword[ebp - 10h], ecx

@35:
    mov esi, edx
    lea edi, [ebp - 30h]
    dec eax
    mov dword[ebp + 8h], eax
    movsd
    movsd
    movsd
    movsd
    mov edi, dword[ebp + 10h]
    mov al, byte[edi + 0F0h]
    mov byte[ebp - 1h], al
    test al, al
    je @41
    movzx eax, al
    lea ecx, [ebp - 20h]
    shl eax, 4h
    add eax, edi
    push eax
    call @04
    lea ecx, [ebp - 20h]
    call @09
    sub byte[ebp - 1h], 1h
    je @37
    mov bl, byte[ebp - 1h]
    movzx esi, bl
    shl esi, 4h
    add esi, edi

@36:
    mov edx, esi
    lea ecx, [ebp - 20h]
    call @06
    lea ecx, [ebp - 20h]
    call @11
    sub esi, 10h
    sub bl, 1h
    jne @36
    mov ebx, dword[ebp - 8h]

@37:
    push edi
    lea edx, [ebp - 20h]
    mov ecx, ebx
    call @04
    mov ecx, dword[ebp - 10h]
    push 4h
    pop edx

@38:
    mov eax, dword[ebx + ecx]
    xor dword[ebx], eax
    add ebx, 4h
    sub edx, 1h
    jne @38
    mov edi, dword[ebp + 0Ch]
    lea esi, [ebp - 30h]
    mov edx, dword[ebp - 0Ch]
    sub ecx, 10h
    mov eax, dword[ebp + 8h]
    add edx, 10h
    mov dword[ebp - 8h], ebx
    movsd
    mov dword[ebp - 0Ch], edx
    mov dword[ebp - 10h], ecx
    movsd
    movsd
    movsd
    test eax, eax
    jne @35

@39:
    xor al, al

@40:
    pop edi
    pop esi
    pop ebx
    leave
    ret 0Ch

@41:
    mov al, 1h
    jmp @40

@42:
    push ebp
    mov ebp, esp
    push esi
    push edi
    mov esi, dword[ebp + 0x0C]
    mov edi, dword[ebp + 0x08]
    mov ecx, dword[ebp + 0x10]
    rep movsb
    pop edi
    pop esi
    leave
    retn

_402010h:
      db 000h, 009h, 012h, 01Bh, 024h, 02Dh, 036h, 03Fh, 048h, 041h, 05Ah, 053h, 06Ch, 065h, 07Eh, 077h
      db 090h, 099h, 082h, 08Bh, 0B4h, 0BDh, 0A6h, 0AFh, 0D8h, 0D1h, 0CAh, 0C3h, 0FCh, 0F5h, 0EEh, 0E7h
      db 03Bh, 032h, 029h, 020h, 01Fh, 016h, 00Dh, 004h, 073h, 07Ah, 061h, 068h, 057h, 05Eh, 045h, 04Ch
      db 0ABh, 0A2h, 0B9h, 0B0h, 08Fh, 086h, 09Dh, 094h, 0E3h, 0EAh, 0F1h, 0F8h, 0C7h, 0CEh, 0D5h, 0DCh
      db 076h, 07Fh, 064h, 06Dh, 052h, 05Bh, 040h, 049h, 03Eh, 037h, 02Ch, 025h, 01Ah, 013h, 008h, 001h
      db 0E6h, 0EFh, 0F4h, 0FDh, 0C2h, 0CBh, 0D0h, 0D9h, 0AEh, 0A7h, 0BCh, 0B5h, 08Ah, 083h, 098h, 091h
      db 04Dh, 044h, 05Fh, 056h, 069h, 060h, 07Bh, 072h, 005h, 00Ch, 017h, 01Eh, 021h, 028h, 033h, 03Ah
      db 0DDh, 0D4h, 0CFh, 0C6h, 0F9h, 0F0h, 0EBh, 0E2h, 095h, 09Ch, 087h, 08Eh, 0B1h, 0B8h, 0A3h, 0AAh
      db 0ECh, 0E5h, 0FEh, 0F7h, 0C8h, 0C1h, 0DAh, 0D3h, 0A4h, 0ADh, 0B6h, 0BFh, 080h, 089h, 092h, 09Bh
      db 07Ch, 075h, 06Eh, 067h, 058h, 051h, 04Ah, 043h, 034h, 03Dh, 026h, 02Fh, 010h, 019h, 002h, 00Bh
      db 0D7h, 0DEh, 0C5h, 0CCh, 0F3h, 0FAh, 0E1h, 0E8h, 09Fh, 096h, 08Dh, 084h, 0BBh, 0B2h, 0A9h, 0A0h
      db 047h, 04Eh, 055h, 05Ch, 063h, 06Ah, 071h, 078h, 00Fh, 006h, 01Dh, 014h, 02Bh, 022h, 039h, 030h
      db 09Ah, 093h, 088h, 081h, 0BEh, 0B7h, 0ACh, 0A5h, 0D2h, 0DBh, 0C0h, 0C9h, 0F6h, 0FFh, 0E4h, 0EDh
      db 00Ah, 003h, 018h, 011h, 02Eh, 027h, 03Ch, 035h, 042h, 04Bh, 050h, 059h, 066h, 06Fh, 074h, 07Dh
      db 0A1h, 0A8h, 0B3h, 0BAh, 085h, 08Ch, 097h, 09Eh, 0E9h, 0E0h, 0FBh, 0F2h, 0CDh, 0C4h, 0DFh, 0D6h
      db 031h, 038h, 023h, 02Ah, 015h, 01Ch, 007h, 00Eh, 079h, 070h, 06Bh, 062h, 05Dh, 054h, 04Fh, 046h

_402110h:
      db 000h, 00Eh, 01Ch, 012h, 038h, 036h, 024h, 02Ah, 070h, 07Eh, 06Ch, 062h, 048h, 046h, 054h, 05Ah
      db 0E0h, 0EEh, 0FCh, 0F2h, 0D8h, 0D6h, 0C4h, 0CAh, 090h, 09Eh, 08Ch, 082h, 0A8h, 0A6h, 0B4h, 0BAh
      db 0DBh, 0D5h, 0C7h, 0C9h, 0E3h, 0EDh, 0FFh, 0F1h, 0ABh, 0A5h, 0B7h, 0B9h, 093h, 09Dh, 08Fh, 081h
      db 03Bh, 035h, 027h, 029h, 003h, 00Dh, 01Fh, 011h, 04Bh, 045h, 057h, 059h, 073h, 07Dh, 06Fh, 061h
      db 0ADh, 0A3h, 0B1h, 0BFh, 095h, 09Bh, 089h, 087h, 0DDh, 0D3h, 0C1h, 0CFh, 0E5h, 0EBh, 0F9h, 0F7h
      db 04Dh, 043h, 051h, 05Fh, 075h, 07Bh, 069h, 067h, 03Dh, 033h, 021h, 02Fh, 005h, 00Bh, 019h, 017h
      db 076h, 078h, 06Ah, 064h, 04Eh, 040h, 052h, 05Ch, 006h, 008h, 01Ah, 014h, 03Eh, 030h, 022h, 02Ch
      db 096h, 098h, 08Ah, 084h, 0AEh, 0A0h, 0B2h, 0BCh, 0E6h, 0E8h, 0FAh, 0F4h, 0DEh, 0D0h, 0C2h, 0CCh
      db 041h, 04Fh, 05Dh, 053h, 079h, 077h, 065h, 06Bh, 031h, 03Fh, 02Dh, 023h, 009h, 007h, 015h, 01Bh
      db 0A1h, 0AFh, 0BDh, 0B3h, 099h, 097h, 085h, 08Bh, 0D1h, 0DFh, 0CDh, 0C3h, 0E9h, 0E7h, 0F5h, 0FBh
      db 09Ah, 094h, 086h, 088h, 0A2h, 0ACh, 0BEh, 0B0h, 0EAh, 0E4h, 0F6h, 0F8h, 0D2h, 0DCh, 0CEh, 0C0h
      db 07Ah, 074h, 066h, 068h, 042h, 04Ch, 05Eh, 050h, 00Ah, 004h, 016h, 018h, 032h, 03Ch, 02Eh, 020h
      db 0ECh, 0E2h, 0F0h, 0FEh, 0D4h, 0DAh, 0C8h, 0C6h, 09Ch, 092h, 080h, 08Eh, 0A4h, 0AAh, 0B8h, 0B6h
      db 00Ch, 002h, 010h, 01Eh, 034h, 03Ah, 028h, 026h, 07Ch, 072h, 060h, 06Eh, 044h, 04Ah, 058h, 056h
      db 037h, 039h, 02Bh, 025h, 00Fh, 001h, 013h, 01Dh, 047h, 049h, 05Bh, 055h, 07Fh, 071h, 063h, 06Dh
      db 0D7h, 0D9h, 0CBh, 0C5h, 0EFh, 0E1h, 0F3h, 0FDh, 0A7h, 0A9h, 0BBh, 0B5h, 09Fh, 091h, 083h, 08Dh

_402210h:
      db 000h, 00Dh, 01Ah, 017h, 034h, 039h, 02Eh, 023h, 068h, 065h, 072h, 07Fh, 05Ch, 051h, 046h, 04Bh
      db 0D0h, 0DDh, 0CAh, 0C7h, 0E4h, 0E9h, 0FEh, 0F3h, 0B8h, 0B5h, 0A2h, 0AFh, 08Ch, 081h, 096h, 09Bh
      db 0BBh, 0B6h, 0A1h, 0ACh, 08Fh, 082h, 095h, 098h, 0D3h, 0DEh, 0C9h, 0C4h, 0E7h, 0EAh, 0FDh, 0F0h
      db 06Bh, 066h, 071h, 07Ch, 05Fh, 052h, 045h, 048h, 003h, 00Eh, 019h, 014h, 037h, 03Ah, 02Dh, 020h
      db 06Dh, 060h, 077h, 07Ah, 059h, 054h, 043h, 04Eh, 005h, 008h, 01Fh, 012h, 031h, 03Ch, 02Bh, 026h
      db 0BDh, 0B0h, 0A7h, 0AAh, 089h, 084h, 093h, 09Eh, 0D5h, 0D8h, 0CFh, 0C2h, 0E1h, 0ECh, 0FBh, 0F6h
      db 0D6h, 0DBh, 0CCh, 0C1h, 0E2h, 0EFh, 0F8h, 0F5h, 0BEh, 0B3h, 0A4h, 0A9h, 08Ah, 087h, 090h, 09Dh
      db 006h, 00Bh, 01Ch, 011h, 032h, 03Fh, 028h, 025h, 06Eh, 063h, 074h, 079h, 05Ah, 057h, 040h, 04Dh
      db 0DAh, 0D7h, 0C0h, 0CDh, 0EEh, 0E3h, 0F4h, 0F9h, 0B2h, 0BFh, 0A8h, 0A5h, 086h, 08Bh, 09Ch, 091h
      db 00Ah, 007h, 010h, 01Dh, 03Eh, 033h, 024h, 029h, 062h, 06Fh, 078h, 075h, 056h, 05Bh, 04Ch, 041h
      db 061h, 06Ch, 07Bh, 076h, 055h, 058h, 04Fh, 042h, 009h, 004h, 013h, 01Eh, 03Dh, 030h, 027h, 02Ah
      db 0B1h, 0BCh, 0ABh, 0A6h, 085h, 088h, 09Fh, 092h, 0D9h, 0D4h, 0C3h, 0CEh, 0EDh, 0E0h, 0F7h, 0FAh
      db 0B7h, 0BAh, 0ADh, 0A0h, 083h, 08Eh, 099h, 094h, 0DFh, 0D2h, 0C5h, 0C8h, 0EBh, 0E6h, 0F1h, 0FCh
      db 067h, 06Ah, 07Dh, 070h, 053h, 05Eh, 049h, 044h, 00Fh, 002h, 015h, 018h, 03Bh, 036h, 021h, 02Ch
      db 00Ch, 001h, 016h, 01Bh, 038h, 035h, 022h, 02Fh, 064h, 069h, 07Eh, 073h, 050h, 05Dh, 04Ah, 047h
      db 0DCh, 0D1h, 0C6h, 0CBh, 0E8h, 0E5h, 0F2h, 0FFh, 0B4h, 0B9h, 0AEh, 0A3h, 080h, 08Dh, 09Ah, 097h

_402310h:
      db 063h, 07Ch, 077h, 07Bh, 0F2h, 06Bh, 06Fh, 0C5h, 030h, 001h, 067h, 02Bh, 0FEh, 0D7h, 0ABh, 076h
      db 0CAh, 082h, 0C9h, 07Dh, 0FAh, 059h, 047h, 0F0h, 0ADh, 0D4h, 0A2h, 0AFh, 09Ch, 0A4h, 072h, 0C0h
      db 0B7h, 0FDh, 093h, 026h, 036h, 03Fh, 0F7h, 0CCh, 034h, 0A5h, 0E5h, 0F1h, 071h, 0D8h, 031h, 015h
      db 004h, 0C7h, 023h, 0C3h, 018h, 096h, 005h, 09Ah, 007h, 012h, 080h, 0E2h, 0EBh, 027h, 0B2h, 075h
      db 009h, 083h, 02Ch, 01Ah, 01Bh, 06Eh, 05Ah, 0A0h, 052h, 03Bh, 0D6h, 0B3h, 029h, 0E3h, 02Fh, 084h
      db 053h, 0D1h, 000h, 0EDh, 020h, 0FCh, 0B1h, 05Bh, 06Ah, 0CBh, 0BEh, 039h, 04Ah, 04Ch, 058h, 0CFh
      db 0D0h, 0EFh, 0AAh, 0FBh, 043h, 04Dh, 033h, 085h, 045h, 0F9h, 002h, 07Fh, 050h, 03Ch, 09Fh, 0A8h
      db 051h, 0A3h, 040h, 08Fh, 092h, 09Dh, 038h, 0F5h, 0BCh, 0B6h, 0DAh, 021h, 010h, 0FFh, 0F3h, 0D2h
      db 0CDh, 00Ch, 013h, 0ECh, 05Fh, 097h, 044h, 017h, 0C4h, 0A7h, 07Eh, 03Dh, 064h, 05Dh, 019h, 073h
      db 060h, 081h, 04Fh, 0DCh, 022h, 02Ah, 090h, 088h, 046h, 0EEh, 0B8h, 014h, 0DEh, 05Eh, 00Bh, 0DBh
      db 0E0h, 032h, 03Ah, 00Ah, 049h, 006h, 024h, 05Ch, 0C2h, 0D3h, 0ACh, 062h, 091h, 095h, 0E4h, 079h
      db 0E7h, 0C8h, 037h, 06Dh, 08Dh, 0D5h, 04Eh, 0A9h, 06Ch, 056h, 0F4h, 0EAh, 065h, 07Ah, 0AEh, 008h
      db 0BAh, 078h, 025h, 02Eh, 01Ch, 0A6h, 0B4h, 0C6h, 0E8h, 0DDh, 074h, 01Fh, 04Bh, 0BDh, 08Bh, 08Ah
      db 070h, 03Eh, 0B5h, 066h, 048h, 003h, 0F6h, 00Eh, 061h, 035h, 057h, 0B9h, 086h, 0C1h, 01Dh, 09Eh
      db 0E1h, 0F8h, 098h, 011h, 069h, 0D9h, 08Eh, 094h, 09Bh, 01Eh, 087h, 0E9h, 0CEh, 055h, 028h, 0DFh
      db 08Ch, 0A1h, 089h, 00Dh, 0BFh, 0E6h, 042h, 068h, 041h, 099h, 02Dh, 00Fh, 0B0h, 054h, 0BBh, 016h

_402410h:
      db 052h, 009h, 06Ah, 0D5h, 030h, 036h, 0A5h, 038h, 0BFh, 040h, 0A3h, 09Eh, 081h, 0F3h, 0D7h, 0FBh
      db 07Ch, 0E3h, 039h, 082h, 09Bh, 02Fh, 0FFh, 087h, 034h, 08Eh, 043h, 044h, 0C4h, 0DEh, 0E9h, 0CBh
      db 054h, 07Bh, 094h, 032h, 0A6h, 0C2h, 023h, 03Dh, 0EEh, 04Ch, 095h, 00Bh, 042h, 0FAh, 0C3h, 04Eh
      db 008h, 02Eh, 0A1h, 066h, 028h, 0D9h, 024h, 0B2h, 076h, 05Bh, 0A2h, 049h, 06Dh, 08Bh, 0D1h, 025h
      db 072h, 0F8h, 0F6h, 064h, 086h, 068h, 098h, 016h, 0D4h, 0A4h, 05Ch, 0CCh, 05Dh, 065h, 0B6h, 092h
      db 06Ch, 070h, 048h, 050h, 0FDh, 0EDh, 0B9h, 0DAh, 05Eh, 015h, 046h, 057h, 0A7h, 08Dh, 09Dh, 084h
      db 090h, 0D8h, 0ABh, 000h, 08Ch, 0BCh, 0D3h, 00Ah, 0F7h, 0E4h, 058h, 005h, 0B8h, 0B3h, 045h, 006h
      db 0D0h, 02Ch, 01Eh, 08Fh, 0CAh, 03Fh, 00Fh, 002h, 0C1h, 0AFh, 0BDh, 003h, 001h, 013h, 08Ah, 06Bh
      db 03Ah, 091h, 011h, 041h, 04Fh, 067h, 0DCh, 0EAh, 097h, 0F2h, 0CFh, 0CEh, 0F0h, 0B4h, 0E6h, 073h
      db 096h, 0ACh, 074h, 022h, 0E7h, 0ADh, 035h, 085h, 0E2h, 0F9h, 037h, 0E8h, 01Ch, 075h, 0DFh, 06Eh
      db 047h, 0F1h, 01Ah, 071h, 01Dh, 029h, 0C5h, 089h, 06Fh, 0B7h, 062h, 00Eh, 0AAh, 018h, 0BEh, 01Bh
      db 0FCh, 056h, 03Eh, 04Bh, 0C6h, 0D2h, 079h, 020h, 09Ah, 0DBh, 0C0h, 0FEh, 078h, 0CDh, 05Ah, 0F4h
      db 01Fh, 0DDh, 0A8h, 033h, 088h, 007h, 0C7h, 031h, 0B1h, 012h, 010h, 059h, 027h, 080h, 0ECh, 05Fh
      db 060h, 051h, 07Fh, 0A9h, 019h, 0B5h, 04Ah, 00Dh, 02Dh, 0E5h, 07Ah, 09Fh, 093h, 0C9h, 09Ch, 0EFh
      db 0A0h, 0E0h, 03Bh, 04Dh, 0AEh, 02Ah, 0F5h, 0B0h, 0C8h, 0EBh, 0BBh, 03Ch, 083h, 053h, 099h, 061h
      db 017h, 02Bh, 004h, 07Eh, 0BAh, 077h, 0D6h, 026h, 0E1h, 069h, 014h, 063h, 055h, 021h, 00Ch, 07Dh

_402510h:
      db 0A5h, 084h, 099h, 08Dh, 00Dh, 0BDh, 0B1h, 054h, 050h, 003h, 0A9h, 07Dh, 019h, 062h, 0E6h, 09Ah
      db 045h, 09Dh, 040h, 087h, 015h, 0EBh, 0C9h, 00Bh, 0ECh, 067h, 0FDh, 0EAh, 0BFh, 0F7h, 096h, 05Bh
      db 0C2h, 01Ch, 0AEh, 06Ah, 05Ah, 041h, 002h, 04Fh, 05Ch, 0F4h, 034h, 008h, 093h, 073h, 053h, 03Fh
      db 00Ch, 052h, 065h, 05Eh, 028h, 0A1h, 00Fh, 0B5h, 009h, 036h, 09Bh, 03Dh, 026h, 069h, 0CDh, 09Fh
      db 01Bh, 09Eh, 074h, 02Eh, 02Dh, 0B2h, 0EEh, 0FBh, 0F6h, 04Dh, 061h, 0CEh, 07Bh, 03Eh, 071h, 097h
      db 0F5h, 068h, 000h, 02Ch, 060h, 01Fh, 0C8h, 0EDh, 0BEh, 046h, 0D9h, 04Bh, 0DEh, 0D4h, 0E8h, 04Ah
      db 06Bh, 02Ah, 0E5h, 016h, 0C5h, 0D7h, 055h, 094h, 0CFh, 010h, 006h, 081h, 0F0h, 044h, 0BAh, 0E3h
      db 0F3h, 0FEh, 0C0h, 08Ah, 0ADh, 0BCh, 048h, 004h, 0DFh, 0C1h, 075h, 063h, 030h, 01Ah, 00Eh, 06Dh
      db 04Ch, 014h, 035h, 02Fh, 0E1h, 0A2h, 0CCh, 039h, 057h, 0F2h, 082h, 047h, 0ACh, 0E7h, 02Bh, 095h
      db 0A0h, 098h, 0D1h, 07Fh, 066h, 07Eh, 0ABh, 083h, 0CAh, 029h, 0D3h, 03Ch, 079h, 0E2h, 01Dh, 076h
      db 03Bh, 056h, 04Eh, 01Eh, 0DBh, 00Ah, 06Ch, 0E4h, 05Dh, 06Eh, 0EFh, 0A6h, 0A8h, 0A4h, 037h, 08Bh
      db 032h, 043h, 059h, 0B7h, 08Ch, 064h, 0D2h, 0E0h, 0B4h, 0FAh, 007h, 025h, 0AFh, 08Eh, 0E9h, 018h
      db 0D5h, 088h, 06Fh, 072h, 024h, 0F1h, 0C7h, 051h, 023h, 07Ch, 09Ch, 021h, 0DDh, 0DCh, 086h, 085h
      db 090h, 042h, 0C4h, 0AAh, 0D8h, 005h, 001h, 012h, 0A3h, 05Fh, 0F9h, 0D0h, 091h, 058h, 027h, 0B9h
      db 038h, 013h, 0B3h, 033h, 0BBh, 070h, 089h, 0A7h, 0B6h, 022h, 092h, 020h, 049h, 0FFh, 078h, 07Ah
      db 08Fh, 0F8h, 080h, 017h, 0DAh, 031h, 0C6h, 0B8h, 0C3h, 0B0h, 077h, 011h, 0CBh, 0FCh, 0D6h, 03Ah

_402610h:
      db 0C6h, 0F8h, 0EEh, 0F6h, 0FFh, 0D6h, 0DEh, 091h, 060h, 002h, 0CEh, 056h, 0E7h, 0B5h, 04Dh, 0ECh
      db 08Fh, 01Fh, 089h, 0FAh, 0EFh, 0B2h, 08Eh, 0FBh, 041h, 0B3h, 05Fh, 045h, 023h, 053h, 0E4h, 09Bh
      db 075h, 0E1h, 03Dh, 04Ch, 06Ch, 07Eh, 0F5h, 083h, 068h, 051h, 0D1h, 0F9h, 0E2h, 0ABh, 062h, 02Ah
      db 008h, 095h, 046h, 09Dh, 030h, 037h, 00Ah, 02Fh, 00Eh, 024h, 01Bh, 0DFh, 0CDh, 04Eh, 07Fh, 0EAh
      db 012h, 01Dh, 058h, 034h, 036h, 0DCh, 0B4h, 05Bh, 0A4h, 076h, 0B7h, 07Dh, 052h, 0DDh, 05Eh, 013h
      db 0A6h, 0B9h, 000h, 0C1h, 040h, 0E3h, 079h, 0B6h, 0D4h, 08Dh, 067h, 072h, 094h, 098h, 0B0h, 085h
      db 0BBh, 0C5h, 04Fh, 0EDh, 086h, 09Ah, 066h, 011h, 08Ah, 0E9h, 004h, 0FEh, 0A0h, 078h, 025h, 04Bh
      db 0A2h, 05Dh, 080h, 005h, 03Fh, 021h, 070h, 0F1h, 063h, 077h, 0AFh, 042h, 020h, 0E5h, 0FDh, 0BFh
      db 081h, 018h, 026h, 0C3h, 0BEh, 035h, 088h, 02Eh, 093h, 055h, 0FCh, 07Ah, 0C8h, 0BAh, 032h, 0E6h
      db 0C0h, 019h, 09Eh, 0A3h, 044h, 054h, 03Bh, 00Bh, 08Ch, 0C7h, 06Bh, 028h, 0A7h, 0BCh, 016h, 0ADh
      db 0DBh, 064h, 074h, 014h, 092h, 00Ch, 048h, 0B8h, 09Fh, 0BDh, 043h, 0C4h, 039h, 031h, 0D3h, 0F2h
      db 0D5h, 08Bh, 06Eh, 0DAh, 001h, 0B1h, 09Ch, 049h, 0D8h, 0ACh, 0F3h, 0CFh, 0CAh, 0F4h, 047h, 010h
      db 06Fh, 0F0h, 04Ah, 05Ch, 038h, 057h, 073h, 097h, 0CBh, 0A1h, 0E8h, 03Eh, 096h, 061h, 00Dh, 00Fh
      db 0E0h, 07Ch, 071h, 0CCh, 090h, 006h, 0F7h, 01Ch, 0C2h, 06Ah, 0AEh, 069h, 017h, 099h, 03Ah, 027h
      db 0D9h, 0EBh, 02Bh, 022h, 0D2h, 0A9h, 007h, 033h, 02Dh, 03Ch, 015h, 0C9h, 087h, 0AAh, 050h, 0A5h
      db 003h, 059h, 009h, 01Ah, 065h, 0D7h, 084h, 0D0h, 082h, 029h, 05Ah, 01Eh, 07Bh, 0A8h, 06Dh, 02Ch

_402710h:
      db 000h, 00Bh, 016h, 01Dh, 02Ch, 027h, 03Ah, 031h, 058h, 053h, 04Eh, 045h, 074h, 07Fh, 062h, 069h
      db 0B0h, 0BBh, 0A6h, 0ADh, 09Ch, 097h, 08Ah, 081h, 0E8h, 0E3h, 0FEh, 0F5h, 0C4h, 0CFh, 0D2h, 0D9h
      db 07Bh, 070h, 06Dh, 066h, 057h, 05Ch, 041h, 04Ah, 023h, 028h, 035h, 03Eh, 00Fh, 004h, 019h, 012h
      db 0CBh, 0C0h, 0DDh, 0D6h, 0E7h, 0ECh, 0F1h, 0FAh, 093h, 098h, 085h, 08Eh, 0BFh, 0B4h, 0A9h, 0A2h
      db 0F6h, 0FDh, 0E0h, 0EBh, 0DAh, 0D1h, 0CCh, 0C7h, 0AEh, 0A5h, 0B8h, 0B3h, 082h, 089h, 094h, 09Fh
      db 046h, 04Dh, 050h, 05Bh, 06Ah, 061h, 07Ch, 077h, 01Eh, 015h, 008h, 003h, 032h, 039h, 024h, 02Fh
      db 08Dh, 086h, 09Bh, 090h, 0A1h, 0AAh, 0B7h, 0BCh, 0D5h, 0DEh, 0C3h, 0C8h, 0F9h, 0F2h, 0EFh, 0E4h
      db 03Dh, 036h, 02Bh, 020h, 011h, 01Ah, 007h, 00Ch, 065h, 06Eh, 073h, 078h, 049h, 042h, 05Fh, 054h
      db 0F7h, 0FCh, 0E1h, 0EAh, 0DBh, 0D0h, 0CDh, 0C6h, 0AFh, 0A4h, 0B9h, 0B2h, 083h, 088h, 095h, 09Eh
      db 047h, 04Ch, 051h, 05Ah, 06Bh, 060h, 07Dh, 076h, 01Fh, 014h, 009h, 002h, 033h, 038h, 025h, 02Eh
      db 08Ch, 087h, 09Ah, 091h, 0A0h, 0ABh, 0B6h, 0BDh, 0D4h, 0DFh, 0C2h, 0C9h, 0F8h, 0F3h, 0EEh, 0E5h
      db 03Ch, 037h, 02Ah, 021h, 010h, 01Bh, 006h, 00Dh, 064h, 06Fh, 072h, 079h, 048h, 043h, 05Eh, 055h
      db 001h, 00Ah, 017h, 01Ch, 02Dh, 026h, 03Bh, 030h, 059h, 052h, 04Fh, 044h, 075h, 07Eh, 063h, 068h
      db 0B1h, 0BAh, 0A7h, 0ACh, 09Dh, 096h, 08Bh, 080h, 0E9h, 0E2h, 0FFh, 0F4h, 0C5h, 0CEh, 0D3h, 0D8h
      db 07Ah, 071h, 06Ch, 067h, 056h, 05Dh, 040h, 04Bh, 022h, 029h, 034h, 03Fh, 00Eh, 005h, 018h, 013h
      db 0CAh, 0C1h, 0DCh, 0D7h, 0E6h, 0EDh, 0F0h, 0FBh, 092h, 099h, 084h, 08Fh, 0BEh, 0B5h, 0A8h, 0A3h

85

(10 відповідей, залишених у Системне програмування)

Черговий ріп.

aes256 (without tables).asm

    use32

    AES_ENCRYPT = 0
    AES_DECRYPT = 1

aes256_cbc:
    push ebp
    mov ebp, esp
    mov eax, dword[ebp + 1Ch]
    sub eax, 0h
    je @02
    sub eax, 1h
    jne @03
    push dword[ebp + 18h]
    mov edx, dword[ebp + 0Ch]
    push dword[ebp + 14h]
    mov ecx, dword[ebp + 8h]
    push dword[ebp + 10h]
    call @48
    jmp @03

@02:
    push dword[ebp + 18h]
    mov edx, dword[ebp + 0Ch]
    push dword[ebp + 14h]
    mov ecx, dword[ebp + 8h]
    push dword[ebp + 10h]
    call @42

@03:
    pop ebp
    ret 18h

@04:
    mov dl, cl
    shr dl, 1h
    or dl, cl
    shr dl, 1h
    mov al, dl
    shr al, 2h
    or dl, al
    movzx ecx, dl
    mov eax, ecx
    shr eax, 4h
    or eax, ecx
    inc eax
    sar eax, 1h
    ret

@05:
    push ebp
    mov ebp, esp
    push ecx
    mov al, cl
    mov byte[ebp - 4h], 1Bh
    push ebx
    mov byte[ebp - 1h], al
    call @04
    mov cl, byte[ebp - 1h]
    mov bl, al
    mov byte[ebp - 3h], 0h
    mov al, 1h
    mov byte[ebp - 2h], al
    mov bh, 80h
    cmp cl, 2h
    jae @06
    mov al, cl
    jmp @14

@06:
    push esi
    test bl, bl
    je @13

@07:
    cmp bh, bl
    jb @09
    movzx esi, bl

@08:
    movzx eax, bh
    cdq
    idiv esi
    mov bh, byte[ebp - 4h]
    movzx ecx, cl
    movzx edx, al
    imul edx, ecx
    movzx ecx, byte[ebp - 2h]
    movzx eax, al
    imul ecx, eax
    xor bh, dl
    mov byte[ebp - 4h], bh
    xor byte[ebp - 3h], cl
    mov cl, bh
    call @04
    mov cl, byte[ebp - 1h]
    mov bh, al
    cmp bh, bl
    jae @08

@09:
    test bh, bh
    je @12
    cmp bl, bh
    jb @11
    movzx esi, bh

@10:
    movzx eax, bl
    cdq
    idiv esi
    movzx ecx, byte[ebp - 4h]
    mov bl, byte[ebp - 1h]
    movzx edx, al
    imul edx, ecx
    movzx ecx, byte[ebp - 3h]
    movzx eax, al
    imul ecx, eax
    xor bl, dl
    mov byte[ebp - 1h], bl
    xor byte[ebp - 2h], cl
    mov cl, bl
    call @04
    mov bl, al
    cmp bl, bh
    jae @10

@11:
    mov cl, byte[ebp - 1h]
    test bl, bl
    jne @07
    mov al, byte[ebp - 2h]
    jmp @13

@12:
    mov al, byte[ebp - 3h]

@13:
    pop esi

@14:
    pop ebx
    leave
    ret

@15:
    movzx ecx, cl
    lea eax, [ecx + ecx]
    xor eax, ecx
    add eax, eax
    xor eax, ecx
    add eax, eax
    xor eax, ecx
    add eax, eax
    xor ecx, eax
    mov eax, ecx
    xor eax, 00006300h
    shr eax, 8h
    xor eax, ecx
    ret

@16:
    movzx eax, cl
    mov ecx, eax
    shl ecx, 3h
    xor ecx, eax
    shl ecx, 2h
    xor ecx, eax
    add ecx, ecx
    mov eax, ecx
    xor eax, 00000500h
    shr eax, 8h
    xor eax, ecx
    ret

@17:
    push ebp
    mov ebp, esp
    push esi
    mov esi, dword[ebp + 8h]
    sub edx, esi
    push edi
    push 4h
    sub ecx, esi
    pop edi

@18:
    mov eax, dword[esi + edx]
    xor eax, dword[esi]
    mov dword[esi + ecx], eax
    lea esi, [esi + 4h]
    sub edi, 1h
    jne @18
    pop edi
    pop esi
    pop ebp
    ret 4h

@19:
    push esi
    push 4h
    sub edx, ecx
    pop esi

@20:
    mov eax, dword[ecx + edx]
    xor dword[ecx], eax
    lea ecx, [ecx + 4h]
    sub esi, 1h
    jne @20
    pop esi
    ret

@21:
    push ebx
    push esi
    mov esi, ecx
    mov cl, byte[esi]
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 4h]
    mov byte[esi], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 8h]
    mov byte[esi + 4h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 0Ch]
    mov byte[esi + 8h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 5h]
    mov bl, byte[esi + 1h]
    mov byte[esi + 0Ch], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 9h]
    mov byte[esi + 1h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 0Dh]
    mov byte[esi + 5h], al
    call @05
    mov cl, al
    call @15
    mov cl, bl
    mov byte[esi + 9h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 0Ah]
    mov bl, byte[esi + 2h]
    mov byte[esi + 0Dh], al
    call @05
    mov cl, al
    call @15
    mov cl, bl
    mov byte[esi + 2h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 0Eh]
    mov bl, byte[esi + 6h]
    mov byte[esi + 0Ah], al
    call @05
    mov cl, al
    call @15
    mov cl, bl
    mov byte[esi + 6h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 0Bh]
    mov bl, byte[esi + 0Fh]
    mov byte[esi + 0Eh], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 7h]
    mov byte[esi + 0Fh], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[esi + 3h]
    mov byte[esi + 0Bh], al
    call @05
    mov cl, al
    call @15
    mov cl, bl
    mov byte[esi + 7h], al
    call @05
    mov cl, al
    call @15
    mov byte[esi + 3h], al
    pop esi
    pop ebx
    ret

@22:
    push ebx
    push esi
    mov esi, ecx
    mov cl, byte[esi]
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 4h]
    mov byte[esi], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 8h]
    mov byte[esi + 4h], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 0Ch]
    mov byte[esi + 8h], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 9h]
    mov bl, byte[esi + 0Dh]
    mov byte[esi + 0Ch], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 5h]
    mov byte[esi + 0Dh], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 1h]
    mov byte[esi + 9h], al
    call @16
    mov cl, al
    call @05
    mov cl, bl
    mov byte[esi + 5h], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 0Ah]
    mov bl, byte[esi + 2h]
    mov byte[esi + 1h], al
    call @16
    mov cl, al
    call @05
    mov cl, bl
    mov byte[esi + 2h], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 0Eh]
    mov bl, byte[esi + 6h]
    mov byte[esi + 0Ah], al
    call @16
    mov cl, al
    call @05
    mov cl, bl
    mov byte[esi + 6h], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 7h]
    mov bl, byte[esi + 3h]
    mov byte[esi + 0Eh], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 0Bh]
    mov byte[esi + 3h], al
    call @16
    mov cl, al
    call @05
    mov cl, byte[esi + 0Fh]
    mov byte[esi + 7h], al
    call @16
    mov cl, al
    call @05
    mov cl, bl
    mov byte[esi + 0Bh], al
    call @16
    mov cl, al
    call @05
    mov byte[esi + 0Fh], al
    pop esi
    pop ebx
    ret

@23:
    push ebp
    mov ebp, esp
    sub esp, 1Ch
    push ebx
    push esi
    push edi
    mov esi, ecx
    mov dword[ebp - 0Ch], ecx
    lea edi, [ebp - 1Ch]
    movsd
    movsd
    movsd
    movsd
    mov cl, byte[ebp - 1Ch]
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 17h]
    mov bl, al
    mov byte[ebp - 3h], bl
    call @05
    mov cl, al
    call @15
    mov cl, bl
    mov dl, al
    shr cl, 7h
    movzx ecx, cl
    imul eax, ecx, 1Bh
    mov cl, dl
    shr cl, 7h
    movzx ecx, cl
    imul ebx, ecx, 1Bh
    mov cl, byte[ebp - 12h]
    mov byte[ebp - 2h], dl
    mov dword[ebp - 8h], eax
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 0Dh]
    mov byte[ebp - 1h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 2h]
    mov ch, al
    xor cl, byte[ebp - 3h]
    mov esi, dword[ebp - 0Ch]
    add cl, cl
    xor cl, ch
    mov bh, byte[ebp - 3h]
    xor cl, byte[ebp - 1h]
    xor cl, bl
    mov byte[ebp - 4h], ch
    xor cl, byte[ebp - 8h]
    xor cl, byte[ebp - 2h]
    mov byte[esi], cl
    mov cl, byte[ebp - 1h]
    mov al, cl
    shr al, 7h
    movzx eax, al
    imul edx, eax, 1Bh
    mov al, cl
    xor al, byte[ebp - 2h]
    add al, al
    xor al, dl
    xor al, ch
    xor al, cl
    xor al, bl
    mov bl, ch
    xor al, bh
    mov byte[esi + 1h], al
    mov al, bl
    shr al, 7h
    movzx eax, al
    imul ecx, eax, 1Bh
    mov al, bl
    xor al, byte[ebp - 1h]
    add al, al
    xor al, cl
    xor al, dl
    xor al, bl
    xor al, byte[ebp - 2h]
    xor al, bh
    mov byte[esi + 2h], al
    xor bl, bh
    add bl, bl
    xor bl, cl
    mov cl, byte[ebp - 18h]
    xor bl, byte[ebp - 1h]
    xor bl, byte[ebp - 8h]
    xor bl, byte[ebp - 2h]
    xor bl, bh
    mov byte[esi + 3h], bl
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 13h]
    mov bl, al
    mov byte[ebp - 3h], bl
    call @05
    mov cl, al
    call @15
    mov cl, bl
    mov dl, al
    shr cl, 7h
    movzx ecx, cl
    imul eax, ecx, 1Bh
    mov cl, dl
    shr cl, 7h
    movzx ecx, cl
    imul ebx, ecx, 1Bh
    mov cl, byte[ebp - 19h]
    mov byte[ebp - 1h], dl
    mov dword[ebp - 8h], eax
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 0Eh]
    mov byte[ebp - 2h], al
    call @05
    mov cl, al
    call @15
    mov ch, al
    mov cl, byte[ebp - 1h]
    xor cl, byte[ebp - 3h]
    shr al, 7h
    add cl, cl
    movzx eax, al
    xor cl, ch
    xor cl, byte[ebp - 2h]
    imul edx, eax, 1Bh
    xor cl, bl
    mov bh, byte[ebp - 2h]
    mov al, ch
    xor al, byte[ebp - 1h]
    xor cl, byte[ebp - 8h]
    add al, al
    xor cl, byte[ebp - 1h]
    xor al, dl
    mov byte[ebp - 4h], ch
    xor al, ch
    mov byte[esi + 4h], cl
    xor al, byte[ebp - 2h]
    xor al, bl
    xor al, byte[ebp - 3h]
    mov byte[esi + 5h], al
    mov al, bh
    shr al, 7h
    movzx eax, al
    imul ecx, eax, 1Bh
    mov al, byte[ebp - 4h]
    mov ah, byte[ebp - 3h]
    xor al, bh
    add al, al
    xor al, cl
    xor al, dl
    xor al, bh
    xor bh, ah
    xor al, byte[ebp - 1h]
    add bh, bh
    xor bh, cl
    xor al, ah
    xor bh, byte[ebp - 4h]
    xor bh, byte[ebp - 8h]
    mov byte[esi + 6h], al
    xor bh, byte[ebp - 1h]
    mov cl, byte[ebp - 14h]
    xor bh, ah
    mov byte[esi + 7h], bh
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 0Fh]
    mov bl, al
    mov byte[ebp - 1h], bl
    call @05
    mov cl, al
    call @15
    mov cl, bl
    mov dl, al
    shr cl, 7h
    movzx ecx, cl
    imul eax, ecx, 1Bh
    mov cl, dl
    shr cl, 7h
    movzx ecx, cl
    imul ebx, ecx, 1Bh
    mov cl, byte[ebp - 1Ah]
    mov byte[ebp - 2h], dl
    mov dword[ebp - 8h], eax
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 15h]
    mov byte[ebp - 3h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 2h]
    mov ch, al
    xor cl, byte[ebp - 1h]
    add cl, cl
    mov bh, byte[ebp - 1h]
    xor cl, ch
    mov byte[ebp - 4h], ch
    xor cl, byte[ebp - 3h]
    xor cl, bl
    xor cl, byte[ebp - 8h]
    xor cl, byte[ebp - 2h]
    mov byte[esi + 8h], cl
    mov cl, byte[ebp - 3h]
    mov al, cl
    shr al, 7h
    movzx eax, al
    imul edx, eax, 1Bh
    mov al, cl
    xor al, byte[ebp - 2h]
    add al, al
    xor al, dl
    xor al, ch
    xor al, cl
    xor al, bl
    mov bl, ch
    xor al, bh
    mov byte[esi + 9h], al
    mov al, bl
    shr al, 7h
    movzx eax, al
    imul ecx, eax, 1Bh
    mov al, bl
    xor al, byte[ebp - 3h]
    add al, al
    xor al, cl
    xor al, dl
    xor al, bl
    xor bl, bh
    xor al, byte[ebp - 2h]
    add bl, bl
    xor bl, cl
    xor al, bh
    xor bl, byte[ebp - 3h]
    xor bl, byte[ebp - 8h]
    xor bl, byte[ebp - 2h]
    xor bl, bh
    mov byte[esi + 0Ah], al
    mov byte[esi + 0Bh], bl
    mov cl, byte[ebp - 1Bh]
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 10h]
    mov bl, al
    mov byte[ebp - 2h], bl
    call @05
    mov cl, al
    call @15
    mov cl, bl
    mov byte[ebp - 1h], al
    shr cl, 7h
    movzx ecx, cl
    imul ebx, ecx, 1Bh
    mov cl, al
    shr cl, 7h
    movzx ecx, cl
    imul eax, ecx, 1Bh
    mov cl, byte[ebp - 16h]
    mov dword[ebp - 8h], eax
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 11h]
    mov byte[ebp - 3h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 1h]
    mov ch, al
    xor cl, byte[ebp - 2h]
    add cl, cl
    mov bh, byte[ebp - 1h]
    xor cl, ch
    mov byte[ebp - 4h], ch
    xor cl, byte[ebp - 3h]
    xor cl, byte[ebp - 8h]
    xor cl, bl
    xor cl, byte[ebp - 2h]
    mov byte[esi + 0Ch], cl
    mov cl, byte[ebp - 3h]
    mov al, cl
    shr al, 7h
    movzx eax, al
    imul edx, eax, 1Bh
    mov al, cl
    xor al, byte[ebp - 2h]
    add al, al
    pop edi
    xor al, dl
    xor al, ch
    xor al, cl
    xor al, bl
    mov bl, ch
    xor al, bh
    mov byte[esi + 0Dh], al
    mov al, bl
    shr al, 7h
    movzx eax, al
    imul ecx, eax, 1Bh
    mov al, bl
    xor al, byte[ebp - 3h]
    add al, al
    xor al, cl
    xor al, dl
    xor al, bl
    xor bl, bh
    add bl, bl
    xor al, bh
    xor al, byte[ebp - 2h]
    xor bl, cl
    xor bl, byte[ebp - 3h]
    xor bl, byte[ebp - 8h]
    xor bl, bh
    mov byte[esi + 0Eh], al
    xor bl, byte[ebp - 2h]
    mov byte[esi + 0Fh], bl
    pop esi
    pop ebx
    leave
    ret

@24:
    push ebp
    mov ebp, esp
    sub esp, 6Ch
    push ebx
    push esi
    mov esi, ecx
    mov dword[ebp - 50h], ecx
    push edi
    lea edi, [ebp - 6Ch]
    movsd
    movsd
    movsd
    movsd
    mov dh, byte[ebp - 6Ch]
    mov cl, byte[ebp - 69h]
    mov dl, dh
    mov bh, byte[ebp - 6Bh]
    xor cl, dh
    mov bl, byte[ebp - 6Ah]
    xor cl, bh
    xor cl, bl
    shr dl, 5h
    add cl, cl
    mov ch, cl
    mov byte[ebp - 1h], cl
    mov cl, byte[ebp - 69h]
    xor ch, dh
    shr cl, 5h
    xor ch, bl
    mov al, cl
    add ch, ch
    and al, 04h
    mov byte[ebp - 2h], ch
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 34h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 30h], eax
    movzx eax, cl
    mov cl, dh
    imul eax, eax, 1Bh
    shr cl, 6h
    mov dword[ebp - 2Ch], eax
    mov al, dl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 28h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 44h], eax
    movzx eax, cl
    mov cl, bh
    imul eax, eax, 1Bh
    shr cl, 5h
    mov dword[ebp - 40h], eax
    mov al, dl
    and al, 02h
    and dl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 24h], eax
    movzx eax, dl
    imul eax, eax, 1Bh
    mov dword[ebp - 20h], eax
    mov al, cl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 1Ch], eax
    mov al, cl
    and al, 02h
    movzx eax, al
    imul eax, eax, 1Bh
    and cl, 01h
    mov dword[ebp - 18h], eax
    movzx eax, cl
    imul eax, eax, 1Bh
    mov dl, bl
    shr dl, 5h
    mov cl, bl
    shr cl, 6h
    mov dword[ebp - 14h], eax
    mov al, dl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 10h], eax
    mov al, cl
    and cl, 01h
    and al, 02h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 3Ch], eax
    movzx eax, cl
    mov cl, ch
    imul eax, eax, 1Bh
    xor cl, byte[ebp - 6Ch]
    xor cl, byte[ebp - 6Bh]
    add cl, cl
    mov dword[ebp - 38h], eax
    mov al, dl
    and al, 02h
    and dl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 0Ch], eax
    movzx eax, dl
    imul eax, eax, 1Bh
    mov dword[ebp - 8h], eax
    mov al, dh
    shr al, 7h
    movzx eax, al
    imul edx, eax, 1Bh
    mov al, bh
    shr al, 7h
    movzx eax, al
    imul ebx, eax, 1Bh
    mov dword[ebp - 5Ch], edx
    xor cl, bl
    xor cl, dl
    xor cl, byte[ebp - 8h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 38h]
    xor cl, byte[ebp - 3Ch]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 40h]
    xor cl, byte[ebp - 44h]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 69h]
    xor cl, byte[ebp - 6Bh]
    xor cl, byte[ebp - 6Ah]
    call @16
    mov cl, al
    call @05
    mov esi, dword[ebp - 50h]
    mov ch, byte[ebp - 69h]
    mov cl, ch
    shr cl, 6h
    mov byte[esi], al
    mov al, byte[ebp - 1h]
    xor al, ch
    xor al, byte[ebp - 6Bh]
    add al, al
    mov byte[ebp - 1h], al
    mov al, cl
    and al, 02h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 50h], eax
    and cl, 01h
    movzx eax, cl
    mov cl, byte[ebp - 6Bh]
    shr cl, 6h
    imul eax, eax, 1Bh
    mov dword[ebp - 4Ch], eax
    mov al, cl
    and cl, 01h
    and al, 02h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 48h], eax
    movzx eax, cl
    mov cl, byte[ebp - 1h]
    xor cl, byte[ebp - 6Bh]
    xor cl, byte[ebp - 6Ah]
    add cl, cl
    imul edx, eax, 1Bh
    mov al, byte[ebp - 6Ah]
    shr al, 7h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 58h], edx
    xor cl, al
    mov dword[ebp - 54h], eax
    xor cl, dl
    xor cl, byte[ebp - 48h]
    xor cl, byte[ebp - 4Ch]
    xor cl, byte[ebp - 50h]
    xor cl, bl
    xor cl, byte[ebp - 8h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 34h]
    xor cl, ch
    xor cl, byte[ebp - 6Ch]
    xor cl, byte[ebp - 6Ah]
    call @16
    mov cl, al
    call @05
    mov cl, byte[ebp - 69h]
    mov byte[esi + 5h], al
    mov al, cl
    shr al, 7h
    movzx eax, al
    imul ebx, eax, 1Bh
    mov al, byte[ebp - 2h]
    xor al, cl
    xor al, byte[ebp - 6Ah]
    add al, al
    xor al, bl
    xor al, byte[ebp - 54h]
    xor al, byte[ebp - 8h]
    xor al, byte[ebp - 0Ch]
    xor al, byte[ebp - 38h]
    xor al, byte[ebp - 3Ch]
    xor al, byte[ebp - 10h]
    xor al, byte[ebp - 14h]
    xor al, byte[ebp - 18h]
    xor al, byte[ebp - 1Ch]
    xor al, byte[ebp - 20h]
    xor al, byte[ebp - 24h]
    xor al, byte[ebp - 40h]
    xor al, byte[ebp - 44h]
    xor al, byte[ebp - 28h]
    xor al, byte[ebp - 2Ch]
    xor al, byte[ebp - 30h]
    xor al, byte[ebp - 34h]
    xor al, cl
    xor al, byte[ebp - 6Ch]
    xor al, byte[ebp - 6Bh]
    mov cl, al
    call @16
    mov cl, al
    call @05
    mov cl, byte[ebp - 1h]
    xor cl, byte[ebp - 69h]
    xor cl, byte[ebp - 6Ch]
    add cl, cl
    mov byte[esi + 0Ah], al
    xor cl, bl
    xor cl, byte[ebp - 58h]
    xor cl, byte[ebp - 48h]
    xor cl, byte[ebp - 4Ch]
    xor cl, byte[ebp - 50h]
    xor cl, byte[ebp - 5Ch]
    xor cl, byte[ebp - 8h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 6Ch]
    xor cl, byte[ebp - 6Bh]
    xor cl, byte[ebp - 6Ah]
    call @16
    mov cl, al
    call @05
    mov dh, byte[ebp - 68h]
    mov cl, byte[ebp - 65h]
    mov dl, dh
    mov bh, byte[ebp - 67h]
    xor cl, dh
    mov bl, byte[ebp - 66h]
    xor cl, bh
    mov byte[esi + 0Fh], al
    xor cl, bl
    add cl, cl
    shr dl, 5h
    mov ch, cl
    mov byte[ebp - 1h], cl
    mov cl, byte[ebp - 65h]
    xor ch, dh
    shr cl, 5h
    xor ch, bl
    mov al, cl
    add ch, ch
    and al, 04h
    mov byte[ebp - 2h], ch
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 8h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 0Ch], eax
    movzx eax, cl
    mov cl, dh
    imul eax, eax, 1Bh
    shr cl, 6h
    mov dword[ebp - 10h], eax
    mov al, dl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 14h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 44h], eax
    movzx eax, cl
    imul eax, eax, 1Bh
    mov dword[ebp - 48h], eax
    mov al, dl
    and al, 02h
    and dl, 01h
    movzx eax, al
    mov cl, bh
    imul eax, eax, 1Bh
    shr cl, 5h
    mov dword[ebp - 18h], eax
    movzx eax, dl
    mov dl, bl
    imul eax, eax, 1Bh
    shr dl, 5h
    mov dword[ebp - 1Ch], eax
    mov al, cl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 20h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 24h], eax
    movzx eax, cl
    mov cl, bl
    imul eax, eax, 1Bh
    shr cl, 6h
    mov dword[ebp - 28h], eax
    mov al, dl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 2Ch], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 4Ch], eax
    movzx eax, cl
    mov cl, ch
    imul eax, eax, 1Bh
    xor cl, byte[ebp - 68h]
    xor cl, byte[ebp - 67h]
    add cl, cl
    mov dword[ebp - 50h], eax
    mov al, dl
    and al, 02h
    and dl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 30h], eax
    movzx eax, dl
    imul eax, eax, 1Bh
    mov dword[ebp - 34h], eax
    mov al, dh
    shr al, 7h
    movzx eax, al
    imul edx, eax, 1Bh
    mov al, bh
    shr al, 7h
    movzx eax, al
    imul ebx, eax, 1Bh
    mov dword[ebp - 54h], edx
    xor cl, bl
    xor cl, dl
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 50h]
    xor cl, byte[ebp - 4Ch]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 48h]
    xor cl, byte[ebp - 44h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 8h]
    xor cl, byte[ebp - 65h]
    xor cl, byte[ebp - 67h]
    xor cl, byte[ebp - 66h]
    call @16
    mov cl, al
    call @05
    mov ch, byte[ebp - 65h]
    mov byte[esi + 4h], al
    mov cl, ch
    mov al, byte[ebp - 1h]
    shr cl, 6h
    xor al, ch
    xor al, byte[ebp - 67h]
    add al, al
    mov byte[ebp - 1h], al
    mov al, cl
    and cl, 01h
    and al, 02h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 38h], eax
    movzx eax, cl
    mov cl, byte[ebp - 67h]
    shr cl, 6h
    imul eax, eax, 1Bh
    mov dword[ebp - 3Ch], eax
    mov al, cl
    and cl, 01h
    and al, 02h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 40h], eax
    movzx eax, cl
    mov cl, byte[ebp - 1h]
    xor cl, byte[ebp - 67h]
    xor cl, byte[ebp - 66h]
    add cl, cl
    imul edx, eax, 1Bh
    mov al, byte[ebp - 66h]
    shr al, 7h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 58h], edx
    xor cl, al
    mov dword[ebp - 5Ch], eax
    xor cl, dl
    xor cl, byte[ebp - 40h]
    xor cl, byte[ebp - 3Ch]
    xor cl, byte[ebp - 38h]
    xor cl, bl
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 8h]
    xor cl, ch
    xor cl, byte[ebp - 68h]
    xor cl, byte[ebp - 66h]
    call @16
    mov cl, al
    call @05
    mov cl, byte[ebp - 65h]
    mov byte[esi + 9h], al
    mov al, cl
    shr al, 7h
    movzx eax, al
    imul ebx, eax, 1Bh
    mov al, byte[ebp - 2h]
    xor al, cl
    xor al, byte[ebp - 66h]
    add al, al
    xor al, bl
    xor al, byte[ebp - 5Ch]
    xor al, byte[ebp - 34h]
    xor al, byte[ebp - 30h]
    xor al, byte[ebp - 50h]
    xor al, byte[ebp - 4Ch]
    xor al, byte[ebp - 2Ch]
    xor al, byte[ebp - 28h]
    xor al, byte[ebp - 24h]
    xor al, byte[ebp - 20h]
    xor al, byte[ebp - 1Ch]
    xor al, byte[ebp - 18h]
    xor al, byte[ebp - 48h]
    xor al, byte[ebp - 44h]
    xor al, byte[ebp - 14h]
    xor al, byte[ebp - 10h]
    xor al, byte[ebp - 0Ch]
    xor al, byte[ebp - 8h]
    xor al, cl
    xor al, byte[ebp - 68h]
    xor al, byte[ebp - 67h]
    mov cl, al
    call @16
    mov cl, al
    call @05
    mov cl, byte[ebp - 1h]
    xor cl, byte[ebp - 65h]
    xor cl, byte[ebp - 68h]
    add cl, cl
    mov byte[esi + 0Eh], al
    xor cl, bl
    xor cl, byte[ebp - 58h]
    xor cl, byte[ebp - 40h]
    xor cl, byte[ebp - 3Ch]
    xor cl, byte[ebp - 38h]
    xor cl, byte[ebp - 54h]
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 8h]
    xor cl, byte[ebp - 68h]
    xor cl, byte[ebp - 67h]
    xor cl, byte[ebp - 66h]
    call @16
    mov cl, al
    call @05
    mov bh, byte[ebp - 64h]
    mov cl, byte[ebp - 61h]
    mov bl, byte[ebp - 62h]
    xor cl, bh
    xor cl, byte[ebp - 63h]
    xor cl, bl
    mov byte[esi + 3h], al
    add cl, cl
    mov ch, cl
    mov byte[ebp - 1h], cl
    mov cl, byte[ebp - 61h]
    xor ch, bh
    shr cl, 5h
    xor ch, bl
    mov al, cl
    add ch, ch
    and al, 04h
    mov byte[ebp - 2h], ch
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 0Ch], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 10h], eax
    movzx eax, cl
    imul eax, eax, 1Bh
    mov dword[ebp - 14h], eax
    mov dl, bh
    shr dl, 5h
    mov cl, bh
    mov al, dl
    shr cl, 6h
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 18h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 48h], eax
    movzx eax, cl
    imul eax, eax, 1Bh
    mov cl, byte[ebp - 63h]
    shr cl, 5h
    mov dword[ebp - 4Ch], eax
    mov al, dl
    and al, 02h
    and dl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 1Ch], eax
    movzx eax, dl
    mov dl, bl
    imul eax, eax, 1Bh
    shr dl, 5h
    mov dword[ebp - 20h], eax
    mov al, cl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 24h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 28h], eax
    movzx eax, cl
    mov cl, bl
    imul eax, eax, 1Bh
    shr cl, 6h
    mov dword[ebp - 2Ch], eax
    mov al, dl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 30h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 50h], eax
    movzx eax, cl
    imul ebx, eax, 1Bh
    mov al, dl
    and al, 02h
    and dl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 58h], ebx
    mov dword[ebp - 34h], eax
    movzx eax, dl
    imul eax, eax, 1Bh
    mov dword[ebp - 8h], eax
    mov al, byte[ebp - 64h]
    shr al, 7h
    movzx eax, al
    imul edx, eax, 1Bh
    mov al, byte[ebp - 63h]
    shr al, 7h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 38h], edx
    mov dword[ebp - 5Ch], eax
    mov cl, ch
    mov bh, byte[ebp - 63h]
    xor cl, byte[ebp - 64h]
    xor cl, byte[ebp - 63h]
    add cl, cl
    xor cl, al
    xor cl, dl
    xor cl, byte[ebp - 8h]
    xor cl, byte[ebp - 34h]
    xor cl, bl
    mov bl, byte[ebp - 61h]
    xor cl, byte[ebp - 50h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 4Ch]
    xor cl, byte[ebp - 48h]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, bl
    xor cl, bh
    xor cl, byte[ebp - 62h]
    call @16
    mov cl, al
    call @05
    mov byte[esi + 8h], al
    mov cl, bl
    mov al, byte[ebp - 1h]
    xor al, bl
    shr cl, 6h
    xor al, bh
    mov ch, byte[ebp - 62h]
    add al, al
    mov byte[ebp - 1h], al
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 3Ch], eax
    movzx eax, cl
    mov cl, bh
    shr cl, 6h
    imul eax, eax, 1Bh
    mov dword[ebp - 40h], eax
    mov al, cl
    and cl, 01h
    and al, 02h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 44h], eax
    movzx eax, cl
    mov cl, byte[ebp - 1h]
    xor cl, byte[ebp - 63h]
    imul edx, eax, 1Bh
    xor cl, ch
    add cl, cl
    mov al, ch
    shr al, 7h
    movzx eax, al
    imul ebx, eax, 1Bh
    mov dword[ebp - 54h], edx
    xor cl, bl
    xor cl, dl
    xor cl, byte[ebp - 44h]
    xor cl, byte[ebp - 40h]
    xor cl, byte[ebp - 3Ch]
    xor cl, byte[ebp - 5Ch]
    xor cl, byte[ebp - 8h]
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 61h]
    xor cl, byte[ebp - 64h]
    xor cl, ch
    call @16
    mov cl, al
    call @05
    mov dl, byte[ebp - 61h]
    mov cl, byte[ebp - 2h]
    xor cl, dl
    mov byte[esi + 0Dh], al
    xor cl, byte[ebp - 62h]
    mov al, dl
    add cl, cl
    shr al, 7h
    xor cl, bl
    movzx eax, al
    mov ebx, dword[ebp - 8h]
    xor cl, bl
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 58h]
    xor cl, byte[ebp - 50h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 4Ch]
    xor cl, byte[ebp - 48h]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    imul eax, eax, 1Bh
    xor cl, al
    mov dword[ebp - 5Ch], eax
    xor cl, dl
    xor cl, byte[ebp - 64h]
    xor cl, byte[ebp - 63h]
    call @16
    mov cl, al
    call @05
    mov cl, byte[ebp - 1h]
    xor cl, byte[ebp - 61h]
    xor cl, byte[ebp - 64h]
    add cl, cl
    mov byte[esi + 2h], al
    xor cl, byte[ebp - 54h]
    xor cl, byte[ebp - 44h]
    xor cl, byte[ebp - 40h]
    xor cl, byte[ebp - 3Ch]
    xor cl, byte[ebp - 38h]
    xor cl, bl
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 5Ch]
    xor cl, byte[ebp - 64h]
    xor cl, byte[ebp - 63h]
    xor cl, byte[ebp - 62h]
    call @16
    mov cl, al
    call @05
    mov cl, byte[ebp - 5Dh]
    mov dh, byte[ebp - 60h]
    mov byte[esi + 7h], al
    mov al, cl
    mov byte[ebp - 1h], cl
    xor al, dh
    mov bh, byte[ebp - 5Fh]
    mov ch, dh
    xor al, bh
    mov bl, byte[ebp - 5Eh]
    xor al, bl
    shr cl, 5h
    add al, al
    xor ch, bl
    xor ch, al
    mov byte[ebp - 2h], al
    mov al, cl
    mov dl, dh
    and al, 04h
    shr dl, 5h
    movzx eax, al
    add ch, ch
    imul eax, eax, 1Bh
    mov byte[ebp - 3h], ch
    mov dword[ebp - 8h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 0Ch], eax
    movzx eax, cl
    mov cl, dh
    imul eax, eax, 1Bh
    shr cl, 6h
    mov dword[ebp - 10h], eax
    mov al, dl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 14h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 44h], eax
    movzx eax, cl
    mov cl, bh
    imul eax, eax, 1Bh
    shr cl, 5h
    mov dword[ebp - 48h], eax
    mov al, dl
    and al, 02h
    and dl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 18h], eax
    movzx eax, dl
    mov dl, bl
    imul eax, eax, 1Bh
    shr dl, 5h
    mov dword[ebp - 1Ch], eax
    mov al, cl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 20h], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 24h], eax
    movzx eax, cl
    mov cl, bl
    imul eax, eax, 1Bh
    shr cl, 6h
    mov dword[ebp - 28h], eax
    mov al, dl
    and al, 04h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 2Ch], eax
    mov al, cl
    and al, 02h
    movzx eax, al
    and cl, 01h
    imul eax, eax, 1Bh
    mov dword[ebp - 4Ch], eax
    movzx eax, cl
    imul eax, eax, 1Bh
    mov cl, byte[ebp - 60h]
    xor cl, byte[ebp - 5Fh]
    xor cl, ch
    add cl, cl
    xor cl, byte[ebp - 1h]
    mov dword[ebp - 50h], eax
    mov al, dl
    xor cl, byte[ebp - 5Fh]
    and al, 02h
    xor cl, byte[ebp - 5Eh]
    and dl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 30h], eax
    movzx eax, dl
    imul eax, eax, 1Bh
    mov dword[ebp - 34h], eax
    mov al, dh
    shr al, 7h
    movzx eax, al
    imul edx, eax, 1Bh
    mov al, bh
    shr al, 7h
    movzx eax, al
    imul ebx, eax, 1Bh
    mov dword[ebp - 54h], edx
    xor cl, bl
    xor cl, dl
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 50h]
    xor cl, byte[ebp - 4Ch]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 48h]
    xor cl, byte[ebp - 44h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 8h]
    call @16
    mov cl, al
    call @05
    mov cl, byte[ebp - 1h]
    mov byte[esi + 0Ch], al
    shr cl, 6h
    mov al, cl
    mov ch, byte[ebp - 1h]
    and al, 02h
    xor ch, byte[ebp - 5Fh]
    movzx eax, al
    and cl, 01h
    imul eax, eax, 1Bh
    xor ch, byte[ebp - 2h]
    add ch, ch
    mov byte[ebp - 2h], ch
    mov dword[ebp - 38h], eax
    movzx eax, cl
    mov cl, byte[ebp - 5Fh]
    imul eax, eax, 1Bh
    shr cl, 6h
    mov dword[ebp - 3Ch], eax
    mov al, cl
    and al, 02h
    and cl, 01h
    movzx eax, al
    imul eax, eax, 1Bh
    mov dword[ebp - 40h], eax
    movzx eax, cl
    imul edx, eax, 1Bh
    mov al, byte[ebp - 5Eh]
    mov dword[ebp - 58h], edx
    mov cl, byte[ebp - 5Fh]
    xor cl, byte[ebp - 5Eh]
    xor cl, ch
    shr al, 7h
    add cl, cl
    movzx eax, al
    xor cl, byte[ebp - 1h]
    xor cl, byte[ebp - 60h]
    xor cl, byte[ebp - 5Eh]
    imul eax, eax, 1Bh
    xor cl, al
    mov dword[ebp - 5Ch], eax
    xor cl, dl
    xor cl, byte[ebp - 40h]
    xor cl, byte[ebp - 3Ch]
    xor cl, byte[ebp - 38h]
    xor cl, bl
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 8h]
    call @16
    mov cl, al
    call @05
    mov dl, byte[ebp - 1h]
    mov byte[esi + 1h], al
    mov cl, dl
    xor cl, byte[ebp - 5Eh]
    mov al, dl
    xor cl, byte[ebp - 3h]
    add cl, cl
    shr al, 7h
    xor cl, dl
    movzx eax, al
    xor cl, byte[ebp - 60h]
    xor cl, byte[ebp - 5Fh]
    imul ebx, eax, 1Bh
    xor cl, bl
    xor cl, byte[ebp - 5Ch]
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 50h]
    xor cl, byte[ebp - 4Ch]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 48h]
    xor cl, byte[ebp - 44h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 8h]
    call @16
    mov cl, al
    call @05
    mov cl, byte[ebp - 1h]
    xor cl, byte[ebp - 60h]
    xor cl, byte[ebp - 2h]
    add cl, cl
    mov byte[esi + 6h], al
    xor cl, byte[ebp - 60h]
    xor cl, byte[ebp - 5Fh]
    xor cl, byte[ebp - 5Eh]
    xor cl, bl
    xor cl, byte[ebp - 58h]
    xor cl, byte[ebp - 40h]
    xor cl, byte[ebp - 3Ch]
    xor cl, byte[ebp - 38h]
    xor cl, byte[ebp - 54h]
    xor cl, byte[ebp - 34h]
    xor cl, byte[ebp - 30h]
    xor cl, byte[ebp - 2Ch]
    xor cl, byte[ebp - 28h]
    xor cl, byte[ebp - 24h]
    xor cl, byte[ebp - 20h]
    xor cl, byte[ebp - 1Ch]
    xor cl, byte[ebp - 18h]
    xor cl, byte[ebp - 14h]
    xor cl, byte[ebp - 10h]
    xor cl, byte[ebp - 0Ch]
    xor cl, byte[ebp - 8h]
    call @16
    mov cl, al
    call @05
    pop edi
    mov byte[esi + 0Bh], al
    pop esi
    pop ebx
    leave
    ret

aes_set_key:
    push ebp
    mov ebp, esp
    movzx eax, byte[ebp + 0Ch]
    sub esp, 0Ch
    push ebx
    sub eax, 10h
    je @28
    sub eax, 8h
    je @27
    sub eax, 8h
    je @26
    sub eax, 60h
    je @28
    sub eax, 40h
    je @27
    sub eax, 40h
    je @26
    mov eax, dword[ebp + 10h]
    mov byte[eax + 0F0h], 0h
    or al, 0FFh
    jmp @36

@26:
    mov bh, 20h
    jmp @29

@27:
    mov bh, 18h
    jmp @29

@28:
    mov bh, 10h

@29:
    mov ecx, dword[ebp + 8h]
    mov dl, bh
    push esi
    mov esi, dword[ebp + 10h]
    push edi
    test bh, bh
    je @31
    mov edi, esi
    sub edi, ecx

@30:
    mov al, byte[ecx]
    mov byte[ecx + edi], al
    inc ecx
    sub dl, 1h
    jne @30

@31:
    mov cl, bh
    mov byte[ebp - 1h], 1h
    add cl, 1Ch
    shl cl, 2h
    mov al, cl
    mov byte[ebp - 5h], cl
    shr al, 4h
    dec al
    mov byte[esi + 0F0h], al
    mov al, bh
    mov byte[ebp - 3h], al
    cmp bh, cl
    jae @35
    movzx ecx, bh
    xor bl, bl
    mov dword[ebp - 0Ch], ecx
    mov byte[ebp - 4h], bl

@32:
    movzx edi, al
    mov al, byte[esi + edi - 2h]
    mov byte[ebp + 0Fh], al
    mov al, byte[esi + edi - 1h]
    mov byte[ebp + 13h], al
    mov eax, edi
    cdq
    idiv dword[ebp - 0Ch]
    mov cl, byte[esi + edi - 4h]
    mov ch, byte[esi + edi - 3h]
    mov byte[ebp - 2h], cl
    mov byte[ebp + 0Bh], ch
    test edx, edx
    jne @33
    mov bl, cl
    mov cl, ch
    call @05
    mov cl, al
    call @15
    xor al, byte[ebp - 1h]
    mov cl, byte[ebp + 0Fh]
    mov byte[ebp - 2h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp + 13h]
    mov byte[ebp + 0Bh], al
    call @05
    mov cl, al
    call @15
    mov cl, bl
    mov byte[ebp + 0Fh], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp - 1h]
    mov bl, byte[ebp - 4h]
    mov byte[ebp + 13h], al
    mov al, cl
    shr al, 7h
    add cl, cl
    movzx eax, al
    imul eax, eax, 1Bh
    xor cl, al
    mov byte[ebp - 1h], cl
    jmp @34

@33:
    cmp bh, 18h
    jbe @34
    cmp edx, 10h
    jne @34
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp + 0Bh]
    mov byte[ebp - 2h], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp + 0Fh]
    mov byte[ebp + 0Bh], al
    call @05
    mov cl, al
    call @15
    mov cl, byte[ebp + 13h]
    mov byte[ebp + 0Fh], al
    call @05
    mov cl, al
    call @15
    mov byte[ebp + 13h], al

@34:
    movzx ecx, bl
    add bl, 4h
    mov byte[ebp - 4h], bl
    mov al, byte[esi + ecx]
    xor al, byte[ebp - 2h]
    mov byte[esi + edi], al
    mov al, byte[esi + ecx + 1h]
    xor al, byte[ebp + 0Bh]
    mov byte[esi + edi + 1h], al
    mov al, byte[esi + ecx + 2h]
    xor al, byte[ebp + 0Fh]
    mov byte[esi + edi + 2h], al
    mov al, byte[esi + ecx + 3h]
    xor al, byte[ebp + 13h]
    mov byte[esi + edi + 3h], al
    mov al, byte[ebp - 3h]
    add al, 4h
    mov byte[ebp - 3h], al
    cmp al, byte[ebp - 5h]
    jb @32

@35:
    pop edi
    xor al, al
    pop esi

@36:
    pop ebx
    leave
    ret 0Ch

@37:
    push ebp
    mov ebp, esp
    sub esp, 14h
    push ebx
    push esi
    mov esi, dword[ebp + 8h]
    mov dword[ebp - 4h], edx
    mov bl, byte[esi + 0F0h]
    test bl, bl
    je @40
    mov edx, ecx
    lea ecx, [ebp - 14h]
    push esi
    call @17
    mov byte[ebp + 8h], 1h
    cmp bl, 1h
    jbe @39
    dec bl
    movzx eax, bl
    mov ebx, eax
    inc al
    push edi
    lea edi, [esi + 10h]
    mov dword[ebp + 8h], eax

@38:
    lea ecx, [ebp - 14h]
    call @23
    mov edx, edi
    lea ecx, [ebp - 14h]
    call @19
    add edi, 10h
    sub ebx, 1h
    jne @38
    pop edi

@39:
    lea ecx, [ebp - 14h]
    call @21
    mov ecx, dword[ebp + 8h]
    lea edx, [ebp - 14h]
    movzx eax, cl
    mov ecx, dword[ebp - 4h]
    shl eax, 4h
    add eax, esi
    push eax
    call @17
    xor al, al
    jmp @41

@40:
    or al, 0FFh

@41:
    pop esi
    pop ebx
    leave
    ret 4h

@42:
    push ebp
    mov ebp, esp
    push ecx
    push ecx
    mov eax, dword[ebp + 8h]
    mov dword[ebp - 8h], edx
    push ebx
    push esi
    push edi
    mov edi, edx
    test eax, eax
    je @45
    mov ebx, dword[ebp + 0Ch]
    sub ecx, ebx
    mov dword[ebp - 4h], ecx

@43:
    dec eax
    mov ecx, ebx
    mov ebx, dword[ebp - 4h]
    push 4h
    mov dword[ebp + 8h], eax
    pop edx

@44:
    mov eax, dword[ecx + ebx]
    xor dword[ecx], eax
    lea ecx, [ecx + 4h]
    sub edx, 1h
    jne @44
    mov ebx, dword[ebp + 0Ch]
    mov edx, ebx
    push dword[ebp + 10h]
    mov ecx, ebx
    call @37
    test al, al
    jne @47
    add dword[ebp - 4h], 10h
    mov esi, ebx
    mov eax, dword[ebp + 8h]
    movsd
    movsd
    movsd
    movsd
    mov edi, dword[ebp - 8h]
    add edi, 10h
    mov dword[ebp - 8h], edi
    test eax, eax
    jne @43

@45:
    xor al, al

@46:
    pop edi
    pop esi
    pop ebx
    leave
    ret 0Ch

@47:
    mov al, 1h
    jmp @46

@48:
    push ebp
    mov ebp, esp
    sub esp, 30h
    mov eax, dword[ebp + 8h]
    mov dword[ebp - 0Ch], ecx
    push ebx
    mov ebx, edx
    mov edx, ecx
    mov dword[ebp - 8h], ebx
    push esi
    push edi
    test eax, eax
    je @53
    mov ecx, dword[ebp + 0Ch]
    sub ecx, ebx
    mov dword[ebp - 10h], ecx

@49:
    mov esi, edx
    lea edi, [ebp - 30h]
    dec eax
    mov dword[ebp + 8h], eax
    movsd
    movsd
    movsd
    movsd
    mov edi, dword[ebp + 10h]
    mov al, byte[edi + 0F0h]
    mov byte[ebp - 1h], al
    test al, al
    je @55
    movzx eax, al
    lea ecx, [ebp - 20h]
    shl eax, 4h
    add eax, edi
    push eax
    call @17
    lea ecx, [ebp - 20h]
    call @22
    sub byte[ebp - 1h], 1h
    je @51
    mov bl, byte[ebp - 1h]
    movzx esi, bl
    shl esi, 4h
    add esi, edi

@50:
    mov edx, esi
    lea ecx, [ebp - 20h]
    call @19
    lea ecx, [ebp - 20h]
    call @24
    sub esi, 10h
    sub bl, 1h
    jne @50
    mov ebx, dword[ebp - 8h]

@51:
    push edi
    lea edx, [ebp - 20h]
    mov ecx, ebx
    call @17
    mov ecx, dword[ebp - 10h]
    push 4h
    pop edx

@52:
    mov eax, dword[ebx + ecx]
    xor dword[ebx], eax
    add ebx, 4h
    sub edx, 1h
    jne @52
    mov edi, dword[ebp + 0Ch]
    lea esi, [ebp - 30h]
    mov edx, dword[ebp - 0Ch]
    sub ecx, 10h
    mov eax, dword[ebp + 8h]
    add edx, 10h
    mov dword[ebp - 8h], ebx
    movsd
    mov dword[ebp - 0Ch], edx
    mov dword[ebp - 10h], ecx
    movsd
    movsd
    movsd
    test eax, eax
    jne @49

@53:
    xor al, al

@54:
    pop edi
    pop esi
    pop ebx
    leave
    ret 0Ch

@55:
    mov al, 1h
    jmp @54

86

(6 відповідей, залишених у Системне програмування)

sha256. Не імплементація, а ріп, бо треба було швидко і чотко. Також для порівняння створено proc на CryptoApi

sha256.asm

    use32

sha256:
    push ebp
    mov ebp, esp
    and esp, 0FFFFFFF8h
    sub esp, 70h
    xor ecx, ecx
    mov dword[esp + 50h], 6A09E667h
    and dword[esp + 48h], ecx
    and dword[esp + 4Ch], ecx
    push esi
    xor esi, esi
    mov dword[esp + 44h], ecx
    push edi
    mov dword[esp + 5Ch], 0BB67AE85h
    mov dword[esp + 60h], 3C6EF372h
    mov dword[esp + 64h], 0A54FF53Ah
    mov dword[esp + 68h], 510E527Fh
    mov dword[esp + 6Ch], 9B05688Ch
    mov dword[esp + 70h], 1F83D9ABh
    mov dword[esp + 74h], 5BE0CD19h
    cmp dword[ebp + 0Ch], ecx
    jbe @04
    mov edi, dword[ebp + 8h]

@02:
    mov al, byte[edi + esi]
    mov byte[ecx + esp + 8h], al
    mov ecx, dword[esp + 48h]
    inc ecx
    mov dword[esp + 48h], ecx
    cmp ecx, 40h
    jne @03
    lea edx, [esp + 8h]
    mov ecx, edx
    call @05
    add dword[esp + 50h], 200h
    adc dword[esp + 54h], 0h
    xor ecx, ecx
    mov dword[esp + 48h], ecx

@03:
    inc esi
    cmp esi, dword[ebp + 0Ch]
    jb @02

@04:
    mov edx, dword[ebp + 10h]
    lea ecx, [esp + 8h]
    call @11
    pop edi
    pop esi
    mov esp, ebp
    pop ebp
    ret 0Ch

@05:
    push ebp
    mov ebp, esp
    sub esp, 128h
    push ebx
    push esi
    push edi
    xor ebx, ebx
    mov edi, ecx
    mov dword[ebp - 20h], edi
    mov esi, ebx
    inc edx

@06:
    movzx ecx, byte[edx - 1h]
    movzx eax, byte[edx]
    lea edx, [edx + 4h]
    shl ecx, 8h
    or ecx, eax
    movzx eax, byte[edx - 3h]
    shl ecx, 8h
    or ecx, eax
    movzx eax, byte[edx - 2h]
    shl ecx, 8h
    or ecx, eax
    mov dword[esi * 4h + ebp - 128h], ecx
    inc esi
    cmp esi, 10h
    jb @06
    push 40h
    pop eax
    cmp esi, eax
    jae @08
    sub eax, esi
    lea ebx, [esi * 4h + ebp - 130h]
    mov dword[ebp - 4h], eax
    mov edi, eax

@07:
    mov ecx, dword[ebx]
    mov esi, ecx
    mov edx, dword[ebx - 34h]
    lea ebx, [ebx + 4h]
    mov eax, ecx
    rol esi, 0Fh
    rol eax, 0Dh
    xor esi, eax
    shr ecx, 0Ah
    xor esi, ecx
    mov eax, edx
    mov ecx, edx
    ror eax, 7h
    rol ecx, 0Eh
    xor ecx, eax
    shr edx, 3h
    xor ecx, edx
    add esi, ecx
    add esi, dword[ebx - 3Ch]
    add esi, dword[ebx - 18h]
    mov dword[ebx + 4h], esi
    dec edi
    jne @07
    mov edi, dword[ebp - 20h]
    xor ebx, ebx

@08:
    mov eax, dword[edi + 50h]
    mov edx, dword[edi + 64h]
    mov dword[ebp - 24h], eax
    mov dword[ebp - 28h], eax
    mov eax, dword[edi + 54h]
    mov dword[ebp - 14h], eax
    mov eax, dword[edi + 58h]
    mov dword[ebp - 10h], eax
    mov eax, dword[edi + 5Ch]
    mov dword[ebp - 18h], eax
    mov eax, dword[edi + 60h]
    mov ecx, eax
    mov dword[ebp - 1Ch], eax
    mov eax, dword[edi + 68h]
    mov dword[ebp - 0Ch], eax
    mov eax, dword[edi + 6Ch]
    mov edi, dword[ebp - 24h]
    mov dword[ebp - 8h], edx
    mov dword[ebp - 4h], eax
    jmp @10

@09:
    mov edx, dword[ebp - 8h]

@10:
    and edx, dword[ebp - 1Ch]
    mov esi, ecx
    mov eax, ecx
    ror esi, 0Bh
    rol eax, 7h
    xor esi, eax
    mov eax, ecx
    ror eax, 6h
    not ecx
    and ecx, dword[ebp - 0Ch]
    xor esi, eax
    xor ecx, edx
    mov eax, edi
    rol eax, 0Ah
    mov edx, edi
    ror edx, 0Dh
    add esi, ecx

;   базонезалежність
;   -------------------------------------------
;    push eax
;    call @f
;@@: pop eax
;    sub eax, @b
;    add esi, dword[eax + ebx + k]
;    pop eax

    add esi, dword[ebx + k]
;   -------------------------------------------

    xor edx, eax
    add esi, dword[ebx + ebp - 128h]
    mov eax, edi
    add esi, dword[ebp - 4h]
    add ebx, 4h
    ror eax, 2h
    xor edx, eax
    mov eax, dword[ebp - 14h]
    mov ecx, eax
    and eax, edi
    xor ecx, edi
    and ecx, dword[ebp - 10h]
    xor ecx, eax
    mov eax, dword[ebp - 0Ch]
    add edx, ecx
    mov dword[ebp - 4h], eax
    mov ecx, dword[ebp - 8h]
    mov eax, dword[ebp - 1Ch]
    mov dword[ebp - 0Ch], ecx
    mov ecx, dword[ebp - 18h]
    mov dword[ebp - 8h], eax
    add ecx, esi
    mov eax, dword[ebp - 10h]
    mov dword[ebp - 18h], eax
    mov eax, dword[ebp - 14h]
    mov dword[ebp - 14h], edi
    lea edi, [esi + edx]
    mov dword[ebp - 1Ch], ecx
    mov dword[ebp - 10h], eax
    cmp ebx, 100h
    jb @09
    mov eax, dword[ebp - 28h]
    mov edx, dword[ebp - 14h]
    add eax, edi
    mov edi, dword[ebp - 20h]
    add dword[edi + 60h], ecx
    add dword[edi + 54h], edx
    mov ecx, dword[ebp - 8h]
    add dword[edi + 64h], ecx
    mov edx, dword[ebp - 10h]
    add dword[edi + 58h], edx
    mov ecx, dword[ebp - 0Ch]
    add dword[edi + 68h], ecx
    mov edx, dword[ebp - 18h]
    add dword[edi + 5Ch], edx
    mov ecx, dword[ebp - 4h]
    add dword[edi + 6Ch], ecx
    mov dword[edi + 50h], eax
    pop edi
    pop esi
    pop ebx
    leave
    ret

@11:
    push ebp
    mov ebp, esp
    push ecx
    push ebx
    push esi
    mov esi, ecx
    mov dword[ebp - 4h], edx
    push edi
    push 38h
    xor edi, edi
    mov ecx, dword[esi + 40h]
    pop ebx
    cmp ecx, ebx
    mov byte[esi + ecx], 80h
    inc ecx
    jae @12
    cmp ecx, ebx
    jae @15
    sub ebx, ecx
    lea eax, [esi + ecx]
    push ebx
    push edi
    push eax
    jmp @14

@12:
    push 40h
    pop edx
    cmp ecx, edx
    jae @13
    sub edx, ecx
    lea eax, [esi + ecx]
    push edx
    push edi
    push eax
    call @20
    add esp, 0Ch

@13:
    mov edx, esi
    mov ecx, esi
    call @05
    push ebx
    push edi
    push esi

@14:
    call @20
    add esp, 0Ch

@15:
    mov eax, dword[esi + 40h]
    shl eax, 3h
    add dword[esi + 48h], eax
    adc dword[esi + 4Ch], edi
    mov al, byte[esi + 48h]
    mov byte[esi + 3Fh], al
    mov ecx, dword[esi + 48h]
    mov eax, dword[esi + 4Ch]
    shrd ecx, eax, 8h
    mov byte[esi + 3Eh], cl
    mov ecx, dword[esi + 48h]
    shr eax, 8h
    mov eax, dword[esi + 4Ch]
    shrd ecx, eax, 10h
    mov byte[esi + 3Dh], cl
    mov ecx, dword[esi + 48h]
    shr eax, 10h
    mov eax, dword[esi + 4Ch]
    shrd ecx, eax, 18h
    mov byte[esi + 3Ch], cl
    mov cl, 20h
    mov edx, dword[esi + 4Ch]
    shr eax, 18h
    mov eax, dword[esi + 48h]
    call @17
    mov byte[esi + 3Bh], al
    mov cl, 28h
    mov eax, dword[esi + 48h]
    mov edx, dword[esi + 4Ch]
    call @17
    mov byte[esi + 3Ah], al
    mov edx, esi
    mov al, byte[esi + 4Eh]
    mov ecx, esi
    mov byte[esi + 39h], al
    mov al, byte[esi + 4Fh]
    mov byte[esi + 38h], al
    call @05
    mov edx, dword[ebp - 4h]

@16:
    push 3h
    pop eax
    sub eax, edi
    mov ecx, eax
    mov eax, dword[esi + 50h]
    shl ecx, 3h
    shr eax, cl
    mov byte[edi + edx], al
    mov eax, dword[esi + 54h]
    shr eax, cl
    mov byte[edi + edx + 4h], al
    mov eax, dword[esi + 58h]
    shr eax, cl
    mov byte[edi + edx + 8h], al
    mov eax, dword[esi + 5Ch]
    shr eax, cl
    mov byte[edi + edx + 0Ch], al
    mov eax, dword[esi + 60h]
    shr eax, cl
    mov byte[edi + edx + 10h], al
    mov eax, dword[esi + 64h]
    shr eax, cl
    mov byte[edi + edx + 14h], al
    mov eax, dword[esi + 68h]
    shr eax, cl
    mov byte[edi + edx + 18h], al
    mov eax, dword[esi + 6Ch]
    shr eax, cl
    mov byte[edi + edx + 1Ch], al
    inc edi
    cmp edi, 4h
    jb @16
    pop edi
    pop esi
    pop ebx
    leave
    ret

@17:
    cmp cl, 40h
    jae @19
    cmp cl, 20h
    jae @18
    shrd eax, edx, cl
    shr edx, cl
    ret

@18:
    mov eax, edx
    xor edx, edx
    and cl, 1Fh
    shr eax, cl
    ret

@19:
    xor eax, eax
    xor edx, edx
    ret

@20:
    push ebp
    mov ebp, esp
    push edi
    mov ecx, dword[ebp + 0x10]
    mov edi, dword[ebp + 0x08]
    mov al, byte[ebp + 0x0C]
    rep stosb
    pop edi
    leave
    retn

k:
    dd 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5
    dd 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174
    dd 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da
    dd 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967
    dd 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85
    dd 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070
    dd 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3
    dd 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2

main.asm

format pe console

section '.code' import readable writeable executable

    PROV_RSA_AES            = 24
    CALG_SHA_256            = 0x0000800C
    CRYPT_VERIFYCONTEXT     = 0xF0000000
    HP_HASHVAL              = 2

include 'win32ax.inc'

library     msvcrt, 'msvcrt.dll',\
            advapi32, 'advapi32.dll'

import      msvcrt,\
            printf, 'printf',\
            getchar, 'getchar',\
            memcmp, 'memcmp'

import      advapi32,\
            CryptAcquireContextA, 'CryptAcquireContextA',\
            CryptCreateHash, 'CryptCreateHash',\
            CryptHashData, 'CryptHashData',\
            CryptGetHashParam, 'CryptGetHashParam',\
            CryptDestroyHash, 'CryptDestroyHash',\
            CryptReleaseContext, 'CryptReleaseContext',\
            RtlGenRandom, 'SystemFunction036'


proc print, buf
    locals
        frmt db '%02X', 0
    endl

    mov esi, [buf]
    xor ecx, ecx

@@: movzx eax, byte[esi]

    push ecx
    cinvoke printf, addr frmt, eax
    pop ecx

    inc ecx
    inc esi

    cmp ecx, 32
    jne @b

    cinvoke printf, next_line

    ret
endp

proc rnd, buf
    locals
        pRandomBuffer rd 1
    endl

    mov edi, [buf]
    xor ecx, ecx
@@: push ecx

    invoke RtlGenRandom, addr pRandomBuffer, 4
    cmp eax, 0
    je .err

    mov eax, [pRandomBuffer]
    xor edx, edx
    mov ecx, 255
    div ecx
    mov eax, edx
    jmp .fin

.err:
    xor eax, eax
    dec eax
.fin:

    mov byte[edi], al

    pop ecx

    inc edi
    inc ecx
    cmp ecx, 32
    jl @b

    ret
endp

include 'sha256.asm'

proc sha256_get_hash_api, txt, len, buf
    locals
        buf_api_size    dd 32
        hProv           rd 1
        hHash           rd 1
    endl

    invoke CryptAcquireContextA, addr hProv, 0, 0, PROV_RSA_AES, CRYPT_VERIFYCONTEXT
    cmp eax, 0
    je .fin1

    invoke CryptCreateHash, [hProv], CALG_SHA_256, 0, 0, addr hHash
    cmp eax, 0
    je .fin

    invoke CryptHashData, [hHash], [txt], [len], 0
    cmp eax, 0
    je .fin

    invoke CryptGetHashParam, [hHash], HP_HASHVAL, [buf], addr buf_api_size, 0
    cmp eax, 0
    je .fin

.fin:
    invoke CryptDestroyHash, [hHash]
.fin1:
    invoke CryptReleaseContext, [hProv], 0

    ret
endp


entry $

    xor ecx, ecx
@@: push ecx

    stdcall rnd, buf_rnd

;   ---------------------------------------------------------------------------------------------------

    stdcall sha256_get_hash_api, buf_rnd, 32, buf_api

;    stdcall print, buf_api

;   ---------------------------------------------------------------------------------------------------
    
    stdcall sha256, buf_rnd, 32, buf_shl

;    stdcall print, buf_shl

;   ---------------------------------------------------------------------------------------------------

    cinvoke memcmp, buf_api, buf_shl, 32
    cmp eax, 0
    jne not_eq

    cinvoke printf, equally
    jmp fin

not_eq:
    cinvoke printf, not_equal
    cinvoke getchar

fin:
    pop ecx
    inc ecx
    cmp ecx, 40
    jl @b

    cinvoke printf, finish
    cinvoke getchar

    xor eax, eax
    ret


    equally         db 'memcmp: equally', 13, 10,           0
    not_equal       db 'memcmp: not equal', 13, 10,         0
    finish          db 13, 10, 'finish ok!', 13, 10,        0
    next_line       db 13, 10,                              0

    buf_rnd         rb 32
    buf_api         rb 32
    buf_shl         rb 32

87

(198 відповідей, залишених у Системне програмування)

Використання RtlGenRandom на прикладі генератору паролів:

format pe console

section '.code' import readable writeable executable

include 'win32ax.inc'

library     msvcrt, 'msvcrt.dll',\
            advapi32, 'advapi32.dll'

import      msvcrt,\
            printf, 'printf',\
            getchar, 'getchar'

import      advapi32,\
            RtlGenRandom, 'SystemFunction036'

proc xrand, min, max
    locals
        pRandomBuffer rd 1
    endl

    invoke RtlGenRandom, addr pRandomBuffer, 4
    cmp eax, 0
    je .err

    mov eax, [pRandomBuffer]
    xor edx, edx
    mov ecx, [max]
    div ecx
    mov eax, edx
    add eax, [min]
    jmp .fin

.err:
    xor eax, eax
    dec eax
.fin:
    ret
endp

proc rand_char, buf, num
    locals
        c db '0aA'
    endl

    mov edi, [buf]
    xor ecx, ecx
@@: push ecx

    push 3
    push 0
    call xrand

    lea esi, [c]
    add esi, eax

    cmp eax, 0
    je .is_num
    push 26
    jmp .is_chr
.is_num:
    push 10
.is_chr:
    push 0
    call xrand

    mov dl, [esi]
    add dl, al
    mov byte[edi], dl

    pop ecx

    inc edi
    inc ecx
    cmp ecx, [num]
    jl @b

    mov byte[edi], 0

    ret
endp


entry $
    xor ecx, ecx
@@: push ecx
    stdcall rand_char, rand_buf, 32
    cinvoke printf, frmt_str, rand_buf
    pop ecx
    inc ecx
    cmp ecx, 40
    jl @b

    cinvoke getchar
    xor eax, eax
    ret


    frmt_str            db '%s', 13, 10, 0
    rand_buf            rb 32 + 1

88

(198 відповідей, залишених у Системне програмування)

Тре було 32-байтовий масив сконвертити у строковий вигляд і навпаки, і я не знав про CryptBinaryToString, і тому створив велик наведений нижче:

format pe console

section '.code' import readable writeable executable

include 'win32ax.inc'

library     msvcrt, 'msvcrt.dll'

import      msvcrt,\
            printf, 'printf',\
            getchar, 'getchar'


proc print, buf
    locals
        frmt db '%02X', 0
    endl

    mov esi, [buf]
    xor ecx, ecx

@@: movzx eax, byte[esi]

    push ecx
    cinvoke printf, addr frmt, eax
    pop ecx

    inc ecx
    inc esi

    cmp ecx, 32
    jne @b

    cinvoke printf, next_line

    ret
endp

proc strkey_to_uint, s, u
    mov esi, [s]
    mov edi, [u]

    xor ecx, ecx
@@: push ecx

    mov eax, ecx
    shr eax, 1

    xor ecx, ecx

.end_step:
    mov dl, byte[esi + ecx]
    sub dl, '0'
    cmp dl, 9
    jng .is_num
    push 'A' - 10
    jmp .is_chr
.is_num:
    push '0'
.is_chr:
    mov dl, byte[esi + ecx]
    pop ebx
    sub dl, bl

    cmp ecx, 0
    jne .next_step
    shl edx, 28
    inc ecx
    jmp .end_step

.next_step:
    mov ebx, edx
    and ebx, 0xF0000000
    shr ebx, 24
    or edx, ebx

    mov byte[edi + eax], dl

    pop ecx
    add ecx, 2
    add esi, 2
    cmp ecx, 64
    jl @b

    ret
endp

proc uint_to_strkey, s, u
    mov esi, [u]
    mov edi, [s]

    xor ecx, ecx
@@: push ecx
    mov cl, 4

.end_step:
    mov al, byte[esi]
    shr al, cl
    and al, 0xF

    cmp al, 9
    jng .is_num
    push 'A' - 10
    jmp .is_chr
.is_num:
    push '0'
.is_chr:
    pop edx

    add eax, edx

    mov byte[edi], al
    inc edi

    cmp cl, 4
    jne .next_step
    xor cl, cl
    jmp .end_step

.next_step:
    pop ecx
    inc ecx
    inc esi
    cmp ecx, 32
    jl @b

    mov byte[edi], 0

    ret
endp

entry $

    stdcall strkey_to_uint, key_str, buf_uint8
    stdcall print, buf_uint8

    cinvoke printf, key_str
    cinvoke printf, next_line

    stdcall uint_to_strkey, buf_char, buf_uint8
    cinvoke printf, buf_char

    cinvoke getchar
    xor eax, eax
    ret


    key_str         db '1122334455667788990011223344556677889900112233445566778899001122', 0
    next_line       db 13, 10, 0

    buf_uint8       rb 32
    buf_char        rb 64 + 1

Ну і до пари на C, навіщо добру пропадать?

typedef enum _KEY_CONV_MODE {
    KEY_ERROR = -1,
    KEY_OK,
    STRKEY_TO_UINT,
    UINT_TO_STRKEY
} KEY_CONV_MODE;


int convert_key(char *s, uint8_t *u, KEY_CONV_MODE m) {
    switch (m) {
        int i;

        case STRKEY_TO_UINT:
            if (strlen(s) != 64)
                return KEY_ERROR;

            for (i = 0; i < 64; i += 2)
                u[i / 2] = (s[i] - (s[i] - '0' <= 9 ? '0' : 'A' - 10)) * 16 + s[i + 1] - (s[i + 1] - '0' <= 9 ? '0' : 'A' - 10);

            break;

        case UINT_TO_STRKEY:
            for (i = 0; i < 32; i++)
                *s++ = (u[i] >> 4) % 16 + ((u[i] >> 4) % 16 <= 9 ? '0' : 'A' - 10),
                *s++ = u[i] % 16 + (u[i] % 16 <= 9 ? '0' : 'A' - 10);

            *s = '\0';

            break;

        default:
            return KEY_ERROR;
    }

    return KEY_OK;
}

update:
трохи причесаний код для v1.1.1

    use32

    SIGN = 'PACK'

aPsafe_depack:
    pushad
    mov esi, dword[esp + 24h]
    mov ecx, dword[esp + 28h]
    mov edi, dword[esp + 2Ch]
    test esi, esi
    je @002
    test edi, edi
    je @002
    cmp ecx, 18h
    jb @002
    mov ebx, dword[esi]
    cmp ebx, SIGN
    jne @002
    mov ebx, dword[esi + 4h]
    cmp ebx, 18h
    jb @002
    sub ecx, ebx
    jb @002
    cmp dword[esi + 8h], ecx
    ja @002
    add ebx, esi
    push dword[esi + 8h]
    push ebx
    call aP_crc32
    add esp, 8h
    cmp eax, dword[esi + 0Ch]
    jne @002
    mov ecx, dword[esp + 30h]
    cmp dword[esi + 10h], ecx
    ja @002
    push ecx
    push edi
    push dword[esi + 8h]
    push ebx
    call aP_depack_asm_safe
    add esp, 10h
    cmp eax, dword[esi + 10h]
    jne @002
    mov ebx, eax
    push eax
    push edi
    call aP_crc32
    add esp, 8h
    cmp eax, dword[esi + 14h]
    mov eax, ebx
    je @003

@002:
    or eax, 0FFFFFFFFh

@003:
    mov dword[esp + 1Ch], eax
    popad
    ret
    dec dword[ecx + 0Ch]
    jne @004
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], 8h
    mov dword[ecx + 4h], eax

@004:
    cmp dword[esp + 4h], 0h
    mov ecx, dword[ecx + 8h]
    je @005
    mov al, byte[ecx]
    add al, al
    inc al
    mov byte[ecx], al
    ret 4h

@005:
    shl byte[ecx], 1h
    ret 4h
    dec dword[ecx + 0Ch]
    jne @006
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], 8h
    mov dword[ecx + 4h], eax

@006:
    mov ecx, dword[ecx + 8h]
    shl byte[ecx], 1h
    ret

@007:
    dec dword[ecx + 0Ch]
    jne @008
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], 8h
    mov dword[ecx + 4h], eax

@008:
    mov ecx, dword[ecx + 8h]
    mov al, byte[ecx]
    add al, al
    inc al
    mov byte[ecx], al
    ret
    mov ecx, dword[esp + 4h]
    cmp ecx, 2h
    jge @009
    mov eax, 64h
    ret

@009:
    xor eax, eax
    shr ecx, 1h
    je @011

@010:
    add eax, 2h
    shr ecx, 1h
    jne @010

@011:
    ret

@012:
    mov eax, dword[esp + 4h]
    mov edx, dword[esp + 4h]
    push ebp
    push esi
    push edi
    xor esi, esi
    lea ecx, [ecx]

@013:
    mov edi, eax
    and edi, 00000001h
    shr eax, 1h
    inc esi
    lea edx, [edx * 2h + edi]
    cmp eax, 1h
    ja @013
    dec esi
    mov ebp,  -1h
    lea edi, [ebp + 9h]
    je @019
    push ebx
    lea esp, [esp]

@014:
    add dword[ecx + 0Ch], ebp
    jne @015
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edi
    mov dword[ecx + 4h], eax

@015:
    mov eax, dword[ecx + 8h]
    test dl, 01h
    je @016
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    jmp @017

@016:
    shl byte[eax], 1h

@017:
    add dword[ecx + 0Ch], ebp
    jne @018
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edi
    mov dword[ecx + 4h], eax

@018:
    mov eax, dword[ecx + 8h]
    mov bl, byte[eax]
    add bl, bl
    inc bl
    shr edx, 1h
    dec esi
    mov byte[eax], bl
    jne @014
    pop ebx

@019:
    add dword[ecx + 0Ch], ebp
    jne @020
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edi
    mov dword[ecx + 4h], eax

@020:
    mov eax, dword[ecx + 8h]
    test dl, 01h
    je @021
    mov dl, byte[eax]
    add dl, dl
    inc dl
    mov byte[eax], dl
    jmp @022

@021:
    shl byte[eax], 1h

@022:
    add dword[ecx + 0Ch], ebp
    jne @023
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edi
    mov dword[ecx + 4h], eax

@023:
    mov ecx, dword[ecx + 8h]
    shl byte[ecx], 1h
    pop edi
    pop esi
    pop ebp
    ret 4h

@024:
    push ebx
    push ebp
    mov ebp, dword[esp + 10h]
    push esi
    xor eax, eax
    push edi
    cmp ebp, 0Fh
    jbe @025
    mov ebp, 0Fh

@025:
    mov edi, dword[esp + 14h]
    mov esi, edi
    sub esi, ebp
    lea esp, [esp]

@026:
    mov bl, byte[edi]
    test bl, bl
    je @029
    mov ecx, ebp
    mov edx, esi
    lea ebx, [ebx]

@027:
    cmp byte[edx], bl
    je @028
    inc edx
    dec ecx
    jne @027

@028:
    xor edx, edx
    test ecx, ecx
    sete dl
    lea eax, [edx * 2h + eax + 7h]
    jmp @030

@029:
    add eax, 7h

@030:
    inc edi
    inc esi
    dec dword[esp + 1Ch]
    jne @026
    pop edi
    pop esi
    pop ebp
    pop ebx
    ret

@031:
    push ebx
    push esi
    push edi
    mov edi, dword[esp + 10h]
    mov dword[ecx + 428h], 0h
    mov dl, byte[edi]
    test dl, dl
    je @050
    mov esi, dword[esp + 14h]
    cmp esi, 0Fh
    jbe @032
    mov esi, 0Fh
    mov dword[esp + 14h], esi

@032:
    mov eax, edi
    sub eax, esi

@033:
    cmp byte[eax], dl
    je @036
    mov esi, dword[esp + 14h]
    dec esi
    inc eax
    mov dword[esp + 14h], esi
    test esi, esi
    jne @033

@034:
    dec dword[ecx + 0Ch]
    jne @035
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], 8h
    mov dword[ecx + 4h], eax

@035:
    mov eax, dword[ecx + 8h]
    shl byte[eax], 1h
    mov al, byte[edi]
    mov edx, dword[ecx + 4h]
    pop edi
    pop esi
    mov byte[edx], al
    inc dword[ecx + 4h]
    pop ebx
    ret 8h

@036:
    cmp dword[esp + 14h], 0h
    je @034
    or esi, 0FFFFFFFFh
    add dword[ecx + 0Ch], esi
    lea edx, [esi + 9h]
    jne @037
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@037:
    mov eax, dword[ecx + 8h]
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    add dword[ecx + 0Ch], esi
    jne @038
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@038:
    mov eax, dword[ecx + 8h]
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    add dword[ecx + 0Ch], esi
    jne @039
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@039:
    mov eax, dword[ecx + 8h]
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    add dword[ecx + 0Ch], esi
    jne @040
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@040:
    mov eax, dword[ecx + 8h]
    test byte[esp + 14h], dl
    je @041
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    jmp @042

@041:
    shl byte[eax], 1h

@042:
    add dword[ecx + 0Ch], esi
    jne @043
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@043:
    test byte[esp + 14h], 04h
    mov eax, dword[ecx + 8h]
    je @044
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    jmp @045

@044:
    shl byte[eax], 1h

@045:
    add dword[ecx + 0Ch], esi
    jne @046
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@046:
    test byte[esp + 14h], 02h
    mov eax, dword[ecx + 8h]
    je @047
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    jmp @048

@047:
    shl byte[eax], 1h

@048:
    add dword[ecx + 0Ch], esi
    jne @049
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@049:
    test byte[esp + 14h], 01h
    mov ecx, dword[ecx + 8h]
    je @058
    mov al, byte[ecx]
    pop edi
    add al, al
    inc al
    pop esi
    mov byte[ecx], al
    pop ebx
    ret 8h

@050:
    or esi, 0FFFFFFFFh
    add dword[ecx + 0Ch], esi
    lea edx, [esi + 9h]
    jne @051
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@051:
    mov eax, dword[ecx + 8h]
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    add dword[ecx + 0Ch], esi
    jne @052
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@052:
    mov eax, dword[ecx + 8h]
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    add dword[ecx + 0Ch], esi
    jne @053
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@053:
    mov eax, dword[ecx + 8h]
    mov bl, byte[eax]
    add bl, bl
    inc bl
    mov byte[eax], bl
    add dword[ecx + 0Ch], esi
    jne @054
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@054:
    mov eax, dword[ecx + 8h]
    shl byte[eax], 1h
    add dword[ecx + 0Ch], esi
    jne @055
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@055:
    mov eax, dword[ecx + 8h]
    shl byte[eax], 1h
    add dword[ecx + 0Ch], esi
    jne @056
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@056:
    mov eax, dword[ecx + 8h]
    shl byte[eax], 1h
    add dword[ecx + 0Ch], esi
    jne @057
    mov eax, dword[ecx + 4h]
    mov dword[ecx + 8h], eax
    inc eax
    mov dword[ecx + 0Ch], edx
    mov dword[ecx + 4h], eax

@057:
    mov ecx, dword[ecx + 8h]

@058:
    shl byte[ecx], 1h
    pop edi
    pop esi
    pop ebx
    ret 8h

@059:
    mov eax, dword[esp + 4h]
    mov edx, dword[esp + 8h]
    cmp eax, 80h
    jae @060
    cmp edx, 4h
    jae @060
    cmp eax, dword[ecx + 424h]
    je @069
    neg eax
    sbb eax, eax
    and eax, 00000006h
    add eax, 5h
    ret 8h

@060:
    cmp eax, dword[ecx + 424h]
    je @069
    cmp eax, 80h
    jae @061
    sub edx, 2h
    jmp @062

@061:
    cmp eax, 500h
    jb @062
    dec edx
    cmp eax, 7D00h
    jb @062
    dec edx

@062:
    shr eax, 8h
    add eax, 3h
    cmp eax, 2h
    jge @063
    mov ecx, 64h
    jmp @065

@063:
    xor ecx, ecx
    shr eax, 1h
    je @065

@064:
    add ecx, 2h
    shr eax, 1h
    jne @064

@065:
    cmp edx, 2h
    jge @066
    mov eax, 64h
    lea eax, [eax + ecx + 0Ah]
    ret 8h

@066:
    xor eax, eax
    shr edx, 1h
    je @068

@067:
    add eax, 2h
    shr edx, 1h
    jne @067

@068:
    lea eax, [eax + ecx + 0Ah]
    ret 8h

@069:
    cmp edx, 2h
    jge @070
    mov eax, 64h
    add eax, 4h
    ret 8h

@070:
    xor eax, eax
    shr edx, 1h
    je @072

@071:
    add eax, 2h
    shr edx, 1h
    jne @071

@072:
    add eax, 4h
    ret 8h

@073:
    push ebx
    mov ebx, dword[esp + 8h]
    push ebp
    push esi
    mov esi, ecx
    cmp dword[esi + 428h], 0h
    push edi
    je @082
    cmp ebx, 80h
    jae @077
    mov ecx, dword[esp + 18h]
    cmp ecx, 4h
    jae @077
    or edi, 0FFFFFFFFh
    add dword[esi + 0Ch], edi
    lea ebp, [edi + 9h]
    jne @074
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ebp
    mov dword[esi + 4h], eax

@074:
    mov eax, dword[esi + 8h]
    mov dl, byte[eax]
    add dl, dl
    inc dl
    mov byte[eax], dl
    add dword[esi + 0Ch], edi
    jne @075
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ebp
    mov dword[esi + 4h], eax

@075:
    mov eax, dword[esi + 8h]
    mov dl, byte[eax]
    add dl, dl
    inc dl
    mov byte[eax], dl
    add dword[esi + 0Ch], edi
    jne @076
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ebp
    mov dword[esi + 4h], eax

@076:
    mov eax, dword[esi + 8h]
    shl byte[eax], 1h
    mov edx, dword[esi + 4h]
    mov al, bl
    and cl, 01h
    add al, al
    or cl, al
    pop edi
    mov byte[edx], cl
    inc dword[esi + 4h]
    mov dword[esi + 424h], ebx
    pop esi
    pop ebp
    pop ebx
    ret 8h

@077:
    or edi, 0FFFFFFFFh
    add dword[esi + 0Ch], edi
    lea ebp, [edi + 9h]
    jne @078
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ebp
    mov dword[esi + 4h], eax

@078:
    mov eax, dword[esi + 8h]
    mov cl, byte[eax]
    add cl, cl
    inc cl
    mov byte[eax], cl
    add dword[esi + 0Ch], edi
    jne @079
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ebp
    mov dword[esi + 4h], eax

@079:
    mov eax, dword[esi + 8h]
    shl byte[eax], 1h
    mov edx, ebx
    shr edx, 8h
    add edx, 2h
    push edx
    mov ecx, esi
    call @012
    mov eax, dword[esi + 4h]
    mov byte[eax], bl
    mov eax, 1h
    add dword[esi + 4h], eax
    mov dword[esi + 424h], ebx
    cmp ebx, 80h
    jae @080
    sub dword[esp + 18h], 2h
    mov ecx, dword[esp + 18h]
    push ecx
    mov ecx, esi
    call @012
    pop edi
    pop esi
    pop ebp
    pop ebx
    ret 8h

@080:
    cmp ebx, 500h
    jb @081
    sub dword[esp + 18h], eax
    cmp ebx, 7D00h
    jb @081
    sub dword[esp + 18h], eax

@081:
    mov ecx, dword[esp + 18h]
    push ecx
    mov ecx, esi
    call @012
    pop edi
    pop esi
    pop ebp
    pop ebx
    ret 8h

@082:
    mov dword[esi + 428h], 1h
    cmp ebx, 80h
    jae @084
    cmp dword[esp + 18h], 4h
    jae @084
    cmp ebx, dword[esi + 424h]
    je @084
    call @007
    mov ecx, esi
    call @007
    dec dword[esi + 0Ch]
    jne @083
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], 8h
    mov dword[esi + 4h], eax

@083:
    mov eax, dword[esi + 8h]
    shl byte[eax], 1h
    mov al, byte[esp + 18h]
    mov ecx, dword[esi + 4h]
    mov dl, bl
    and al, 01h
    add dl, dl
    or al, dl
    pop edi
    mov byte[ecx], al
    inc dword[esi + 4h]
    mov dword[esi + 424h], ebx
    pop esi
    pop ebp
    pop ebx
    ret 8h

@084:
    or edi, 0FFFFFFFFh
    add dword[esi + 0Ch], edi
    lea ebp, [edi + 9h]
    jne @085
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ebp
    mov dword[esi + 4h], eax

@085:
    mov eax, dword[esi + 8h]
    mov dl, byte[eax]
    add dl, dl
    inc dl
    mov byte[eax], dl
    add dword[esi + 0Ch], edi
    jne @086
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ebp
    mov dword[esi + 4h], eax

@086:
    mov eax, dword[esi + 8h]
    shl byte[eax], 1h
    cmp ebx, dword[esi + 424h]
    je @088
    mov eax, ebx
    shr eax, 8h
    add eax, 3h
    push eax
    call @012
    mov ecx, dword[esi + 4h]
    mov byte[ecx], bl
    mov eax, 1h
    add dword[esi + 4h], eax
    mov dword[esi + 424h], ebx
    cmp ebx, 80h
    jae @087
    sub dword[esp + 18h], 2h
    mov edx, dword[esp + 18h]
    push edx
    mov ecx, esi
    call @012
    pop edi
    pop esi
    pop ebp
    pop ebx
    ret 8h

@087:
    cmp ebx, 500h
    jb @091
    sub dword[esp + 18h], eax
    cmp ebx, 7D00h
    jb @091
    sub dword[esp + 18h], eax
    mov edx, dword[esp + 18h]
    push edx
    mov ecx, esi
    call @012
    pop edi
    pop esi
    pop ebp
    pop ebx
    ret 8h

@088:
    add dword[esi + 0Ch], edi
    jne @089
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ebp
    mov dword[esi + 4h], eax

@089:
    mov eax, dword[esi + 8h]
    shl byte[eax], 1h
    add dword[esi + 0Ch], edi
    jne @090
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ebp
    mov dword[esi + 4h], eax

@090:
    mov eax, dword[esi + 8h]
    shl byte[eax], 1h

@091:
    mov edx, dword[esp + 18h]
    push edx
    mov ecx, esi
    call @012
    pop edi
    pop esi
    pop ebp
    pop ebx
    ret 8h
    mov eax, dword[esp + 4h]
    lea edx, [eax + 16800h]
    cmp edx, dword[ecx + 414h]
    jbe @093
    mov ecx, dword[ecx + 41Ch]
    cmp eax, ecx
    jbe @092
    sub eax, ecx
    ret 4h

@092:
    sub eax, ecx
    add eax, 16800h
    ret 4h

@093:
    xor eax, eax
    ret 4h

@094:
    sub esp, 10h
    push ebx
    push ebp
    mov ebp, dword[esp + 20h]
    push esi
    xor ebx, ebx
    mov esi, ecx
    push edi
    mov dword[esp + 10h], ebx
    mov dword[esp + 14h], ebx
    cmp dword[esi + 418h], ebp
    jae @100
    jmp @095
    lea esp, [esp]
    lea esp, [esp]

@095:
    mov eax, dword[esi + 414h]
    lea ecx, [eax + 16800h]
    cmp ecx, eax
    jbe @097
    mov ecx, dword[esi + 41Ch]
    cmp eax, ecx
    jbe @096
    sub eax, ecx
    jmp @098

@096:
    sub eax, ecx
    add eax, 16800h
    jmp @098

@097:
    xor eax, eax

@098:
    mov ecx, dword[esi + 418h]
    movzx edx, byte[ecx]
    movzx ecx, byte[ecx + 1h]
    mov edx, dword[edx * 4h + esi + 14h]
    mov ecx, dword[ecx * 4h + edx]
    mov edi, dword[esi + 10h]
    mov dword[eax * 4h + edi], ecx
    mov eax, dword[esi + 418h]
    movzx edx, byte[eax]
    movzx eax, byte[eax + 1h]
    mov ecx, dword[edx * 4h + esi + 14h]
    mov edx, dword[esi + 414h]
    mov dword[eax * 4h + ecx], edx
    mov ecx, 1h
    add dword[esi + 414h], ecx
    add dword[esi + 418h], ecx
    mov eax, dword[esi + 414h]
    mov ecx, eax
    sub ecx, dword[esi + 41Ch]
    cmp ecx, 16800h
    jbe @099
    dec eax
    mov dword[esi + 41Ch], eax

@099:
    cmp dword[esi + 418h], ebp
    jb @095

@100:
    mov eax, dword[esp + 30h]
    mov edx, 16700h
    cmp eax, edx
    jbe @101
    mov dword[esp + 30h], edx
    jmp @102

@101:
    cmp eax, 1h
    jbe @121

@102:
    movzx eax, byte[ebp]
    movzx ecx, byte[ebp + 1h]
    mov eax, dword[eax * 4h + esi + 14h]
    mov edi, dword[ecx * 4h + eax]
    cmp edi, ebx
    je @121
    mov ecx, dword[esi + 420h]
    lea eax, [ecx + edi]
    mov dword[esp + 1Ch], 800h
    cmp eax, ebp
    jb @107
    nop

@103:
    cmp edi, ebx
    je @107
    lea eax, [edi + 16800h]
    cmp eax, dword[esi + 414h]
    jbe @105
    mov eax, dword[esi + 41Ch]
    cmp edi, eax
    jbe @104
    sub edi, eax
    jmp @106

@104:
    sub edi, eax
    add edi, 16800h
    jmp @106

@105:
    xor edi, edi

@106:
    mov eax, dword[esi + 10h]
    mov edi, dword[edi * 4h + eax]
    lea eax, [ecx + edi]
    cmp eax, ebp
    jae @103

@107:
    cmp dword[esp + 2Ch], edx
    jbe @108
    mov dword[esp + 2Ch], edx

@108:
    cmp edi, ebx
    je @121
    add eax, 0h

@109:
    mov ecx, ebp
    sub ecx, eax
    mov dword[esp + 18h], ecx
    cmp ecx, dword[esp + 2Ch]
    ja @121
    mov ecx, dword[esp + 10h]
    mov dl, byte[eax + ecx]
    cmp dl, byte[ecx + ebp]
    mov ecx, dword[esp + 18h]
    mov ebx, 2h
    je @110
    cmp ecx, dword[esi + 424h]
    jne @116

@110:
    mov edx, dword[esp + 30h]
    cmp ebx, edx
    jae @113
    lea ecx, [ebp + 2h]
    mov ebp, eax
    sub ebp, dword[esp + 28h]

@111:
    mov al, byte[ecx + ebp]
    cmp al, byte[ecx]
    jne @112
    inc ebx
    inc ecx
    cmp ebx, edx
    jb @111

@112:
    mov ecx, dword[esp + 18h]
    mov ebp, dword[esp + 28h]
    cmp ebx, edx

@113:
    je @120
    cmp ebx, dword[esp + 10h]
    jbe @114
    push ebx
    push ecx
    mov ecx, esi
    call @059
    mov ecx, dword[esp + 10h]
    mov edx, dword[esp + 14h]
    push ecx
    push edx
    mov ecx, esi
    mov ebp, eax
    call @059
    sub ebp, eax
    add ebp, ebp
    mov eax, 4EC4EC4Fh
    imul ebp
    mov ebp, dword[esp + 28h]
    sar edx, 2h
    mov eax, edx
    shr eax, 1Fh
    add eax, edx
    add eax, dword[esp + 10h]
    cmp ebx, eax
    jbe @116
    mov ecx, dword[esp + 18h]
    mov dword[esp + 14h], ecx
    jmp @115

@114:
    cmp ecx, dword[esi + 424h]
    jne @116
    push ebx
    push ecx
    mov ecx, esi
    call @059
    mov edx, dword[esp + 10h]
    mov ebp, eax
    mov eax, dword[esp + 14h]
    push edx
    push eax
    mov ecx, esi
    call @059
    mov ecx, eax
    sub ecx, ebp
    mov ebp, dword[esp + 28h]
    mov eax, 2AAAAAABh
    imul ecx
    mov ecx, edx
    shr ecx, 1Fh
    add ecx, edx
    add ecx, ebx
    cmp ecx, dword[esp + 10h]
    jb @116
    mov edx, dword[esp + 18h]
    mov dword[esp + 14h], edx

@115:
    mov dword[esp + 10h], ebx

@116:
    lea eax, [edi + 16800h]
    cmp eax, dword[esi + 414h]
    jbe @118
    mov eax, dword[esi + 41Ch]
    cmp edi, eax
    jbe @117
    sub edi, eax
    jmp @119

@117:
    sub edi, eax
    add edi, 16800h
    jmp @119

@118:
    xor edi, edi

@119:
    mov ecx, dword[esi + 10h]
    mov edi, dword[edi * 4h + ecx]
    mov eax, dword[esi + 420h]
    add eax, edi
    dec dword[esp + 1Ch]
    je @121
    test edi, edi
    jne @109
    jmp @121

@120:
    mov dword[esp + 14h], ecx
    mov dword[esp + 10h], ebx

@121:
    mov eax, dword[esp + 24h]
    mov edx, dword[esp + 10h]
    mov ecx, dword[esp + 14h]
    pop edi
    pop esi
    pop ebp
    mov dword[eax], edx
    mov dword[eax + 4h], ecx
    pop ebx
    add esp, 10h
    ret 10h

aP_workmem_size:
    mov eax, 0A0000h
    ret

aP_max_packed_size:
    mov eax, dword[esp + 4h]
    mov ecx, eax
    shr ecx, 3h
    lea eax, [ecx + eax + 40h]
    ret

@124:
    push ecx
    mov eax, dword[esp + 8h]
    push ebx
    push ebp
    mov ebp, dword[eax]
    push esi
    push edi
    mov edi, dword[eax + 4h]
    push ebp
    push edi
    mov esi, ecx
    call @059
    mov dword[esp + 10h], eax
    mov eax, dword[esp + 1Ch]
    mov ecx, dword[eax]
    mov ebx, dword[eax + 4h]
    push ecx
    mov dword[esp + 20h], ecx
    push ebx
    mov ecx, esi
    call @059
    mov esi, eax
    mov dword[esp + 18h], 0h
    cmp ebx, edi
    jl @125
    mov ecx, dword[esp + 10h]
    sub ecx, esi
    add ecx, ecx
    mov eax, 38E38E39h
    imul ecx
    sar edx, 1h
    mov eax, edx
    shr eax, 1Fh
    add eax, edx
    jmp @126

@125:
    mov eax, dword[esp + 10h]
    sub eax, esi
    cdq
    and edx, 00000003h
    add eax, edx
    sar eax, 2h

@126:
    add eax, dword[esp + 1Ch]
    cmp ebp, eax
    jge @127
    mov dword[esp + 18h], 1h

@127:
    cmp dword[esp + 20h], 0h
    jbe @128
    cmp dword[esp + 1Ch], ebp
    jl @128
    mov eax, 1h
    cmp esi, dword[esp + 10h]
    jl @129

@128:
    mov eax, dword[esp + 18h]

@129:
    pop edi
    pop esi
    pop ebp
    pop ebx
    pop ecx
    ret 0Ch

@130:
    push ecx
    mov eax, dword[esp + 8h]
    push ebx
    push ebp
    mov ebp, dword[eax]
    push esi
    push edi
    mov edi, dword[eax + 4h]
    push ebp
    push edi
    mov esi, ecx
    call @059
    mov dword[esp + 10h], eax
    mov eax, dword[esp + 1Ch]
    mov ecx, dword[eax]
    mov ebx, dword[eax + 4h]
    push ecx
    mov dword[esp + 20h], ecx
    push ebx
    mov ecx, esi
    call @059
    mov esi, eax
    mov dword[esp + 18h], 0h
    cmp ebx, edi
    jl @131
    mov eax, dword[esp + 10h]
    sub eax, esi
    cdq
    and edx, 00000003h
    add eax, edx
    sar eax, 2h
    jmp @132

@131:
    mov ecx, dword[esp + 10h]
    sub ecx, esi
    add ecx, ecx
    mov eax, 2E8BA2E9h
    imul ecx
    sar edx, 1h
    mov eax, edx
    shr eax, 1Fh
    add eax, edx

@132:
    add eax, dword[esp + 1Ch]
    cmp ebp, eax
    jge @133
    mov dword[esp + 18h], 1h

@133:
    cmp dword[esp + 20h], 0h
    jbe @134
    cmp dword[esp + 1Ch], ebp
    jl @134
    mov eax, 1h
    cmp esi, dword[esp + 10h]
    jl @135

@134:
    mov eax, dword[esp + 18h]

@135:
    pop edi
    pop esi
    pop ebp
    pop ebx
    pop ecx
    ret 0Ch

@136:
    sub esp, 30h
    cmp dword[esp + 3Ch], 0h
    push esi
    mov esi, ecx
    jne @137
    xor eax, eax
    pop esi
    add esp, 30h
    ret 18h

@137:
    mov ecx, dword[esp + 38h]
    test ecx, ecx
    jne @139

@138:
    or eax, 0FFFFFFFFh
    pop esi
    add esp, 30h
    ret 18h

@139:
    mov edx, dword[esp + 3Ch]
    test edx, edx
    je @138
    mov eax, dword[esp + 44h]
    test eax, eax
    je @138
    push ebp
    mov dword[esi], ecx
    dec ecx
    push edi
    mov dword[esi + 420h], ecx
    mov dword[esi + 4h], edx
    mov dword[esi + 10h], eax
    lea ecx, [esi + 14h]
    lea edx, [eax + 5A018h]
    mov edi, 100h
    mov ebp, 1h
    push ebx
    lea ecx, [ecx]

@140:
    mov dword[ecx], edx
    xor eax, eax

@141:
    mov ebx, dword[ecx]
    mov dword[eax + ebx], 0h
    add eax, 4h
    cmp eax, 400h
    jb @141
    add ecx, 4h
    add edx, 400h
    sub edi, ebp
    jne @140
    mov ecx, dword[esi]
    mov edx, dword[esi + 10h]
    or eax, 0FFFFFFFFh
    mov dword[esi + 424h], eax
    mov dword[esi + 418h], ecx
    mov dword[esi + 414h], ebp
    mov dword[esi + 41Ch], edi
    mov dword[edx], edi
    mov ecx, dword[esi]
    mov edx, dword[esi + 4h]
    mov dword[esi + 428h], edi
    mov cl, byte[ecx]
    mov dword[esp + 18h], eax
    mov eax, dword[esp + 4Ch]
    mov byte[edx], cl
    add dword[esi + 4h], ebp
    add dword[esi], ebp
    dec eax
    mov dword[esp + 50h], edi
    mov dword[esp + 14h], edi
    mov dword[esi + 0Ch], ebp
    cmp eax, ebp
    jbe @192

@142:
    mov ecx, dword[esp + 54h]
    test ecx, ecx
    je @143
    mov eax, dword[esp + 14h]
    inc eax
    mov dword[esp + 14h], eax
    test eax, 00000FFFh
    jne @143
    mov edx, dword[esp + 58h]
    mov eax, dword[esi + 4h]
    sub eax, dword[esp + 48h]
    push edx
    mov edx, dword[esi]
    sub edx, dword[esp + 48h]
    push eax
    mov eax, dword[esp + 54h]
    push edx
    push eax
    call ecx
    add esp, 10h
    test eax, eax
    je @188

@143:
    cmp ebp, dword[esp + 18h]
    jne @144
    mov ecx, dword[esp + 38h]
    mov edx, dword[esp + 3Ch]
    mov dword[esp + 20h], ecx
    mov dword[esp + 24h], edx
    jmp @145

@144:
    mov eax, dword[esp + 4Ch]
    mov ecx, dword[esi]
    sub eax, ebp
    push eax
    push ebp
    push ecx
    lea edx, [esp + 2Ch]
    push edx
    mov ecx, esi
    call @094

@145:
    cmp dword[esp + 20h], 2h
    jl @173
    mov eax, dword[esi + 424h]
    cmp dword[esp + 24h], eax
    jne @147
    cmp edi, 1h
    jbe @150
    mov ebx, dword[esp + 2Ch]
    cmp ebx, eax
    je @150
    mov ecx, dword[esp + 50h]
    mov eax, ebp
    push edi
    sub eax, edi
    push eax
    push ecx
    call @024
    add esp, 0Ch
    push edi
    push ebx
    mov ecx, esi
    mov dword[esp + 24h], eax
    call @059
    cmp eax, dword[esp + 1Ch]
    jge @150
    mov eax, ebx
    cmp eax, 500h
    jl @146
    cmp edi, 2h
    je @150

@146:
    cmp eax, 7D00h
    jl @147
    cmp edi, 3h
    je @150

@147:
    mov ebx, dword[esp + 4Ch]
    sub ebx, ebp
    lea edx, [ebx - 1h]
    push edx
    lea eax, [ebp + 1h]
    push eax
    mov eax, dword[esi]
    inc eax
    push eax
    lea ecx, [esp + 44h]
    push ecx
    mov ecx, esi
    mov dword[esp + 2Ch], ebx
    call @094
    lea eax, [ebp + 1h]
    push edi
    lea edx, [esp + 3Ch]
    mov dword[esp + 1Ch], eax
    push edx
    lea eax, [esp + 28h]
    push eax
    mov ecx, esi
    call @124
    mov dword[esp + 10h], eax
    test edi, edi
    jne @148
    mov ecx, dword[esp + 20h]
    cmp dword[esp + 38h], ecx
    jge @148
    mov edx, dword[esp + 38h]
    mov eax, dword[esp + 3Ch]
    push edx
    push eax
    mov ecx, esi
    call @059
    mov ecx, dword[esi]
    push 1h
    push ebp
    push ecx
    mov ebx, eax
    call @024
    mov edx, dword[esp + 2Ch]
    add esp, 0Ch
    lea ebx, [ebx + eax + 1h]
    mov eax, dword[esp + 24h]
    push edx
    push eax
    mov ecx, esi
    call @059
    cmp ebx, eax
    mov ebx, dword[esp + 1Ch]
    jg @149

@148:
    cmp dword[esp + 10h], 0h
    jne @171

@149:
    cmp dword[esp + 20h], 2h
    jle @150
    mov eax, dword[esi]
    lea ecx, [ebx - 2h]
    push ecx
    lea edx, [ebp + 2h]
    push edx
    add eax, 2h
    push eax
    lea ecx, [esp + 3Ch]
    push ecx
    mov ecx, esi
    call @094
    push edi
    lea edx, [esp + 34h]
    push edx
    lea eax, [esp + 28h]
    push eax
    mov ecx, esi
    call @130
    test eax, eax
    jne @171
    cmp dword[esp + 20h], 3h
    jle @150
    mov edx, dword[esi]
    add ebx,  -3h
    push ebx
    lea ecx, [ebp + 3h]
    push ecx
    add edx, 3h
    push edx
    lea eax, [esp + 3Ch]
    push eax
    mov ecx, esi
    call @094
    push edi
    lea ecx, [esp + 34h]
    push ecx
    lea edx, [esp + 28h]
    push edx
    mov ecx, esi
    call @130
    test eax, eax
    jne @171

@150:
    test edi, edi
    je @161
    cmp edi, 1h
    jbe @159
    mov eax, edi
    sub eax, ebp
    add eax, dword[esp + 4Ch]
    cmp eax, edi
    jbe @151
    mov eax, edi

@151:
    mov edx, dword[esp + 50h]
    push eax
    mov ebx, ebp
    sub ebx, edi
    push ebx
    push edx
    lea eax, [esp + 3Ch]
    push eax
    mov ecx, esi
    mov dword[esp + 20h], ebx
    call @094
    cmp dword[esp + 30h], edi
    jb @152
    mov ecx, dword[esp + 34h]
    push edi
    push ecx
    mov ecx, esi
    call @059
    mov edx, dword[esp + 2Ch]
    push edi
    push edx
    mov ecx, esi
    mov ebx, eax
    call @059
    cmp eax, ebx
    mov ebx, dword[esp + 10h]
    jle @152
    mov eax, dword[esp + 34h]
    mov ecx, dword[esp + 30h]
    mov dword[esp + 2Ch], eax
    mov dword[esp + 28h], ecx

@152:
    mov edx, dword[esp + 50h]
    push edi
    push ebx
    push edx
    call @024
    add esp, 0Ch
    mov dword[esp + 1Ch], eax
    mov eax, dword[esp + 2Ch]
    push edi
    push eax
    mov ecx, esi
    call @059
    mov ebx, eax
    cmp ebx, dword[esp + 1Ch]
    jge @157
    mov ecx, dword[esp + 24h]
    cmp ecx, dword[esi + 424h]
    jne @153
    mov edx, dword[esp + 20h]
    mov eax, ecx
    push edx
    inc eax
    push eax
    mov ecx, esi
    call @059
    mov ecx, dword[esp + 20h]
    mov edx, dword[esp + 24h]
    push ecx
    add eax, ebx
    push edx
    mov ecx, esi
    mov dword[esp + 18h], eax
    call @059
    add eax, dword[esp + 1Ch]
    cmp eax, dword[esp + 10h]
    jle @157

@153:
    mov eax, dword[esp + 2Ch]
    cmp eax, dword[esi + 424h]
    jne @154
    cmp dword[esi + 428h], 0h
    je @156

@154:
    cmp eax, 500h
    jl @155
    cmp edi, 2h
    je @157

@155:
    cmp eax, 7D00h
    jl @156
    cmp edi, 3h
    je @157

@156:
    push edi
    push eax
    mov ecx, esi
    call @073
    jmp @160

@157:
    mov ebx, dword[esp + 50h]
    lea esp, [esp]

@158:
    mov eax, ebp
    sub eax, edi
    push eax
    push ebx
    mov ecx, esi
    call @031
    inc ebx
    dec edi
    jne @158
    mov dword[esp + 50h], ebx
    jmp @161

@159:
    mov edx, dword[esp + 50h]
    lea ecx, [ebp - 1h]
    push ecx
    push edx
    mov ecx, esi
    call @031

@160:
    xor edi, edi

@161:
    mov ebx, dword[esp + 20h]
    cmp ebx, 3h
    jg @169
    mov eax, dword[esi]
    push ebx
    push ebp
    push eax
    call @024
    mov ecx, dword[esp + 30h]
    add esp, 0Ch
    push ebx
    push ecx
    mov ecx, esi
    mov dword[esp + 24h], eax
    call @059
    cmp eax, dword[esp + 1Ch]
    jg @164
    mov eax, dword[esp + 24h]
    cmp eax, dword[esi + 424h]
    jne @162
    cmp dword[esi + 428h], 0h
    je @168

@162:
    mov ebx, dword[esp + 20h]
    cmp eax, 500h
    jl @163
    cmp ebx, 2h
    je @165

@163:
    cmp eax, 7D00h
    jl @170
    jmp @165

@164:
    mov ebx, dword[esp + 20h]

@165:
    mov dword[esp + 10h], ebx
    test ebx, ebx
    je @167

@166:
    mov edx, dword[esi]
    push ebp
    push edx
    mov ecx, esi
    call @031
    inc dword[esi]
    dec dword[esp + 10h]
    jne @166

@167:
    lea ebp, [ebx + ebp - 1h]
    jmp @176

@168:
    mov ebx, dword[esp + 20h]
    push ebx
    push eax
    mov ecx, esi
    call @073
    add dword[esi], ebx
    lea ebp, [ebx + ebp - 1h]
    jmp @176

@169:
    mov eax, dword[esp + 24h]

@170:
    push ebx
    push eax
    mov ecx, esi
    call @073
    add dword[esi], ebx
    lea ebp, [ebx + ebp - 1h]
    jmp @176

@171:
    test edi, edi
    jne @172
    mov eax, dword[esp + 20h]
    mov ecx, dword[esp + 24h]
    mov edx, dword[esi]
    mov dword[esp + 28h], eax
    mov dword[esp + 2Ch], ecx
    mov dword[esp + 50h], edx

@172:
    inc edi
    jmp @175

@173:
    test edi, edi
    je @174
    inc edi
    jmp @175

@174:
    mov eax, dword[esi]
    push ebp
    push eax
    mov ecx, esi
    call @031

@175:
    inc dword[esi]

@176:
    test edi, edi
    je @184
    cmp edi, dword[esp + 28h]
    jne @184
    mov eax, edi
    sub eax, ebp
    add eax, dword[esp + 4Ch]
    cmp eax, edi
    jbe @177
    mov eax, edi

@177:
    push eax
    mov eax, dword[esp + 54h]
    mov ebx, ebp
    sub ebx, edi
    push ebx
    push eax
    lea ecx, [esp + 3Ch]
    push ecx
    mov ecx, esi
    mov dword[esp + 20h], ebx
    call @094
    cmp dword[esp + 30h], edi
    jb @178
    mov edx, dword[esp + 34h]
    push edi
    push edx
    mov ecx, esi
    call @059
    mov ebx, eax
    mov eax, dword[esp + 2Ch]
    push edi
    push eax
    mov ecx, esi
    call @059
    cmp eax, ebx
    mov ebx, dword[esp + 10h]
    jle @178
    mov ecx, dword[esp + 34h]
    mov edx, dword[esp + 30h]
    mov dword[esp + 2Ch], ecx
    mov dword[esp + 28h], edx

@178:
    mov eax, dword[esp + 50h]
    push edi
    push ebx
    push eax
    call @024
    mov ecx, dword[esp + 38h]
    add esp, 0Ch
    push edi
    push ecx
    mov ecx, esi
    mov ebx, eax
    call @059
    cmp eax, ebx
    jge @182
    mov eax, dword[esp + 2Ch]
    cmp eax, dword[esi + 424h]
    jne @179
    cmp dword[esi + 428h], 0h
    je @181

@179:
    cmp eax, 500h
    jl @180
    cmp edi, 2h
    je @182

@180:
    cmp eax, 7D00h
    jl @181
    cmp edi, 3h
    je @182

@181:
    push edi
    push eax
    mov ecx, esi
    call @073
    xor edi, edi
    jmp @184

@182:
    mov ebx, dword[esp + 50h]
    lea ecx, [ecx]

@183:
    mov edx, ebp
    sub edx, edi
    push edx
    push ebx
    mov ecx, esi
    call @031
    inc ebx
    dec edi
    jne @183
    mov dword[esp + 50h], ebx

@184:
    mov eax, dword[esp + 4Ch]
    inc ebp
    dec eax
    cmp ebp, eax
    jb @142
    test edi, edi
    je @192
    cmp edi, 1h
    jbe @191
    mov ecx, dword[esp + 50h]
    mov eax, ebp
    push edi
    sub eax, edi
    push eax
    push ecx
    call @024
    mov edx, dword[esp + 38h]
    add esp, 0Ch
    push edi
    push edx
    mov ecx, esi
    mov ebx, eax
    call @059
    cmp eax, ebx
    jg @189
    mov eax, dword[esp + 2Ch]
    cmp eax, dword[esi + 424h]
    jne @185
    cmp dword[esi + 428h], 0h
    je @187

@185:
    cmp eax, 500h
    jl @186
    cmp edi, 2h
    je @189

@186:
    cmp eax, 7D00h
    jl @187
    cmp edi, 3h
    je @189

@187:
    push edi
    push eax
    mov ecx, esi
    call @073
    jmp @192

@188:
    pop ebx
    pop edi
    pop ebp
    or eax, 0FFFFFFFFh
    pop esi
    add esp, 30h
    ret 18h

@189:
    mov ebx, dword[esp + 50h]

@190:
    mov eax, ebp
    sub eax, edi
    push eax
    push ebx
    mov ecx, esi
    call @031
    inc ebx
    dec edi
    jne @190
    jmp @192

@191:
    mov edx, dword[esp + 50h]
    lea ecx, [ebp - 1h]
    push ecx
    push edx
    mov ecx, esi
    call @031

@192:
    mov edi, dword[esp + 4Ch]
    cmp ebp, edi
    jae @194
    mov edi, edi

@193:
    mov eax, dword[esi]
    push ebp
    push eax
    mov ecx, esi
    call @031
    inc dword[esi]
    inc ebp
    cmp ebp, edi
    jb @193

@194:
    or ebp, 0FFFFFFFFh
    add dword[esi + 0Ch], ebp
    lea ecx, [ebp + 9h]
    jne @195
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ecx
    mov dword[esi + 4h], eax

@195:
    mov eax, dword[esi + 8h]
    mov dl, byte[eax]
    add dl, dl
    inc dl
    mov byte[eax], dl
    add dword[esi + 0Ch], ebp
    jne @196
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ecx
    mov dword[esi + 4h], eax

@196:
    mov eax, dword[esi + 8h]
    mov dl, byte[eax]
    add dl, dl
    inc dl
    mov byte[eax], dl
    add dword[esi + 0Ch], ebp
    jne @197
    mov eax, dword[esi + 4h]
    mov dword[esi + 8h], eax
    inc eax
    mov dword[esi + 0Ch], ecx
    mov dword[esi + 4h], eax

@197:
    mov eax, dword[esi + 8h]
    shl byte[eax], 1h
    mov eax, dword[esi + 4h]
    mov byte[eax], 0h
    mov ecx, dword[esi + 0Ch]
    mov eax, dword[esi + 8h]
    inc dword[esi + 4h]
    dec ecx
    shl byte[eax], cl
    mov eax, dword[esp + 54h]
    test eax, eax
    je @198
    mov ecx, dword[esp + 58h]
    mov edx, dword[esi + 4h]
    sub edx, dword[esp + 48h]
    push ecx
    mov ecx, dword[esi]
    sub ecx, dword[esp + 48h]
    push edx
    push ecx
    push edi
    call eax
    add esp, 10h
    test eax, eax
    jne @198
    pop ebx
    pop edi
    mov eax, ebp
    pop ebp
    pop esi
    add esp, 30h
    ret 18h

@198:
    mov eax, dword[esi + 4h]
    sub eax, dword[esp + 48h]
    pop ebx
    pop edi
    pop ebp
    pop esi
    add esp, 30h
    ret 18h

aP_pack:
    mov eax, dword[esp + 0Ch]
    sub esp, 42Ch
    test eax, eax
    jne @200
    add esp, 42Ch
    ret

@200:
    mov ecx, dword[esp + 444h]
    mov edx, dword[esp + 440h]
    push ecx
    mov ecx, dword[esp + 440h]
    push edx
    mov edx, dword[esp + 43Ch]
    push ecx
    push eax
    mov eax, dword[esp + 440h]
    push edx
    push eax
    lea ecx, [esp + 18h]
    call @136
    add esp, 42Ch
    ret

aP_depack_asm:
    pushad
    mov esi, dword[esp + 24h]
    mov edi, dword[esp + 28h]
    cld
    mov dl, 80h
    xor ebx, ebx

@202:
    movsb
    mov bl, 2h

@203:
    call @213
    jae @202
    xor ecx, ecx
    call @213
    jae @205
    xor eax, eax
    call @213
    jae @206
    mov bl, 2h
    inc ecx
    mov al, 10h

@204:
    call @213
    adc al, al
    jae @204
    jne @212
    stosb
    jmp @203

@205:
    call @216
    sub ecx, ebx
    jne @207
    call @215
    jmp @211

@206:
    lodsb
    shr eax, 1h
    je @218
    adc ecx, ecx
    jmp @208

@207:
    xchg eax, ecx
    dec eax
    shl eax, 8h
    lodsb
    call @215
    cmp eax, 7D00h
    jae @208
    cmp ah, 5h
    jae @209
    cmp eax, 7Fh
    ja @210

@208:
    inc ecx

@209:
    inc ecx

@210:
    xchg eax, ebp

@211:
    mov eax, ebp
    mov bl, 1h

@212:
    push esi
    mov esi, edi
    sub esi, eax
    rep movsb
    pop esi
    jmp @203

@213:
    add dl, dl
    jne @214
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@214:
    ret

@215:
    xor ecx, ecx

@216:
    inc ecx

@217:
    call @213
    adc ecx, ecx
    call @213
    jb @217
    ret

@218:
    sub edi, dword[esp + 28h]
    mov dword[esp + 1Ch], edi
    popad
    ret

aP_depack_asm_fast:
    pushad
    mov esi, dword[esp + 24h]
    mov edi, dword[esp + 28h]
    cld
    mov dl, 80h

@220:
    mov al, byte[esi]
    add esi, 1h
    mov byte[edi], al
    add edi, 1h
    mov ebx, 2h

@221:
    add dl, dl
    jne @222
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@222:
    jae @220
    add dl, dl
    jne @223
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@223:
    jae @230
    xor eax, eax
    add dl, dl
    jne @224
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@224:
    jae @241
    add dl, dl
    jne @225
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@225:
    adc eax, eax
    add dl, dl
    jne @226
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@226:
    adc eax, eax
    add dl, dl
    jne @227
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@227:
    adc eax, eax
    add dl, dl
    jne @228
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@228:
    adc eax, eax
    je @229
    mov ebx, edi
    sub ebx, eax
    mov al, byte[ebx]

@229:
    mov byte[edi], al
    inc edi
    mov ebx, 2h
    jmp @221

@230:
    mov eax, 1h

@231:
    add dl, dl
    jne @232
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@232:
    adc eax, eax
    add dl, dl
    jne @233
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@233:
    jb @231
    sub eax, ebx
    mov ebx, 1h
    jne @237
    mov ecx, 1h

@234:
    add dl, dl
    jne @235
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@235:
    adc ecx, ecx
    add dl, dl
    jne @236
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@236:
    jb @234
    push esi
    mov esi, edi
    sub esi, ebp
    rep movsb
    pop esi
    jmp @221

@237:
    dec eax
    shl eax, 8h
    mov al, byte[esi]
    inc esi
    mov ebp, eax
    mov ecx, 1h

@238:
    add dl, dl
    jne @239
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@239:
    adc ecx, ecx
    add dl, dl
    jne @240
    mov dl, byte[esi]
    inc esi
    adc dl, dl

@240:
    jb @238
    cmp eax, 7D00h
    sbb ecx,  -1h
    cmp eax, 500h
    sbb ecx,  -1h
    cmp eax, 80h
    adc ecx, 0h
    cmp eax, 80h
    adc ecx, 0h
    push esi
    mov esi, edi
    sub esi, eax
    rep movsb
    pop esi
    jmp @221

@241:
    mov al, byte[esi]
    inc esi
    xor ecx, ecx
    shr al, 1h
    je @242
    adc ecx, 2h
    mov ebp, eax
    push esi
    mov esi, edi
    sub esi, eax
    rep movsb
    pop esi
    mov ebx, 1h
    jmp @221

@242:
    sub edi, dword[esp + 28h]
    mov dword[esp + 1Ch], edi
    popad
    ret

aPsafe_check:
    pushad
    mov esi, dword[esp + 24h]
    test esi, esi
    je @244
    mov ebx, dword[esi]
    cmp ebx, SIGN
    jne @244
    mov ebx, dword[esi + 4h]
    cmp ebx, 18h
    jb @244
    add ebx, esi
    push dword[esi + 8h]
    push ebx
    call aP_crc32
    add esp, 8h
    cmp eax, dword[esi + 0Ch]
    mov eax, dword[esi + 10h]
    je @245

@244:
    or eax, 0FFFFFFFFh

@245:
    mov dword[esp + 1Ch], eax
    popad
    ret

aP_depack_asm_safe:
    pushad
    mov esi, dword[esp + 24h]
    mov eax, dword[esp + 28h]
    mov edi, dword[esp + 2Ch]
    mov ecx, dword[esp + 30h]
    push eax
    push ecx
    test esi, esi
    je @269
    test edi, edi
    je @269
    or ebp, 0FFFFFFFFh
    cld
    xor edx, edx

@247:
    sub dword[esp + 4h], 1h
    jb @269
    mov al, byte[esi]
    add esi, 1h
    sub dword[esp], 1h
    jb @269
    mov byte[edi], al
    add edi, 1h
    mov ebx, 2h

@248:
    add dl, dl
    jne @249
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@249:
    jae @247
    add dl, dl
    jne @250
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@250:
    jae @257
    xor eax, eax
    add dl, dl
    jne @251
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@251:
    jae @268
    add dl, dl
    jne @252
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@252:
    adc eax, eax
    add dl, dl
    jne @253
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@253:
    adc eax, eax
    add dl, dl
    jne @254
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@254:
    adc eax, eax
    add dl, dl
    jne @255
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@255:
    adc eax, eax
    je @256
    mov ebx, dword[esp + 38h]
    sub ebx, dword[esp]
    cmp eax, ebx
    ja @269
    mov ebx, edi
    sub ebx, eax
    mov al, byte[ebx]

@256:
    sub dword[esp], 1h
    jb @269
    mov byte[edi], al
    inc edi
    mov ebx, 2h
    jmp @248

@257:
    mov eax, 1h

@258:
    add dl, dl
    jne @259
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@259:
    adc eax, eax
    jb @269
    add dl, dl
    jne @260
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@260:
    jb @258
    sub eax, ebx
    mov ebx, 1h
    jne @264
    mov ecx, 1h

@261:
    add dl, dl
    jne @262
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@262:
    adc ecx, ecx
    jb @269
    add dl, dl
    jne @263
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@263:
    jb @261
    push ecx
    mov ecx, dword[esp + 3Ch]
    sub ecx, dword[esp + 4h]
    cmp ebp, ecx
    pop ecx
    ja @269
    sub dword[esp], ecx
    jb @269
    push esi
    mov esi, edi
    sub esi, ebp
    rep movsb
    pop esi
    jmp @248

@264:
    dec eax
    test eax, 0FF000000h
    jne @269
    shl eax, 8h
    sub dword[esp + 4h], 1h
    jb @269
    mov al, byte[esi]
    inc esi
    mov ebp, eax
    mov ecx, 1h

@265:
    add dl, dl
    jne @266
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@266:
    adc ecx, ecx
    jb @269
    add dl, dl
    jne @267
    sub dword[esp + 4h], 1h
    jb @269
    mov dl, byte[esi]
    inc esi
    add dl, dl
    inc dl

@267:
    jb @265
    cmp eax, 7D00h
    sbb ecx,  -1h
    cmp eax, 500h
    sbb ecx,  -1h
    cmp eax, 80h
    adc ecx, 0h
    cmp eax, 80h
    adc ecx, 0h
    push ecx
    mov ecx, dword[esp + 3Ch]
    sub ecx, dword[esp + 4h]
    cmp eax, ecx
    pop ecx
    ja @269
    sub dword[esp], ecx
    jb @269
    push esi
    mov esi, edi
    sub esi, eax
    rep movsb
    pop esi
    jmp @248

@268:
    sub dword[esp + 4h], 1h
    jb @269
    mov al, byte[esi]
    inc esi
    xor ecx, ecx
    shr al, 1h
    je @270
    adc ecx, 2h
    mov ebp, eax
    push ecx
    mov ecx, dword[esp + 3Ch]
    sub ecx, dword[esp + 4h]
    cmp eax, ecx
    pop ecx
    ja @269
    sub dword[esp], ecx
    jb @269
    push esi
    mov esi, edi
    sub esi, eax
    rep movsb
    pop esi
    mov ebx, 1h
    jmp @248

@269:
    add esp, 8h
    popad
    or eax, 0FFFFFFFFh
    ret

@270:
    add esp, 8h
    sub edi, dword[esp + 2Ch]
    mov dword[esp + 1Ch], edi
    popad
    ret

aPsafe_pack:
    pushad
    mov ebp, esp
    mov esi, dword[ebp + 24h]
    mov edi, dword[ebp + 28h]
    mov ecx, dword[ebp + 2Ch]
    or eax, 0FFFFFFFFh
    test esi, esi
    je @272
    test edi, edi
    je @272
    test ecx, ecx
    je @272
    mov ebx, SIGN
    mov dword[edi], ebx
    mov ebx, 18h
    mov dword[edi + 4h], ebx
    add ebx, edi
    mov dword[edi + 10h], ecx
    push ecx
    push esi
    call aP_crc32
    add esp, 8h
    mov dword[edi + 14h], eax
    push dword[ebp + 38h]
    push dword[ebp + 34h]
    push dword[ebp + 30h]
    push ecx
    push ebx
    push esi
    call aP_pack
    add esp, 18h
    cmp eax,  -1h
    je @272
    mov dword[edi + 8h], eax
    mov edx, eax
    push eax
    push ebx
    call aP_crc32
    add esp, 8h
    mov dword[edi + 0Ch], eax
    lea eax, [edx + 18h]

@272:
    mov dword[esp + 1Ch], eax
    popad
    ret

aPsafe_get_orig_size:
    pushad
    mov esi, dword[esp + 24h]
    mov ebx, dword[esi]
    or eax, 0FFFFFFFFh
    cmp ebx, SIGN
    jne @274
    mov ebx, dword[esi + 4h]
    cmp ebx, 18h
    jb @274
    mov eax, dword[esi + 10h]

@274:
    mov dword[esp + 1Ch], eax
    popad
    ret

aP_crc32:
    pushad
    mov edx, dword[esp + 24h]
    mov ecx, dword[esp + 28h]
    xor eax, eax
    test ecx, ecx
    je @275
    not eax

@276:
    xor al, byte[edx]
    inc edx
    mov bl, 8h

@277:
    shr eax, 1h
    jae @278
    xor eax, 0EDB88320h

@278:
    dec bl
    jne @277
    dec ecx
    jne @276
    not eax

@275:
    mov dword[esp + 1Ch], eax
    popad
    ret

90

(229 відповідей, залишених у Windows)

Ганяв на VM (ту що TP). Задоволений що мало жере ресурсів, ну і інтерфейс око радує.
За усе життя користування віндою, BSoDило дуже мало (більшість казусів - по причині софту з кривими дровами).
Оновлятися не планую, бо і так все гарно на 7-ці працює, впадло (недоцільно, заради вибриків у UI).

Бачу багато настроїв типу "віндє капєц" / "пєндоси на нас бабла срубят" і т.п. Фігня то все. Windows то вам не Nokia: не дурні вони, аби прос#$ть такий сегмент. Як і у політиці, пускають яку небудь утку в ЗМІ, і дивляться на настрої - якщо тихо, голосують, ні - оправдуються. Не будуть платити за обновки - придумають щось інше, вигідне для усіх сторін)) Суть то одна, увесь час..

VertoX написав:

А по вашому гоп-стоп це як?

Не можу знати, бо не маю досвіду. Може я бачив як школярів щипали, без тілесних ушкоджень, тому і є моя думка такою. Що сперечатися, один хєр результат однаковий - ти пограбований, все.

VertoX написав:

якщо вже вас реально діймає моє скиглення

Мені однаково, не переймайтеся. Просто ви багато і емоційно пишете.

VertoX написав:

Це як раз і є різновид класичного гоп-стопу.

Ага, дати в морду, а потім пройтись по карманам і втекти.

VertoX написав:

Чому ви вирішили,що я нию?

Іноді занадто емоційно передаєте свої думки, і в контексті скарг або "саркастично-іронічного" стилю, це виглядає саме як ниття.

93

(16 відповідей, залишених у C++)

Ставте 13-у студію, не надійтесь на сумісність.

========== Сборка: успешно: 1, с ошибками: 0, без изменений: 0, пропущено: 0 ==========

Chemist-i написав:
Kane написав:

Злі ви усі, кібер-гопно-тролі.

Не плутайте поняття. Гопнікі та тролі - взаємовиключні речі. Троль тонкими лінгвістичними конструкціями виводить гопників на чисту води (вони самі себе палять) в очах інших користувачів.
А також не слід забувати, що є конструктивний тролінг, а є just for fun.

p.s. Якшо Ви ведетесь на тролінг, слід задуматись, чи не школяр/гопнік/неадекват Ви часом? - це для неконструктивного тролінгу. Конструктивний же має на меті, все ж, вирішити якесь питання (або наглядно показати, як в даній темі)

Цей набір слів, створено з контексту перемовин які зазначені вище, і він не містить якоїсь конкретики щодо якоїсь групи людей, аби їх образити або ще що, а значить він не вартий коментарів на вікіпедистський манер як ви розписали.

Особисто мені на все це пофіг. Розраховувати в інеті на якусь порядність або повагу - нерозумно. Треба звикнути, що більшість користувачів має на меті кепкувати з іншого такого-ж екземпляра, таким чином доповнюючи свої недоліки, які він не може реалізувати в реальності.

VertoX, чесно кажучи, я не читав повністю теми, і не розбирав хто є жертва, а хто потерпілий, тобто без особистостей.

VertoX написав:

Якась дибількувата логіка. Питання без підколу. Вас особисто колись гопали?

Я просто відреагував на ствердження вельмишановної пані Cyan про тролінг, аналогія один в один.
У класі 7-му було, віддав 10 грн., але то буде голосно сказано що "гопнули" - просто він старший за мене, а я малявка, тому все на словах відбулося, без шмону. Через деякий час виявилося, що це друг мого друга, і гроші було віддано. Більше ніколи в житті, конфліктів на грунті "гоп-стоп" не було (не рахуючи ще наркомана, який не міг толком сказати що йому треба).
Те що зображено на відео - відверте пограбування.

VertoX написав:

Ну шо ж...Гопніком мене вже охрестили,тепер я ще й на додачу неадекватний школяр! Жизнь удалась!

Менше нийте.

95

(16 відповідей, залишених у C++)

Ну просто <sys/socket.h> це не Windows. Хз як там, спробуйте замінити на winsock2.h.

96

(16 відповідей, залишених у C++)

Getting the sources and compiling

You'll need Visual Studio 2013. A free Community edition will work.

We try to standardize on one, latest publicly available version. Currently we're using 2013 Update 4. Other versions might work but we don't test with them.

Open vs/sumatrapdf-vc2013.sln, compile and run.

Ви так робите, чи якось по-своєму?

97

(16 відповідей, залишених у C++)

Він точно щось не те курить...

Злі ви усі, кібер-гопно-тролі.

Cyan написав:
Kane написав:
Cyan написав:

біди людства не через тролів, а через саме людство, яке ведеться на провокації тролів

Біда потерпілого не від гопніків, а через самих потерпілих, які ходять не там де треба.

нєфіг поночі шлятись

Тобто якщо ти не можеш протистояти тролінгу, пнх з форума?

Cyan написав:
VertoX написав:

Всі біди людства через тролів. Ганьба вам(тролям) панове.

біди людства не через тролів, а через саме людство, яке ведеться на провокації тролів

Біда потерпілого не від гопніків, а через самих потерпілих, які ходять не там де треба.