Function at 0x385b3800
Capabilities:
Encode data using xor

Disassembly:
wait
fninit
pushal
pushfd
call fcn.385b37d2
pop ebx
cmp ebx, 0
je 0x385b3888
cmp ebx, 1
je 0x385b37c8
cmp ebx, 2
je fcn.385b37d2
cmp ebx, 3
je 0x385b37fe
cmp ebx, 4
je 0x385b3822
add ebx, 0xc5
mov ecx, 0xdcb
mov eax, ebx
push eax
add byte [eax], 0x55
mov ebp, esp
sub esp, 8
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
cmp dword [ebx], 0x4550
jne 0x385b3c2c
mov ecx, dword [ebx + 0xdc14]
lea eax, [ecx - 0xe9a]
cmp eax, 0x13ff166
ja 0x385b3c2c
invalid
mov eax, 0x10b
cmp word [ebx + 0x18], ax
jne 0x385b3c2c
movzx eax, word [ebx + 0x16]
test eax, 0x3000
jne 0x385b3c2c
mov eax, dword [ebx + 0x9549]
sub ecx, eax
cmp dword [ebx + 0x954d], ecx
jne 0x385b3c2c
cmp eax, 0xe9a
jb 0x385b3c2c
mov eax, dword [ebx + 0x955d]
and eax, 0xe0000000
cmp eax, 0xe0000000
jne 0x385b3c2c
push 4
lea edi, [ebx + 0x1400]
add byte [eax], al
push edi
push 0x34
push ebx
mov dword [ebp - 8], edi
call 0x37e6b7f0
add esp, 0x10
cmp eax, 4
jne 0x385b3c2c
cmp dword [edi], 0xb83adcf
jne 0x385b3c2c
lea ecx, [ebx + 0x400]
mov edx, 0x7b51bc8
lea esi, [eax + 0x2f]
lea esp, [esp]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x385b39fd
add ecx, 4
add edx, 4
sub esi, 4
jae 0x385b38c0
mov ax, word [ecx]
cmp ax, word [edx]
jne 0x385b39fd
mov al, byte [ecx + 2]
cmp al, byte [edx + 2]
jne 0x385b39fd
push 0xe9a
push ebx
call 0x37ac3fb0
mov esi, eax
add esp, 8
test esi, esi
je 0x385b3c1a
push 0xe9a
push esi
push dword [ebx + 0xdc24]
push ebx
call 0x37e6b7f0
add esp, 0x10
cmp eax, 0xe9a
jne 0x385b39e1
mov al, byte [esi + 0x37]
mov dl, byte [esi + 0x38]
cmp al, 3
je 0x385b3967
cmp al, 0x2b
je 0x385b3951
cmp al, 0x33
jne 0x385b39e1
mov ecx, 0xcf
xor byte [esi + ecx], dl
lea eax, [esi + ecx]
inc ecx
cmp ecx, 0xdcb
jb 0x385b3940
jmp 0x385b397f
mov ecx, 0xcf
sub byte [esi + ecx], dl
lea eax, [esi + ecx]
inc ecx
cmp ecx, 0xdcb
jb 0x385b3956
jmp 0x385b397f
mov ecx, 0xcf
lea esp, [esp]
add byte [esi + ecx], dl
lea eax, [esi + ecx]
inc ecx
cmp ecx, 0xdcb
jb 0x385b3970
mov edi, 0xcf
mov ecx, 0x13
lea esp, [esp]
mov dl, byte [esi + ecx + 0x5a]
mov al, byte [esi + edi]
test cl, 1
je 0x385b39a0
xor al, dl
jmp 0x385b39a2
sub al, dl
sub ecx, 1
mov byte [esi + edi], al
jns 0x385b3990
inc edi
cmp edi, 0xdcb
jb 0x385b3984
mov eax, dword [esi + 0xc74]
mov dword [ebx + 0x1400], eax
mov eax, dword [ebx + 0xdc24]
push esi
push ebx
mov dword [ebx + 0x1404], eax
call 0x37ac3ff0
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
push ebx
call 0x37ac3ff0
add esp, 8
mov dword [edi], 0x4c494146
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x3c]
lea esi, [eax + 0xe99]
neg eax
and esi, eax
mov dword [ebp - 4], esi
je 0x385b3c2c
mov ecx, dword [ebx + 0x9549]
lea eax, [ecx - 0xe9a]
cmp esi, eax
ja 0x385b3c2c
mov edx, dword [ebx + 0x9545]
sub edx, esi
add edx, ecx
mov dword [ebp + 8], edx
je 0x385b3c2c
mov eax, dword [ebx + 0x50]
sub eax, esi
cmp edx, eax
ja 0x385b3c2c
push 0x800
sub ecx, esi
add ecx, dword [ebx + 0x954d]
push edi
push ecx
push ebx
call 0x37e6b7f0
add esp, 0x10
cmp eax, 0x800
jne 0x385b3c2c
mov ecx, edi
mov edx, 0x7b51bc8
mov esi, 0x33
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x385b3c2c
add ecx, 4
add edx, 4
sub esi, 4
jae 0x385b3a76
mov ax, word [ecx]
cmp ax, word [edx]
jne 0x385b3c2c
mov al, byte [ecx + 2]
cmp al, byte [edx + 2]
jne 0x385b3c2c
mov al, byte [ebx + 0x1437]
mov cl, byte [ebx + 0x1438]
cmp al, 3
je 0x385b3af3
cmp al, 0x2b
je 0x385b3adc
cmp al, 0x33
jne 0x385b3c1a
lea eax, [ebx + 0x14cf]
mov edx, 0x662
lea ebx, [ebx]
xor byte [eax], cl
lea eax, [eax + 1]
sub edx, 1
jne 0x385b3ad0
jmp 0x385b3b0a
lea eax, [ebx + 0x14cf]
mov edx, 0x662
sub byte [eax], cl
lea eax, [eax + 1]
sub edx, 1
jne 0x385b3ae7
jmp 0x385b3b0a
lea eax, [ebx + 0x14cf]
mov edx, 0x662
mov edi, edi
add byte [eax], cl
lea eax, [eax + 1]
sub edx, 1
jne 0x385b3b00
mov esi, 0xcf
nop
mov al, byte [edi + esi]
mov ecx, 0x13
jmp 0x385b3b20
mov dl, byte [ebx + ecx + 0x145a]
test cl, 1
je 0x385b3b30
xor al, dl
jmp 0x385b3b32
sub al, dl
sub ecx, 1
mov byte [edi + esi], al
jns 0x385b3b20
inc esi
cmp esi, 0x731
jb 0x385b3b10
mov eax, dword [ebx + 0xdc14]
sub eax, dword [ebx + 0xdc24]
push eax
push ebx
call 0x37ac3fb0
mov edi, eax
add esp, 8
test edi, edi
je 0x385b3c17
mov edx, dword [ebx + 0xdc24]
mov ecx, dword [ebx + 0xdc14]
sub ecx, edx
push ecx
push edi
push edx
push ebx
call 0x37e6b7f0
mov ecx, dword [ebx + 0xdc14]
add esp, 0x10
sub ecx, dword [ebx + 0xdc24]
cmp eax, ecx
jne 0x385b3bb4
lea edx, [ecx - 5]
xor esi, esi
test edx, edx
je 0x385b3bb4
cmp byte [edi + esi], 0xe8
jne 0x385b3baf
mov ecx, dword [edi + esi + 1]
mov eax, dword [ebp + 8]
add ecx, 5
sub eax, dword [ebx + 0x28]
add ecx, esi
cmp ecx, eax
je 0x385b3bd4
inc esi
cmp esi, edx
jb 0x385b3b96
push edi
push ebx
call 0x37ac3ff0
add esp, 8
mov dword [ebx + 0x1400], 0x4c494146
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push ebx
call 0x37ac3ff0
mov dword [ebx + 0x1400], 0x4f5045
add esp, 8
mov eax, dword [ebx + 0x9549]
sub eax, dword [ebp - 4]
add eax, dword [ebx + 0x954d]
mov dword [ebx + 0x1404], eax
mov eax, dword [ebx + 0xdc24]
add eax, esi
pop edi
mov dword [ebx + 0x1408], eax
mov eax, 1
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 8]
mov dword [edi], 0x4c494146
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret