Function at 0x40d760
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x40
mov eax, dword [0x4780bc]
xor eax, esp
mov dword [esp + 0x3c], eax
push ebx
mov ebx, dword [esp + 0x60]
push edi
call fcn.00415120
mov edi, eax
test edi, edi
jne 0x40d786
xor bl, bl
jmp 0x40d98c
cmp dword [esp + 0x60], 0x10
lea eax, [esp + 0x4c]
mov dword [esp + 0x14], 0
cmovae eax, dword [esp + 0x4c]
push eax
push 0x2712
push edi
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0xf
mov dword [esp + 0x38], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 0xf
call fcn.004185d0
push 1
push 0x51
push edi
call fcn.004185d0
add esp, 0x18
mov dword [esp + 8], 0xdeddc5c1
mov dword [esp + 0xc], 0xc7c0c3
xor ecx, ecx
mov byte [esp + 0x10], 1
lea eax, [ecx - 0x51]
xor byte [esp + ecx + 8], al
inc ecx
cmp ecx, 7
jb 0x40d7f4
push esi
lea eax, [esp + 0xc]
mov byte [esp + 0x14], 0
push eax
push 0x2722
push edi
call fcn.004185d0
push str.bratvapubgm.com
push 0x27c1
push edi
call fcn.004185d0
push 1
push 0x40
push edi
call fcn.004185d0
cmp dword [esp + 0xa4], 0x10
lea eax, [esp + 0x90]
cmovae eax, dword [esp + 0x90]
push eax
push 0x271f
push edi
call fcn.004185d0
push 0x40e330
push 0x4e2b
push edi
call fcn.004185d0
lea eax, [esp + 0x54]
push eax
push 0x2711
push edi
call fcn.004185d0
add esp, 0x48
push 0x40c140
push 0x4e6f
push edi
call fcn.004185d0
lea eax, [esp + 0x3c]
push eax
push 0x272d
push edi
call fcn.004185d0
push edi
call fcn.00415160
push edi
mov esi, eax
call fcn.00415100
add esp, 0x20
test esi, esi
pop esi
je 0x40d8b5
mov edx, dword [esp + 0x28]
xor bl, bl
jmp 0x40d8f6
push 0x1024
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push 0x1024
push 0
push eax
mov dword [0x478858], eax
call sub.VCRUNTIME140.dll_memset
mov edx, dword [esp + 0x38]
lea ecx, [esp + 0x24]
add esp, 0x10
cmp edx, 0x10
cmovae ecx, dword [esp + 0x14]
sub ebx, ecx
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [ebx + ecx - 1], al
test al, al
jne 0x40d8e7
mov bl, 1
mov ecx, dword [esp + 0x40]
cmp ecx, 0x10
jb 0x40d930
mov edx, dword [esp + 0x2c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d922
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40d9fb
push ecx
push edx
call fcn.0045e420
mov edx, dword [esp + 0x30]
add esp, 8
mov dword [esp + 0x3c], 0
mov dword [esp + 0x40], 0xf
mov byte [esp + 0x2c], 0
cmp edx, 0x10
jb 0x40d977
mov ecx, dword [esp + 0x14]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40d96d
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40d9fb
push edx
push ecx
call fcn.0045e420
add esp, 8
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0xf
mov byte [esp + 0x14], 0
mov ecx, dword [esp + 0x60]
cmp ecx, 0x10
jb 0x40d9be
mov edx, dword [esp + 0x4c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d9b4
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40d9fb
push ecx
push edx
call fcn.0045e420
add esp, 8
mov ecx, dword [esp + 0x7c]
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], 0xf
mov byte [esp + 0x4c], 0
cmp ecx, 0x10
jb 0x40da0b
mov edx, dword [esp + 0x68]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40da01
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40da01
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0045e420
add esp, 8
mov ecx, dword [esp + 0x44]
mov al, bl
pop edi
pop ebx
xor ecx, esp
call fcn.0045e42e
add esp, 0x40
ret