能力值:
( LV12,RANK:222 )
|
-
-
2 楼
unsigned long __fastcall base64_encode(char *p_encode, const char *p_src, unsigned long ul_src_len)
{
static char base64_alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
__asm{
mov esi, edx
mov edi, ecx
push edi
mov ecx, ul_src_len
mov ebx, offset base64_alphabet;
aa10:
cmp ecx, 4
jb aa11
sub ecx, 3
lodsd
dec esi
bswap eax
rol eax, 6
and al, 63
xlat
stosb
rol eax, 6
and al, 63
xlat
stosb
rol eax, 6
and al, 63
xlat
stosb
rol eax, 6
and al, 63
xlat
stosb
jmp aa10
aa11:
mov edx, ecx
aa20:
dec ecx
jl aa21
lodsb
shl eax, 8
jmp aa20
aa21:
mov ecx, edx
sub ecx, 3
neg ecx
mov edx, ecx
aa30:
dec ecx
jl aa31
shl eax, 8
jmp aa30
aa31:
rol eax, 6
and al, 63
xlat
stosb
rol eax, 6
and al, 63
xlat
stosb
rol eax, 6
and al, 63
xlat
stosb
rol eax, 6
and al, 63
xlat
stosb
sub edi, edx
mov al, '='
mov ecx, edx
repne stosb
mov al, 0
stosb
pop eax
sub eax, edi
neg eax
dec eax
}
}
unsigned long __fastcall base64_decode(char *p_decode, const char *p_src, unsigned long ul_src_len)
{
__asm{
mov esi, edx
mov edi, ecx
mov ebx, ecx
mov ecx, ul_src_len
shr ecx, 2
aa10:
dec ecx
jl aa18
xor edx, edx
lodsd
aa11:
// A..Z
cmp al, 'A'
jb aa13 // 0..9 , + , /
cmp al, 'Z'
jg aa12 // a..z
sub al, 'A'
jmp aa17 // success
aa12: // a..z
cmp al, 'a'
jb aa16 // error: bad symbol
cmp al, 'z'
jg aa16 // error: bad symbol
sub al, 'a' - 'Z' + 'A' - 1
jmp aa17 // success
aa13: // 0..9
cmp al, '0'
jb aa14 // + , /
cmp al, '9'
jg aa16 // error: bad symbol
sub al, '0' - 'Z' + 'A' - 'z' + 'a' - 2;
jmp aa17 // success
aa14: // + , /
cmp al, '+'
jnz aa15 // /
mov al, 62
jmp aa17 // success
aa15:
cmp al, '/'
jnz aa16 // error: bad symbol
mov al, 63
jmp aa17 // success
aa16:
xor ecx, ecx
aa20:
dec ecx
shl edx, 6
shr eax, 8
jnz aa20
shl edx, 2
mov eax, edx
bswap eax
stosd
sub ebx, edi
neg ebx
lea ebx, [ebx + ecx - 1]
jmp aa19
aa17: // symbol was decoding
or dl, al
shl edx, 6
shr eax, 8
jnz aa11
shl edx, 2
bswap edx
mov eax, edx
stosd
dec edi
jmp aa10
aa18:
sub ebx, edi
neg ebx
aa19:
mov eax, ebx
}
}
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
32... 不是64的,
|
能力值:
( LV3,RANK:30 )
|
-
-
4 楼
www.luocong.com
稍微改一下就是32了
|