Function at 0x40d340
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push 0xffffffffffffffff
push 0x4389c8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x48
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x68]
movzx eax, word [edi + 6]
mov esi, ecx
movzx ecx, word [edi + 4]
mov ebx, dword [esi + 0x4234]
imul eax, ecx
imul ebx, eax
push ebx
mov ecx, esi
call fcn.004046e0
mov edx, dword [esi + 0x1c4]
push ebx
push edx
mov ecx, esi
call fcn.00404470
mov cx, word [esi + 0x41e0]
mov al, byte [esi + 0x41e6]
mov dl, byte [esi + 0x41e7]
mov word [esp + 0x30], cx
mov cl, byte [esi + 0x41e8]
mov byte [esp + 0x13], al
mov ax, word [esi + 0x41e2]
mov byte [esp + 0x12], dl
mov dx, word [esi + 0x41e4]
mov byte [esp + 0x68], cl
lea ecx, [esi + 0x1e4]
mov word [esp + 0x28], ax
mov word [esp + 0x2c], dx
mov dword [esp + 0x40], ecx
call fcn.004181a0
mov eax, dword [esi + 0x3a1c]
mov ebp, dword [esi + 0x3a20]
push eax
push ebp
mov dword [esp + 0x68], 0
mov dword [esp + 0x40], ebp
mov dword [esp + 0x5c], ebp
call dword [sym.imp.GDI32.dll_SelectObject]
mov dword [esp + 0x50], eax
mov eax, dword [esi + 0x3a24]
mov ebx, dword [esi + 0x3a20]
push 0
push eax
push ebx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x58], ebx
call dword [sym.imp.GDI32.dll_SelectPalette]
push ebx
mov dword [esp + 0x4c], eax
call dword [sym.imp.GDI32.dll_RealizePalette]
movzx eax, byte [esi + 0x41dc]
lea ecx, [eax - 8]
cmp ecx, 0x18
mov byte [esp + 0x60], 2
ja case.0x40d44e.9
movzx ecx, byte [ecx + 0x40d86c]
jmp dword [ecx*4 + 0x40d85c]
movzx eax, word [edi + 2]
movzx ecx, word [edi + 6]
mov edx, dword [esi + 0x1c4]
add ecx, eax
cmp eax, ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], eax
jge 0x40d7e3
movzx eax, word [edi]
movzx edx, word [edi + 4]
lea ecx, [edx + eax]
nop
cmp eax, ecx
mov dword [esp + 0x3c], eax
jge 0x40d55e
movzx eax, byte [esp + 0x68]
movzx ecx, byte [esp + 0x12]
movzx edx, byte [esp + 0x13]
movzx ebx, word [esp + 0x28]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edx
lea esp, [esp]
mov eax, dword [esp + 0x24]
movzx ebp, byte [eax]
mov ecx, dword [esp + 0x14]
mov eax, ebp
shr eax, cl
movzx ecx, word [esp + 0x2c]
and eax, ecx
imul eax, eax, 0xff
cdq
idiv ecx
mov ecx, dword [esp + 0x18]
movzx eax, al
or eax, 0x200
shl eax, 8
mov dword [esp + 0x44], eax
mov eax, ebp
shr eax, cl
and eax, ebx
imul eax, eax, 0xff
cdq
idiv ebx
movzx ecx, al
mov eax, dword [esp + 0x44]
or eax, ecx
mov ecx, dword [esp + 0x1c]
shl eax, 8
mov dword [esp + 0x44], eax
mov eax, ebp
shr eax, cl
movzx ecx, word [esp + 0x30]
and eax, ecx
imul eax, eax, 0xff
cdq
idiv ecx
mov ebp, dword [esp + 0x3c]
mov ecx, dword [esi + 0x3a20]
movzx edx, al
mov eax, dword [esp + 0x44]
or eax, edx
push eax
mov eax, dword [esp + 0x24]
push eax
push ebp
push ecx
call dword [sym.imp.GDI32.dll_SetPixelV]
mov ecx, dword [esp + 0x24]
movzx eax, word [edi]
movzx edx, word [edi + 4]
inc ecx
mov dword [esp + 0x24], ecx
inc ebp
lea ecx, [edx + eax]
cmp ebp, ecx
mov dword [esp + 0x3c], ebp
jl 0x40d4b0
mov ebx, dword [esp + 0x34]
mov edx, dword [esp + 0x20]
movzx ebp, word [edi + 6]
inc edx
mov dword [esp + 0x20], edx
movzx edx, word [edi + 2]
add edx, ebp
cmp dword [esp + 0x20], edx
jl 0x40d480
jmp 0x40d7df
mov eax, dword [esi + 0x1c4]
movzx ecx, word [edi + 6]
mov dword [esp + 0x24], eax
movzx eax, word [edi + 2]
add ecx, eax
cmp eax, ecx
mov dword [esp + 0x20], eax
jge 0x40d7e3
movzx eax, word [edi]
movzx edx, word [edi + 4]
lea ecx, [edx + eax]
lea ebx, [ebx]
cmp eax, ecx
mov dword [esp + 0x3c], eax
jge 0x40d690
movzx eax, byte [esp + 0x68]
movzx ecx, byte [esp + 0x12]
movzx edx, byte [esp + 0x13]
movzx ebx, word [esp + 0x28]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edx
lea esp, [esp]
mov eax, dword [esp + 0x24]
movzx ebp, word [eax]
mov ecx, dword [esp + 0x14]
mov eax, ebp
shr eax, cl
movzx ecx, word [esp + 0x2c]
and eax, ecx
imul eax, eax, 0xff
cdq
idiv ecx
mov ecx, dword [esp + 0x18]
movzx eax, al
or eax, 0x200
shl eax, 8
mov dword [esp + 0x44], eax
mov eax, ebp
shr eax, cl
and eax, ebx
imul eax, eax, 0xff
cdq
idiv ebx
movzx ecx, al
mov eax, dword [esp + 0x44]
or eax, ecx
mov ecx, dword [esp + 0x1c]
shl eax, 8
mov dword [esp + 0x44], eax
mov eax, ebp
shr eax, cl
movzx ecx, word [esp + 0x30]
and eax, ecx
imul eax, eax, 0xff
cdq
idiv ecx
mov ebp, dword [esp + 0x3c]
mov ecx, dword [esi + 0x3a20]
movzx edx, al
mov eax, dword [esp + 0x44]
or eax, edx
push eax
mov eax, dword [esp + 0x24]
push eax
push ebp
push ecx
call dword [sym.imp.GDI32.dll_SetPixelV]
mov ecx, dword [esp + 0x24]
movzx eax, word [edi]
movzx edx, word [edi + 4]
add ecx, 2
mov dword [esp + 0x24], ecx
inc ebp
lea ecx, [edx + eax]
cmp ebp, ecx
mov dword [esp + 0x3c], ebp
jl 0x40d5e0
mov ebx, dword [esp + 0x34]
mov edx, dword [esp + 0x20]
movzx ebp, word [edi + 6]
inc edx
mov dword [esp + 0x20], edx
movzx edx, word [edi + 2]
add edx, ebp
cmp dword [esp + 0x20], edx
jl 0x40d5b0
jmp 0x40d7df
mov eax, dword [esi + 0x1c4]
movzx ecx, word [edi + 6]
mov dword [esp + 0x24], eax
movzx eax, word [edi + 2]
add ecx, eax
cmp eax, ecx
mov dword [esp + 0x20], eax
jge 0x40d7e3
movzx eax, word [edi]
movzx edx, word [edi + 4]
lea ecx, [edx + eax]
lea esp, [esp]
cmp eax, ecx
mov dword [esp + 0x3c], eax
jge 0x40d7c2
movzx eax, byte [esp + 0x68]
movzx ecx, byte [esp + 0x12]
movzx edx, byte [esp + 0x13]
movzx ebx, word [esp + 0x28]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edx
lea esp, [esp]
mov eax, dword [esp + 0x24]
mov ebp, dword [eax]
mov ecx, dword [esp + 0x14]
mov eax, ebp
shr eax, cl
movzx ecx, word [esp + 0x2c]
and eax, ecx
imul eax, eax, 0xff
xor edx, edx
div ecx
mov ecx, dword [esp + 0x18]
xor edx, edx
movzx eax, al
or eax, 0x200
shl eax, 8
mov dword [esp + 0x44], eax
mov eax, ebp
shr eax, cl
and eax, ebx
imul eax, eax, 0xff
div ebx
xor edx, edx
movzx ecx, al
mov eax, dword [esp + 0x44]
or eax, ecx
mov ecx, dword [esp + 0x1c]
shl eax, 8
mov dword [esp + 0x44], eax
mov eax, ebp
shr eax, cl
movzx ecx, word [esp + 0x30]
and eax, ecx
imul eax, eax, 0xff
div ecx
mov ebp, dword [esp + 0x3c]
mov ecx, dword [esi + 0x3a20]
movzx edx, al
mov eax, dword [esp + 0x44]
or eax, edx
push eax
mov eax, dword [esp + 0x24]
push eax
push ebp
push ecx
call dword [sym.imp.GDI32.dll_SetPixelV]
mov ecx, dword [esp + 0x24]
movzx eax, word [edi]
movzx edx, word [edi + 4]
add ecx, 4
mov dword [esp + 0x24], ecx
inc ebp
lea ecx, [edx + eax]
cmp ebp, ecx
mov dword [esp + 0x3c], ebp
jl 0x40d710
mov ebx, dword [esp + 0x34]
mov edx, dword [esp + 0x20]
movzx ebp, word [edi + 6]
inc edx
mov dword [esp + 0x20], edx
movzx edx, word [edi + 2]
add edx, ebp
cmp dword [esp + 0x20], edx
jl 0x40d6e0
mov ebp, dword [esp + 0x38]
mov eax, dword [esp + 0x48]
push 0
push eax
push ebx
call dword [sym.imp.GDI32.dll_SelectPalette]
push ebx
call dword [sym.imp.GDI32.dll_RealizePalette]
mov ecx, dword [esp + 0x50]
push ecx
jmp 0x40d82e
push eax
push str.Invalid_number_of_bits_per_pixel:__d_n
push 0
push 0x445ec8
call fcn.00403360
mov edx, dword [esp + 0x58]
add esp, 0x10
push 0
push edx
push ebx
call dword [sym.imp.GDI32.dll_SelectPalette]
push ebx
call dword [sym.imp.GDI32.dll_RealizePalette]
mov eax, dword [esp + 0x50]
push eax
push ebp
call dword [sym.imp.GDI32.dll_SelectObject]
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x60], 0xffffffff
call fcn.004181b0
mov ecx, dword [esp + 0x58]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x54
ret 4