OLD | NEW |
(Empty) | |
| 1 OPTION DOTNAME |
| 2 .text$ SEGMENT ALIGN(64) 'CODE' |
| 3 EXTERN OPENSSL_ia32cap_P:NEAR |
| 4 |
| 5 PUBLIC RC4 |
| 6 |
| 7 ALIGN 16 |
| 8 RC4 PROC PUBLIC |
| 9 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue |
| 10 mov QWORD PTR[16+rsp],rsi |
| 11 mov rax,rsp |
| 12 $L$SEH_begin_RC4:: |
| 13 mov rdi,rcx |
| 14 mov rsi,rdx |
| 15 mov rdx,r8 |
| 16 mov rcx,r9 |
| 17 |
| 18 or rsi,rsi |
| 19 jne $L$entry |
| 20 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue |
| 21 mov rsi,QWORD PTR[16+rsp] |
| 22 DB 0F3h,0C3h ;repret |
| 23 $L$entry:: |
| 24 push rbx |
| 25 push r12 |
| 26 push r13 |
| 27 $L$prologue:: |
| 28 mov r11,rsi |
| 29 mov r12,rdx |
| 30 mov r13,rcx |
| 31 xor r10,r10 |
| 32 xor rcx,rcx |
| 33 |
| 34 lea rdi,QWORD PTR[8+rdi] |
| 35 mov r10b,BYTE PTR[((-8))+rdi] |
| 36 mov cl,BYTE PTR[((-4))+rdi] |
| 37 cmp DWORD PTR[256+rdi],-1 |
| 38 je $L$RC4_CHAR |
| 39 lea r8,QWORD PTR[OPENSSL_ia32cap_P] |
| 40 mov r8d,DWORD PTR[r8] |
| 41 xor rbx,rbx |
| 42 inc r10b |
| 43 sub rbx,r10 |
| 44 sub r13,r12 |
| 45 mov eax,DWORD PTR[r10*4+rdi] |
| 46 test r11,-16 |
| 47 jz $L$loop1 |
| 48 bt r8d,30 |
| 49 jc $L$intel |
| 50 and rbx,7 |
| 51 lea rsi,QWORD PTR[1+r10] |
| 52 jz $L$oop8 |
| 53 sub r11,rbx |
| 54 $L$oop8_warmup:: |
| 55 add cl,al |
| 56 mov edx,DWORD PTR[rcx*4+rdi] |
| 57 mov DWORD PTR[rcx*4+rdi],eax |
| 58 mov DWORD PTR[r10*4+rdi],edx |
| 59 add al,dl |
| 60 inc r10b |
| 61 mov edx,DWORD PTR[rax*4+rdi] |
| 62 mov eax,DWORD PTR[r10*4+rdi] |
| 63 xor dl,BYTE PTR[r12] |
| 64 mov BYTE PTR[r13*1+r12],dl |
| 65 lea r12,QWORD PTR[1+r12] |
| 66 dec rbx |
| 67 jnz $L$oop8_warmup |
| 68 |
| 69 lea rsi,QWORD PTR[1+r10] |
| 70 jmp $L$oop8 |
| 71 ALIGN 16 |
| 72 $L$oop8:: |
| 73 add cl,al |
| 74 mov edx,DWORD PTR[rcx*4+rdi] |
| 75 mov DWORD PTR[rcx*4+rdi],eax |
| 76 mov ebx,DWORD PTR[rsi*4+rdi] |
| 77 ror r8,8 |
| 78 mov DWORD PTR[r10*4+rdi],edx |
| 79 add dl,al |
| 80 mov r8b,BYTE PTR[rdx*4+rdi] |
| 81 add cl,bl |
| 82 mov edx,DWORD PTR[rcx*4+rdi] |
| 83 mov DWORD PTR[rcx*4+rdi],ebx |
| 84 mov eax,DWORD PTR[4+rsi*4+rdi] |
| 85 ror r8,8 |
| 86 mov DWORD PTR[4+r10*4+rdi],edx |
| 87 add dl,bl |
| 88 mov r8b,BYTE PTR[rdx*4+rdi] |
| 89 add cl,al |
| 90 mov edx,DWORD PTR[rcx*4+rdi] |
| 91 mov DWORD PTR[rcx*4+rdi],eax |
| 92 mov ebx,DWORD PTR[8+rsi*4+rdi] |
| 93 ror r8,8 |
| 94 mov DWORD PTR[8+r10*4+rdi],edx |
| 95 add dl,al |
| 96 mov r8b,BYTE PTR[rdx*4+rdi] |
| 97 add cl,bl |
| 98 mov edx,DWORD PTR[rcx*4+rdi] |
| 99 mov DWORD PTR[rcx*4+rdi],ebx |
| 100 mov eax,DWORD PTR[12+rsi*4+rdi] |
| 101 ror r8,8 |
| 102 mov DWORD PTR[12+r10*4+rdi],edx |
| 103 add dl,bl |
| 104 mov r8b,BYTE PTR[rdx*4+rdi] |
| 105 add cl,al |
| 106 mov edx,DWORD PTR[rcx*4+rdi] |
| 107 mov DWORD PTR[rcx*4+rdi],eax |
| 108 mov ebx,DWORD PTR[16+rsi*4+rdi] |
| 109 ror r8,8 |
| 110 mov DWORD PTR[16+r10*4+rdi],edx |
| 111 add dl,al |
| 112 mov r8b,BYTE PTR[rdx*4+rdi] |
| 113 add cl,bl |
| 114 mov edx,DWORD PTR[rcx*4+rdi] |
| 115 mov DWORD PTR[rcx*4+rdi],ebx |
| 116 mov eax,DWORD PTR[20+rsi*4+rdi] |
| 117 ror r8,8 |
| 118 mov DWORD PTR[20+r10*4+rdi],edx |
| 119 add dl,bl |
| 120 mov r8b,BYTE PTR[rdx*4+rdi] |
| 121 add cl,al |
| 122 mov edx,DWORD PTR[rcx*4+rdi] |
| 123 mov DWORD PTR[rcx*4+rdi],eax |
| 124 mov ebx,DWORD PTR[24+rsi*4+rdi] |
| 125 ror r8,8 |
| 126 mov DWORD PTR[24+r10*4+rdi],edx |
| 127 add dl,al |
| 128 mov r8b,BYTE PTR[rdx*4+rdi] |
| 129 add sil,8 |
| 130 add cl,bl |
| 131 mov edx,DWORD PTR[rcx*4+rdi] |
| 132 mov DWORD PTR[rcx*4+rdi],ebx |
| 133 mov eax,DWORD PTR[((-4))+rsi*4+rdi] |
| 134 ror r8,8 |
| 135 mov DWORD PTR[28+r10*4+rdi],edx |
| 136 add dl,bl |
| 137 mov r8b,BYTE PTR[rdx*4+rdi] |
| 138 add r10b,8 |
| 139 ror r8,8 |
| 140 sub r11,8 |
| 141 |
| 142 xor r8,QWORD PTR[r12] |
| 143 mov QWORD PTR[r13*1+r12],r8 |
| 144 lea r12,QWORD PTR[8+r12] |
| 145 |
| 146 test r11,-8 |
| 147 jnz $L$oop8 |
| 148 cmp r11,0 |
| 149 jne $L$loop1 |
| 150 jmp $L$exit |
| 151 |
| 152 ALIGN 16 |
| 153 $L$intel:: |
| 154 test r11,-32 |
| 155 jz $L$loop1 |
| 156 and rbx,15 |
| 157 jz $L$oop16_is_hot |
| 158 sub r11,rbx |
| 159 $L$oop16_warmup:: |
| 160 add cl,al |
| 161 mov edx,DWORD PTR[rcx*4+rdi] |
| 162 mov DWORD PTR[rcx*4+rdi],eax |
| 163 mov DWORD PTR[r10*4+rdi],edx |
| 164 add al,dl |
| 165 inc r10b |
| 166 mov edx,DWORD PTR[rax*4+rdi] |
| 167 mov eax,DWORD PTR[r10*4+rdi] |
| 168 xor dl,BYTE PTR[r12] |
| 169 mov BYTE PTR[r13*1+r12],dl |
| 170 lea r12,QWORD PTR[1+r12] |
| 171 dec rbx |
| 172 jnz $L$oop16_warmup |
| 173 |
| 174 mov rbx,rcx |
| 175 xor rcx,rcx |
| 176 mov cl,bl |
| 177 |
| 178 $L$oop16_is_hot:: |
| 179 lea rsi,QWORD PTR[r10*4+rdi] |
| 180 add cl,al |
| 181 mov edx,DWORD PTR[rcx*4+rdi] |
| 182 pxor xmm0,xmm0 |
| 183 mov DWORD PTR[rcx*4+rdi],eax |
| 184 add al,dl |
| 185 mov ebx,DWORD PTR[4+rsi] |
| 186 movzx eax,al |
| 187 mov DWORD PTR[rsi],edx |
| 188 add cl,bl |
| 189 pinsrw xmm0,WORD PTR[rax*4+rdi],0 |
| 190 jmp $L$oop16_enter |
| 191 ALIGN 16 |
| 192 $L$oop16:: |
| 193 add cl,al |
| 194 mov edx,DWORD PTR[rcx*4+rdi] |
| 195 pxor xmm2,xmm0 |
| 196 psllq xmm1,8 |
| 197 pxor xmm0,xmm0 |
| 198 mov DWORD PTR[rcx*4+rdi],eax |
| 199 add al,dl |
| 200 mov ebx,DWORD PTR[4+rsi] |
| 201 movzx eax,al |
| 202 mov DWORD PTR[rsi],edx |
| 203 pxor xmm2,xmm1 |
| 204 add cl,bl |
| 205 pinsrw xmm0,WORD PTR[rax*4+rdi],0 |
| 206 movdqu XMMWORD PTR[r13*1+r12],xmm2 |
| 207 lea r12,QWORD PTR[16+r12] |
| 208 $L$oop16_enter:: |
| 209 mov edx,DWORD PTR[rcx*4+rdi] |
| 210 pxor xmm1,xmm1 |
| 211 mov DWORD PTR[rcx*4+rdi],ebx |
| 212 add bl,dl |
| 213 mov eax,DWORD PTR[8+rsi] |
| 214 movzx ebx,bl |
| 215 mov DWORD PTR[4+rsi],edx |
| 216 add cl,al |
| 217 pinsrw xmm1,WORD PTR[rbx*4+rdi],0 |
| 218 mov edx,DWORD PTR[rcx*4+rdi] |
| 219 mov DWORD PTR[rcx*4+rdi],eax |
| 220 add al,dl |
| 221 mov ebx,DWORD PTR[12+rsi] |
| 222 movzx eax,al |
| 223 mov DWORD PTR[8+rsi],edx |
| 224 add cl,bl |
| 225 pinsrw xmm0,WORD PTR[rax*4+rdi],1 |
| 226 mov edx,DWORD PTR[rcx*4+rdi] |
| 227 mov DWORD PTR[rcx*4+rdi],ebx |
| 228 add bl,dl |
| 229 mov eax,DWORD PTR[16+rsi] |
| 230 movzx ebx,bl |
| 231 mov DWORD PTR[12+rsi],edx |
| 232 add cl,al |
| 233 pinsrw xmm1,WORD PTR[rbx*4+rdi],1 |
| 234 mov edx,DWORD PTR[rcx*4+rdi] |
| 235 mov DWORD PTR[rcx*4+rdi],eax |
| 236 add al,dl |
| 237 mov ebx,DWORD PTR[20+rsi] |
| 238 movzx eax,al |
| 239 mov DWORD PTR[16+rsi],edx |
| 240 add cl,bl |
| 241 pinsrw xmm0,WORD PTR[rax*4+rdi],2 |
| 242 mov edx,DWORD PTR[rcx*4+rdi] |
| 243 mov DWORD PTR[rcx*4+rdi],ebx |
| 244 add bl,dl |
| 245 mov eax,DWORD PTR[24+rsi] |
| 246 movzx ebx,bl |
| 247 mov DWORD PTR[20+rsi],edx |
| 248 add cl,al |
| 249 pinsrw xmm1,WORD PTR[rbx*4+rdi],2 |
| 250 mov edx,DWORD PTR[rcx*4+rdi] |
| 251 mov DWORD PTR[rcx*4+rdi],eax |
| 252 add al,dl |
| 253 mov ebx,DWORD PTR[28+rsi] |
| 254 movzx eax,al |
| 255 mov DWORD PTR[24+rsi],edx |
| 256 add cl,bl |
| 257 pinsrw xmm0,WORD PTR[rax*4+rdi],3 |
| 258 mov edx,DWORD PTR[rcx*4+rdi] |
| 259 mov DWORD PTR[rcx*4+rdi],ebx |
| 260 add bl,dl |
| 261 mov eax,DWORD PTR[32+rsi] |
| 262 movzx ebx,bl |
| 263 mov DWORD PTR[28+rsi],edx |
| 264 add cl,al |
| 265 pinsrw xmm1,WORD PTR[rbx*4+rdi],3 |
| 266 mov edx,DWORD PTR[rcx*4+rdi] |
| 267 mov DWORD PTR[rcx*4+rdi],eax |
| 268 add al,dl |
| 269 mov ebx,DWORD PTR[36+rsi] |
| 270 movzx eax,al |
| 271 mov DWORD PTR[32+rsi],edx |
| 272 add cl,bl |
| 273 pinsrw xmm0,WORD PTR[rax*4+rdi],4 |
| 274 mov edx,DWORD PTR[rcx*4+rdi] |
| 275 mov DWORD PTR[rcx*4+rdi],ebx |
| 276 add bl,dl |
| 277 mov eax,DWORD PTR[40+rsi] |
| 278 movzx ebx,bl |
| 279 mov DWORD PTR[36+rsi],edx |
| 280 add cl,al |
| 281 pinsrw xmm1,WORD PTR[rbx*4+rdi],4 |
| 282 mov edx,DWORD PTR[rcx*4+rdi] |
| 283 mov DWORD PTR[rcx*4+rdi],eax |
| 284 add al,dl |
| 285 mov ebx,DWORD PTR[44+rsi] |
| 286 movzx eax,al |
| 287 mov DWORD PTR[40+rsi],edx |
| 288 add cl,bl |
| 289 pinsrw xmm0,WORD PTR[rax*4+rdi],5 |
| 290 mov edx,DWORD PTR[rcx*4+rdi] |
| 291 mov DWORD PTR[rcx*4+rdi],ebx |
| 292 add bl,dl |
| 293 mov eax,DWORD PTR[48+rsi] |
| 294 movzx ebx,bl |
| 295 mov DWORD PTR[44+rsi],edx |
| 296 add cl,al |
| 297 pinsrw xmm1,WORD PTR[rbx*4+rdi],5 |
| 298 mov edx,DWORD PTR[rcx*4+rdi] |
| 299 mov DWORD PTR[rcx*4+rdi],eax |
| 300 add al,dl |
| 301 mov ebx,DWORD PTR[52+rsi] |
| 302 movzx eax,al |
| 303 mov DWORD PTR[48+rsi],edx |
| 304 add cl,bl |
| 305 pinsrw xmm0,WORD PTR[rax*4+rdi],6 |
| 306 mov edx,DWORD PTR[rcx*4+rdi] |
| 307 mov DWORD PTR[rcx*4+rdi],ebx |
| 308 add bl,dl |
| 309 mov eax,DWORD PTR[56+rsi] |
| 310 movzx ebx,bl |
| 311 mov DWORD PTR[52+rsi],edx |
| 312 add cl,al |
| 313 pinsrw xmm1,WORD PTR[rbx*4+rdi],6 |
| 314 mov edx,DWORD PTR[rcx*4+rdi] |
| 315 mov DWORD PTR[rcx*4+rdi],eax |
| 316 add al,dl |
| 317 mov ebx,DWORD PTR[60+rsi] |
| 318 movzx eax,al |
| 319 mov DWORD PTR[56+rsi],edx |
| 320 add cl,bl |
| 321 pinsrw xmm0,WORD PTR[rax*4+rdi],7 |
| 322 add r10b,16 |
| 323 movdqu xmm2,XMMWORD PTR[r12] |
| 324 mov edx,DWORD PTR[rcx*4+rdi] |
| 325 mov DWORD PTR[rcx*4+rdi],ebx |
| 326 add bl,dl |
| 327 movzx ebx,bl |
| 328 mov DWORD PTR[60+rsi],edx |
| 329 lea rsi,QWORD PTR[r10*4+rdi] |
| 330 pinsrw xmm1,WORD PTR[rbx*4+rdi],7 |
| 331 mov eax,DWORD PTR[rsi] |
| 332 mov rbx,rcx |
| 333 xor rcx,rcx |
| 334 sub r11,16 |
| 335 mov cl,bl |
| 336 test r11,-16 |
| 337 jnz $L$oop16 |
| 338 |
| 339 psllq xmm1,8 |
| 340 pxor xmm2,xmm0 |
| 341 pxor xmm2,xmm1 |
| 342 movdqu XMMWORD PTR[r13*1+r12],xmm2 |
| 343 lea r12,QWORD PTR[16+r12] |
| 344 |
| 345 cmp r11,0 |
| 346 jne $L$loop1 |
| 347 jmp $L$exit |
| 348 |
| 349 ALIGN 16 |
| 350 $L$loop1:: |
| 351 add cl,al |
| 352 mov edx,DWORD PTR[rcx*4+rdi] |
| 353 mov DWORD PTR[rcx*4+rdi],eax |
| 354 mov DWORD PTR[r10*4+rdi],edx |
| 355 add al,dl |
| 356 inc r10b |
| 357 mov edx,DWORD PTR[rax*4+rdi] |
| 358 mov eax,DWORD PTR[r10*4+rdi] |
| 359 xor dl,BYTE PTR[r12] |
| 360 mov BYTE PTR[r13*1+r12],dl |
| 361 lea r12,QWORD PTR[1+r12] |
| 362 dec r11 |
| 363 jnz $L$loop1 |
| 364 jmp $L$exit |
| 365 |
| 366 ALIGN 16 |
| 367 $L$RC4_CHAR:: |
| 368 add r10b,1 |
| 369 movzx eax,BYTE PTR[r10*1+rdi] |
| 370 test r11,-8 |
| 371 jz $L$cloop1 |
| 372 jmp $L$cloop8 |
| 373 ALIGN 16 |
| 374 $L$cloop8:: |
| 375 mov r8d,DWORD PTR[r12] |
| 376 mov r9d,DWORD PTR[4+r12] |
| 377 add cl,al |
| 378 lea rsi,QWORD PTR[1+r10] |
| 379 movzx edx,BYTE PTR[rcx*1+rdi] |
| 380 movzx esi,sil |
| 381 movzx ebx,BYTE PTR[rsi*1+rdi] |
| 382 mov BYTE PTR[rcx*1+rdi],al |
| 383 cmp rcx,rsi |
| 384 mov BYTE PTR[r10*1+rdi],dl |
| 385 jne $L$cmov0 |
| 386 mov rbx,rax |
| 387 $L$cmov0:: |
| 388 add dl,al |
| 389 xor r8b,BYTE PTR[rdx*1+rdi] |
| 390 ror r8d,8 |
| 391 add cl,bl |
| 392 lea r10,QWORD PTR[1+rsi] |
| 393 movzx edx,BYTE PTR[rcx*1+rdi] |
| 394 movzx r10d,r10b |
| 395 movzx eax,BYTE PTR[r10*1+rdi] |
| 396 mov BYTE PTR[rcx*1+rdi],bl |
| 397 cmp rcx,r10 |
| 398 mov BYTE PTR[rsi*1+rdi],dl |
| 399 jne $L$cmov1 |
| 400 mov rax,rbx |
| 401 $L$cmov1:: |
| 402 add dl,bl |
| 403 xor r8b,BYTE PTR[rdx*1+rdi] |
| 404 ror r8d,8 |
| 405 add cl,al |
| 406 lea rsi,QWORD PTR[1+r10] |
| 407 movzx edx,BYTE PTR[rcx*1+rdi] |
| 408 movzx esi,sil |
| 409 movzx ebx,BYTE PTR[rsi*1+rdi] |
| 410 mov BYTE PTR[rcx*1+rdi],al |
| 411 cmp rcx,rsi |
| 412 mov BYTE PTR[r10*1+rdi],dl |
| 413 jne $L$cmov2 |
| 414 mov rbx,rax |
| 415 $L$cmov2:: |
| 416 add dl,al |
| 417 xor r8b,BYTE PTR[rdx*1+rdi] |
| 418 ror r8d,8 |
| 419 add cl,bl |
| 420 lea r10,QWORD PTR[1+rsi] |
| 421 movzx edx,BYTE PTR[rcx*1+rdi] |
| 422 movzx r10d,r10b |
| 423 movzx eax,BYTE PTR[r10*1+rdi] |
| 424 mov BYTE PTR[rcx*1+rdi],bl |
| 425 cmp rcx,r10 |
| 426 mov BYTE PTR[rsi*1+rdi],dl |
| 427 jne $L$cmov3 |
| 428 mov rax,rbx |
| 429 $L$cmov3:: |
| 430 add dl,bl |
| 431 xor r8b,BYTE PTR[rdx*1+rdi] |
| 432 ror r8d,8 |
| 433 add cl,al |
| 434 lea rsi,QWORD PTR[1+r10] |
| 435 movzx edx,BYTE PTR[rcx*1+rdi] |
| 436 movzx esi,sil |
| 437 movzx ebx,BYTE PTR[rsi*1+rdi] |
| 438 mov BYTE PTR[rcx*1+rdi],al |
| 439 cmp rcx,rsi |
| 440 mov BYTE PTR[r10*1+rdi],dl |
| 441 jne $L$cmov4 |
| 442 mov rbx,rax |
| 443 $L$cmov4:: |
| 444 add dl,al |
| 445 xor r9b,BYTE PTR[rdx*1+rdi] |
| 446 ror r9d,8 |
| 447 add cl,bl |
| 448 lea r10,QWORD PTR[1+rsi] |
| 449 movzx edx,BYTE PTR[rcx*1+rdi] |
| 450 movzx r10d,r10b |
| 451 movzx eax,BYTE PTR[r10*1+rdi] |
| 452 mov BYTE PTR[rcx*1+rdi],bl |
| 453 cmp rcx,r10 |
| 454 mov BYTE PTR[rsi*1+rdi],dl |
| 455 jne $L$cmov5 |
| 456 mov rax,rbx |
| 457 $L$cmov5:: |
| 458 add dl,bl |
| 459 xor r9b,BYTE PTR[rdx*1+rdi] |
| 460 ror r9d,8 |
| 461 add cl,al |
| 462 lea rsi,QWORD PTR[1+r10] |
| 463 movzx edx,BYTE PTR[rcx*1+rdi] |
| 464 movzx esi,sil |
| 465 movzx ebx,BYTE PTR[rsi*1+rdi] |
| 466 mov BYTE PTR[rcx*1+rdi],al |
| 467 cmp rcx,rsi |
| 468 mov BYTE PTR[r10*1+rdi],dl |
| 469 jne $L$cmov6 |
| 470 mov rbx,rax |
| 471 $L$cmov6:: |
| 472 add dl,al |
| 473 xor r9b,BYTE PTR[rdx*1+rdi] |
| 474 ror r9d,8 |
| 475 add cl,bl |
| 476 lea r10,QWORD PTR[1+rsi] |
| 477 movzx edx,BYTE PTR[rcx*1+rdi] |
| 478 movzx r10d,r10b |
| 479 movzx eax,BYTE PTR[r10*1+rdi] |
| 480 mov BYTE PTR[rcx*1+rdi],bl |
| 481 cmp rcx,r10 |
| 482 mov BYTE PTR[rsi*1+rdi],dl |
| 483 jne $L$cmov7 |
| 484 mov rax,rbx |
| 485 $L$cmov7:: |
| 486 add dl,bl |
| 487 xor r9b,BYTE PTR[rdx*1+rdi] |
| 488 ror r9d,8 |
| 489 lea r11,QWORD PTR[((-8))+r11] |
| 490 mov DWORD PTR[r13],r8d |
| 491 lea r12,QWORD PTR[8+r12] |
| 492 mov DWORD PTR[4+r13],r9d |
| 493 lea r13,QWORD PTR[8+r13] |
| 494 |
| 495 test r11,-8 |
| 496 jnz $L$cloop8 |
| 497 cmp r11,0 |
| 498 jne $L$cloop1 |
| 499 jmp $L$exit |
| 500 ALIGN 16 |
| 501 $L$cloop1:: |
| 502 add cl,al |
| 503 movzx ecx,cl |
| 504 movzx edx,BYTE PTR[rcx*1+rdi] |
| 505 mov BYTE PTR[rcx*1+rdi],al |
| 506 mov BYTE PTR[r10*1+rdi],dl |
| 507 add dl,al |
| 508 add r10b,1 |
| 509 movzx edx,dl |
| 510 movzx r10d,r10b |
| 511 movzx edx,BYTE PTR[rdx*1+rdi] |
| 512 movzx eax,BYTE PTR[r10*1+rdi] |
| 513 xor dl,BYTE PTR[r12] |
| 514 lea r12,QWORD PTR[1+r12] |
| 515 mov BYTE PTR[r13],dl |
| 516 lea r13,QWORD PTR[1+r13] |
| 517 sub r11,1 |
| 518 jnz $L$cloop1 |
| 519 jmp $L$exit |
| 520 |
| 521 ALIGN 16 |
| 522 $L$exit:: |
| 523 sub r10b,1 |
| 524 mov DWORD PTR[((-8))+rdi],r10d |
| 525 mov DWORD PTR[((-4))+rdi],ecx |
| 526 |
| 527 mov r13,QWORD PTR[rsp] |
| 528 mov r12,QWORD PTR[8+rsp] |
| 529 mov rbx,QWORD PTR[16+rsp] |
| 530 add rsp,24 |
| 531 $L$epilogue:: |
| 532 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue |
| 533 mov rsi,QWORD PTR[16+rsp] |
| 534 DB 0F3h,0C3h ;repret |
| 535 $L$SEH_end_RC4:: |
| 536 RC4 ENDP |
| 537 PUBLIC RC4_set_key |
| 538 |
| 539 ALIGN 16 |
| 540 RC4_set_key PROC PUBLIC |
| 541 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue |
| 542 mov QWORD PTR[16+rsp],rsi |
| 543 mov rax,rsp |
| 544 $L$SEH_begin_RC4_set_key:: |
| 545 mov rdi,rcx |
| 546 mov rsi,rdx |
| 547 mov rdx,r8 |
| 548 |
| 549 |
| 550 lea rdi,QWORD PTR[8+rdi] |
| 551 lea rdx,QWORD PTR[rsi*1+rdx] |
| 552 neg rsi |
| 553 mov rcx,rsi |
| 554 xor eax,eax |
| 555 xor r9,r9 |
| 556 xor r10,r10 |
| 557 xor r11,r11 |
| 558 |
| 559 lea r8,QWORD PTR[OPENSSL_ia32cap_P] |
| 560 mov r8d,DWORD PTR[r8] |
| 561 bt r8d,20 |
| 562 jc $L$c1stloop |
| 563 jmp $L$w1stloop |
| 564 |
| 565 ALIGN 16 |
| 566 $L$w1stloop:: |
| 567 mov DWORD PTR[rax*4+rdi],eax |
| 568 add al,1 |
| 569 jnc $L$w1stloop |
| 570 |
| 571 xor r9,r9 |
| 572 xor r8,r8 |
| 573 ALIGN 16 |
| 574 $L$w2ndloop:: |
| 575 mov r10d,DWORD PTR[r9*4+rdi] |
| 576 add r8b,BYTE PTR[rsi*1+rdx] |
| 577 add r8b,r10b |
| 578 add rsi,1 |
| 579 mov r11d,DWORD PTR[r8*4+rdi] |
| 580 cmovz rsi,rcx |
| 581 mov DWORD PTR[r8*4+rdi],r10d |
| 582 mov DWORD PTR[r9*4+rdi],r11d |
| 583 add r9b,1 |
| 584 jnc $L$w2ndloop |
| 585 jmp $L$exit_key |
| 586 |
| 587 ALIGN 16 |
| 588 $L$c1stloop:: |
| 589 mov BYTE PTR[rax*1+rdi],al |
| 590 add al,1 |
| 591 jnc $L$c1stloop |
| 592 |
| 593 xor r9,r9 |
| 594 xor r8,r8 |
| 595 ALIGN 16 |
| 596 $L$c2ndloop:: |
| 597 mov r10b,BYTE PTR[r9*1+rdi] |
| 598 add r8b,BYTE PTR[rsi*1+rdx] |
| 599 add r8b,r10b |
| 600 add rsi,1 |
| 601 mov r11b,BYTE PTR[r8*1+rdi] |
| 602 jnz $L$cnowrap |
| 603 mov rsi,rcx |
| 604 $L$cnowrap:: |
| 605 mov BYTE PTR[r8*1+rdi],r10b |
| 606 mov BYTE PTR[r9*1+rdi],r11b |
| 607 add r9b,1 |
| 608 jnc $L$c2ndloop |
| 609 mov DWORD PTR[256+rdi],-1 |
| 610 |
| 611 ALIGN 16 |
| 612 $L$exit_key:: |
| 613 xor eax,eax |
| 614 mov DWORD PTR[((-8))+rdi],eax |
| 615 mov DWORD PTR[((-4))+rdi],eax |
| 616 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue |
| 617 mov rsi,QWORD PTR[16+rsp] |
| 618 DB 0F3h,0C3h ;repret |
| 619 $L$SEH_end_RC4_set_key:: |
| 620 RC4_set_key ENDP |
| 621 |
| 622 PUBLIC RC4_options |
| 623 |
| 624 ALIGN 16 |
| 625 RC4_options PROC PUBLIC |
| 626 lea rax,QWORD PTR[$L$opts] |
| 627 mov rdx,QWORD PTR[OPENSSL_ia32cap_P] |
| 628 mov edx,DWORD PTR[rdx] |
| 629 bt edx,20 |
| 630 jc $L$8xchar |
| 631 bt edx,30 |
| 632 jnc $L$done |
| 633 add rax,25 |
| 634 DB 0F3h,0C3h ;repret |
| 635 $L$8xchar:: |
| 636 add rax,12 |
| 637 $L$done:: |
| 638 DB 0F3h,0C3h ;repret |
| 639 ALIGN 64 |
| 640 $L$opts:: |
| 641 DB 114,99,52,40,56,120,44,105,110,116,41,0 |
| 642 DB 114,99,52,40,56,120,44,99,104,97,114,41,0 |
| 643 DB 114,99,52,40,49,54,120,44,105,110,116,41,0 |
| 644 DB 82,67,52,32,102,111,114,32,120,56,54,95,54,52,44,32 |
| 645 DB 67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97 |
| 646 DB 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103 |
| 647 DB 62,0 |
| 648 ALIGN 64 |
| 649 RC4_options ENDP |
| 650 EXTERN __imp_RtlVirtualUnwind:NEAR |
| 651 |
| 652 ALIGN 16 |
| 653 stream_se_handler PROC PRIVATE |
| 654 push rsi |
| 655 push rdi |
| 656 push rbx |
| 657 push rbp |
| 658 push r12 |
| 659 push r13 |
| 660 push r14 |
| 661 push r15 |
| 662 pushfq |
| 663 sub rsp,64 |
| 664 |
| 665 mov rax,QWORD PTR[120+r8] |
| 666 mov rbx,QWORD PTR[248+r8] |
| 667 |
| 668 lea r10,QWORD PTR[$L$prologue] |
| 669 cmp rbx,r10 |
| 670 jb $L$in_prologue |
| 671 |
| 672 mov rax,QWORD PTR[152+r8] |
| 673 |
| 674 lea r10,QWORD PTR[$L$epilogue] |
| 675 cmp rbx,r10 |
| 676 jae $L$in_prologue |
| 677 |
| 678 lea rax,QWORD PTR[24+rax] |
| 679 |
| 680 mov rbx,QWORD PTR[((-8))+rax] |
| 681 mov r12,QWORD PTR[((-16))+rax] |
| 682 mov r13,QWORD PTR[((-24))+rax] |
| 683 mov QWORD PTR[144+r8],rbx |
| 684 mov QWORD PTR[216+r8],r12 |
| 685 mov QWORD PTR[224+r8],r13 |
| 686 |
| 687 $L$in_prologue:: |
| 688 mov rdi,QWORD PTR[8+rax] |
| 689 mov rsi,QWORD PTR[16+rax] |
| 690 mov QWORD PTR[152+r8],rax |
| 691 mov QWORD PTR[168+r8],rsi |
| 692 mov QWORD PTR[176+r8],rdi |
| 693 |
| 694 jmp $L$common_seh_exit |
| 695 stream_se_handler ENDP |
| 696 |
| 697 |
| 698 ALIGN 16 |
| 699 key_se_handler PROC PRIVATE |
| 700 push rsi |
| 701 push rdi |
| 702 push rbx |
| 703 push rbp |
| 704 push r12 |
| 705 push r13 |
| 706 push r14 |
| 707 push r15 |
| 708 pushfq |
| 709 sub rsp,64 |
| 710 |
| 711 mov rax,QWORD PTR[152+r8] |
| 712 mov rdi,QWORD PTR[8+rax] |
| 713 mov rsi,QWORD PTR[16+rax] |
| 714 mov QWORD PTR[168+r8],rsi |
| 715 mov QWORD PTR[176+r8],rdi |
| 716 |
| 717 $L$common_seh_exit:: |
| 718 |
| 719 mov rdi,QWORD PTR[40+r9] |
| 720 mov rsi,r8 |
| 721 mov ecx,154 |
| 722 DD 0a548f3fch |
| 723 |
| 724 mov rsi,r9 |
| 725 xor rcx,rcx |
| 726 mov rdx,QWORD PTR[8+rsi] |
| 727 mov r8,QWORD PTR[rsi] |
| 728 mov r9,QWORD PTR[16+rsi] |
| 729 mov r10,QWORD PTR[40+rsi] |
| 730 lea r11,QWORD PTR[56+rsi] |
| 731 lea r12,QWORD PTR[24+rsi] |
| 732 mov QWORD PTR[32+rsp],r10 |
| 733 mov QWORD PTR[40+rsp],r11 |
| 734 mov QWORD PTR[48+rsp],r12 |
| 735 mov QWORD PTR[56+rsp],rcx |
| 736 call QWORD PTR[__imp_RtlVirtualUnwind] |
| 737 |
| 738 mov eax,1 |
| 739 add rsp,64 |
| 740 popfq |
| 741 pop r15 |
| 742 pop r14 |
| 743 pop r13 |
| 744 pop r12 |
| 745 pop rbp |
| 746 pop rbx |
| 747 pop rdi |
| 748 pop rsi |
| 749 DB 0F3h,0C3h ;repret |
| 750 key_se_handler ENDP |
| 751 |
| 752 .text$ ENDS |
| 753 .pdata SEGMENT READONLY ALIGN(4) |
| 754 ALIGN 4 |
| 755 DD imagerel $L$SEH_begin_RC4 |
| 756 DD imagerel $L$SEH_end_RC4 |
| 757 DD imagerel $L$SEH_info_RC4 |
| 758 |
| 759 DD imagerel $L$SEH_begin_RC4_set_key |
| 760 DD imagerel $L$SEH_end_RC4_set_key |
| 761 DD imagerel $L$SEH_info_RC4_set_key |
| 762 |
| 763 .pdata ENDS |
| 764 .xdata SEGMENT READONLY ALIGN(8) |
| 765 ALIGN 8 |
| 766 $L$SEH_info_RC4:: |
| 767 DB 9,0,0,0 |
| 768 DD imagerel stream_se_handler |
| 769 $L$SEH_info_RC4_set_key:: |
| 770 DB 9,0,0,0 |
| 771 DD imagerel key_se_handler |
| 772 |
| 773 .xdata ENDS |
| 774 END |
OLD | NEW |