Function at 0x4c9a95
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x1ae8
call fcn.004c0c40
mov eax, dword [0x518450]
xor eax, esp
mov dword [esp + 0x1ae4], eax
mov eax, dword [esp + 0x1aec]
xor edx, edx
mov ecx, dword [esp + 0x1af0]
push ebp
mov ebp, edx
mov dword [esp + 0x28], eax
push esi
mov esi, edx
mov dword [esp + 8], ecx
mov dword [esp + 0xc], edx
mov dword [esp + 0x20], esi
cmp dword [esp + 0x1afc], edx
jne 0x4c9ae3
xor eax, eax
jmp 0x4ca1f0
test ecx, ecx
jne 0x4c9b06
call fcn.004c2ffe
and dword [eax], esi
call fcn.004c302f
mov dword [eax], 0x16
call fcn.004c467e
or eax, 0xffffffff
jmp 0x4ca1f0
push ebx
push edi
mov ecx, eax
mov edi, eax
sar ecx, 5
and edi, 0x1f
shl edi, 6
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x18], edi
mov ecx, dword [ecx*4 + 0x52a778]
mov bl, byte [edi + ecx + 0x24]
add bl, bl
sar bl, 1
cmp bl, 2
je 0x4c9b36
cmp bl, 1
jne 0x4c9b63
mov eax, dword [esp + 0x1b04]
not eax
test al, 1
jne 0x4c9b5f
call fcn.004c2ffe
and dword [eax], esi
call fcn.004c302f
mov dword [eax], 0x16
call fcn.004c467e
jmp 0x4ca1e5
mov eax, dword [esp + 0x34]
test byte [edi + ecx + 4], 0x20
je 0x4c9b77
push 2
push edx
push edx
push eax
call fcn.004cb3f6
add esp, 0x10
push dword [esp + 0x34]
call fcn.004cd78a
pop ecx
test eax, eax
je 0x4c9e7a
mov eax, dword [esp + 0x2c]
mov eax, dword [eax*4 + 0x52a778]
test byte [edi + eax + 4], 0x80
je 0x4c9e7a
call fcn.004c7b5c
xor ecx, ecx
mov eax, dword [eax + 0x6c]
cmp dword [eax + 0xa8], ecx
lea eax, [esp + 0x38]
push eax
mov eax, dword [esp + 0x30]
sete cl
mov dword [esp + 0x24], ecx
mov eax, dword [eax*4 + 0x52a778]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x4c9e7a
cmp dword [esp + 0x20], esi
je 0x4c9be5
test bl, bl
je 0x4c9e7a
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
xor ecx, ecx
mov dword [esp + 0x3c], eax
and dword [esp + 0x28], ecx
mov eax, dword [esp + 0x10]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], eax
cmp dword [esp + 0x1b04], ecx
jbe 0x4ca1b5
xor edx, edx
mov dword [esp + 0x34], 0xa
mov dword [esp + 0x24], edx
and dword [esp + 0x20], ebp
test bl, bl
jne 0x4c9d8a
mov cl, byte [eax]
xor eax, eax
cmp cl, 0xa
sete al
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x2c]
mov edx, dword [eax*4 + 0x52a778]
cmp dword [edi + edx + 0x38], ebp
je 0x4c9c60
mov al, byte [edi + edx + 0x34]
mov byte [esp + 0x40], al
lea eax, [esp + 0x40]
push 2
mov byte [esp + 0x45], cl
and dword [edi + edx + 0x38], ebp
push eax
jmp 0x4c9cb2
movsx eax, cl
push eax
call fcn.004caf83
pop ecx
test eax, eax
je 0x4c9cac
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x1c]
sub eax, edx
add eax, dword [esp + 0x1b04]
cmp eax, 1
jbe 0x4c9e4d
push 2
push edx
lea eax, [esp + 0x20]
push eax
call fcn.004cf03e
add esp, 0xc
cmp eax, 0xffffffff
je 0x4ca19f
mov eax, dword [esp + 0x1c]
inc eax
inc dword [esp + 0x24]
jmp 0x4c9ccc
push 1
push dword [esp + 0x20]
lea eax, [esp + 0x20]
push eax
call fcn.004cf03e
add esp, 0xc
cmp eax, 0xffffffff
je 0x4c9e13
mov eax, dword [esp + 0x1c]
xor ecx, ecx
inc eax
inc dword [esp + 0x24]
push ecx
push ecx
push 5
mov dword [esp + 0x28], eax
lea eax, [esp + 0x4c]
push eax
push 1
lea eax, [esp + 0x2c]
push eax
push ecx
push dword [esp + 0x58]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [esp + 0x20], eax
test eax, eax
je 0x4c9e13
push 0
lea ecx, [esp + 0x2c]
push ecx
push eax
lea eax, [esp + 0x4c]
push eax
mov eax, dword [esp + 0x3c]
mov eax, dword [eax*4 + 0x52a778]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4c9e70
mov esi, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
add esi, edx
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x28], eax
jl 0x4ca1a3
cmp dword [esp + 0x38], ebp
je 0x4c9d84
push 0
lea eax, [esp + 0x2c]
mov byte [esp + 0x44], 0xd
push eax
push 1
lea eax, [esp + 0x4c]
push eax
mov eax, dword [esp + 0x3c]
mov eax, dword [eax*4 + 0x52a778]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4c9e70
cmp dword [esp + 0x28], 1
jl 0x4c9e13
inc dword [esp + 0x14]
inc esi
mov ecx, dword [esp + 0x18]
jmp 0x4c9dfe
cmp bl, 1
je 0x4c9d94
cmp bl, 2
jne 0x4c9dbb
movzx ecx, word [eax]
xor edx, edx
cmp cx, word [esp + 0x34]
mov dword [esp + 0x18], ecx
sete dl
add eax, 2
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x24]
add edx, 2
mov dword [esp + 0x1c], eax
mov dword [esp + 0x24], edx
cmp bl, 1
je 0x4c9dc5
cmp bl, 2
jne 0x4c9e06
push ecx
call fcn.004cf496
pop ecx
mov ecx, dword [esp + 0x18]
cmp ax, cx
jne 0x4c9e70
add esi, 2
cmp dword [esp + 0x20], ebp
je 0x4c9dfe
push 0xd
pop eax
push eax
mov dword [esp + 0x1c], eax
call fcn.004cf496
pop ecx
mov ecx, dword [esp + 0x18]
cmp ax, cx
jne 0x4c9e70
inc esi
inc dword [esp + 0x14]
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
cmp edx, dword [esp + 0x1b04]
jb 0x4c9c1c
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
test esi, esi
jne 0x4ca1ea
test ebp, ebp
je 0x4ca1b7
push 5
pop ebx
cmp ebp, ebx
jne 0x4ca1ac
call fcn.004c302f
mov dword [eax], 9
call fcn.004c2ffe
mov dword [eax], ebx
jmp 0x4ca1e5
mov ebx, dword [esp + 0x2c]
inc esi
mov al, byte [edx]
mov ecx, dword [ebx*4 + 0x52a778]
mov byte [edi + ecx + 0x34], al
mov eax, dword [ebx*4 + 0x52a778]
mov dword [edi + eax + 0x38], 1
jmp 0x4c9e13
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
jmp 0x4c9e13
mov eax, dword [esp + 0x2c]
mov eax, dword [eax*4 + 0x52a778]
test byte [edi + eax + 4], 0x80
je 0x4ca15c
mov ecx, dword [esp + 0x10]
xor ebp, ebp
mov dword [esp + 0x24], ebp
mov edx, ecx
test bl, bl
jne 0x4c9f59
cmp dword [esp + 0x1b04], esi
jbe 0x4ca1b7
mov eax, edx
lea edi, [esp + 0x6f4]
xor ecx, ecx
sub eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x1b04]
jae 0x4c9ee7
mov bl, byte [edx]
inc edx
inc eax
cmp bl, 0xa
jne 0x4c9edb
inc dword [esp + 0x14]
mov byte [edi], 0xd
inc edi
inc ecx
mov byte [edi], bl
inc edi
inc ecx
cmp ecx, 0x13ff
jb 0x4c9ec0
mov ebx, dword [esp + 0x18]
lea eax, [esp + 0x6f4]
sub edi, eax
mov dword [esp + 0x20], edx
push 0
lea eax, [esp + 0x34]
push eax
push edi
lea eax, [esp + 0x700]
push eax
mov eax, dword [esp + 0x3c]
mov eax, dword [eax*4 + 0x52a778]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4c9f4a
add esi, dword [esp + 0x30]
mov ecx, dword [esp + 0x10]
cmp dword [esp + 0x30], edi
jl 0x4c9f43
mov edx, dword [esp + 0x20]
mov eax, edx
sub eax, ecx
cmp eax, dword [esp + 0x1b04]
jb 0x4c9eb1
mov edi, ebx
jmp 0x4c9e17
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov edi, ebx
jmp 0x4c9e13
cmp bl, 2
jne 0x4ca034
cmp dword [esp + 0x1b04], esi
jbe 0x4ca1b7
and dword [esp + 0x38], 0
lea ebx, [esp + 0x6f4]
push 0xd
pop esi
mov eax, edx
push 0xa
sub eax, ecx
mov ecx, dword [esp + 0x3c]
pop ebp
cmp eax, dword [esp + 0x1b04]
jae 0x4c9fbf
movzx edi, word [edx]
add eax, 2
add edx, 2
cmp di, bp
jne 0x4c9fae
add dword [esp + 0x14], 2
mov word [ebx], si
add ebx, 2
add ecx, 2
mov word [ebx], di
add ecx, 2
add ebx, 2
cmp ecx, 0x13fe
jb 0x4c9f89
mov edi, dword [esp + 0x18]
lea eax, [esp + 0x6f4]
sub ebx, eax
mov dword [esp + 0x20], edx
push 0
lea eax, [esp + 0x34]
push eax
push ebx
lea eax, [esp + 0x700]
push eax
mov eax, dword [esp + 0x3c]
mov eax, dword [eax*4 + 0x52a778]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [esp + 0x28]
mov ebp, dword [esp + 0x24]
test eax, eax
je 0x4c9e70
add esi, dword [esp + 0x30]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x28], esi
cmp dword [esp + 0x30], ebx
jl 0x4c9e17
mov edx, dword [esp + 0x20]
mov eax, edx
sub eax, ecx
cmp eax, dword [esp + 0x1b04]
jb 0x4c9f6f
jmp 0x4c9e17
mov ebx, dword [esp + 0x1b04]
mov dword [esp + 0x1c], edx
test ebx, ebx
je 0x4ca1b7
mov dword [esp + 0x34], 0xa
and dword [esp + 0x38], 0
lea eax, [esp + 0x48]
mov edi, dword [esp + 0x1c]
sub edx, ecx
mov ecx, dword [esp + 0x38]
push 0xd
pop esi
cmp edx, ebx
jae 0x4ca093
movzx ebp, word [edi]
add edx, 2
add edi, 2
cmp bp, word [esp + 0x34]
jne 0x4ca082
mov word [eax], si
add eax, 2
add ecx, 2
mov word [eax], bp
add ecx, 2
add eax, 2
cmp ecx, 0x6a8
jb 0x4ca065
xor ebp, ebp
mov dword [esp + 0x1c], edi
push ebp
push ebp
push 0xd55
lea ecx, [esp + 0x700]
push ecx
lea ecx, [esp + 0x58]
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
push eax
mov eax, ecx
push eax
push ebp
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, dword [esp + 0x28]
mov ebp, dword [esp + 0x24]
mov edi, dword [esp + 0x18]
mov dword [esp + 0x20], eax
test eax, eax
je 0x4c9e70
xor ecx, ecx
mov dword [esp + 0x28], ecx
push 0
sub eax, ecx
lea edx, [esp + 0x34]
push edx
push eax
lea eax, [esp + 0x700]
add eax, ecx
push eax
mov eax, dword [esp + 0x3c]
mov eax, dword [eax*4 + 0x52a778]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4ca123
mov ecx, dword [esp + 0x28]
add ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x28], ecx
cmp eax, ecx
jg 0x4ca0e1
jmp 0x4ca137
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x28]
mov ebp, eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x24], ebp
cmp eax, ecx
mov ecx, dword [esp + 0x10]
jg 0x4c9e17
mov edx, dword [esp + 0x1c]
mov esi, edx
sub esi, ecx
mov dword [esp + 0x28], esi
cmp esi, ebx
jb 0x4ca04f
jmp 0x4c9e17
push 0
lea ecx, [esp + 0x34]
push ecx
push dword [esp + 0x1b0c]
push dword [esp + 0x1c]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4ca18c
mov esi, dword [esp + 0x30]
xor ebp, ebp
mov ecx, dword [esp + 0x10]
mov edx, ebp
jmp 0x4c9e1b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x10]
mov ebp, eax
mov edx, esi
jmp 0x4c9e1b
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
jmp 0x4c9e1b
push ebp
call fcn.004c3011
pop ecx
jmp 0x4ca1e5
mov ecx, eax
mov eax, dword [esp + 0x2c]
mov eax, dword [eax*4 + 0x52a778]
test byte [edi + eax + 4], 0x40
je 0x4ca1d2
cmp byte [ecx], 0x1a
jne 0x4ca1d2
xor eax, eax
jmp 0x4ca1ee
call fcn.004c302f
mov dword [eax], 0x1c
call fcn.004c2ffe
and dword [eax], 0
or eax, 0xffffffff
jmp 0x4ca1ee
sub esi, edx
mov eax, esi
pop edi
pop ebx
mov ecx, dword [esp + 0x1aec]
pop esi
pop ebp
xor ecx, esp
call fcn.004b9a6c
add esp, 0x1ae8
ret