Function at 0x40d020
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x5d6b10]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
push edi
mov edi, dword [ebp + 0xc]
mov esi, dword [eax]
mov dword [ebp - 0x2c], eax
cmp esi, 0x100
jge 0x40d057
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005463d8
mov esp, ebp
pop ebp
ret
lea eax, [esi + esi]
push ebx
push eax
call fcn.00549811
mov ebx, eax
add esp, 4
mov dword [ebp - 0x24], ebx
test ebx, ebx
je 0x40d4e2
push esi
push edi
push ebx
call fcn.00547f80
mov edi, dword [ebp - 0x2c]
add esp, 0xc
xor edx, edx
mov ecx, ebx
mov esi, dword [edi]
dec esi
test esi, esi
jle 0x40d09f
lea ebx, [ebx]
mov al, byte [ebx + edx + 1]
lea ecx, [ecx + 1]
xor byte [ecx - 1], al
inc edx
cmp edx, esi
jl 0x40d090
mov esi, dword [edi]
mov edx, ebx
test esi, esi
jle 0x40d0cb
movzx ecx, byte [edx]
lea edx, [edx + 1]
mov eax, ecx
and ecx, 0xf
shr eax, 4
movzx eax, byte [eax + 0x5d05b8]
shl al, 4
or al, byte [ecx + 0x5d05b8]
mov byte [edx - 1], al
dec esi
jne 0x40d0a7
mov ebx, dword [edi]
push ebx
mov dword [ebp - 8], ebx
call fcn.00549811
add esp, 4
mov dword [ebp - 0x28], eax
test eax, eax
je 0x40d4e2
mov eax, ebx
mov esi, dword [ebp - 0x24]
cdq
xor edi, edi
and edx, 0x1f
add eax, edx
sar eax, 5
cdq
and edx, 7
lea ecx, [edx + eax]
xor edx, edx
sar ecx, 3
mov eax, ebx
div ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x40d1d4
lea ecx, [edi + 1]
mov eax, ecx
mov dword [ebp - 0x14], ecx
cdq
idiv dword [ebp + 0x14]
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x10]
movzx ebx, byte [edx + eax]
mov eax, edi
cdq
idiv dword [ebp + 0x14]
movzx eax, byte [edx + ecx]
xor ecx, ecx
imul ebx, eax
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp + 0x14]
cmovge eax, ecx
mov edi, ebx
mov dword [ebp - 0x18], ebx
shr edi, 3
mov dword [ebp - 0x20], eax
test edi, edi
je 0x40d182
mov eax, dword [ebp - 0x10]
lea ecx, [esi + 1]
dec eax
mov dword [ebp - 0x14], eax
lea esp, [esp]
mov bl, byte [esi]
push eax
push ecx
push esi
call fcn.005485d0
mov edx, dword [ebp - 0x10]
lea ecx, [esi + 1]
mov eax, dword [ebp - 0x14]
add esp, 0xc
mov byte [edx + esi - 1], bl
dec edi
jne 0x40d160
mov ebx, dword [ebp - 0x18]
jmp 0x40d185
mov edx, dword [ebp - 0x10]
and ebx, 7
jbe 0x40d1c2
dec edx
mov dword [ebp - 0x14], edx
mov edi, edi
mov al, byte [esi]
mov ecx, esi
movzx edi, al
add al, al
shr edi, 7
mov byte [esi], al
test edx, edx
je 0x40d1b8
mov al, byte [ecx + 1]
inc ecx
test al, al
jns 0x40d1ae
or byte [ecx - 1], 1
add al, al
mov byte [ecx], al
dec edx
jne 0x40d1a2
mov edx, dword [ebp - 0x14]
test edi, edi
je 0x40d1bf
or byte [ecx], 1
dec ebx
jne 0x40d190
add esi, dword [ebp - 0x10]
dec dword [ebp - 0x1c]
mov edi, dword [ebp - 0x20]
jne 0x40d112
mov ebx, dword [ebp - 8]
mov edi, dword [ebp - 0x10]
mov eax, ebx
cdq
idiv edi
mov esi, dword [ebp - 0x24]
mov ecx, eax
xor eax, eax
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], eax
test ecx, ecx
jle 0x40d295
mov edx, eax
imul edx, eax
mov edi, edx
mov dword [ebp - 0x18], edx
shr edi, 3
test edi, edi
je 0x40d236
mov eax, dword [ebp - 0x10]
lea ecx, [esi + 1]
dec eax
mov dword [ebp - 0x20], eax
lea esp, [esp]
mov bl, byte [esi]
push eax
push ecx
push esi
call fcn.005485d0
mov eax, dword [ebp - 0x10]
lea ecx, [esi + 1]
add esp, 0xc
mov byte [eax + esi - 1], bl
mov eax, dword [ebp - 0x20]
dec edi
jne 0x40d210
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x14]
and edx, 7
mov dword [ebp - 0x18], edx
jbe 0x40d281
mov eax, dword [ebp - 0x10]
lea ebx, [eax - 1]
mov al, byte [esi]
mov ecx, esi
movzx edi, al
add al, al
shr edi, 7
mov byte [esi], al
test ebx, ebx
je 0x40d26e
mov edx, ebx
mov al, byte [ecx + 1]
inc ecx
test al, al
jns 0x40d264
or byte [ecx - 1], 1
add al, al
mov byte [ecx], al
dec edx
jne 0x40d258
mov edx, dword [ebp - 0x18]
test edi, edi
je 0x40d275
or byte [ecx], 1
dec edx
mov dword [ebp - 0x18], edx
jne 0x40d244
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x10]
inc eax
add esi, edi
mov dword [ebp - 0x1c], eax
cmp eax, ecx
jl 0x40d1f1
mov ebx, dword [ebp - 8]
mov eax, ebx
mov esi, dword [ebp - 0x24]
cdq
idiv edi
mov ecx, eax
xor eax, eax
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], eax
test ecx, ecx
jle 0x40d355
nop
mov edx, eax
imul edx, eax
mov edi, edx
mov dword [ebp - 0x18], edx
shr edi, 3
test edi, edi
je 0x40d2f6
mov eax, dword [ebp - 0x10]
lea ecx, [esi + 1]
dec eax
mov dword [ebp - 0x20], eax
jmp 0x40d2d0
mov bl, byte [esi]
push eax
push ecx
push esi
call fcn.005485d0
mov eax, dword [ebp - 0x10]
lea ecx, [esi + 1]
add esp, 0xc
mov byte [eax + esi - 1], bl
mov eax, dword [ebp - 0x20]
dec edi
jne 0x40d2d0
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x14]
and edx, 7
mov dword [ebp - 0x18], edx
jbe 0x40d341
mov eax, dword [ebp - 0x10]
lea ebx, [eax - 1]
mov al, byte [esi]
mov ecx, esi
movzx edi, al
add al, al
shr edi, 7
mov byte [esi], al
test ebx, ebx
je 0x40d32e
mov edx, ebx
mov al, byte [ecx + 1]
inc ecx
test al, al
jns 0x40d324
or byte [ecx - 1], 1
add al, al
mov byte [ecx], al
dec edx
jne 0x40d318
mov edx, dword [ebp - 0x18]
test edi, edi
je 0x40d335
or byte [ecx], 1
dec edx
mov dword [ebp - 0x18], edx
jne 0x40d304
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x10]
inc eax
add esi, edi
mov dword [ebp - 0x1c], eax
cmp eax, ecx
jl 0x40d2b0
mov ebx, dword [ebp - 8]
push ebx
mov ebx, dword [ebp - 0x28]
push 0
push ebx
mov dword [ebp - 0xc], 0x8040201
mov dword [ebp - 8], 0x80402010
call fcn.00546e30
mov esi, dword [ebp - 0x24]
add esp, 0xc
xor eax, eax
mov dword [ebp - 0x14], eax
lea ebx, [ebx]
add eax, ebx
xor ebx, ebx
mov dword [ebp - 0x20], eax
test edi, edi
jle 0x40d408
jmp 0x40d390
mov dl, byte [esi]
inc esi
test dl, 1
je 0x40d39e
mov cl, byte [ebp + ebx - 0xc]
or byte [eax], cl
test dl, 2
je 0x40d3aa
mov cl, byte [ebp + ebx - 0xc]
or byte [eax + 0x20], cl
test dl, 4
je 0x40d3b6
mov cl, byte [ebp + ebx - 0xc]
or byte [eax + 0x40], cl
test dl, 8
je 0x40d3c2
mov cl, byte [ebp + ebx - 0xc]
or byte [eax + 0x60], cl
test dl, 0x10
je 0x40d3d1
mov cl, byte [ebp + ebx - 0xc]
or byte [eax + 0x80], cl
test dl, 0x20
je 0x40d3e0
mov cl, byte [ebp + ebx - 0xc]
or byte [eax + 0xa0], cl
test dl, 0x40
je 0x40d3ef
mov cl, byte [ebp + ebx - 0xc]
or byte [eax + 0xc0], cl
test dl, dl
jns 0x40d3fd
mov cl, byte [ebp + ebx - 0xc]
or byte [eax + 0xe0], cl
add eax, 0x100
dec edi
jne 0x40d390
mov edi, dword [ebp - 0x10]
mov eax, dword [ebp - 0x20]
inc ebx
cmp ebx, 8
jl 0x40d387
mov eax, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x28]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, 0x20
jl 0x40d380
mov ecx, dword [ebp - 0x2c]
mov edi, ebx
mov edx, edi
mov esi, dword [ecx]
test esi, esi
jle 0x40d45c
movzx ecx, byte [edx]
lea edx, [edx + 1]
mov eax, ecx
and ecx, 0xf
shr eax, 4
movzx eax, byte [eax + 0x5d05b8]
shl al, 4
or al, byte [ecx + 0x5d05b8]
mov byte [edx - 1], al
dec esi
jne 0x40d435
mov ecx, dword [ebp - 0x2c]
mov eax, 0x5458
cmp word [edi], ax
jne 0x40d4d1
mov eax, dword [edi + 2]
lea ebx, [edi + 2]
cmp eax, dword [ecx]
jae 0x40d4d1
mov edi, dword [ebp - 0x2c]
xor edx, edx
mov dword [ecx], eax
xor esi, esi
lea eax, [ebx + 8]
mov ecx, eax
mov edi, dword [edi]
test edi, edi
je 0x40d495
movsx ax, byte [ecx]
lea ecx, [ecx + 1]
add esi, eax
sub edx, eax
dec edi
jne 0x40d484
lea eax, [ebx + 8]
cmp word [ebx + 4], si
jne 0x40d4ce
cmp word [ebx + 6], dx
jne 0x40d4ce
mov ecx, dword [ebp - 0x2c]
mov ebx, dword [ebp - 0x24]
push dword [ecx]
push eax
push ebx
call fcn.00547f80
push dword [ebp - 0x28]
call fcn.005497d9
add esp, 0x10
mov eax, ebx
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005463d8
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x28]
push edi
call fcn.005497d9
push dword [ebp - 0x24]
call fcn.005497d9
add esp, 8
mov ecx, dword [ebp - 4]
xor eax, eax
pop ebx
pop edi
xor ecx, ebp
pop esi
call fcn.005463d8
mov esp, ebp
pop ebp
ret