Function at 0x40aa1c
Capabilities:
Encode data using xor
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov ebx, dword [ebp + 8]
test ebx, ebx
je 0x40acdf
call fcn.0040a851
cmp dword [0x47a024], 0
jne 0x40aa4b
cmp dword [0x47a028], 0
je 0x40acda
mov edx, 0x4d2734
mov ecx, 0x4100
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
cmp byte [ebx], 1
jne 0x40aaa2
or ecx, 0xffffffff
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
add ecx, 0x3f
mov dword [esp], ecx
call sub.msvcrt.dll_malloc
test eax, eax
je 0x40acda
mov ecx, eax
mov esi, eax
jmp 0x40aa92
cmp al, 0xff
setne dl
neg edx
and edx, eax
xor edx, 0xffffffa5
mov byte [ecx], dl
inc ecx
inc ebx
mov al, byte [ebx + 1]
test al, al
jne 0x40aa82
mov eax, esi
mov byte [ecx], 0
mov ebx, esi
jmp 0x40aaa6
mov eax, ebx
xor ebx, ebx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 0x10000
mov dword [esp], 0x4d2734
call fcn.00414580
test ebx, ebx
je 0x40aad1
mov dword [esp], ebx
call fcn.0041afa8
mov byte [0x4e2734], 0
mov eax, dword [0x4d030c]
test eax, eax
je 0x40aae3
call eax
mov dword [esp], 0
call fcn.00414570
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
mov dword [esp], eax
call fcn.00414610
mov edx, dword [eax]
mov edi, dword [eax + 4]
mov esi, dword [eax + 8]
mov ebx, dword [eax + 0xc]
mov ecx, dword [eax + 0x10]
inc ecx
mov dword [ebp - 0x2c], ecx
mov eax, dword [eax + 0x14]
add eax, 0x76c
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x3c], edx
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x3c]
mov dword [esp + 0x20], edx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], ebx
mov edx, dword [ebp - 0x2c]
mov dword [esp + 0x10], edx
mov ecx, dword [ebp - 0x30]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], eax
mov dword [esp + 4], str.__05i___04i__02i__02i__02i:_02i:_02i:
mov dword [esp], 0x4e2b34
call sub.msvcrt.dll_sprintf
cmp dword [0x47a024], 0
je 0x40aca7
cmp byte [0x4d0328], 0
je 0x40aca7
mov dword [esp + 4], 0x483ea3
mov dword [esp], 0x4d0328
call sub.msvcrt.dll_fopen
mov ebx, eax
test eax, eax
je 0x40aca7
mov eax, 0x4e2b34
call fcn.0040a778
mov dword [ebp - 0x2c], eax
xor eax, eax
or ecx, 0xffffffff
mov edi, dword [ebp - 0x2c]
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp dword [0x4d2328], 0
je 0x40ac7c
mov dword [ebp - 0x30], ecx
jmp 0x40ac70
mov esi, dword [ebp - 0x30]
cmp esi, 0x12000
jbe 0x40abd2
mov esi, 0x12000
mov edx, dword [0x4d272c]
mov eax, dword [0x4d2730]
xor ecx, ecx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x48], ecx
inc edx
movzx edx, dl
mov edi, dword [edx*4 + 0x4d232c]
mov ebx, edi
add eax, ebx
movzx eax, al
mov esi, dword [eax*4 + 0x4d232c]
mov dword [edx*4 + 0x4d232c], esi
mov dword [eax*4 + 0x4d232c], edi
lea edi, [ebx + esi]
and edi, 0xff
mov edi, dword [edi*4 + 0x4d232c]
mov ebx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x48]
mov cl, byte [ebx + ecx]
xor edi, ecx
mov ecx, edi
mov ebx, dword [ebp - 0x48]
mov byte [ebx + 0x4e2bb4], cl
inc ebx
mov dword [ebp - 0x48], ebx
mov esi, dword [ebp - 0x44]
cmp ebx, esi
jl 0x40abe8
mov ebx, dword [ebp - 0x40]
mov dword [0x4d272c], edx
mov dword [0x4d2730], eax
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], esi
mov dword [esp], 0x4e2bb4
call sub.msvcrt.dll_fwrite
sub dword [ebp - 0x30], esi
add dword [ebp - 0x2c], esi
cmp dword [ebp - 0x30], 0
jg 0x40abc2
jmp 0x40ac97
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], ecx
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], ebx
call sub.msvcrt.dll_fflush
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
cmp dword [0x47a028], 0
je 0x40accf
mov eax, 0x4e2b41
call fcn.0040a778
mov edx, dword [sym.imp.msvcrt.dll__iob]
add edx, 0x40
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_fputs
mov eax, dword [0x4d0308]
test eax, eax
je 0x40acda
call eax
call fcn.0040a866
add esp, 0x6c
pop ebx
pop esi
pop edi
pop ebp
ret