Function at 0x4037d0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 8
push ebx
mov ebx, dword [esp + 0x10]
xor edx, edx
push ebp
push esi
cmp ebx, edx
push edi
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], edx
jne 0x4037f6
pop edi
pop esi
pop ebp
mov eax, 0xffffff9a
pop ebx
add esp, 8
ret
mov esi, dword [ebx + 0x7c]
cmp esi, edx
jne 0x40380a
pop edi
pop esi
pop ebp
mov eax, 0xffffff9a
pop ebx
add esp, 8
ret
cmp dword [esi], edx
jne 0x40381b
pop edi
pop esi
pop ebp
mov eax, 0xffffff9c
pop ebx
add esp, 8
ret
mov ecx, dword [esp + 0x24]
cmp ecx, edx
jne 0x40382d
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret
mov eax, dword [esp + 0x20]
mov dword [esi + 0x14], ecx
mov dword [esi + 0x10], eax
mov eax, dword [esi + 0x5c]
cmp ecx, eax
jbe 0x403841
mov dword [esi + 0x14], eax
cmp dword [esi + 0x14], edx
jbe 0x4039e9
mov eax, dword [esi + 8]
test eax, eax
jne 0x40390e
mov eax, dword [esi + 0x58]
test eax, eax
jbe 0x40390e
mov ebp, 0x4000
cmp eax, ebp
jae 0x40386f
mov ebp, eax
test ebp, ebp
je 0x403823
mov cl, byte [ebx + 0x30]
xor eax, eax
test cl, 1
je 0x40387e
mov eax, 0xc
mov ecx, dword [esi + 0x68]
mov edi, dword [esi + 0x3c]
mov edx, dword [esi + 0x60]
add ecx, edi
add ecx, eax
push 0
push ecx
push edx
call fcn.0040715b
add esp, 0xc
test eax, eax
jne 0x4039f5
mov eax, dword [esi + 0x60]
mov ecx, dword [esi]
push eax
push 1
push ebp
push ecx
call fcn.004066c0
add esp, 0x10
cmp eax, 1
jne 0x4039f5
test byte [ebx + 0x30], 1
je 0x4038f6
xor edi, edi
test ebp, ebp
jbe 0x4038f6
mov edx, dword [esi]
mov bl, byte [edx + edi]
call fcn.00401220
xor bl, al
mov byte [esp + 0x24], bl
mov eax, dword [esp + 0x24]
and eax, 0xff
push eax
call fcn.00401240
mov ecx, dword [esi]
add esp, 4
mov byte [ecx + edi], bl
inc edi
cmp edi, ebp
jb 0x4038c6
mov ebx, dword [esp + 0x1c]
mov ecx, dword [esi + 0x3c]
mov eax, dword [esi + 0x58]
mov edx, dword [esi]
add ecx, ebp
sub eax, ebp
mov dword [esi + 0x3c], ecx
mov dword [esi + 0x58], eax
mov dword [esi + 4], edx
mov dword [esi + 8], ebp
mov eax, dword [esi + 0x64]
test eax, eax
jne 0x403988
mov eax, dword [esi + 0x14]
mov edi, dword [esi + 8]
cmp eax, edi
jae 0x403921
mov edi, eax
xor eax, eax
test edi, edi
jbe 0x403938
mov ecx, dword [esi + 4]
mov edx, dword [esi + 0x10]
mov cl, byte [ecx + eax]
mov byte [edx + eax], cl
inc eax
cmp eax, edi
jb 0x403927
mov edx, dword [esi + 0x10]
mov eax, dword [esi + 0x50]
push edi
push edx
push eax
call fcn.00404080
mov edx, dword [esi + 0x5c]
mov ecx, dword [esi + 8]
mov ebp, dword [esi + 0x10]
mov dword [esi + 0x50], eax
mov eax, dword [esi + 0x14]
sub edx, edi
sub ecx, edi
sub eax, edi
mov dword [esi + 0x5c], edx
mov edx, dword [esi + 4]
mov dword [esi + 8], ecx
mov ecx, dword [esi + 0x18]
mov dword [esi + 0x14], eax
mov eax, dword [esp + 0x1c]
add esp, 0xc
add ebp, edi
add edx, edi
add ecx, edi
add eax, edi
mov dword [esi + 0x10], ebp
mov dword [esi + 4], edx
mov dword [esi + 0x18], ecx
mov dword [esp + 0x10], eax
jmp 0x4039d6
mov ebp, dword [esi + 0x18]
mov ebx, dword [esi + 0x10]
lea ecx, [esi + 4]
push 2
push ecx
call fcn.00403c50
mov edi, dword [esi + 0x18]
mov edx, dword [esi + 0x50]
sub edi, ebp
mov dword [esp + 0x1c], eax
push edi
push ebx
push edx
call fcn.00404080
mov ebx, dword [esi + 0x5c]
mov edx, dword [esp + 0x24]
mov dword [esi + 0x50], eax
mov eax, dword [esp + 0x28]
add esp, 0x14
sub ebx, edi
add edx, edi
cmp eax, 1
mov dword [esi + 0x5c], ebx
mov dword [esp + 0x10], edx
je 0x4039e9
test eax, eax
jne 0x403a00
mov ebx, dword [esp + 0x1c]
mov eax, dword [esi + 0x14]
test eax, eax
ja 0x40384a
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x403a00
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 8
ret
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret