Function at 0x87f430
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov ecx, dword [0x884658]
xor eax, eax
mov dword [ebp - 0x1c], eax
push ebx
push esi
mov dword [ebp - 0x18], eax
push edi
mov dword [ebp - 0x14], eax
push 0xffffffffffffffff
push ecx
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, dword [ebp + 8]
test edi, edi
jne 0x87f49b
mov esi, dword [ebp + 0x14]
test esi, esi
jbe 0x87f696
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
sub edx, eax
mov bl, byte [eax]
mov cl, al
add cl, dl
xor bl, cl
mov cl, bl
mov byte [eax], bl
and ecx, 0xff
inc eax
dec esi
mov cl, byte [ecx + 0x883f60]
mov byte [eax - 1], cl
jne 0x87f477
jmp 0x87f696
push edi
call fcn.0087ecb0
add esp, 4
and eax, 0xff
mov dword [ebp - 0xc], eax
jne 0x87f4c3
mov eax, dword [0x884658]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x50f]
test eax, eax
je 0x87f66a
mov al, byte [edi + 0x262]
test al, al
je 0x87f66a
cmp al, 2
jne 0x87f514
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp + 0xc]
push ecx
push edx
add edi, 0x2d
push eax
push edi
call fcn.0087f2c0
mov ecx, dword [0x884658]
add esp, 0x10
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
cmp al, 1
jne 0x87f654
mov esi, dword [ebp + 0x10]
mov eax, dword [ebp + 0x14]
mov edx, esi
mov edi, esi
add esi, eax
and edx, 0xf
mov eax, esi
sub edi, edx
and eax, 0xf
je 0x87f53d
mov ecx, 0x10
sub ecx, eax
add esi, ecx
mov ebx, esi
push 4
sub ebx, edi
push 0x3000
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, dword [ebp + 8]
xor edx, edx
mov dword [ebp - 4], eax
mov dword [ebp - 0x14], 0
mov dx, word [ecx + 0xd]
add edx, edi
mov dword [ebp - 0x18], edx
lea edx, [ebp - 0x20]
push edx
lea edx, [ebp - 8]
push edx
push ebx
push eax
mov eax, dword [ecx]
push eax
call fcn.0087b690
test eax, eax
jne 0x87f5be
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x87f5be
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
je 0x87f5be
mov ecx, dword [ebp - 4]
push 0x8000
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov edx, dword [0x884658]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 8]
lea eax, [ebp - 8]
push 1
push eax
mov eax, dword [edx]
lea ecx, [ebp - 0x20]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
cmp ebx, dword [ebp - 8]
je 0x87f5dc
sub esi, 0x10
cmp edi, esi
mov ebx, edi
jae 0x87f60e
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 4]
add ecx, 0x2d
sub eax, edi
mov dword [ebp - 0xc], ecx
mov dword [ebp + 8], eax
jmp 0x87f5f8
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0xc]
add eax, ebx
push eax
push edx
call fcn.00876820
add ebx, 0x10
add esp, 8
cmp ebx, esi
jb 0x87f5f5
mov eax, dword [ebp - 4]
mov edx, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x14]
mov esi, eax
sub esi, edi
mov edi, dword [ebp + 0xc]
add esi, edx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x8000
and ecx, 3
push 0
rep movsb byte es:[edi], byte [esi]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [0x884658]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x884658]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 0x14]
test esi, esi
jbe 0x87f696
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
sub edx, eax
mov bl, byte [eax]
mov cl, dl
add cl, al
xor bl, cl
mov cl, bl
mov byte [eax], bl
and ecx, 0xff
inc eax
dec esi
mov cl, byte [ecx + edi + 0x2d]
mov byte [eax - 1], cl
jne 0x87f679
mov edx, dword [0x884658]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret