Function at 0x402970
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 0x4029a2
mov dword [ebp - 0x3c], str.Empty_key
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp - 0x38]
call dword [sym.imp.MSVCR90.dll_public:_void___thiscall_std::exception::constructor_char_const__const_const__]
push 0x40bb30
lea ecx, [ebp - 0x38]
push ecx
call sub.MSVCR90.dll__CxxThrowException
cmp dword [ebp + 0x10], 0x10
je 0x4029d6
cmp dword [ebp + 0x10], 0x18
je 0x4029d6
cmp dword [ebp + 0x10], 0x20
je 0x4029d6
mov dword [ebp - 0x4c], str.Incorrect_key_length
lea edx, [ebp - 0x4c]
push edx
lea ecx, [ebp - 0x48]
call dword [sym.imp.MSVCR90.dll_public:_void___thiscall_std::exception::constructor_char_const__const_const__]
push 0x40bb30
lea eax, [ebp - 0x48]
push eax
call sub.MSVCR90.dll__CxxThrowException
cmp dword [ebp + 0x14], 0x10
je 0x402a0a
cmp dword [ebp + 0x14], 0x18
je 0x402a0a
cmp dword [ebp + 0x14], 0x20
je 0x402a0a
mov dword [ebp - 0x5c], str.Incorrect_block_length
lea ecx, [ebp - 0x5c]
push ecx
lea ecx, [ebp - 0x58]
call dword [sym.imp.MSVCR90.dll_public:_void___thiscall_std::exception::constructor_char_const__const_const__]
push 0x40bb30
lea edx, [ebp - 0x58]
push edx
call sub.MSVCR90.dll__CxxThrowException
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp + 0x10]
mov dword [eax + 0x3c8], ecx
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp + 0x14]
mov dword [edx + 0x3cc], eax
mov ecx, dword [ebp - 0x60]
mov edx, dword [ecx + 0x3cc]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp - 0x60]
add ecx, 0x3d4
push ecx
call sub.MSVCR90.dll_memcpy
add esp, 0xc
mov edx, dword [ebp - 0x60]
mov eax, dword [edx + 0x3cc]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp - 0x60]
add edx, 0x3f4
push edx
call sub.MSVCR90.dll_memcpy
add esp, 0xc
mov eax, dword [ebp - 0x60]
mov ecx, dword [eax + 0x3c8]
mov dword [ebp - 0x64], ecx
cmp dword [ebp - 0x64], 0x10
je 0x402a7c
cmp dword [ebp - 0x64], 0x18
je 0x402ab5
jmp 0x402ad3
mov edx, dword [ebp - 0x60]
cmp dword [edx + 0x3cc], 0x10
jne 0x402a91
mov dword [ebp - 0x68], 0xa
jmp 0x402aa7
mov eax, dword [ebp - 0x60]
xor ecx, ecx
cmp dword [eax + 0x3cc], 0x18
setne cl
lea ecx, [ecx + ecx + 0xc]
mov dword [ebp - 0x68], ecx
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x68]
mov dword [edx + 0x3d0], eax
jmp 0x402ae0
mov ecx, dword [ebp - 0x60]
xor edx, edx
cmp dword [ecx + 0x3cc], 0x20
sete dl
lea edx, [edx + edx + 0xc]
mov eax, dword [ebp - 0x60]
mov dword [eax + 0x3d0], edx
jmp 0x402ae0
mov ecx, dword [ebp - 0x60]
mov dword [ecx + 0x3d0], 0xe
mov edx, dword [ebp - 0x60]
mov eax, dword [edx + 0x3cc]
cdq
and edx, 3
add eax, edx
sar eax, 2
mov dword [ebp - 4], eax
mov dword [ebp - 0x10], 0
jmp 0x402b07
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x60]
mov edx, dword [ebp - 0x10]
cmp edx, dword [ecx + 0x3d0]
jg 0x402b4a
mov dword [ebp - 0x28], 0
jmp 0x402b27
mov eax, dword [ebp - 0x28]
add eax, 1
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
cmp ecx, dword [ebp - 4]
jge 0x402b48
mov edx, dword [ebp - 0x10]
shl edx, 5
mov eax, dword [ebp - 0x60]
lea ecx, [eax + edx + 8]
mov edx, dword [ebp - 0x28]
mov dword [ecx + edx*4], 0
jmp 0x402b1e
jmp 0x402afe
mov dword [ebp - 0x10], 0
jmp 0x402b5c
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x60]
mov edx, dword [ebp - 0x10]
cmp edx, dword [ecx + 0x3d0]
jg 0x402ba2
mov dword [ebp - 0x28], 0
jmp 0x402b7c
mov eax, dword [ebp - 0x28]
add eax, 1
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
cmp ecx, dword [ebp - 4]
jge 0x402ba0
mov edx, dword [ebp - 0x10]
shl edx, 5
mov eax, dword [ebp - 0x60]
lea ecx, [eax + edx + 0x1e8]
mov edx, dword [ebp - 0x28]
mov dword [ecx + edx*4], 0
jmp 0x402b73
jmp 0x402b53
mov eax, dword [ebp - 0x60]
mov ecx, dword [eax + 0x3d0]
add ecx, 1
imul ecx, dword [ebp - 4]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0x60]
mov eax, dword [edx + 0x3c8]
cdq
and edx, 3
add eax, edx
sar eax, 2
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x60]
add eax, 0x414
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], 0
jmp 0x402bed
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x1c]
jge 0x402c6b
mov ecx, dword [ebp - 0x14]
movzx edx, byte [ecx]
shl edx, 0x18
mov eax, dword [ebp - 0x18]
mov dword [eax], edx
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x14]
movzx eax, byte [edx]
shl eax, 0x10
mov ecx, dword [ebp - 0x18]
or eax, dword [ecx]
mov edx, dword [ebp - 0x18]
mov dword [edx], eax
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
movzx edx, byte [ecx]
shl edx, 8
mov eax, dword [ebp - 0x18]
or edx, dword [eax]
mov ecx, dword [ebp - 0x18]
mov dword [ecx], edx
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x14]
movzx ecx, byte [eax]
mov edx, dword [ebp - 0x18]
or ecx, dword [edx]
mov eax, dword [ebp - 0x18]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x18]
add edx, 4
mov dword [ebp - 0x18], edx
jmp 0x402be4
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0
jmp 0x402c8d
mov eax, dword [ebp - 0x28]
add eax, 1
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x24]
add ecx, 1
mov dword [ebp - 0x24], ecx
mov edx, dword [ebp - 0x28]
cmp edx, dword [ebp - 0x1c]
jge 0x402d00
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0xc]
jge 0x402d00
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
shl eax, 5
mov ecx, dword [ebp - 0x60]
lea ecx, [ecx + eax + 8]
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov eax, dword [ebp - 0x28]
mov esi, dword [ebp - 0x60]
mov eax, dword [esi + eax*4 + 0x414]
mov dword [ecx + edx*4], eax
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov ecx, dword [ebp - 0x60]
mov edx, dword [ecx + 0x3d0]
sub edx, eax
shl edx, 5
mov eax, dword [ebp - 0x60]
lea ecx, [eax + edx + 0x1e8]
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov eax, dword [ebp - 0x28]
mov esi, dword [ebp - 0x60]
mov eax, dword [esi + eax*4 + 0x414]
mov dword [ecx + edx*4], eax
jmp 0x402c7b
mov dword [ebp - 8], 0
mov ecx, dword [ebp - 0x24]
cmp ecx, dword [ebp - 0xc]
jge 0x403007
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x60]
mov ecx, dword [eax + edx*4 + 0x410]
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 0x20]
sar edx, 0x10
and edx, 0xff
movsx eax, byte [edx + str.cw]
and eax, 0xff
shl eax, 0x18
mov ecx, dword [ebp - 0x20]
sar ecx, 8
and ecx, 0xff
movsx edx, byte [ecx + str.cw]
and edx, 0xff
shl edx, 0x10
xor eax, edx
mov ecx, dword [ebp - 0x20]
and ecx, 0xff
movsx edx, byte [ecx + str.cw]
and edx, 0xff
shl edx, 8
xor eax, edx
mov ecx, dword [ebp - 0x20]
sar ecx, 0x18
and ecx, 0xff
movsx edx, byte [ecx + str.cw]
and edx, 0xff
xor eax, edx
mov ecx, dword [ebp - 8]
movsx edx, byte [ecx + 0x40b0a8]
and edx, 0xff
shl edx, 0x18
xor eax, edx
mov ecx, dword [ebp - 0x60]
xor eax, dword [ecx + 0x414]
mov edx, dword [ebp - 0x60]
mov dword [edx + 0x414], eax
mov eax, dword [ebp - 8]
add eax, 1
mov dword [ebp - 8], eax
cmp dword [ebp - 0x1c], 8
je 0x402e1e
mov dword [ebp - 0x10], 1
mov dword [ebp - 0x28], 0
mov ecx, dword [ebp - 0x10]
cmp ecx, dword [ebp - 0x1c]
jge 0x402e19
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x28]
mov esi, dword [ebp - 0x60]
mov edx, dword [eax + edx*4 + 0x414]
xor edx, dword [esi + ecx*4 + 0x414]
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x60]
mov dword [ecx + eax*4 + 0x414], edx
mov edx, dword [ebp - 0x28]
add edx, 1
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
jmp 0x402dd6
jmp 0x402f74
mov dword [ebp - 0x10], 1
mov dword [ebp - 0x28], 0
mov eax, dword [ebp - 0x1c]
cdq
sub eax, edx
sar eax, 1
cmp dword [ebp - 0x10], eax
jge 0x402e74
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x28]
mov esi, dword [ebp - 0x60]
mov ecx, dword [edx + ecx*4 + 0x414]
xor ecx, dword [esi + eax*4 + 0x414]
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x60]
mov dword [eax + edx*4 + 0x414], ecx
mov ecx, dword [ebp - 0x28]
add ecx, 1
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x10]
add edx, 1
mov dword [ebp - 0x10], edx
jmp 0x402e2c
mov eax, dword [ebp - 0x1c]
cdq
sub eax, edx
sar eax, 1
mov ecx, dword [ebp - 0x60]
mov edx, dword [ecx + eax*4 + 0x410]
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x1c]
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]
xor ecx, dword [edx + eax*4 + 0x414]
mov eax, dword [ebp - 0x1c]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [ebp - 0x60]
mov dword [edx + eax*4 + 0x414], ecx
mov eax, dword [ebp - 0x1c]
cdq
sub eax, edx
sar eax, 1
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
add eax, 1
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
cmp ecx, dword [ebp - 0x1c]
jge 0x402f74
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x28]
mov esi, dword [ebp - 0x60]
mov edx, dword [eax + edx*4 + 0x414]
xor edx, dword [esi + ecx*4 + 0x414]
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x60]
mov dword [ecx + eax*4 + 0x414], edx
mov edx, dword [ebp - 0x28]
add edx, 1
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 0x10], eax
jmp 0x402f31
mov dword [ebp - 0x28], 0
jmp 0x402f8f
mov ecx, dword [ebp - 0x28]
add ecx, 1
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x24]
add edx, 1
mov dword [ebp - 0x24], edx
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x1c]
jge 0x403002
mov ecx, dword [ebp - 0x24]
cmp ecx, dword [ebp - 0xc]
jge 0x403002
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
shl eax, 5
mov edx, dword [ebp - 0x60]
lea ecx, [edx + eax + 8]
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov eax, dword [ebp - 0x28]
mov esi, dword [ebp - 0x60]
mov eax, dword [esi + eax*4 + 0x414]
mov dword [ecx + edx*4], eax
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov ecx, dword [ebp - 0x60]
mov edx, dword [ecx + 0x3d0]
sub edx, eax
shl edx, 5
mov eax, dword [ebp - 0x60]
lea ecx, [eax + edx + 0x1e8]
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov eax, dword [ebp - 0x28]
mov esi, dword [ebp - 0x60]
mov eax, dword [esi + eax*4 + 0x414]
mov dword [ecx + edx*4], eax
jmp 0x402f7d
jmp 0x402d07
mov dword [ebp - 0x2c], 1
jmp 0x403019
mov ecx, dword [ebp - 0x2c]
add ecx, 1
mov dword [ebp - 0x2c], ecx
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x2c]
cmp eax, dword [edx + 0x3d0]
jge 0x4030c5
mov dword [ebp - 0x28], 0
jmp 0x40303d
mov ecx, dword [ebp - 0x28]
add ecx, 1
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x28]
cmp edx, dword [ebp - 4]
jge 0x4030c0
mov eax, dword [ebp - 0x2c]
shl eax, 5
mov ecx, dword [ebp - 0x60]
lea edx, [ecx + eax + 0x1e8]
mov eax, dword [ebp - 0x28]
mov ecx, dword [edx + eax*4]
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 0x20]
sar edx, 0x18
and edx, 0xff
mov eax, dword [ebp - 0x20]
sar eax, 0x10
and eax, 0xff
mov ecx, dword [edx*4 + 0x40a0a8]
xor ecx, dword [eax*4 + 0x40a4a8]
mov edx, dword [ebp - 0x20]
sar edx, 8
and edx, 0xff
xor ecx, dword [edx*4 + 0x40a8a8]
mov eax, dword [ebp - 0x20]
and eax, 0xff
xor ecx, dword [eax*4 + 0x40aca8]
mov edx, dword [ebp - 0x2c]
shl edx, 5
mov eax, dword [ebp - 0x60]
lea edx, [eax + edx + 0x1e8]
mov eax, dword [ebp - 0x28]
mov dword [edx + eax*4], ecx
jmp 0x403034
jmp 0x403010
mov ecx, dword [ebp - 0x60]
mov byte [ecx + 4], 1
pop esi
mov esp, ebp
pop ebp
ret 0x10