Function at 0x409d20
Capabilities:
Encode data using xor
Encrypt data using aes
Encrypt data using rc4 ksa
Reference aes constants

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
mov edx, dword [esp + 0x10]
push 0x4494ea
push eax
mov dword fs:[0], esp
sub esp, 0xa4
test edx, edx
push ebx
mov ebx, dword [esp + 0xbc]
push ebp
push esi
push edi
mov ebp, ecx
jle 0x409d66
mov ecx, edx
mov eax, ecx
shr ecx, 2
mov esi, ebx
lea edi, [esp + 0x6c]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0xc4]
mov esi, 5
cmp eax, esi
jl 0x409d93
xor eax, eax
test edx, edx
jle 0x409d93
lea esp, [esp]
mov cl, byte [esp + eax + 0x6c]
xor cl, 0x21
add cl, 0x31
mov byte [esp + eax + 0x6c], cl
inc eax
cmp eax, edx
jl 0x409d80
test ebx, ebx
jne 0x409dec
mov edx, dword [str.FileCrypt_ERROR:_No_Key_DataSpecified_]
push edx
lea ecx, [esp + 0x50]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov esi, eax
lea ecx, [esp + 0x24]
mov dword [esp + 0xbc], ebx
call dword [sym.imp.MSVCR71.dll_public:_void___thiscall_exception::constructor_void_]
push esi
lea ecx, [esp + 0x34]
mov byte [esp + 0xc0], 1
mov dword [esp + 0x28], 0x455de8
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
push 0x47326c
lea eax, [esp + 0x28]
push eax
mov byte [esp + 0xc4], bl
call sub.MSVCR71.dll__CxxThrowException
cmp edx, 1
jge 0x409e4b
mov ecx, dword [str.FileCrypt_ERROR:_Key_Data_Length_should_be___0_]
push ecx
lea ecx, [esp + 0x50]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov esi, eax
lea ecx, [esp + 0x24]
mov dword [esp + 0xbc], 2
call dword [sym.imp.MSVCR71.dll_public:_void___thiscall_exception::constructor_void_]
push esi
lea ecx, [esp + 0x34]
mov byte [esp + 0xc0], 3
mov dword [esp + 0x28], 0x455de8
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
push 0x47326c
lea edx, [esp + 0x28]
push edx
mov byte [esp + 0xc4], 2
call sub.MSVCR71.dll__CxxThrowException
mov ebx, dword [esp + 0xd4]
cmp ebx, 0x10
je 0x409e94
cmp ebx, 0x18
je 0x409e94
cmp ebx, 0x20
je 0x409e94
push str.Illegal_Key_Length_
lea ecx, [esp + 0x50]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
push eax
lea ecx, [esp + 0x28]
mov dword [esp + 0xc0], 4
call fcn.00409c10
push 0x47326c
lea eax, [esp + 0x28]
push eax
call sub.MSVCR71.dll__CxxThrowException
mov edi, dword [esp + 0xd8]
cmp edi, 0x10
je 0x409edb
cmp edi, 0x18
je 0x409edb
cmp edi, 0x20
je 0x409edb
mov ecx, dword [str.Illegal_Block_Size_]
push ecx
lea ecx, [esp + 0x50]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
push eax
lea ecx, [esp + 0x28]
mov dword [esp + 0xc0], esi
call fcn.00409c10
push 0x47326c
lea edx, [esp + 0x28]
push edx
call sub.MSVCR71.dll__CxxThrowException
mov edx, dword [esp + 0xdc]
test edx, edx
jl 0x40a363
cmp edx, 2
jg 0x40a363
mov eax, dword [esp + 0xe0]
test eax, eax
jl 0x40a329
cmp eax, 2
jg 0x40a329
mov dword [ebp + 0x10], edx
xor esi, esi
xor edx, edx
test ebx, ebx
mov dword [ebp + 0x14], eax
jle 0x409f38
lea esp, [esp]
mov al, byte [esp + edx + 0x6c]
mov byte [esp + esi + 0x4c], al
lea eax, [edx + 1]
cdq
idiv dword [esp + 0xcc]
inc esi
cmp esi, ebx
jl 0x409f20
mov esi, dword [esp + 0xd0]
mov ecx, edi
mov edx, ecx
shr ecx, 2
mov dword [ebp + 8], edi
lea eax, [ebp + 0x3dc]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 8]
mov esi, eax
mov eax, ecx
shr ecx, 2
lea edi, [ebp + 0x3fc]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, ebx
mov edx, ecx
shr ecx, 2
mov dword [ebp + 0xc], ebx
lea esi, [esp + 0x4c]
lea edi, [ebp + 0x18]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 0xc]
cmp eax, 0x10
je 0x409fb7
cmp eax, 0x18
je 0x409fa6
mov dword [ebp + 0x3d8], 0xe
jmp 0x409fda
mov ecx, dword [ebp + 8]
xor eax, eax
cmp ecx, 0x20
sete al
lea eax, [eax + eax + 0xc]
jmp 0x409fd4
mov eax, dword [ebp + 8]
cmp eax, 0x10
jne 0x409fc6
mov eax, 0xa
jmp 0x409fd4
xor ecx, ecx
cmp eax, 0x18
setne cl
lea ecx, [ecx + ecx + 0xc]
mov eax, ecx
mov dword [ebp + 0x3d8], eax
mov eax, dword [ebp + 8]
cdq
and edx, 3
add eax, edx
mov ebx, eax
mov eax, dword [ebp + 0x3d8]
sar ebx, 2
xor edx, edx
test eax, eax
mov dword [esp + 0x20], ebx
jl 0x40a01a
lea esi, [ebp + 0x38]
jmp 0x40a000
test ebx, ebx
jle 0x40a00c
mov ecx, ebx
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0x3d8]
inc edx
add esi, 0x20
cmp edx, eax
jle 0x40a000
mov eax, dword [ebp + 0x3d8]
xor edx, edx
test eax, eax
jl 0x40a04a
lea esi, [ebp + 0x1f8]
lea esp, [esp]
test ebx, ebx
jle 0x40a03c
mov ecx, ebx
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0x3d8]
inc edx
add esi, 0x20
cmp edx, eax
jle 0x40a030
mov eax, dword [ebp + 0x3d8]
inc eax
imul eax, ebx
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
cdq
and edx, 3
add eax, edx
mov esi, eax
sar esi, 2
test esi, esi
lea ecx, [ebp + 0x41c]
lea eax, [esp + 0x4c]
jle 0x40a0a0
mov edi, esi
movzx edx, byte [eax]
shl edx, 0x18
mov dword [ecx], edx
movzx edx, byte [eax + 1]
inc eax
shl edx, 0x10
or dword [ecx], edx
xor edx, edx
mov dh, byte [eax + 1]
inc eax
add ecx, 4
or dword [ecx - 4], edx
movzx edx, byte [eax + 1]
or dword [ecx - 4], edx
inc eax
inc eax
dec edi
jne 0x40a076
xor edi, edi
test esi, esi
mov dword [esp + 0x1c], edi
jle 0x40a0f4
lea ecx, [ebp + 0x41c]
mov dword [esp + 0x14], ecx
cmp edi, dword [esp + 0x18]
jge 0x40a0f0
mov eax, edi
cdq
idiv ebx
mov ecx, dword [ecx]
lea ebx, [edx + eax*8]
mov dword [ebp + ebx*4 + 0x38], ecx
mov ecx, dword [ebp + 0x3d8]
mov ebx, dword [esp + 0x20]
sub ecx, eax
lea edx, [edx + ecx*8]
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx]
inc edi
add ecx, 4
cmp edi, esi
mov dword [ebp + edx*4 + 0x1f8], eax
mov dword [esp + 0x14], ecx
jl 0x40a0b4
mov dword [esp + 0x1c], edi
cmp edi, dword [esp + 0x18]
jge 0x40a283
mov dword [esp + 0x14], 0x455d00
jmp 0x40a110
mov eax, dword [ebp + esi*4 + 0x418]
mov ecx, eax
shr ecx, 0x10
movzx ecx, cl
movsx edx, byte [ecx + str.cw]
mov ecx, dword [esp + 0x14]
movsx ecx, byte [ecx]
xor edx, ecx
movzx ecx, ah
movzx ecx, byte [ecx + str.cw]
mov dword [esp + 0x10], eax
shl edx, 8
xor edx, ecx
mov ecx, dword [esp + 0x10]
and eax, 0xff
movzx eax, byte [eax + str.cw]
shl edx, 8
xor edx, eax
shr ecx, 0x18
movzx eax, byte [ecx + str.cw]
mov ecx, dword [esp + 0x14]
shl edx, 8
xor edx, eax
mov eax, dword [ebp + 0x41c]
xor eax, edx
inc ecx
cmp esi, 8
mov dword [ebp + 0x41c], eax
mov dword [esp + 0x14], ecx
je 0x40a1a4
cmp esi, 1
jle 0x40a221
lea eax, [ebp + 0x420]
lea ecx, [esi - 1]
mov edx, dword [eax - 4]
xor dword [eax], edx
add eax, 4
dec ecx
jne 0x40a194
jmp 0x40a221
lea eax, [ebp + 0x420]
mov ecx, 3
nop
mov edx, dword [eax - 4]
xor dword [eax], edx
add eax, 4
dec ecx
jne 0x40a1b0
mov eax, dword [ebp + 0x428]
mov ecx, eax
shr ecx, 0x18
movsx edx, byte [ecx + str.cw]
mov ecx, eax
shr ecx, 0x10
movzx ecx, cl
movzx ecx, byte [ecx + str.cw]
shl edx, 8
xor edx, ecx
movzx ecx, ah
movzx ecx, byte [ecx + str.cw]
mov dword [esp + 0x10], eax
shl edx, 8
and eax, 0xff
movzx eax, byte [eax + str.cw]
xor edx, ecx
shl edx, 8
xor edx, eax
xor dword [ebp + 0x42c], edx
lea eax, [ebp + 0x430]
mov ecx, 3
mov edx, dword [eax - 4]
xor dword [eax], edx
add eax, 4
dec ecx
jne 0x40a216
test esi, esi
mov dword [esp + 0x10], 0
jle 0x40a279
lea ecx, [ebp + 0x41c]
cmp edi, dword [esp + 0x18]
jge 0x40a283
mov eax, edi
cdq
idiv ebx
mov ebx, dword [ecx]
add ecx, 4
lea edi, [edx + eax*8]
mov dword [ebp + edi*4 + 0x38], ebx
mov edi, dword [ebp + 0x3d8]
mov ebx, dword [esp + 0x20]
sub edi, eax
lea eax, [edx + edi*8]
mov edx, dword [ecx - 4]
mov edi, dword [esp + 0x1c]
mov dword [ebp + eax*4 + 0x1f8], edx
mov eax, dword [esp + 0x10]
inc eax
inc edi
cmp eax, esi
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], edi
jl 0x40a233
cmp edi, dword [esp + 0x18]
jl 0x40a110
mov ecx, dword [ebp + 0x3d8]
mov eax, 1
cmp ecx, eax
mov dword [esp + 0x14], eax
jle 0x40a30a
lea ecx, [ebp + 0x218]
mov dword [esp + 0x18], ecx
test ebx, ebx
jle 0x40a2ec
mov edx, ebx
jmp 0x40a2b0
mov eax, dword [ecx]
mov dword [esp + 0x10], eax
movzx edi, byte [esp + 0x12]
mov esi, eax
shr esi, 0x18
mov esi, dword [esi*4 + 0x454d00]
xor esi, dword [edi*4 + 0x455100]
movzx edi, ah
xor esi, dword [edi*4 + 0x455500]
and eax, 0xff
xor esi, dword [eax*4 + 0x455900]
mov dword [ecx], esi
add ecx, 4
dec edx
jne 0x40a2b0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edx, dword [ebp + 0x3d8]
inc eax
add ecx, 0x20
cmp eax, edx
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
jl 0x40a2a0
mov ecx, dword [esp + 0xb4]
pop edi
pop esi
mov byte [ebp + 4], 1
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xb0
ret 0x20
mov eax, dword [str.FileCrypt_ERROR:_Illegal_Padding_Mode_]
push eax
lea ecx, [esp + 0x70]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
push eax
lea ecx, [esp + 0x90]
mov dword [esp + 0xc0], 8
call fcn.00409c10
push 0x47326c
lea ecx, [esp + 0x90]
push ecx
call sub.MSVCR71.dll__CxxThrowException
mov edx, dword [str.FileCrypt_ERROR:_Illegal_Operation_Mode_]
push edx
lea ecx, [esp + 0x50]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov esi, eax
mov ebx, 6
lea ecx, [esp + 0x24]
mov dword [esp + 0xbc], ebx
call dword [sym.imp.MSVCR71.dll_public:_void___thiscall_exception::constructor_void_]
push esi
lea ecx, [esp + 0x34]
mov byte [esp + 0xc0], 7
mov dword [esp + 0x28], 0x455de8
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
push 0x47326c
lea eax, [esp + 0x28]
push eax
mov byte [esp + 0xc4], bl
call sub.MSVCR71.dll__CxxThrowException
int3