Function at 0x39f3490
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x1c
push ebp
push esi
push edi
push 0
push 0
push 3
push 0
mov esi, 1
push esi
push 0x81
push eax
mov ebp, ecx
call dword [0x3a5fdb0]
mov edi, eax
cmp edi, 0xffffffff
jne 0x39f34e6
call dword [0x3a5fd78]
cmp eax, 2
je 0x39f34db
mov eax, dword [ebp + 0x18]
cmp eax, 5
jae 0x39f34db
mov dword [ebp + eax*4 + 4], 0xface0201
add dword [ebp + 0x18], esi
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x1c
ret 4
push 0
push 0
push 0x40
push edi
call dword [0x3a5ffb0]
push 0
lea ecx, [esp + 0x30]
push ecx
push 0x10
lea edx, [esp + 0x24]
push edx
push edi
call dword [0x3a5fe08]
test eax, eax
je 0x39f3787
cmp dword [esp + 0x2c], 0x10
jne 0x39f3787
push ebx
lea eax, [esp + 0x18]
push eax
push edi
call dword [0x3a5fe14]
mov ebx, eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x14], ebx
test eax, eax
jl 0x39f375d
mov esi, dword [esp + 0x1c]
jg 0x39f3548
test esi, esi
jb 0x39f3758
mov edx, dword [esp + 0x24]
xor ecx, ecx
add edx, esi
adc ecx, eax
mov eax, dword [esp + 0x18]
cmp eax, ecx
jb 0x39f3758
ja 0x39f3568
cmp ebx, edx
jb 0x39f3758
mov ebx, dword [0x3a5ffb0]
push 0
lea ecx, [esp + 0x24]
push ecx
push esi
push edi
call ebx
mov edx, dword [esp + 0x24]
push edx
call fcn.0393d9d0
mov esi, eax
add esp, 4
test esi, esi
jne 0x39f35ab
push 0xface0204
mov ecx, ebp
call fcn.039f3310
push edi
call dword [0x3a5fd90]
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x1c
ret 4
mov ecx, dword [esp + 0x24]
push 0
lea eax, [esp + 0x34]
push eax
push ecx
push esi
push edi
call dword [0x3a5fe08]
test eax, eax
je 0x39f3730
mov edx, dword [esp + 0x30]
cmp edx, dword [esp + 0x24]
jne 0x39f3730
cmp byte [esi], 0x74
jne 0x39f3730
cmp byte [esi + 1], 0x68
jne 0x39f3730
cmp byte [esi + 2], 0x69
jne 0x39f3730
cmp byte [esi + 3], 0x6e
jne 0x39f3730
mov eax, 0xb8
cmp word [esi + 8], ax
jb 0x39f3730
mov ecx, dword [esp + 0x18]
cmp ecx, dword [esi + 0x74]
jl 0x39f3730
jg 0x39f3627
mov edx, dword [esp + 0x14]
cmp edx, dword [esi + 0x70]
jb 0x39f3730
mov ecx, dword [esi + 0x70]
push 0
lea eax, [esi + 0x74]
push eax
push ecx
push edi
call ebx
mov ebx, dword [esi + 0x78]
test ebx, ebx
jne 0x39f3663
push 0xface0210
mov ecx, ebp
call fcn.039f3310
push edi
call dword [0x3a5fd90]
push esi
call fcn.0393d9e0
add esp, 4
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x1c
ret 4
push esi
call fcn.0393d9e0
push ebx
call fcn.0393d9d0
mov esi, eax
add esp, 8
mov dword [esp + 0x10], esi
test esi, esi
jne 0x39f3686
push 0xface0206
jmp 0x39f3591
push 0
lea edx, [esp + 0x34]
push edx
push ebx
push esi
push edi
call dword [0x3a5fe08]
test eax, eax
je 0x39f3729
cmp dword [esp + 0x30], ebx
jne 0x39f3729
push edi
call dword [0x3a5fd90]
lea eax, [ebx - 1]
push eax
call fcn.0393d9d0
add esp, 4
mov dword [ebp], eax
test eax, eax
jne 0x39f36e3
push esi
call fcn.0393d9e0
add esp, 4
push 0xface0208
mov ecx, ebp
call fcn.039f3310
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x1c
ret 4
mov cl, byte [esi + 1]
lea edx, [esi + 1]
inc edx
mov esi, eax
cmp ebx, 2
jbe 0x39f370a
lea edi, [ebx - 2]
mov al, byte [edx]
xor al, cl
mov byte [esi], al
shl cl, 7
and al, 0x7f
or al, cl
inc edx
inc esi
sub edi, 1
mov cl, al
jne 0x39f36f4
mov ecx, dword [esp + 0x10]
push ecx
mov byte [esi], 0
call fcn.0393d9e0
add esp, 4
pop ebx
pop edi
pop esi
mov eax, 1
pop ebp
add esp, 0x1c
ret 4
push 0xface0207
jmp 0x39f3735
push 0xface0205
mov ecx, ebp
call fcn.039f3310
push esi
call fcn.0393d9e0
add esp, 4
push edi
call dword [0x3a5fd90]
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x1c
ret 4
mov esi, 1
mov eax, dword [ebp + 0x18]
cmp eax, 5
jae 0x39f3598
mov dword [ebp + eax*4 + 4], 0xface0203
add dword [ebp + 0x18], esi
push edi
call dword [0x3a5fd90]
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x1c
ret 4
mov eax, dword [ebp + 0x18]
cmp eax, 5
jae 0x39f379a
mov dword [ebp + eax*4 + 4], 0xface0202
add dword [ebp + 0x18], esi
push edi
call dword [0x3a5fd90]
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x1c
ret 4