Function at 0x520b94
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x56b01a
mov eax, dword fs:[0]
push eax
sub esp, 0x78
mov eax, dword [0x5ca018]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov edx, eax
mov esi, dword [ebp + 0x10]
and eax, 0x3f
mov ebx, dword [ebp + 0x18]
imul ecx, eax, 0x38
sar edx, 6
mov dword [ebp - 0x5c], esi
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x4c], edx
mov eax, dword [edx*4 + 0x5cf790]
mov dword [ebp - 0x44], ecx
mov eax, dword [ecx + eax + 0x18]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp + 0x14]
add eax, esi
mov dword [ebp - 0x50], eax
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
cmp byte [ebx + 0x14], 0
mov dword [ebp - 0x70], eax
jne 0x520c0d
mov ecx, ebx
call fcn.00407a8b
mov esi, dword [ebp + 8]
lea eax, [ebx + 0xc]
mov dword [ebp - 0x6c], eax
mov edi, esi
mov eax, dword [eax]
mov ecx, dword [eax + 8]
xor eax, eax
stosd dword es:[edi], eax
mov dword [ebp - 0x74], ecx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov eax, dword [ebp - 0x5c]
mov edi, eax
mov dword [ebp - 0x34], edi
cmp eax, dword [ebp - 0x50]
jae 0x520f36
xor ebx, ebx
mov al, byte [edi]
mov byte [ebp - 0x2d], al
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x2c], 1
mov eax, dword [eax*4 + 0x5cf790]
mov dword [ebp - 0x38], eax
cmp ecx, 0xfde9
jne 0x520d89
mov ecx, dword [ebp - 0x38]
mov eax, ebx
mov edx, dword [ebp - 0x44]
add ecx, 0x2e
add ecx, edx
cmp byte [ecx], bl
je 0x520c78
inc eax
inc ecx
cmp eax, 5
jl 0x520c6d
mov edi, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x34]
sub edi, ecx
mov dword [ebp - 0x2c], eax
test eax, eax
jle 0x520d29
mov eax, dword [ebp - 0x38]
add eax, 0x2e
add eax, edx
mov dword [ebp - 0x64], eax
movzx eax, byte [eax]
movsx eax, byte [eax + 0x5cab78]
inc eax
mov dword [ebp - 0x3c], eax
sub eax, dword [ebp - 0x2c]
mov dword [ebp - 0x38], eax
cmp eax, edi
jg 0x520eb8
mov ecx, dword [ebp - 0x2c]
mov edi, ebx
mov esi, dword [ebp - 0x64]
mov al, byte [esi]
mov byte [ebp + edi - 0x18], al
inc edi
inc esi
cmp edi, ecx
jl 0x520cba
mov edi, dword [ebp - 0x38]
test edi, edi
jle 0x520ce6
push edi
mov edi, dword [ebp - 0x34]
lea eax, [ebp - 0x18]
add eax, ecx
push edi
push eax
call fcn.00407036
mov edx, dword [ebp - 0x44]
add esp, 0xc
mov ecx, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x4c]
mov edi, ebx
mov eax, dword [esi*4 + 0x5cf790]
add eax, edx
mov byte [eax + edi + 0x2e], bl
inc edi
cmp edi, ecx
jl 0x520ceb
push dword [ebp - 0x48]
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x18]
mov edi, dword [ebp - 0x34]
lea ecx, [ebp - 0x7c]
mov dword [ebp - 0x68], eax
xor eax, eax
cmp dword [ebp - 0x3c], 4
push ecx
sete al
mov dword [ebp - 0x7c], ebx
inc eax
mov dword [ebp - 0x78], ebx
mov dword [ebp - 0x2c], eax
push eax
lea eax, [ebp - 0x68]
jmp 0x520d68
movzx eax, byte [ecx]
movsx ecx, byte [eax + 0x5cab78]
inc ecx
mov dword [ebp - 0x38], ecx
cmp ecx, edi
jg 0x520ee6
push dword [ebp - 0x48]
mov edi, dword [ebp - 0x34]
xor eax, eax
cmp ecx, 4
mov dword [ebp - 0x84], ebx
lea ecx, [ebp - 0x84]
mov dword [ebp - 0x80], ebx
sete al
mov dword [ebp - 0x3c], edi
inc eax
push ecx
mov dword [ebp - 0x2c], eax
push eax
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x40]
push eax
call fcn.00408201
add esp, 0x14
cmp eax, 0xffffffff
je 0x520f36
mov eax, dword [ebp - 0x38]
dec eax
add edi, eax
jmp 0x520e12
mov ecx, dword [ebp - 0x44]
mov dl, byte [ecx + eax + 0x2d]
test dl, 4
je 0x520db6
mov al, byte [ecx + eax + 0x2e]
and dl, 0xfb
push dword [ebp - 0x48]
mov byte [ebp - 0x20], al
mov al, byte [edi]
mov byte [ebp - 0x1f], al
mov eax, dword [ebp - 0x38]
push 2
mov byte [ecx + eax + 0x2d], dl
lea eax, [ebp - 0x20]
push eax
jmp 0x520dfd
push dword [ebp - 0x6c]
movsx eax, byte [edi]
push eax
call fcn.004069bf
pop ecx
pop ecx
test eax, eax
je 0x520df7
lea eax, [edi + 1]
mov dword [ebp - 0x3c], eax
cmp eax, dword [ebp - 0x50]
jae 0x520f0a
push dword [ebp - 0x48]
lea eax, [ebp - 0x40]
push 2
push edi
push eax
call fcn.00409435
add esp, 0x10
cmp eax, 0xffffffff
je 0x520f36
mov edi, dword [ebp - 0x3c]
jmp 0x520e12
push dword [ebp - 0x48]
push 1
push edi
lea eax, [ebp - 0x40]
push eax
call fcn.00409435
add esp, 0x10
cmp eax, 0xffffffff
je 0x520f36
push ebx
push ebx
push 5
lea eax, [ebp - 0x28]
inc edi
push eax
push dword [ebp - 0x2c]
lea eax, [ebp - 0x40]
mov dword [ebp - 0x34], edi
push eax
push ebx
push dword [ebp - 0x70]
call fcn.00409656
add esp, 0x20
mov dword [ebp - 0x3c], eax
test eax, eax
je 0x520f36
push ebx
lea ecx, [ebp - 0x58]
push ecx
push eax
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x520f2e
mov eax, edi
sub eax, dword [ebp - 0x5c]
add eax, dword [esi + 8]
mov dword [esi + 4], eax
mov eax, dword [ebp - 0x3c]
cmp dword [ebp - 0x58], eax
jb 0x520f36
cmp byte [ebp - 0x2d], 0xa
jne 0x520ea7
push 0xd
pop eax
push ebx
mov word [ebp - 0x54], ax
lea eax, [ebp - 0x58]
push eax
push 1
lea eax, [ebp - 0x54]
push eax
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x520f2e
cmp dword [ebp - 0x58], 1
jb 0x520f36
inc dword [esi + 8]
inc dword [esi + 4]
cmp edi, dword [ebp - 0x50]
jae 0x520f36
mov ecx, dword [ebp - 0x74]
jmp 0x520c38
test edi, edi
jle 0x520ee1
mov esi, dword [ebp - 0x2c]
mov eax, edx
mov edx, dword [ebp - 0x4c]
mov cl, byte [ebx + ecx]
mov edx, dword [edx*4 + 0x5cf790]
add edx, eax
add edx, ebx
inc ebx
mov byte [edx + esi + 0x2e], cl
mov ecx, dword [ebp - 0x34]
cmp ebx, edi
jl 0x520ec1
mov esi, dword [ebp + 8]
add dword [esi + 4], edi
jmp 0x520f36
test edi, edi
jle 0x520ee1
mov edx, dword [ebp - 0x34]
mov esi, dword [ebp - 0x44]
mov eax, dword [ebp - 0x4c]
mov ecx, dword [eax*4 + 0x5cf790]
mov al, byte [ebx + edx]
add ecx, esi
mov byte [ecx + ebx + 0x2e], al
inc ebx
cmp ebx, edi
jl 0x520ef0
jmp 0x520ede
mov ebx, dword [ebp - 0x4c]
mov edx, dword [ebp - 0x44]
mov al, byte [edi]
mov ecx, dword [ebx*4 + 0x5cf790]
mov byte [edx + ecx + 0x2e], al
mov eax, dword [ebx*4 + 0x5cf790]
or byte [edx + eax + 0x2d], 4
inc dword [esi + 4]
jmp 0x520f36
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi], eax
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00405a92
leave
ret