Function at 0x4c5942
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x507cb3
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x1034
call fcn.00504b10
mov eax, dword [0x5184d0]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
and dword [ebp - 0x102c], 0
lea ebx, [ebp - 0x414]
mov dword [ebp - 0x1024], ebx
mov dword [ebp - 0x1018], 0x200
xor esi, esi
mov dword [ebp - 0x1020], esi
xor edi, edi
mov dword [ebp - 0x101c], edi
xor ecx, ecx
mov dword [ebp - 0x1028], ecx
mov eax, dword [ebp + 8]
test eax, eax
jne 0x4c59be
mov eax, 0x405104
mov dword [ebp + 8], eax
xor ecx, ecx
cmp cx, word [eax]
je 0x4c5ece
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edi, eax
test edi, edi
jne 0x4c59da
or edi, 0xffffffff
xor eax, eax
mov word [ebp - 0x414], ax
cmp byte [0x519a8f], al
jne 0x4c5e48
cmp edi, 0xffffffff
je 0x4c5e48
mov edx, 0x200
lea ecx, [ebp - 0x414]
jmp 0x4c5a76
cmp eax, 0x8007007a
jne 0x4c5ad3
mov eax, dword [ebp - 0x1018]
cmp eax, 0x10000
jae 0x4c5ac7
lea ecx, [ebp - 0x414]
cmp ebx, ecx
je 0x4c5a38
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x1018]
add eax, eax
mov dword [ebp - 0x1018], eax
cmp eax, 0x10000
jbe 0x4c5a52
mov eax, 0x10000
mov dword [ebp - 0x1018], eax
add eax, eax
push eax
push 0
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ebx, eax
mov dword [ebp - 0x1024], ebx
test ebx, ebx
je 0x4c5abb
xor eax, eax
mov word [ebx], ax
mov edx, dword [ebp - 0x1018]
mov ecx, ebx
lea eax, [ebp + 0xc]
push eax
push dword [ebp + 8]
call fcn.004b2015
test eax, eax
jne 0x4c5a05
mov dword [ebp - 0x1024], ebx
lea eax, [ebp - 0x1034]
push eax
mov edx, dword [ebp - 0x1018]
mov ecx, ebx
call fcn.0043ea57
test eax, eax
je 0x4c5ae4
push eax
push 0x36b01a1
call dword [sym.imp.certcli.dll_Ordinal_357]
mov edi, esi
jmp 0x4c5ed0
push 0x8007000e
push 0x35f01a1
jmp 0x4c5ad9
push 0x8007006f
push 0x34f01a1
jmp 0x4c5ad9
push eax
push 0x34701a1
call dword [sym.imp.certcli.dll_Ordinal_357]
jmp 0x4c5e48
mov eax, dword [ebp - 0x1034]
mov dword [ebp - 0x1018], eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
and eax, 0xffff7fff
xor ecx, ecx
sub eax, ecx
je 0x4c5e29
dec eax
sub eax, 1
je 0x4c5de6
mov eax, dword [ebp - 0x1034]
lea ebx, [eax + eax]
lea eax, [ebx + 2]
cmp eax, 0x400
ja 0x4c5b31
lea eax, [ebp - 0x1014]
mov dword [ebp - 0x101c], eax
jmp 0x4c5b64
add eax, eax
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x101c], eax
mov dword [ebp - 0x1030], edi
test eax, eax
jne 0x4c5b6a
push 0x8007000e
push 0x3a601a1
call dword [sym.imp.certcli.dll_Ordinal_357]
or edi, 0xffffffff
mov eax, dword [ebp - 0x101c]
mov dword [ebp - 0x1030], edi
push ebx
push dword [ebp - 0x1024]
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
mov edx, dword [ebp - 0x1024]
mov ebx, edx
mov dword [ebp - 0x1024], ebx
cmp edi, 0xffffffff
je 0x4c5e48
mov eax, dword [ebp - 0x101c]
mov dword [ebp - 0x1040], eax
xor ecx, ecx
mov dword [ebp - 0x1038], ecx
mov dword [ebp - 0x1024], ebx
cmp dword [ebp - 0x1034], ecx
jle 0x4c5c1d
mov dword [ebp - 0x103c], ebx
mov dword [ebp - 0x1024], ebx
mov edi, dword [ebp - 0x1034]
mov ebx, eax
cmp word [ebx], 0xa
jne 0x4c5bf1
lea esi, [ebx + 2]
mov eax, edi
sub eax, ecx
add eax, eax
push eax
push ebx
push esi
call sub.msvcrt.dll_memmove
add esp, 0xc
push 0xd
pop eax
mov word [ebx], ax
mov ebx, esi
mov ecx, dword [ebp - 0x1038]
inc ecx
inc edi
inc ecx
mov dword [ebp - 0x1038], ecx
add ebx, 2
cmp ecx, edi
jl 0x4c5bc7
mov dword [ebp - 0x1018], edi
mov ebx, dword [ebp - 0x103c]
mov edi, dword [ebp - 0x1030]
mov esi, dword [ebp - 0x1020]
mov eax, dword [ebp - 0x101c]
mov dword [ebp - 0x1030], eax
mov eax, dword [ebp - 0x1018]
add eax, eax
mov dword [ebp - 0x1038], eax
call fcn.004c58a9
test al, al
je 0x4c5c8d
cmp byte [0x519a8d], 0
jne 0x4c5d79
mov eax, 0xfeff
mov word [ebp - 0x1018], ax
push 0
lea eax, [ebp - 0x102c]
push eax
push 2
lea eax, [ebp - 0x1018]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x1030]
test eax, eax
je 0x4c5d7f
mov esi, dword [ebp - 0x102c]
shr esi, 1
mov dword [ebp - 0x1028], esi
jmp 0x4c5d7f
xor edx, edx
mov dword [ebp - 0x1028], edx
mov eax, dword [ebp - 0x1018]
test eax, eax
je 0x4c5d56
lea ecx, [eax*2 + 2]
mov dword [ebp - 0x103c], ecx
cmp ecx, 0x400
ja 0x4c5cc0
lea esi, [ebp - 0x814]
jmp 0x4c5cf7
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
test esi, esi
jne 0x4c5ce9
push 0x8007000e
push 0x3ec01a1
call dword [sym.imp.certcli.dll_Ordinal_357]
or edi, 0xffffffff
mov eax, dword [ebp - 0x1028]
jmp 0x4c5d58
mov eax, dword [ebp - 0x1018]
mov ecx, dword [ebp - 0x103c]
xor edx, edx
push edx
push edx
push ecx
push esi
push eax
push dword [ebp - 0x101c]
push edx
call dword [sym.imp.KERNEL32.dll_GetACP]
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0x1028], eax
test eax, eax
jne 0x4c5d58
call fcn.004c73cc
push eax
push 0x3fe01a1
call dword [sym.imp.certcli.dll_Ordinal_357]
call dword [sym.imp.KERNEL32.dll_GetACP]
push eax
push 0x3ff01a1
push ebx
call dword [sym.imp.certcli.dll_Ordinal_359]
push dword [ebp - 0x1018]
push 0x40001a1
push 0x428674
call dword [sym.imp.certcli.dll_Ordinal_359]
jmp 0x4c5cde
mov eax, edx
mov edx, esi
mov dword [ebp - 0x1038], eax
mov dword [ebp - 0x1020], esi
xor eax, eax
mov dword [ebp - 0x1028], eax
cmp edi, 0xffffffff
je 0x4c5e48
jmp 0x4c5d7f
mov edx, dword [ebp - 0x1030]
push 0
lea eax, [ebp - 0x102c]
push eax
mov ecx, dword [ebp - 0x1038]
push ecx
push edx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4c5dc2
call fcn.004c73cc
mov esi, eax
push esi
push 0x40d01a1
call dword [sym.imp.certcli.dll_Ordinal_357]
cmp esi, 0x80070006
jne 0x4c5e22
or edi, 0xffffffff
mov byte [0x519a8f], 1
jmp 0x4c5e22
call fcn.004c58a9
mov esi, dword [ebp - 0x1020]
mov edi, dword [ebp - 0x101c]
test al, al
je 0x4c5ed0
shr dword [ebp - 0x102c], 1
jmp 0x4c5ed0
push ecx
lea eax, [ebp - 0x102c]
push eax
push dword [ebp - 0x1034]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
jne 0x4c5e1c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 1
je 0x4c5e19
push 6
push eax
push 0x39001a1
call dword [sym.imp.certcli.dll_Ordinal_358]
or edi, 0xffffffff
mov dword [ebp - 0x1024], ebx
cmp edi, 0xffffffff
je 0x4c5e48
jmp 0x4c5e91
mov eax, 0x8000ffff
push eax
push eax
push 0x37f01a1
call dword [sym.imp.certcli.dll_Ordinal_358]
mov byte [0x519a8f], 1
mov dword [ebp - 0x1024], ebx
and dword [ebp - 4], 0
push 0x442320
call dword [sym.imp.msvcrt.dll_void____cdecl___unsigned_int__struct__EXCEPTION_POINTERS_____cdecl__set_se_translator_void____cdecl___unsigned_int__struct__EXCEPTION_POINTERS___]
mov esi, eax
mov dword [ebp - 0x103c], esi
mov byte [ebp - 4], 1
mov edi, dword [ebp + 8]
push 1
call fcn.0050435a
lea ecx, [ebp + 0xc]
push ecx
push edi
push eax
call dword [sym.imp.msvcrt.dll_vfwprintf]
mov dword [ebp - 0x102c], eax
mov byte [ebp - 4], 0
push esi
call dword [sym.imp.msvcrt.dll_void____cdecl___unsigned_int__struct__EXCEPTION_POINTERS_____cdecl__set_se_translator_void____cdecl___unsigned_int__struct__EXCEPTION_POINTERS___]
add esp, 0x18
or dword [ebp - 4], 0xffffffff
mov esi, dword [ebp - 0x1020]
mov edi, dword [ebp - 0x101c]
jmp 0x4c5ed0
mov esi, ecx
mov byte [0x519a8d], 1
test ebx, ebx
je 0x4c5eec
lea eax, [ebp - 0x414]
cmp eax, ebx
je 0x4c5eec
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
je 0x4c5f01
lea eax, [ebp - 0x814]
cmp eax, esi
je 0x4c5f01
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
test edi, edi
je 0x4c5f16
lea eax, [ebp - 0x1014]
cmp eax, edi
je 0x4c5f16
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x102c]
add eax, dword [ebp - 0x1028]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.005036b0
leave
ret