Function at 0x40d3ce
Capabilities:
Encrypt data using aes
Reference aes constants

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x68
push esi
mov dword [ebp - 0x60], ecx
cmp dword [ebp + 8], 0
jne 0x40d400
mov dword [ebp - 0x3c], str.Empty_key
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp - 0x38]
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
push 0x418f58
lea eax, [ebp - 0x38]
push eax
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp + 0x10], 0x10
je 0x40d434
cmp dword [ebp + 0x10], 0x18
je 0x40d434
cmp dword [ebp + 0x10], 0x20
je 0x40d434
mov dword [ebp - 0x4c], str.Incorrect_key_length
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x48]
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
push 0x418f58
lea eax, [ebp - 0x48]
push eax
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp + 0x14], 0x10
je 0x40d468
cmp dword [ebp + 0x14], 0x18
je 0x40d468
cmp dword [ebp + 0x14], 0x20
je 0x40d468
mov dword [ebp - 0x5c], str.Incorrect_block_length
lea eax, [ebp - 0x5c]
push eax
lea ecx, [ebp - 0x58]
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
push 0x418f58
lea eax, [ebp - 0x58]
push eax
call sub.MSVCRT.dll__CxxThrowException
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp + 0x10]
mov dword [eax + 0x3c8], ecx
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp + 0x14]
mov dword [eax + 0x3cc], ecx
mov eax, dword [ebp - 0x60]
push dword [eax + 0x3cc]
push dword [ebp + 0xc]
mov eax, dword [ebp - 0x60]
add eax, 0x3d4
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov eax, dword [ebp - 0x60]
push dword [eax + 0x3cc]
push dword [ebp + 0xc]
mov eax, dword [ebp - 0x60]
add eax, 0x3f4
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 0x3c8]
mov dword [ebp - 0x64], eax
cmp dword [ebp - 0x64], 0x10
je 0x40d4d4
cmp dword [ebp - 0x64], 0x18
je 0x40d510
jmp 0x40d531
mov eax, dword [ebp - 0x60]
cmp dword [eax + 0x3cc], 0x10
jne 0x40d4e9
mov dword [ebp - 0x68], 0xa
jmp 0x40d502
mov eax, dword [ebp - 0x60]
xor ecx, ecx
cmp dword [eax + 0x3cc], 0x18
setne cl
dec ecx
and ecx, 0xfffffffe
add ecx, 0xe
mov dword [ebp - 0x68], ecx
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x68]
mov dword [eax + 0x3d0], ecx
jmp 0x40d53e
mov eax, dword [ebp - 0x60]
xor ecx, ecx
cmp dword [eax + 0x3cc], 0x20
sete cl
dec ecx
and ecx, 0xfffffffe
add ecx, 0xe
mov eax, dword [ebp - 0x60]
mov dword [eax + 0x3d0], ecx
jmp 0x40d53e
mov eax, dword [ebp - 0x60]
mov dword [eax + 0x3d0], 0xe
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 0x3cc]
cdq
push 4
pop ecx
idiv ecx
mov dword [ebp - 0x2c], eax
and dword [ebp - 0x14], 0
jmp 0x40d55d
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [eax + 0x3d0]
jg 0x40d598
and dword [ebp - 0x1c], 0
jmp 0x40d578
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x2c]
jge 0x40d596
mov eax, dword [ebp - 0x14]
shl eax, 5
mov ecx, dword [ebp - 0x60]
lea eax, [ecx + eax + 8]
mov ecx, dword [ebp - 0x1c]
and dword [eax + ecx*4], 0
jmp 0x40d571
jmp 0x40d556
and dword [ebp - 0x14], 0
jmp 0x40d5a5
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [eax + 0x3d0]
jg 0x40d5e3
and dword [ebp - 0x1c], 0
jmp 0x40d5c0
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x2c]
jge 0x40d5e1
mov eax, dword [ebp - 0x14]
shl eax, 5
mov ecx, dword [ebp - 0x60]
lea eax, [ecx + eax + 0x1e8]
mov ecx, dword [ebp - 0x1c]
and dword [eax + ecx*4], 0
jmp 0x40d5b9
jmp 0x40d59e
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 0x3d0]
inc eax
imul eax, dword [ebp - 0x2c]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 0x3c8]
cdq
push 4
pop ecx
idiv ecx
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x60]
add eax, 0x414
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x18], eax
and dword [ebp - 0x14], 0
jmp 0x40d624
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0xc]
jge 0x40d69d
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax]
shl eax, 0x18
mov ecx, dword [ebp - 4]
mov dword [ecx], eax
mov eax, dword [ebp - 0x18]
inc eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax]
shl eax, 0x10
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx]
or ecx, eax
mov eax, dword [ebp - 4]
mov dword [eax], ecx
mov eax, dword [ebp - 0x18]
inc eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax]
shl eax, 8
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx]
or ecx, eax
mov eax, dword [ebp - 4]
mov dword [eax], ecx
mov eax, dword [ebp - 0x18]
inc eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax]
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx]
or ecx, eax
mov eax, dword [ebp - 4]
mov dword [eax], ecx
mov eax, dword [ebp - 0x18]
inc eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 4]
add eax, 4
mov dword [ebp - 4], eax
jmp 0x40d61d
and dword [ebp - 0x10], 0
and dword [ebp - 0x1c], 0
jmp 0x40d6b5
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
inc eax
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0xc]
jge 0x40d725
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x28]
jge 0x40d725
mov eax, dword [ebp - 0x10]
cdq
idiv dword [ebp - 0x2c]
shl eax, 5
mov ecx, dword [ebp - 0x60]
lea ecx, [ecx + eax + 8]
mov eax, dword [ebp - 0x10]
cdq
idiv dword [ebp - 0x2c]
mov eax, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x60]
mov eax, dword [esi + eax*4 + 0x414]
mov dword [ecx + edx*4], eax
mov eax, dword [ebp - 0x10]
cdq
idiv dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x60]
mov ecx, dword [ecx + 0x3d0]
sub ecx, eax
shl ecx, 5
mov eax, dword [ebp - 0x60]
lea ecx, [eax + ecx + 0x1e8]
mov eax, dword [ebp - 0x10]
cdq
idiv dword [ebp - 0x2c]
mov eax, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x60]
mov eax, dword [esi + eax*4 + 0x414]
mov dword [ecx + edx*4], eax
jmp 0x40d6a7
and dword [ebp - 0x24], 0
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x28]
jge 0x40da0c
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x60]
mov eax, dword [ecx + eax*4 + 0x410]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sar eax, 0x10
and eax, 0xff
movsx eax, byte [eax + str.cw]
and eax, 0xff
shl eax, 0x18
mov ecx, dword [ebp - 0x20]
sar ecx, 8
and ecx, 0xff
movsx ecx, byte [ecx + str.cw]
and ecx, 0xff
shl ecx, 0x10
xor eax, ecx
mov ecx, dword [ebp - 0x20]
and ecx, 0xff
movsx ecx, byte [ecx + str.cw]
and ecx, 0xff
shl ecx, 8
xor eax, ecx
mov ecx, dword [ebp - 0x20]
sar ecx, 0x18
and ecx, 0xff
movsx ecx, byte [ecx + str.cw]
and ecx, 0xff
xor eax, ecx
mov ecx, dword [ebp - 0x24]
movsx ecx, byte [ecx + 0x416c80]
and ecx, 0xff
shl ecx, 0x18
xor eax, ecx
mov ecx, dword [ebp - 0x60]
mov ecx, dword [ecx + 0x414]
xor ecx, eax
mov eax, dword [ebp - 0x60]
mov dword [eax + 0x414], ecx
mov eax, dword [ebp - 0x24]
inc eax
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0xc], 8
je 0x40d838
mov dword [ebp - 0x14], 1
and dword [ebp - 0x1c], 0
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0xc]
jge 0x40d833
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x60]
mov edx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x60]
mov eax, dword [ecx + eax*4 + 0x414]
xor eax, dword [esi + edx*4 + 0x414]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x60]
mov dword [edx + ecx*4 + 0x414], eax
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
jmp 0x40d7f4
jmp 0x40d983
mov dword [ebp - 0x14], 1
and dword [ebp - 0x1c], 0
mov eax, dword [ebp - 0xc]
cdq
sub eax, edx
sar eax, 1
cmp dword [ebp - 0x14], eax
jge 0x40d887
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x60]
mov edx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x60]
mov eax, dword [ecx + eax*4 + 0x414]
xor eax, dword [esi + edx*4 + 0x414]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x60]
mov dword [edx + ecx*4 + 0x414], eax
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
jmp 0x40d843
mov eax, dword [ebp - 0xc]
cdq
sub eax, edx
sar eax, 1
mov ecx, dword [ebp - 0x60]
mov eax, dword [ecx + eax*4 + 0x410]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0xc]
cdq
sub eax, edx
sar eax, 1
mov ecx, dword [ebp - 0x20]
and ecx, 0xff
movsx ecx, byte [ecx + str.cw]
and ecx, 0xff
mov edx, dword [ebp - 0x20]
sar edx, 8
and edx, 0xff
movsx edx, byte [edx + str.cw]
and edx, 0xff
shl edx, 8
xor ecx, edx
mov edx, dword [ebp - 0x20]
sar edx, 0x10
and edx, 0xff
movsx edx, byte [edx + str.cw]
and edx, 0xff
shl edx, 0x10
xor ecx, edx
mov edx, dword [ebp - 0x20]
sar edx, 0x18
and edx, 0xff
movsx edx, byte [edx + str.cw]
and edx, 0xff
shl edx, 0x18
xor ecx, edx
mov edx, dword [ebp - 0x60]
mov esi, dword [edx + eax*4 + 0x414]
xor esi, ecx
mov eax, dword [ebp - 0xc]
cdq
sub eax, edx
sar eax, 1
mov ecx, dword [ebp - 0x60]
mov dword [ecx + eax*4 + 0x414], esi
mov eax, dword [ebp - 0xc]
cdq
sub eax, edx
sar eax, 1
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0xc]
jge 0x40d983
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x60]
mov edx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x60]
mov eax, dword [ecx + eax*4 + 0x414]
xor eax, dword [esi + edx*4 + 0x414]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x60]
mov dword [edx + ecx*4 + 0x414], eax
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
jmp 0x40d944
and dword [ebp - 0x1c], 0
jmp 0x40d997
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
inc eax
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0xc]
jge 0x40da07
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x28]
jge 0x40da07
mov eax, dword [ebp - 0x10]
cdq
idiv dword [ebp - 0x2c]
shl eax, 5
mov ecx, dword [ebp - 0x60]
lea ecx, [ecx + eax + 8]
mov eax, dword [ebp - 0x10]
cdq
idiv dword [ebp - 0x2c]
mov eax, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x60]
mov eax, dword [esi + eax*4 + 0x414]
mov dword [ecx + edx*4], eax
mov eax, dword [ebp - 0x10]
cdq
idiv dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x60]
mov ecx, dword [ecx + 0x3d0]
sub ecx, eax
shl ecx, 5
mov eax, dword [ebp - 0x60]
lea ecx, [eax + ecx + 0x1e8]
mov eax, dword [ebp - 0x10]
cdq
idiv dword [ebp - 0x2c]
mov eax, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x60]
mov eax, dword [esi + eax*4 + 0x414]
mov dword [ecx + edx*4], eax
jmp 0x40d989
jmp 0x40d729
mov dword [ebp - 8], 1
jmp 0x40da1c
mov eax, dword [ebp - 8]
inc eax
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 8]
cmp ecx, dword [eax + 0x3d0]
jge 0x40dac4
and dword [ebp - 0x1c], 0
jmp 0x40da3b
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x2c]
jge 0x40dabf
mov eax, dword [ebp - 8]
shl eax, 5
mov ecx, dword [ebp - 0x60]
lea eax, [ecx + eax + 0x1e8]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [eax + ecx*4]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sar eax, 0x18
and eax, 0xff
mov ecx, dword [ebp - 0x20]
sar ecx, 0x10
and ecx, 0xff
mov eax, dword [eax*4 + 0x415c80]
xor eax, dword [ecx*4 + 0x416080]
mov ecx, dword [ebp - 0x20]
sar ecx, 8
and ecx, 0xff
xor eax, dword [ecx*4 + 0x416480]
mov ecx, dword [ebp - 0x20]
and ecx, 0xff
xor eax, dword [ecx*4 + 0x416880]
mov ecx, dword [ebp - 8]
shl ecx, 5
mov edx, dword [ebp - 0x60]
lea ecx, [edx + ecx + 0x1e8]
mov edx, dword [ebp - 0x1c]
mov dword [ecx + edx*4], eax
jmp 0x40da34
jmp 0x40da15
mov eax, dword [ebp - 0x60]
mov byte [eax + 4], 1
pop esi
leave
ret 0x10