Skip to content

Commit 46a5c4f

Browse files
committed
Improve RC4 shellcode
ESI is not clobbered; no need to clear EDX as only DL is filled before and it is overwritten before use. Shellcodes in ruby modules not regenerated, but I guess you want to regenerate them again anyway :-)
1 parent 269e507 commit 46a5c4f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

external/source/shellcode/windows/x86/src/block/block_rc4.asm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
; EDI - pointer to 0x100 bytes scratch space for S-box
1111
; Direction flag has to be cleared
1212
; Output: None. Data is decoded in place.
13-
; Clobbers: EAX, EBX, ECX, EDX, ESI, EBP (stack is not used)
13+
; Clobbers: EAX, EBX, ECX, EDX, EBP (stack is not used)
1414

1515
; Initialize S-box
1616
xor eax, eax ; Start with 0
@@ -35,8 +35,7 @@ permute:
3535
3636
3737
; decryption loop
38-
xor ebx, ebx ; Clear EBX and EDX (EAX is already cleared)
39-
xor edx, edx
38+
xor ebx, ebx ; Clear EBX (EAX is already cleared)
4039
decrypt:
4140
inc al ; AL += 1
4241
add bl, [edi+eax] ; BL += S[AL]

0 commit comments

Comments
 (0)