Function at 0x413d80
Capabilities:
Access peb ldr_data
Encode data using xor
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x46b110
mov eax, dword fs:[0]
push eax
sub esp, 0x50
mov eax, dword [0x4854a0]
xor eax, esp
mov dword [esp + 0x4c], eax
push ebx
push ebp
push esi
mov eax, dword [0x4854a0]
xor eax, esp
push eax
lea eax, [esp + 0x60]
mov dword fs:[0], eax
mov eax, dword [edi]
mov ecx, dword [eax + 0x10]
mov edx, dword [edi + 0x30]
push 0
push 0
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebx, dword [edi + 0xc]
cmp dword [edi + 8], ebx
lea esi, [edi + 4]
jbe 0x413dd5
call fcn.004382be
mov ebp, dword [esi + 4]
cmp ebp, dword [esi + 8]
jbe 0x413de2
call fcn.004382be
xor edx, edx
cmp ebp, ebx
mov eax, ebp
je 0x413e01
lea ebx, [ebx]
mov ecx, dword [eax]
mov ecx, dword [ecx + 0x14]
add ecx, 0x10
add eax, 4
add edx, ecx
cmp eax, ebx
jne 0x413df0
mov ecx, dword [edi + 0x30]
push 0
mov dword [esp + 0x1c], edx
lea edx, [esp + 0x20]
push edx
push 4
lea eax, [esp + 0x24]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x413f32
cmp dword [esp + 0x1c], 4
jne 0x413f32
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x413e47
mov edx, dword [edi + 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x413fa9
push eax
call fcn.0041bf8c
mov ebp, eax
add esp, 4
mov dword [esp + 0x34], ebp
mov dword [esp + 0x68], 0
mov ebx, dword [esi + 8]
cmp dword [esi + 4], ebx
mov eax, dword [esp + 0x18]
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], ebp
jbe 0x413e7b
call fcn.004382be
mov eax, dword [esi + 4]
cmp eax, dword [esi + 8]
mov dword [esp + 0x20], eax
jbe 0x413e90
call fcn.004382be
mov eax, dword [esp + 0x20]
push ebx
push esi
push eax
push esi
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x3c]
push edx
mov ebx, 0x414df0
call fcn.00414e10
mov eax, dword [esp + 0x30]
push eax
call fcn.00417ad0
mov ebx, eax
add esp, 0x1c
push ebx
call fcn.0041bf8c
mov esi, eax
add esp, 4
mov dword [esp + 0x24], esi
mov byte [esp + 0x68], 1
mov ecx, dword [esp + 0x18]
push ecx
push ebp
lea edx, [esp + 0x1c]
push edx
push esi
mov dword [esp + 0x24], ebx
call fcn.00417ab0
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x48]
push eax
mov edx, esi
call fcn.00405e70
add esp, 0x14
xor eax, eax
xor byte [esp + eax + 0x38], 0xa4
add eax, 1
cmp eax, 0x20
jb 0x413ef5
mov eax, dword [edi + 0x30]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea ecx, [esp + 0x20]
push ecx
push 0x20
lea edx, [esp + 0x44]
push edx
push eax
call ebx
test eax, eax
jne 0x413f39
push esi
call fcn.0041bf87
add esp, 4
push ebp
call fcn.0041bf87
add esp, 4
xor eax, eax
jmp 0x413fae
cmp dword [esp + 0x1c], 0x20
jne 0x413f20
cmp dword [edi + 0x13c], 0
jbe 0x413f6c
xor ecx, ecx
cmp dword [esp + 0x14], ecx
jbe 0x413f6c
xor edx, edx
mov eax, ecx
div dword [edi + 0x13c]
add ecx, 1
mov dl, byte [edx + edi + 0x3c]
xor byte [ecx + esi - 1], dl
cmp ecx, dword [esp + 0x14]
jb 0x413f51
mov ecx, dword [esp + 0x14]
mov edx, dword [edi + 0x30]
push 0
lea eax, [esp + 0x20]
push eax
push ecx
push esi
push edx
call ebx
test eax, eax
je 0x413f20
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x14]
jne 0x413f20
mov ecx, dword [edi + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push esi
call fcn.0041bf87
add esp, 4
push ebp
call fcn.0041bf87
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.00436f5b
add esp, 0x5c
ret