Skip to content

Instantly share code, notes, and snippets.

@gmbeard
Created November 8, 2017 09:21
Show Gist options
  • Save gmbeard/b0de6903bb6f5dd6c34c4d7b8fb8a9e7 to your computer and use it in GitHub Desktop.
Save gmbeard/b0de6903bb6f5dd6c34c4d7b8fb8a9e7 to your computer and use it in GitHub Desktop.
.text
.def _ZN50_$LT$asm_bug..Rot13$u20$as$u20$asm_bug..Crypto$GT$7encrypt17hbaabafb2f8efe03fE;
.scl 2;
.type 32;
.endef
.section .text,"xr",one_only,_ZN50_$LT$asm_bug..Rot13$u20$as$u20$asm_bug..Crypto$GT$7encrypt17hbaabafb2f8efe03fE
.globl _ZN50_$LT$asm_bug..Rot13$u20$as$u20$asm_bug..Crypto$GT$7encrypt17hbaabafb2f8efe03fE
.p2align 4, 0x90
_ZN50_$LT$asm_bug..Rot13$u20$as$u20$asm_bug..Crypto$GT$7encrypt17hbaabafb2f8efe03fE:
movq 16(%rcx), %r11
testq %r11, %r11
je .LBB0_8
movq (%rcx), %rcx
movb $26, %r8b
.p2align 4, 0x90
.LBB0_2:
movzbl (%rcx), %edx
movl %edx, %eax
addb $-65, %al
cmpb $26, %al
jae .LBB0_4
movb $65, %r9b
movb $-52, %r10b
jmp .LBB0_6
.p2align 4, 0x90
.LBB0_4:
movl %edx, %eax
addb $-97, %al
cmpb $25, %al
ja .LBB0_7
movb $97, %r9b
movb $-84, %r10b
.LBB0_6:
addb %r10b, %dl
movzbl %dl, %edx
imull $79, %edx, %eax
andl $30720, %eax
shrl $11, %eax
mulb %r8b
subb %al, %dl
addb %r9b, %dl
movb %dl, (%rcx)
.LBB0_7:
incq %rcx
decq %r11
jne .LBB0_2
.LBB0_8:
xorl %eax, %eax
retq
.def _ZN58_$LT$asm_bug..Rot13$u20$as$u20$core..ops..deref..Deref$GT$5deref17h1695a17e29e80338E;
.scl 2;
.type 32;
.endef
.section .text,"xr",one_only,_ZN58_$LT$asm_bug..Rot13$u20$as$u20$core..ops..deref..Deref$GT$5deref17h1695a17e29e80338E
.globl _ZN58_$LT$asm_bug..Rot13$u20$as$u20$core..ops..deref..Deref$GT$5deref17h1695a17e29e80338E
.p2align 4, 0x90
_ZN58_$LT$asm_bug..Rot13$u20$as$u20$core..ops..deref..Deref$GT$5deref17h1695a17e29e80338E:
movq (%rcx), %rax
movq 16(%rcx), %rdx
retq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment