Function at 0x405036
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 0x405068
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 0x40d880
lea eax, [ebp - 0x38]
push eax
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp + 0x10], 0x10
je 0x40509c
cmp dword [ebp + 0x10], 0x18
je 0x40509c
cmp dword [ebp + 0x10], 0x20
je 0x40509c
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 0x40d880
lea eax, [ebp - 0x48]
push eax
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp + 0x14], 0x10
je 0x4050d0
cmp dword [ebp + 0x14], 0x18
je 0x4050d0
cmp dword [ebp + 0x14], 0x20
je 0x4050d0
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 0x40d880
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 0x40513c
cmp dword [ebp - 0x64], 0x18
je 0x405178
jmp 0x405199
mov eax, dword [ebp - 0x60]
cmp dword [eax + 0x3cc], 0x10
jne 0x405151
mov dword [ebp - 0x68], 0xa
jmp 0x40516a
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 0x4051a6
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 0x4051a6
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 0x4051c5
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 0x405200
and dword [ebp - 0x1c], 0
jmp 0x4051e0
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x2c]
jge 0x4051fe
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 0x4051d9
jmp 0x4051be
and dword [ebp - 0x14], 0
jmp 0x40520d
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 0x40524b
and dword [ebp - 0x1c], 0
jmp 0x405228
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x2c]
jge 0x405249
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 0x405221
jmp 0x405206
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 0x40528c
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0xc]
jge 0x405305
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 0x405285
and dword [ebp - 0x10], 0
and dword [ebp - 0x1c], 0
jmp 0x40531d
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 0x40538d
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x28]
jge 0x40538d
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 0x40530f
and dword [ebp - 0x24], 0
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x28]
jge 0x405674
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 + 0x40cb70]
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 0x4054a0
mov dword [ebp - 0x14], 1
and dword [ebp - 0x1c], 0
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0xc]
jge 0x40549b
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 0x40545c
jmp 0x4055eb
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 0x4054ef
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 0x4054ab
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 0x4055eb
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 0x4055ac
and dword [ebp - 0x1c], 0
jmp 0x4055ff
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 0x40566f
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x28]
jge 0x40566f
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 0x4055f1
jmp 0x405391
mov dword [ebp - 8], 1
jmp 0x405684
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 0x40572c
and dword [ebp - 0x1c], 0
jmp 0x4056a3
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x2c]
jge 0x405727
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 + 0x40bb70]
xor eax, dword [ecx*4 + 0x40bf70]
mov ecx, dword [ebp - 0x20]
sar ecx, 8
and ecx, 0xff
xor eax, dword [ecx*4 + 0x40c370]
mov ecx, dword [ebp - 0x20]
and ecx, 0xff
xor eax, dword [ecx*4 + 0x40c770]
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 0x40569c
jmp 0x40567d
mov eax, dword [ebp - 0x60]
mov byte [eax + 4], 1
pop esi
leave
ret 0x10