-
-
Save Maroc-OS/cdab9c863564919b169d to your computer and use it in GitHub Desktop.
Revisions
-
iamgreaser created this gist
Aug 31, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ /* void rc4_apply(char *stream, int len, char *rc4buf); */ rc4_apply: push {r4, r5, r6, lr} mov r3, #0 mov r4, #0 lp_rc4: add r3, r3, #1 and r3, r3, #0xFF ldrb r5, [r2, r3] add r4, r4, r5 and r4, r4, #0xFF ldrb r6, [r2, r4] strb r6, [r2, r3] strb r5, [r2, r4] add r5, r5, r6 and r5, r5, #0xFF ldrb r6, [r0, r5] eor r6, r6, r5 strb r6, [r0], #1 subs r1, r1, #1 bne lp_rc4 pop {r4, r5, r6, pc} This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ /* void rc4_apply(char *stream, int len, char *rc4buf); */ rc4_apply: push esi push edi push ebx mov edi, [esp + 0x04] mov ecx, [esp + 0x08] mov esi, [esp + 0x0C] xor eax, eax xor edx, edx lp_rc4: inc al mov bl, [esi+eax] add dl, bl mov bh, bl xchg [esi+eax], bl mov [esi+edx], bl add bh, bl xor [edi], bh inc edi loop lp_rc4 pop ebx pop edi pop esi ret