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

Disassembly:
sub esp, 0x4c
mov ecx, dword [0x1008faa8]
test ecx, ecx
mov eax, dword [esp + 0x6c]
push ebx
setne byte [esp + 7]
mov ebx, 3
push ebp
mov ebp, dword [esp + 0x6c]
test eax, eax
push esi
cmovne ebx, eax
mov dword [esp + 0x38], ebx
push edi
test ecx, ecx
jne 0x10040ab7
call fcn.10037ad0
test al, al
jne 0x10040abf
dec ebx
or ebx, 1
mov dword [esp + 0x3c], ebx
mov esi, dword [esp + 0x78]
mov edi, dword [esp + 0x6c]
test esi, esi
jne 0x10040adb
mov eax, ebp
cdq
mov esi, eax
xor esi, edx
sub esi, edx
imul esi, edi
mov dword [esp + 0x78], esi
mov ecx, dword [0x1008fc44]
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x80]
push eax
mov edx, dword [ecx]
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x80]
push edi
push dword [esp + 0x80]
push dword [esp + 0x80]
call dword [edx + 0xb4]
cmp dword [esp + 0x7c], 0
jle 0x10041248
cmp dword [esp + 0x1c], 0
jle 0x10041248
mov edx, dword [esp + 0x60]
test edx, edx
je 0x10040b52
mov eax, dword [esp + 0x30]
sub eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x34]
sub ecx, dword [esp + 0x64]
imul eax, esi
imul ecx, ebp
add edx, eax
add edx, ecx
mov dword [esp + 0x60], edx
cmp dword [0x1008fd80], 0
mov eax, 1
jne 0x10040b84
xorps xmm0, xmm0
mov dword [0x1008fd80], 0x28
mov word [0x1008fd8c], ax
mov dword [0x1008fd90], 0
movups xmmword [0x1008fd98], xmm0
mov dl, byte [esp + 0x13]
test dl, dl
je 0x10040ba6
xor eax, eax
mov ecx, 0x1008fda8
mov esi, 0x100
mov word [ecx], ax
lea ecx, [ecx + 2]
inc eax
cmp ax, si
jl 0x10040b98
jmp 0x10040bd5
cmp ebx, 3
jge 0x10040bd5
xor eax, eax
nop dword [eax]
mov byte [eax*4 + 0x1008fda8], al
mov byte [eax*4 + 0x1008fda9], al
mov byte [eax*4 + 0x1008fdaa], al
mov byte [eax*4 + 0x1008fdab], 0
inc eax
cmp eax, 0x100
jl 0x10040bb0
mov eax, dword [esp + 0x7c]
test dl, dl
mov dword [0x1008fd84], eax
mov ecx, 8
lea eax, [ebx*8]
movzx eax, ax
cmove ecx, eax
mov eax, ebx
mov word [0x1008fd8e], cx
mov ecx, 1
cmovne eax, ecx
cmp ebx, 2
jne 0x10040c18
mov eax, 0x20
mov word [0x1008fd8e], ax
mov eax, 4
imul eax, dword [esp + 0x7c]
mov ebx, dword [esp + 0x1c]
mov esi, ebx
mov dword [esp + 0x20], ebx
add eax, 3
and eax, 0xfffffffc
imul esi, eax
mov dword [esp + 0x2c], eax
cmp esi, 0x40000
jle 0x10040c6e
mov ebx, dword [0x1008fc48]
test ebx, ebx
jne 0x10040c4d
call fcn.10039630
mov ebx, eax
call fcn.10039640
cmp ebx, eax
jne 0x10040c6a
mov esi, 0x40000
mov eax, esi
cdq
idiv dword [esp + 0x2c]
mov ebx, eax
mov dword [esp + 0x20], ebx
jmp 0x10040c6e
mov ebx, dword [esp + 0x20]
cmp esi, dword [0x100901b4]
jle 0x10040cb3
push dword [0x100901b0]
call fcn.10045fe1
lea eax, [esi + 3]
mov dword [0x100901b4], esi
cdq
xor ecx, ecx
and edx, 3
mov esi, 4
add eax, edx
sar eax, 2
mul esi
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.10045fd8
add esp, 8
mov dword [0x100901b0], eax
jmp 0x10040cb8
mov esi, 4
mov eax, dword [esp + 0x60]
mov dword [0x1008fd88], ebx
test eax, eax
jne 0x10040d10
imul edi, ebp
cmp edi, dword [0x100901bc]
jle 0x10040d10
push dword [0x100901b8]
call fcn.10045fe1
lea eax, [edi + 3]
mov dword [0x100901bc], edi
cdq
xor ecx, ecx
and edx, 3
add eax, edx
sar eax, 2
mul esi
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.10045fd8
mov ebx, eax
add esp, 8
mov eax, dword [esp + 0x60]
mov dword [0x100901b8], ebx
jmp 0x10040d16
mov ebx, dword [0x100901b8]
xor ecx, ecx
mov dword [esp + 0x38], ecx
cmp dword [esp + 0x1c], ecx
jle 0x10041248
movzx edx, byte [esp + 0x13]
mov dword [esp + 0x50], edx
nop
xor edi, edi
mov dword [esp + 0x24], edi
cmp ecx, dword [esp + 0x1c]
jge 0x10041062
mov edx, ecx
mov ecx, dword [esp + 0x20]
sub edx, dword [esp + 0x68]
mov dword [esp + 0x14], edx
lea esi, [ecx - 1]
imul esi, dword [esp + 0x2c]
mov dword [esp + 0x18], esi
nop word [eax + eax]
cmp edi, ecx
jge 0x10041062
test eax, eax
jne 0x10040da3
mov eax, dword [esp + 0x30]
push ebx
push dword [esp + 0x80]
add eax, edx
push eax
mov eax, dword [esp + 0x40]
sub eax, dword [esp + 0x70]
push eax
push dword [esp + 0x94]
call dword [esp + 0x94]
mov ebx, dword [0x100901b8]
add esp, 0x14
mov edx, dword [esp + 0x14]
mov edi, ebx
jmp 0x10040dad
mov edi, eax
add eax, dword [esp + 0x78]
mov dword [esp + 0x60], eax
mov ecx, dword [0x100901b0]
add ecx, esi
cmp byte [esp + 0x13], 0
je 0x100410fa
cmp dword [esp + 0x3c], 3
mov edx, dword [esp + 0x7c]
jge 0x10040e9a
cmp dword [0x1008fd7c], 0
mov ebp, dword [0x1008fd78]
je 0x10040e00
lea eax, [edx - 1]
dec ecx
imul eax, dword [esp + 0x74]
add ecx, edx
add edi, eax
mov eax, dword [esp + 0x74]
neg eax
mov dword [esp + 0x28], eax
or eax, 0xffffffff
mov dword [esp + 0x40], eax
xor eax, eax
jmp 0x10040e15
mov eax, dword [esp + 0x74]
mov dword [esp + 0x28], eax
mov eax, 1
mov dword [esp + 0x40], 1
mov dword [0x1008fd7c], eax
test edx, edx
je 0x10040e8b
nop
movzx eax, byte [edi]
dec edx
add ebp, eax
mov dword [esp + 0x4c], edx
jns 0x10040e30
xor ebp, ebp
jmp 0x10040e3e
cmp ebp, 0xff
mov eax, 0xff
cmovg ebp, eax
lea eax, [ebp*2]
add edi, dword [esp + 0x28]
add eax, ebp
shl eax, 3
cdq
and edx, 0xff
lea ebx, [edx + eax]
mov eax, 0xb21642c9
sar ebx, 8
imul esi, ebx, 0xffffff01
add bl, 0x20
mov byte [ecx], bl
add ecx, dword [esp + 0x40]
imul esi
add edx, esi
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [esp + 0x4c]
add ebp, eax
test edx, edx
jne 0x10040e20
mov esi, dword [esp + 0x18]
mov dword [0x1008fd78], ebp
mov ebp, dword [esp + 0x74]
jmp 0x10041027
cmp dword [0x1008fd74], 0
mov esi, dword [0x1008fd70]
mov ebp, dword [0x1008fd68]
mov ebx, dword [0x1008fd6c]
mov dword [esp + 0x28], edx
mov dword [esp + 0x40], esi
je 0x10040ee6
lea eax, [edx - 1]
mov dword [esp + 0x48], 0xffffffff
mov edx, dword [esp + 0x74]
imul eax, edx
neg edx
mov dword [esp + 0x44], edx
mov edx, dword [esp + 0x28]
add edi, eax
mov eax, dword [esp + 0x28]
dec eax
add ecx, eax
xor eax, eax
jmp 0x10040efb
mov eax, dword [esp + 0x74]
mov dword [esp + 0x44], eax
mov eax, 1
mov dword [esp + 0x48], 1
mov dword [0x1008fd74], eax
test edx, edx
je 0x1004100d
movzx eax, byte [edi]
dec edx
add ebp, eax
mov dword [esp + 0x28], edx
mov esi, 0xff
jns 0x10040f1d
xor ebp, ebp
jmp 0x10040f26
cmp ebp, 0xff
cmovg ebp, esi
lea eax, [ebp*4]
add eax, ebp
cdq
and edx, 0xff
add eax, edx
sar eax, 8
mov dword [esp + 0x54], eax
imul eax, eax, 0xffffff01
cdq
and edx, 3
add eax, edx
sar eax, 2
add ebp, eax
movzx eax, byte [edi + 1]
add ebx, eax
jns 0x10040f5c
xor ebx, ebx
jmp 0x10040f65
cmp ebx, 0xff
cmovg ebx, esi
lea eax, [ebx*8]
cdq
and edx, 0xff
add eax, edx
sar eax, 8
imul esi, eax, 0xffffff01
mov dword [esp + 0x58], eax
mov eax, 0x92492493
imul esi
add edx, esi
mov esi, dword [esp + 0x40]
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
add ebx, eax
movzx eax, byte [edi + 2]
add esi, eax
mov dword [esp + 0x4c], ebx
jns 0x10040fab
xor esi, esi
jmp 0x10040fb9
cmp esi, 0xff
mov eax, 0xff
cmovg esi, eax
lea eax, [esi + esi*4]
add edi, dword [esp + 0x44]
cdq
and edx, 0xff
lea ebx, [edx + eax]
sar ebx, 8
imul eax, ebx, 0xffffff01
cdq
and edx, 3
add eax, edx
mov edx, dword [esp + 0x28]
sar eax, 2
add esi, eax
mov al, bl
shl bl, 2
add bl, 7
mov dword [esp + 0x40], esi
add al, bl
mov ebx, dword [esp + 0x4c]
add al, byte [esp + 0x54]
shl al, 3
add al, byte [esp + 0x58]
mov byte [ecx], al
add ecx, dword [esp + 0x48]
test edx, edx
jne 0x10040f08
mov dword [0x1008fd68], ebp
mov ebp, dword [esp + 0x74]
mov dword [0x1008fd6c], ebx
mov dword [0x1008fd70], esi
mov esi, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov ebx, dword [0x100901b8]
mov ecx, dword [esp + 0x38]
inc edx
mov edi, dword [esp + 0x24]
inc ecx
sub esi, dword [esp + 0x2c]
inc edi
cmp ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x60]
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x24], edi
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], edx
jl 0x10040d60
mov ebx, dword [0x1008fc48]
test ebx, ebx
jne 0x10041073
call fcn.10039630
mov ebx, eax
mov esi, dword [esp + 0x20]
sub esi, edi
mov edi, dword [esp + 0x38]
imul esi, dword [esp + 0x2c]
sub edi, dword [esp + 0x24]
call fcn.10039640
cmp ebx, eax
mov eax, dword [0x100901b0]
je 0x100411f9
mov ecx, dword [esp + 0x24]
add eax, esi
push 0xcc0020
push dword [esp + 0x54]
push 0x1008fd80
push eax
mov eax, dword [esp + 0x8c]
push ecx
push eax
push 0
push 0
push ecx
push eax
mov eax, dword [esp + 0x58]
add eax, edi
push eax
push dword [esp + 0x60]
push dword [0x1008def8]
call dword [sym.imp.GDI32.dll_StretchDIBits]
push dword [0x100901b0]
call fcn.10045fe1
add esp, 4
mov dword [0x100901b0], 0
mov dword [0x100901b4], 0
jmp 0x1004122f
mov eax, dword [esp + 0x3c]
dec eax
cmp eax, 3
ja case.default.0x10041108
jmp dword [eax*4 + 0x10041250]
mov edx, dword [esp + 0x7c]
test edx, edx
je 0x10041126
mov al, byte [edi]
lea ecx, [ecx + 1]
add edi, ebp
mov byte [ecx - 1], al
sub edx, 1
jne 0x10041117
mov edx, dword [esp + 0x14]
jmp case.default.0x10041108
mov esi, dword [esp + 0x7c]
test esi, esi
je 0x100411f0
nop dword [eax + eax]
mov bl, byte [edi + 1]
lea ecx, [ecx + 4]
movzx eax, byte [edi]
add edi, ebp
movzx edx, bl
imul edx, eax
mov byte [ecx - 1], bl
shr edx, 8
mov byte [ecx - 4], dl
mov byte [ecx - 3], dl
mov byte [ecx - 2], dl
sub esi, 1
jne 0x10041140
jmp 0x10041023
mov esi, dword [esp + 0x7c]
test esi, esi
je 0x100411f0
inc edi
mov al, byte [edi + 1]
lea ecx, [ecx + 3]
mov dl, byte [edi - 1]
mov byte [ecx - 3], al
mov al, byte [edi]
add edi, ebp
mov byte [ecx - 2], al
mov byte [ecx - 1], dl
sub esi, 1
jne 0x10041173
mov esi, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
jmp case.default.0x10041108
mov ebx, dword [esp + 0x7c]
test ebx, ebx
je 0x1004102b
add edi, 3
nop word [eax + eax]
movzx esi, byte [edi]
lea ecx, [ecx + 4]
movzx eax, byte [edi - 1]
mov dl, byte [edi - 3]
imul eax, esi
shr eax, 8
mov byte [ecx - 4], al
movzx eax, byte [edi - 2]
imul eax, esi
shr eax, 8
mov byte [ecx - 3], al
movzx eax, dl
imul eax, esi
shr eax, 8
mov byte [ecx - 2], al
mov al, byte [edi]
add edi, ebp
mov byte [ecx - 1], al
sub ebx, 1
jne 0x100411b0
jmp 0x10041023
mov esi, dword [esp + 0x18]
jmp case.default.0x10041108
push dword [esp + 0x50]
add eax, esi
push 0x1008fd80
push eax
mov eax, dword [esp + 0x30]
push eax
push 0
push 0
push 0
push eax
push dword [esp + 0x9c]
mov eax, dword [esp + 0x54]
add eax, edi
push eax
push dword [esp + 0x5c]
push dword [0x1008def8]
call dword [sym.imp.GDI32.dll_SetDIBitsToDevice]
mov ecx, dword [esp + 0x38]
cmp ecx, dword [esp + 0x1c]
jge 0x10041248
mov eax, dword [esp + 0x60]
mov ebx, dword [0x100901b8]
jmp 0x10040d30
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret