Function at 0x409174
Capabilities:
Encode data using xor

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xfffff004
push eax
add esp, 0xfffffda4
mov edi, edx
mov ebx, eax
test edi, edi
je 0x40958f
mov eax, 0xdf6
call fcn.0040e8b4
push eax
call fcn.0042ad28
pop ecx
push 0x443291
call fcn.0042ad28
pop ecx
xor edx, edx
or word [ebx + 0x3ee4], 0x40
mov eax, dword [ebx + 0x6614]
push edx
add eax, 7
xor edx, edx
push eax
mov eax, ebx
call fcn.0040375c
xor ecx, ecx
mov edx, 0x73
mov eax, ebx
call fcn.00407488
push 0
push 0
mov edx, 2
mov eax, ebx
call fcn.0040375c
mov eax, ebx
call fcn.00403814
mov dword [esp], eax
mov dword [esp + 4], edx
mov edx, dword [esp]
mov dword [esp + 8], edx
mov edx, dword [esp + 4]
mov dword [esp + 0xc], edx
push dword [esp + 4]
push dword [esp + 4]
mov eax, edi
call fcn.0040959c
mov dword [esp + 0x10], 0
lea esi, [ebx + 0x4c20]
mov edi, eax
mov dword [esp + 0x14], 0
lea eax, [esi + 0xc30]
mov edx, 0x14
call fcn.00406fa4
mov word [esi + 8], 0x8000
xor ecx, ecx
mov eax, ebx
mov dword [esi + 0x24], ecx
xor ecx, ecx
or word [ebx + 0x4c28], 0x4000
push 0
push 0x443297
push 0
xor edx, edx
call fcn.00408dc0
push 0
push 0
xor edx, edx
mov eax, ebx
call fcn.0040375c
xor ecx, ecx
xor esi, esi
mov edx, edi
mov dword [esp + 0x18], ecx
shl edx, 9
lea eax, [esp + 0x1020]
call fcn.00403bec
push dword [esp + 0x1024]
push 0
push dword [esp + 0x1028]
call fcn.0043a750
add esp, 0xc
mov dword [esp + 0x1c], 0xfffffff
jmp 0x40942e
call fcn.0040bd24
cmp dword [esp + 4], 0
jne 0x4092c7
cmp dword [esp], 0x200
jae 0x4092fb
jmp 0x4092c9
jge 0x4092fb
mov eax, dword [esp]
mov ebp, eax
mov eax, pe_nt_image_headers32
sub eax, ebp
push eax
push 0
lea edx, [esp + 0x1034]
add edx, ebp
push edx
call fcn.0043a750
add esp, 0xc
mov dword [esp], 0
mov dword [esp + 4], 0
jmp 0x40930c
mov ebp, pe_nt_image_headers32
sub dword [esp], 0x200
sbb dword [esp + 4], 0
lea edx, [esp + 0x102c]
mov ecx, ebp
mov eax, ebx
call fcn.004035f8
mov edx, dword [esp + 0x18]
shl edx, 9
add edx, dword [esp + 0x1020]
xor eax, eax
mov cl, byte [esp + eax + 0x102c]
xor byte [edx + eax], cl
inc eax
cmp eax, 0x200
jl 0x40932c
lea edx, [esp + 0x102c]
mov ecx, pe_nt_image_headers32
or eax, 0xffffffff
call fcn.0040c154
mov byte [esp + esi + 0x20], al
inc esi
shr eax, 8
mov byte [esp + esi + 0x20], al
inc esi
cmp esi, 0x1000
jne 0x4093b8
lea eax, [esp + 0x122c]
mov edx, ebx
call fcn.00402f40
push 0
push 0
mov edx, 2
mov eax, ebx
call fcn.0040375c
lea edx, [esp + 0x20]
mov ecx, esi
mov eax, ebx
call fcn.00403438
lea edx, [esp + 0x20]
mov ecx, esi
mov eax, dword [esp + 0x1c]
call fcn.0040c154
mov dword [esp + 0x1c], eax
xor esi, esi
lea eax, [esp + 0x122c]
mov edx, 2
call fcn.00402f64
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
and eax, 0xff
xor edx, edx
cmp edx, 0
jne 0x409412
cmp eax, 0
jne 0x409412
mov ecx, dword [ebx + 0x13b8]
cmp byte [ecx + 0x20b4], 0
jne 0x409412
push 0
push pe_nt_image_headers32
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
call fcn.0043d3f0
push edx
push eax
push dword [esp + 0x14]
push dword [esp + 0x14]
call fcn.00438f74
push eax
push 0x44329a
call fcn.0042ad28
add esp, 8
add dword [esp + 0x10], 1
adc dword [esp + 0x14], 0
inc dword [esp + 0x18]
mov edx, dword [esp + 0x18]
cmp edx, edi
jb 0x40942e
xor ecx, ecx
mov dword [esp + 0x18], ecx
cmp dword [esp + 4], 0
jne 0x409441
cmp dword [esp], 0
ja 0x4092b0
jmp 0x409447
jg 0x4092b0
push 0
push 0
mov edx, 2
mov eax, ebx
call fcn.0040375c
lea edx, [esp + 0x20]
mov ecx, esi
mov eax, ebx
call fcn.00403438
lea edx, [esp + 0x20]
mov ecx, esi
mov eax, dword [esp + 0x1c]
call fcn.0040c154
mov dword [esp + 0x1c], eax
mov esi, edi
shl esi, 9
mov ecx, esi
mov edx, dword [esp + 0x1020]
mov eax, ebx
call fcn.00403438
mov ecx, esi
mov edx, dword [esp + 0x1020]
mov eax, dword [esp + 0x1c]
call fcn.0040c154
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x1c]
not eax
mov dword [ebx + 0x4c38], eax
mov eax, ebx
push dword [esp + 0xc]
push dword [esp + 0xc]
xor edx, edx
call fcn.0040375c
lea eax, [esp + 0x123c]
xor edx, edx
call fcn.00416fe8
mov edx, 0x4432a4
lea eax, [esp + 0x123c]
mov ecx, 8
call fcn.0041718c
lea eax, [esp + 0x123c]
mov esi, edi
mov edx, esi
call fcn.00417114
push dword [esp + 0x14]
push dword [esp + 0x14]
lea eax, [esp + 0x1244]
call fcn.00417164
lea edx, [ebx + 0x5850]
lea eax, [esp + 0x123c]
call fcn.00417254
push 0
push 0x443297
push 0
push 0
push 2
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
call fcn.0043d3f0
shl esi, 9
mov ecx, eax
add ecx, esi
xor edx, edx
mov eax, ebx
call fcn.00408dc0
push 0
push 0
mov edx, 2
mov eax, ebx
call fcn.0040375c
mov edx, dword [ebx + 0x13b8]
cmp byte [edx + 0x20b4], 0
jne 0x40956d
push 0x4432ad
call fcn.0042ad28
pop ecx
lea eax, [esp + 0x123c]
mov edx, 2
call fcn.0041701c
lea eax, [esp + 0x1020]
mov edx, 2
call fcn.00401244
add esp, 0x125c
pop ebp
pop edi
pop esi
pop ebx
ret