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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp + 8]
cmp edx, 0x10
je 0x40fa45
cmp edx, 0x18
je 0x40fa45
cmp edx, 0x20
jne 0x40fd7f
cmp ecx, 0x10
je 0x40fa58
cmp ecx, 0x18
je 0x40fa58
cmp ecx, 0x20
jne 0x40fd94
mov eax, ecx
sar eax, 0x1f
shr eax, 0x1e
add eax, ecx
sar eax, 2
mov dword [ebp - 0x20], eax
mov eax, edx
sar eax, 0x1f
shr eax, 0x1e
add eax, edx
mov edx, dword [ebp - 0x18]
sar eax, 2
mov dword [edx + 0x3e8], eax
mov edx, dword [ebp - 0x20]
cmp edx, eax
jge 0x40fa87
mov edx, eax
mov ecx, dword [ebp - 0x18]
add edx, 6
cmp eax, 8
mov dword [ecx + 0x3ec], edx
je 0x40fd2e
cmp eax, 6
je 0x40fd47
cmp eax, 4
je 0x40fd63
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + 0x3ec]
mov edx, ecx
mov dword [ebp - 0x28], ecx
inc edx
imul eax, edx
test eax, eax
jle 0x40fc51
mov ebx, dword [ebp - 0x20]
mov dword [ebp - 0x14], 0
shl ebx, 2
mov dword [ebp - 0x10], 1
neg ebx
mov dword [ebp - 0x30], ebx
jmp 0x40fb34
mov ecx, dword [ebp - 0x1c]
mov ebx, eax
xor edx, edx
mov dl, byte [ecx + eax*4]
xor eax, eax
shl edx, 0x18
mov al, byte [ecx + ebx*4 + 1]
shl eax, 0x10
or edx, eax
xor eax, eax
mov al, byte [ecx + ebx*4 + 3]
or edx, eax
xor eax, eax
mov al, byte [ecx + ebx*4 + 2]
shl eax, 8
or edx, eax
mov eax, dword [ebp - 0x18]
mov dword [eax + ebx*4], edx
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x28]
inc eax
mov ebx, dword [ebp - 0x14]
mov ecx, dword [edx + 0x3e8]
inc ebx
imul eax, ecx
mov dword [ebp - 0x14], ebx
cmp eax, dword [ebp - 0x14]
jle 0x40fc51
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 0x20], eax
jg 0x40fae3
mov edx, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x18]
mov eax, edx
mov edi, dword [ecx + edx*4 - 4]
sar edx, 0x1f
idiv dword [ebp - 0x20]
test edx, edx
jne 0x40fbef
mov eax, edi
mov edx, edi
movzx ebx, ah
mov al, byte [ebp - 0x10]
mov esi, edi
shr edx, 0x10
and eax, 0xffffff80
and edx, 0xff
and esi, 0xff
shr edi, 0x18
cmp al, 1
sbb ecx, ecx
xor eax, eax
mov al, byte [edx + str.cw]
mov edx, dword [ebp - 0x10]
xor eax, edx
xor edx, edx
mov dl, byte [ebx + str.cw]
xor ecx, 0xffffffff
shl eax, 8
and ecx, 0x1b
or eax, edx
xor edx, edx
shl eax, 8
mov dl, byte [esi + str.cw]
or eax, edx
mov dl, byte [edi + str.cw]
shl eax, 8
and edx, 0xff
mov edi, edx
or edi, eax
mov eax, dword [ebp - 0x10]
and eax, 0x7f
mov dword [ebp - 0x10], eax
mov esi, dword [ebp - 0x10]
add esi, esi
mov dword [ebp - 0x10], esi
mov ebx, dword [ebp - 0x10]
xor ebx, ecx
mov dword [ebp - 0x10], ebx
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x30]
add eax, edx
mov ebx, dword [ebp - 0x14]
mov esi, dword [eax + ebx*4]
mov eax, dword [ebp - 0x18]
xor edi, esi
mov dword [eax + ebx*4], edi
jmp 0x40fb14
cmp edx, 4
jne 0x40fbd4
cmp dword [ebp - 0x20], 6
jle 0x40fbd4
mov eax, edi
xor edx, edx
shr eax, 0x18
mov ecx, edi
mov dl, byte [eax + str.cw]
mov eax, edi
shr eax, 0x10
shl edx, 8
and eax, 0xff
mov al, byte [eax + str.cw]
and eax, 0xff
or edx, eax
movzx eax, ch
shl edx, 8
mov al, byte [eax + str.cw]
and eax, 0xff
or edx, eax
mov eax, edi
shl edx, 8
and eax, 0xff
mov al, byte [eax + str.cw]
and eax, 0xff
mov edi, eax
or edi, edx
jmp 0x40fbd4
mov eax, dword [ebp - 0x28]
test eax, eax
js 0x40fd26
mov ecx, dword [ebp - 0x18]
xor edi, edi
mov ecx, dword [ecx + 0x3e8]
mov dword [ebp - 0x24], ecx
mov eax, dword [ebp - 0x24]
test eax, eax
jle 0x40fd1c
mov esi, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
sub esi, edi
mov eax, dword [ebp - 0x24]
imul ecx, edi
imul esi, eax
xor ebx, ebx
mov dword [ebp - 0x2c], ecx
nop
lea esi, [esi]
lea eax, [esi + ebx]
mov edx, dword [ebp - 0x18]
test edi, edi
mov ecx, dword [edx + eax*4]
je 0x40fd03
cmp edi, dword [ebp - 0x28]
je 0x40fd03
mov eax, ecx
shr eax, 0x18
mov al, byte [eax + str.cw]
and eax, 0xff
mov edx, dword [eax*4 + 0x41e040]
mov eax, ecx
shr eax, 0x10
and eax, 0xff
mov al, byte [eax + str.cw]
and eax, 0xff
xor edx, dword [eax*4 + 0x41e440]
movzx eax, cl
mov al, byte [eax + str.cw]
and eax, 0xff
xor edx, dword [eax*4 + 0x41ec40]
movzx eax, ch
mov ecx, edx
mov al, byte [eax + str.cw]
and eax, 0xff
mov edx, dword [eax*4 + 0x41e840]
xor ecx, edx
mov eax, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x18]
add eax, ebx
inc ebx
cmp dword [ebp - 0x24], ebx
mov dword [edx + eax*4 + 0x1e0], ecx
jg 0x40fc90
inc edi
cmp edi, dword [ebp - 0x28]
jle 0x40fc6a
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ecx + 0x3c0], 0x40df80
mov dword [ecx + 0x3c4], 0x40f130
jmp 0x40faae
mov ebx, dword [ebp - 0x18]
mov dword [ebx + 0x3c0], 0x40d9f0
mov dword [ebx + 0x3c4], 0x40eb50
jmp 0x40faae
mov edx, dword [ebp - 0x18]
mov dword [edx + 0x3c0], 0x40d620
mov dword [edx + 0x3c4], 0x40e760
jmp 0x40faae
push ebx
push 0x3a6
push str._home_nightlybuild_buildroot_packages_FileZilla3_src_putty_sshaes.c
push str.blocklen__16__blocklen__24__blocklen__32
call sub.msvcrt.dll__assert
push ecx
push 0x3a7
push str._home_nightlybuild_buildroot_packages_FileZilla3_src_putty_sshaes.c
push str.keylen__16__keylen__24__keylen__32
call sub.msvcrt.dll__assert
lea esi, [esi]
push ebp
mov edx, 0x10
mov ebp, esp
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov dword [ebp + 8], 0x20
pop ebp
jmp fcn.0040fa20