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

Disassembly:
push 0xffffffffffffffff
push 0x438a58
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x60
push esi
push edi
push 0x41c
mov esi, ecx
call fcn.004046e0
push 0x41c
mov ecx, esi
call fcn.004047e0
mov al, byte [esi + 0x41e6]
mov cx, word [esi + 0x41e0]
mov edi, dword [esp + 0x7c]
mov dl, byte [esi + 0x41e7]
mov byte [esp + 0xa], al
mov ax, word [esi + 0x41e2]
mov word [esp + 0x3c], cx
mov cl, byte [esi + 0x41e8]
mov word [esp + 0x34], ax
mov eax, dword [esp + 0x84]
mov byte [esp + 8], cl
lea ecx, [edi + eax]
cmp edi, ecx
mov byte [esp + 9], dl
mov dx, word [esi + 0x41e4]
mov word [esp + 0x38], dx
mov dword [esp + 0x10], edi
mov dword [esp + 0x54], ecx
jge 0x412986
mov edx, dword [esp + 0x78]
lea ecx, [esi + 0x1e4]
mov dword [esp + 0x44], ecx
mov ecx, dword [esp + 0x80]
push ebx
add edx, ecx
push ebp
mov dword [esp + 0x48], edx
mov dword [esp + 0x34], eax
mov ecx, dword [esp + 0x4c]
call fcn.004181a0
mov eax, dword [esi + 0x3a1c]
mov ebp, dword [esi + 0x3a20]
push eax
push ebp
mov dword [esp + 0x80], 0
mov dword [esp + 0x60], ebp
mov dword [esp + 0x74], ebp
call dword [sym.imp.GDI32.dll_SelectObject]
mov dword [esp + 0x68], eax
mov eax, dword [esi + 0x3a24]
mov ebx, dword [esi + 0x3a20]
push 0
push eax
push ebx
mov dword [esp + 0x60], ebx
mov dword [esp + 0x70], ebx
call dword [sym.imp.GDI32.dll_SelectPalette]
push ebx
mov dword [esp + 0x64], eax
call dword [sym.imp.GDI32.dll_RealizePalette]
mov eax, dword [esp + 0x80]
cmp eax, dword [esp + 0x48]
mov byte [esp + 0x78], 2
mov dword [esp + 0x84], eax
jge 0x41292c
mov eax, dword [esp + 0x88]
mov dword [esp + 0x30], eax
jmp 0x412790
mov eax, dword [esp + 0x30]
mov edi, edi
mov ebp, 0x10
cmp eax, ebp
mov ebx, ebp
jge 0x41279d
mov ebx, eax
mov eax, dword [esp + 0x34]
cmp eax, 0x10
jge 0x4127a8
mov ebp, eax
push 1
lea edx, [esp + 0x17]
push edx
mov ecx, esi
call fcn.00404470
mov al, byte [esp + 0x13]
test al, 1
je 0x412999
mov ecx, dword [esi + 0x1c4]
mov eax, ebp
imul eax, ebx
shl eax, 2
push eax
push ecx
mov ecx, esi
call fcn.00404470
mov eax, dword [esp + 0x18]
mov edx, dword [esi + 0x1c4]
lea ecx, [eax + ebp]
cmp eax, ecx
mov dword [esp + 0x8c], edx
mov dword [esp + 0x38], edi
mov dword [esp + 0x2c], ecx
jge 0x4128f8
mov ebp, dword [esp + 0x84]
lea eax, [ebx + ebp]
mov dword [esp + 0x28], eax
jmp 0x412810
cmp ebp, eax
jge 0x4128eb
movzx eax, byte [esp + 0x10]
movzx ecx, byte [esp + 0x11]
movzx edx, byte [esp + 0x12]
movzx ebx, word [esp + 0x3c]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], edx
jmp 0x412840
mov eax, dword [esp + 0x8c]
mov edi, dword [eax]
mov ecx, dword [esp + 0x1c]
mov eax, edi
shr eax, cl
movzx ecx, word [esp + 0x40]
and eax, ecx
imul eax, eax, 0xff
xor edx, edx
div ecx
mov ecx, dword [esp + 0x20]
xor edx, edx
movzx eax, al
or eax, 0x200
shl eax, 8
mov dword [esp + 0x50], eax
mov eax, edi
shr eax, cl
and eax, ebx
imul eax, eax, 0xff
div ebx
xor edx, edx
movzx ecx, al
mov eax, dword [esp + 0x50]
or eax, ecx
mov ecx, dword [esp + 0x24]
shl eax, 8
mov dword [esp + 0x50], eax
mov eax, edi
shr eax, cl
movzx ecx, word [esp + 0x44]
and eax, ecx
imul eax, eax, 0xff
div ecx
mov edi, dword [esp + 0x38]
movzx edx, al
mov eax, dword [esp + 0x50]
or eax, edx
push eax
mov eax, dword [esi + 0x3a20]
push edi
push ebp
push eax
call dword [sym.imp.GDI32.dll_SetPixelV]
add dword [esp + 0x8c], 4
mov eax, dword [esp + 0x28]
inc ebp
cmp ebp, eax
jl 0x412840
mov ecx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x84]
inc edi
cmp edi, ecx
mov dword [esp + 0x38], edi
jl 0x412810
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x84]
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x48]
add eax, 0x10
sub edx, 0x10
cmp eax, ecx
mov dword [esp + 0x84], eax
mov dword [esp + 0x30], edx
jl 0x41278a
mov ebx, dword [esp + 0x54]
mov ebp, dword [esp + 0x58]
mov ecx, dword [esp + 0x60]
push 0
push ecx
push ebx
call dword [sym.imp.GDI32.dll_SelectPalette]
push ebx
mov dword [esp + 0x64], eax
call dword [sym.imp.GDI32.dll_RealizePalette]
mov edx, dword [esp + 0x68]
push edx
push ebp
call dword [sym.imp.GDI32.dll_SelectObject]
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x68], eax
mov dword [esp + 0x78], 0xffffffff
call fcn.004181b0
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x5c]
add edi, 0x10
sub ecx, 0x10
cmp edi, eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x34], ecx
jl 0x412703
pop ebp
pop ebx
mov ecx, dword [esp + 0x68]
pop edi
pop esi
mov dword fs:[0], ecx
add esp, 0x6c
ret 0x10
test al, 0x20
je 0x412b2d
push 2
lea ecx, [esp + 0x18]
push ecx
mov ecx, esi
call fcn.00404470
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 0x1c4]
movzx dx, ah
mov dh, al
mov eax, edx
mov dword [esp + 0x14], eax
movzx eax, ax
push eax
push ecx
mov ecx, esi
call fcn.00404470
mov eax, ebp
imul eax, ebx
lea edx, [esi + 0x2b8]
push edx
movzx edx, word [esp + 0x18]
lea ecx, [eax*4 + 8]
mov eax, dword [esi + 0x274]
push ecx
mov ecx, dword [esi + 0x1c4]
push edx
push eax
push ecx
mov ecx, esi
call fcn.00410850
test al, al
je 0x4128fc
mov eax, dword [esp + 0x18]
mov edx, dword [esi + 0x274]
lea ecx, [eax + ebp]
cmp eax, ecx
mov dword [esp + 0x8c], edx
mov dword [esp + 0x38], edi
mov dword [esp + 0x2c], ecx
jge 0x4128f8
mov ebp, dword [esp + 0x84]
lea eax, [ebx + ebp]
mov dword [esp + 0x28], eax
lea ebx, [ebx]
cmp ebp, eax
jge 0x412b1b
movzx eax, byte [esp + 0x10]
movzx ecx, byte [esp + 0x11]
movzx edx, byte [esp + 0x12]
movzx ebx, word [esp + 0x3c]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], edx
jmp 0x412a70
mov eax, dword [esp + 0x8c]
mov edi, dword [eax]
mov ecx, dword [esp + 0x1c]
mov eax, edi
shr eax, cl
movzx ecx, word [esp + 0x40]
and eax, ecx
imul eax, eax, 0xff
xor edx, edx
div ecx
mov ecx, dword [esp + 0x20]
xor edx, edx
movzx eax, al
or eax, 0x200
shl eax, 8
mov dword [esp + 0x50], eax
mov eax, edi
shr eax, cl
and eax, ebx
imul eax, eax, 0xff
div ebx
xor edx, edx
movzx ecx, al
mov eax, dword [esp + 0x50]
or eax, ecx
mov ecx, dword [esp + 0x24]
shl eax, 8
mov dword [esp + 0x50], eax
mov eax, edi
shr eax, cl
movzx ecx, word [esp + 0x44]
and eax, ecx
imul eax, eax, 0xff
div ecx
mov edi, dword [esp + 0x38]
movzx edx, al
mov eax, dword [esp + 0x50]
or eax, edx
push eax
mov eax, dword [esi + 0x3a20]
push edi
push ebp
push eax
call dword [sym.imp.GDI32.dll_SetPixelV]
add dword [esp + 0x8c], 4
mov eax, dword [esp + 0x28]
inc ebp
cmp ebp, eax
jl 0x412a70
mov ecx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x84]
inc edi
cmp edi, ecx
mov dword [esp + 0x38], edi
jl 0x412a40
jmp 0x4128f8
test al, 0x40
je 0x412bc0
push 2
lea ecx, [esp + 0x18]
push ecx
mov ecx, esi
call fcn.00404470
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 0x1c4]
movzx dx, ah
mov dh, al
mov eax, edx
mov dword [esp + 0x14], eax
movzx eax, ax
push eax
push ecx
mov ecx, esi
call fcn.00404470
mov eax, ebp
imul eax, ebx
lea edx, [esi + 0x2f0]
push edx
movzx edx, word [esp + 0x18]
lea ecx, [eax*4 + 0x1c]
mov eax, dword [esi + 0x274]
push ecx
mov ecx, dword [esi + 0x1c4]
push edx
push eax
push ecx
mov ecx, esi
call fcn.00410850
test al, al
je 0x4128fc
mov edx, dword [esi + 0x274]
movzx eax, byte [esp + 0x13]
mov ecx, dword [esp + 0x84]
push edx
push eax
push ebp
push ebx
push edi
push ecx
mov ecx, esi
call fcn.00411870
jmp 0x4128fc
movzx edx, al
mov eax, dword [esp + 0x84]
push edx
push ebp
push ebx
push edi
push eax
mov ecx, esi
call fcn.00411520
jmp 0x4128fc