Function at 0x403e90
Capabilities:
Encode data using xor

Disassembly:
push 0xffffffffffffffff
push 0x406049
mov eax, dword fs:[0]
push eax
sub esp, 0x2c
push ebx
push ebp
push esi
push edi
mov eax, dword [0x409020]
xor eax, esp
push eax
lea eax, [esp + 0x40]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x54]
cmp ebp, 6
jb case.0x40401e.7
mov edi, dword [esp + 0x58]
cmp byte [edi], 0x51
jne case.0x40401e.7
cmp byte [edi + 1], 0x44
jne case.0x40401e.7
movzx ebx, word [edi + 4]
mov esi, dword [esp + 0x50]
add edi, 4
add edi, 2
sub ebp, 6
call fcn.004040f0
movzx eax, bx
test eax, eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x20], eax
jle 0x404089
cmp ebp, 7
jb case.0x40401e.7
mov al, byte [edi]
add edi, 1
mov byte [esp + 0x54], al
movzx eax, word [edi]
movzx esi, ax
mov ecx, ebp
sub ebp, 3
lea edx, [esi + 4]
add edi, 2
cmp ebp, edx
jl case.0x40401e.7
mov edx, dword [esi + edi]
lea edx, [esi + edx + 7]
cmp edx, ecx
ja case.0x40401e.7
mov cl, ah
xor cl, al
xor eax, eax
test esi, esi
jbe 0x403f61
lea esp, [esp]
mov dl, byte [eax + edi]
not dl
xor dl, cl
mov byte [eax + edi], dl
add eax, 1
cmp eax, esi
jb 0x403f50
push esi
push edi
call fcn.00402690
mov ecx, eax
push edi
mov eax, esi
call fcn.00402970
mov ebx, dword [edi + esi]
mov dword [esp + 0x20], eax
add edi, esi
mov eax, 0xfffffffc
sub eax, esi
add ebp, eax
add esp, 4
add edi, 4
cmp ebp, ebx
jb case.0x40401e.7
mov cl, byte [esp + 0x54]
xor eax, eax
cmp cl, 7
mov edx, edi
mov dword [esp + 0x14], edx
mov dword [esp + 0x58], eax
je 0x403fac
cmp cl, 6
jne 0x40400b
mov al, bh
xor al, bl
xor esi, esi
test ebx, ebx
jbe 0x403fc7
mov cl, byte [esi + edi]
not cl
xor cl, al
mov byte [esi + edi], cl
add esi, 1
cmp esi, ebx
jb 0x403fb6
push ebx
push edi
lea ecx, [esp + 0x2c]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const___unsigned_int_]
push eax
lea esi, [esp + 0x5c]
mov dword [esp + 0x4c], 0
call fcn.00402b00
mov ecx, eax
call dword [sym.imp.MSVCP80.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
lea ecx, [esp + 0x24]
mov dword [esp + 0x48], 0xffffffff
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov eax, dword [esp + 0x58]
mov cl, byte [esp + 0x54]
mov edx, dword [esp + 0x14]
movzx ecx, cl
add ecx, 0xffffffff
add edi, ebx
sub ebp, ebx
cmp ecx, 9
ja case.0x40401e.7
jmp dword [ecx*4 + 0x4040c8]
mov eax, dword [edx]
jmp case.0x40401e.5
movzx eax, byte [edx]
jmp case.0x40401e.5
movzx eax, word [edx]
jmp case.0x40401e.5
push 0x18
call fcn.0040556c
add esp, 4
test eax, eax
je 0x40404a
call fcn.00402bd0
mov esi, eax
jmp 0x40404c
xor esi, esi
mov edx, dword [esp + 0x14]
push edx
push ebx
push esi
call fcn.00403e90
mov ebx, eax
test ebx, ebx
jne 0x404094
mov eax, esi
mov ecx, dword [esp + 0x1c]
push eax
mov eax, dword [esp + 0x58]
push eax
mov eax, dword [esp + 0x58]
push ecx
call fcn.00403450
mov eax, dword [esp + 0x18]
add eax, 1
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x18], eax
jl 0x403f08
mov eax, ebp
neg eax
sbb eax, eax
and eax, 4
jmp 0x4040af
test esi, esi
je 0x4040a6
mov edx, dword [esi]
mov eax, dword [edx + 0x80]
push 1
mov ecx, esi
call eax
mov eax, ebx
jmp 0x4040af
mov eax, 4
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret 0xc