Function at 0x40f400
Capabilities:
Encrypt data using rc4 ksa
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x43b7f8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x84
push ebx
push ebp
mov ebx, ecx
push 0x2000
call fcn.0040bed0
mov al, byte [ebx + 0x473a]
mov cx, word [ebx + 0x4734]
mov dl, byte [ebx + 0x473b]
mov byte [esp + 0x3c], al
mov ax, word [ebx + 0x4736]
mov word [esp + 0x34], cx
mov cl, byte [ebx + 0x473c]
mov word [esp + 0x40], ax
mov eax, dword [esp + 0xa0]
mov byte [esp + 0x38], cl
mov ecx, dword [esp + 0xa8]
mov byte [esp + 0x28], dl
mov dx, word [ebx + 0x4738]
mov dword [esp + 0x20], eax
lea ebp, [eax + ecx]
mov word [esp + 0x30], dx
cmp eax, ebp
mov dword [esp + 0x6c], ebp
jge 0x40fa8c
mov eax, dword [esp + 0xa4]
push esi
mov esi, dword [esp + 0x68]
push edi
mov edi, dword [esp + 0xa4]
mov dword [esp + 0x58], ecx
lea edx, [edi + eax]
mov dword [esp + 0x68], edx
lea eax, [ebx + 0x4fc]
lea ecx, [esp + 0x6c]
push eax
call fcn.00408db0
mov eax, dword [ebx + 0x3d34]
mov ecx, dword [ebx + 0x3d38]
push eax
push ecx
lea ecx, [esp + 0x94]
mov dword [esp + 0xa4], 0
call fcn.00408e20
mov edx, dword [ebx + 0x3d3c]
mov eax, dword [ebx + 0x3d38]
push edx
push eax
lea ecx, [esp + 0x8c]
call fcn.00408e60
mov eax, dword [esp + 0x68]
mov byte [esp + 0x9c], 2
cmp edi, eax
mov dword [esp + 0x18], edi
jge 0x40fa40
mov eax, dword [esp + 0xac]
mov dword [esp + 0x60], eax
jmp 0x40f523
mov eax, dword [esp + 0x60]
mov ebp, 0x10
mov edi, ebp
cmp eax, ebp
mov dword [esp + 0x14], ebp
mov dword [esp + 0x20], edi
jge 0x40f53c
mov dword [esp + 0x20], eax
mov edi, eax
mov eax, dword [esp + 0x58]
cmp eax, 0x10
jge 0x40f54b
mov dword [esp + 0x14], eax
mov ebp, eax
lea ecx, [esp + 0x13]
push 1
push ecx
mov ecx, ebx
call fcn.0040bbc0
mov al, byte [esp + 0x13]
test al, 1
je 0x40f6d1
mov edx, ebp
mov eax, dword [ebx + 0x4dc]
imul edx, edi
shl edx, 2
push edx
push eax
mov ecx, ebx
call fcn.0040bbc0
mov eax, dword [esp + 0x28]
mov ecx, dword [ebx + 0x4dc]
add ebp, eax
mov dword [esp + 0x20], ecx
cmp eax, ebp
mov dword [esp + 0x14], eax
mov dword [esp + 0x50], ebp
jge 0x40fa13
mov ecx, dword [esp + 0x18]
lea eax, [edi + ecx]
mov dword [esp + 0x78], eax
jmp 0x40f5ad
mov ecx, dword [esp + 0x18]
cmp ecx, eax
mov dword [esp + 0x2c], ecx
jge 0x40f6bb
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x40]
mov eax, dword [esp + 0x38]
mov ebp, dword [esp + 0x48]
and edx, 0xff
and ecx, 0xff
mov dword [esp + 0x4c], edx
mov edx, dword [esp + 0x44]
and edx, 0xff
and eax, 0xffff
mov dword [esp + 0x64], edx
mov edx, dword [esp + 0x3c]
and ebp, 0xffff
and edx, 0xffff
mov dword [esp + 0x54], ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x1c], edx
jmp 0x40f612
mov ecx, dword [esp + 0x54]
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x20]
mov edi, dword [edx]
mov edx, edi
shr edx, cl
mov ecx, dword [esp + 0x4c]
and edx, eax
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div dword [esp + 0x34]
mov edx, edi
shr edx, cl
mov ecx, dword [esp + 0x64]
shr edi, cl
mov ecx, dword [esp + 0x1c]
and edx, ebp
and edi, ecx
and eax, 0xff
or ah, 2
shl eax, 8
mov dword [esp + 0x5c], eax
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div ebp
mov edx, dword [esp + 0x5c]
and eax, 0xff
or edx, eax
mov eax, edi
shl edx, 8
shl eax, 8
mov dword [esp + 0x5c], edx
sub eax, edi
xor edx, edx
mov edi, dword [esp + 0x2c]
div ecx
mov ecx, dword [esp + 0x5c]
mov edx, dword [esp + 0x14]
and eax, 0xff
or ecx, eax
mov eax, dword [ebx + 0x3d38]
push ecx
push edx
push edi
push eax
call dword [sym.imp.GDI32.dll_SetPixelV]
mov eax, dword [esp + 0x20]
add eax, 4
inc edi
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x78]
cmp edi, eax
mov dword [esp + 0x2c], edi
jl 0x40f60a
mov ebp, dword [esp + 0x50]
mov ecx, dword [esp + 0x14]
inc ecx
cmp ecx, ebp
mov dword [esp + 0x14], ecx
jl 0x40f5a9
jmp 0x40fa13
test al, 2
je 0x40f783
lea ecx, [esp + 0x70]
push 4
push ecx
mov ecx, ebx
call fcn.0040bbc0
mov ebp, dword [esp + 0x70]
mov eax, dword [esp + 0x48]
mov cl, byte [esp + 0x40]
mov edi, dword [esp + 0x38]
mov edx, ebp
and eax, 0xffff
shr edx, cl
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x3c]
and edi, 0xffff
and eax, 0xffff
mov dword [esp + 0x1c], eax
mov cl, byte [esp + 0x30]
and edx, edi
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div edi
mov edx, ebp
shr edx, cl
mov ecx, dword [esp + 0x2c]
and edx, ecx
mov edi, eax
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div ecx
mov cl, byte [esp + 0x44]
and edi, 0xff
shr ebp, cl
mov ecx, dword [esp + 0x1c]
or edi, 0x200
shl edi, 8
xor edx, edx
and ebp, ecx
and eax, 0xff
or edi, eax
mov eax, ebp
shl eax, 8
sub eax, ebp
mov ebp, dword [esp + 0x14]
div ecx
shl edi, 8
and eax, 0xff
or edi, eax
mov dword [esp + 0x80], edi
jmp 0x40f78a
mov edi, dword [esp + 0x80]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x18]
push edi
push ebp
push edx
push eax
push ecx
mov ecx, ebx
call fcn.0040cc40
test byte [esp + 0x13], 4
je 0x40f843
lea edx, [esp + 0x7c]
push 4
push edx
mov ecx, ebx
call fcn.0040bbc0
mov edi, dword [esp + 0x7c]
mov cl, byte [esp + 0x40]
mov esi, dword [esp + 0x38]
mov eax, dword [esp + 0x3c]
mov edx, edi
and esi, 0xffff
shr edx, cl
and eax, 0xffff
mov cl, byte [esp + 0x30]
mov dword [esp + 0x1c], eax
mov ebp, dword [esp + 0x48]
and ebp, 0xffff
and edx, esi
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div esi
mov edx, edi
shr edx, cl
mov cl, byte [esp + 0x44]
shr edi, cl
mov ecx, dword [esp + 0x1c]
and edx, ebp
and edi, ecx
mov esi, eax
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div ebp
and esi, 0xff
xor edx, edx
or esi, 0x200
shl esi, 8
and eax, 0xff
or esi, eax
mov eax, edi
shl eax, 8
sub eax, edi
div ecx
shl esi, 8
and eax, 0xff
or esi, eax
test byte [esp + 0x13], 8
je 0x40fa13
lea eax, [esp + 0x24]
push 1
push eax
mov ecx, ebx
call fcn.0040bbc0
mov al, byte [esp + 0x13]
mov edi, dword [ebx + 0x4dc]
test al, 0x10
mov eax, dword [esp + 0x24]
je 0x40f9ae
and eax, 0xff
lea ecx, [eax + eax*2]
shl ecx, 1
push ecx
push edi
mov ecx, ebx
call fcn.0040bbc0
mov al, byte [esp + 0x24]
mov dword [esp + 0x14], 0
test al, al
jbe 0x40fa13
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x40]
and eax, 0xff
mov esi, dword [esp + 0x38]
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x48]
and eax, 0xffff
and ecx, 0xff
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x44]
and eax, 0xff
and esi, 0xffff
mov dword [esp + 0x64], eax
mov eax, dword [esp + 0x3c]
and eax, 0xffff
mov dword [esp + 0x54], ecx
mov dword [esp + 0x34], esi
mov dword [esp + 0x1c], eax
jmp 0x40f8f3
mov ecx, dword [esp + 0x54]
mov esi, dword [esp + 0x34]
mov ebp, dword [edi]
add edi, 4
mov edx, ebp
shr edx, cl
mov ecx, dword [esp + 0x4c]
and edx, esi
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div esi
mov edx, ebp
shr edx, cl
mov ecx, dword [esp + 0x2c]
and edx, ecx
mov esi, eax
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div ecx
mov ecx, dword [esp + 0x64]
and esi, 0xff
shr ebp, cl
mov ecx, dword [esp + 0x1c]
or esi, 0x200
shl esi, 8
xor edx, edx
and ebp, ecx
and eax, 0xff
or esi, eax
mov eax, ebp
shl eax, 8
sub eax, ebp
div ecx
shl esi, 8
and eax, 0xff
or esi, eax
xor eax, eax
mov al, byte [edi]
push esi
mov edx, eax
and eax, 0xf
shr edx, 4
mov ebp, eax
inc edi
xor eax, eax
mov al, byte [edi]
mov ecx, eax
and eax, 0xf
shr ecx, 4
inc ecx
inc eax
push eax
mov eax, dword [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x24]
add ebp, eax
add edx, ecx
push ebp
push edx
mov ecx, ebx
inc edi
call fcn.0040cc40
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x24]
inc eax
and edx, 0xff
cmp eax, edx
mov dword [esp + 0x14], eax
jl 0x40f8eb
jmp 0x40fa13
and eax, 0xff
mov ecx, ebx
shl eax, 1
push eax
push edi
call fcn.0040bbc0
mov al, byte [esp + 0x24]
xor ebp, ebp
test al, al
jbe 0x40fa13
xor eax, eax
push esi
mov al, byte [edi]
mov edx, eax
and eax, 0xf
shr edx, 4
mov dword [esp + 0x54], eax
inc edi
xor eax, eax
mov al, byte [edi]
mov ecx, eax
and eax, 0xf
shr ecx, 4
inc ecx
inc eax
push eax
mov eax, dword [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x5c]
add ecx, eax
inc edi
push ecx
mov ecx, dword [esp + 0x28]
add edx, ecx
mov ecx, ebx
push edx
call fcn.0040cc40
mov edx, dword [esp + 0x24]
inc ebp
and edx, 0xff
cmp ebp, edx
jl 0x40f9c8
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x60]
mov ecx, dword [esp + 0x68]
add eax, 0x10
sub edx, 0x10
cmp eax, ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x60], edx
jl 0x40f51f
mov ebp, dword [esp + 0x74]
mov edi, dword [esp + 0xa4]
lea ecx, [esp + 0x84]
call fcn.00408e90
lea ecx, [esp + 0x8c]
call fcn.00408e40
lea ecx, [esp + 0x6c]
mov dword [esp + 0x9c], 0xffffffff
call fcn.00408dd0
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x58]
add eax, 0x10
sub edx, 0x10
cmp eax, ebp
mov dword [esp + 0x28], eax
mov dword [esp + 0x58], edx
jl 0x40f4ab
pop edi
pop esi
mov ecx, dword [esp + 0x8c]
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x90
ret 0x10