Function at 0x4c5150
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x4f4
push esi
mov esi, edx
cmp byte [esi], 0
push edi
mov edi, ecx
mov dword [esp + 8], edi
je 0x4c5416
mov eax, dword [0x5988f8]
test eax, eax
je 0x4c5187
mov edx, 0xf
mov ecx, esi
call fcn.00518d60
cmp byte [esi], 0
je 0x4c5416
push 0x1a
push esi
call fcn.00563730
add esp, 8
test eax, eax
je 0x4c51a8
push 0x1a
push esi
mov byte [eax], 0x20
call fcn.00563730
add esp, 8
test eax, eax
jne 0x4c5196
cmp dword [edi + 0x6b0], 0xffffffff
je 0x4c52d8
mov edx, 0x4eb
lea ecx, [esp + 0x10]
call fcn.0041e210
mov eax, dword [0x598904]
test eax, eax
je 0x4c5225
mov eax, dword [esp + 0x500]
test eax, eax
jne 0x4c5225
mov edx, 1
lea ecx, [esp + 0x10]
call fcn.00522930
mov eax, dword [0x5988f8]
test eax, eax
je 0x4c51fc
mov edx, 0xf
lea ecx, [esp + 0x10]
call fcn.00518d60
mov dl, 0x20
lea ecx, [esp + 0x10]
call fcn.005190f0
mov al, byte [esp + 0x10]
test al, al
je 0x4c5225
lea edi, [esp + 0x10]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4c5214
mov ax, word [0x575258]
mov word [edi], ax
mov eax, esi
mov edx, esi
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4c5230
lea edi, [esp + 0x10]
sub eax, edx
dec edi
mov edi, edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4c5240
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x10]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4c5260
mov cx, word [0x574b0c]
mov dl, byte [0x574b0e]
mov word [edi], cx
lea eax, [esp + 0x10]
mov byte [edi + 2], dl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4c5282
mov esi, dword [esp + 8]
push 0
sub eax, edx
lea ecx, [esp + 0x10]
push ecx
push eax
mov eax, dword [esi + 0x6b0]
lea edx, [esp + 0x1c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [0x598900], 1
jne 0x4c5416
mov ecx, dword [esi + 0x6b0]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov dword [esi + 0x6b0], 0xffffffff
pop esi
add esp, 0x4f4
ret 4
push ebx
push 0
push 0x80
push 4
push 0
push 3
push 0x40000000
add edi, 0x4a0
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4c5415
push 2
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, 0x4eb
lea ecx, [esp + 0x14]
call fcn.0041e210
mov eax, dword [0x598904]
test eax, eax
je 0x4c5382
mov eax, dword [esp + 0x504]
test eax, eax
jne 0x4c5382
mov edx, 1
lea ecx, [esp + 0x14]
call fcn.00522930
mov eax, dword [0x5988f8]
test eax, eax
je 0x4c5357
mov edx, 0xf
lea ecx, [esp + 0x14]
call fcn.00518d60
mov dl, 0x20
lea ecx, [esp + 0x14]
call fcn.005190f0
mov al, byte [esp + 0x14]
test al, al
je 0x4c5382
lea edi, [esp + 0x14]
dec edi
nop
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4c5370
mov dx, word [0x575258]
mov word [edi], dx
mov eax, esi
mov edx, esi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4c5386
lea edi, [esp + 0x14]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4c5394
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x14]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4c53b1
mov ax, word [0x574b0c]
mov cl, byte [0x574b0e]
mov word [edi], ax
lea eax, [esp + 0x14]
mov byte [edi + 2], cl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4c53d2
sub eax, edx
push 0
lea edx, [esp + 0x14]
push edx
push eax
lea eax, [esp + 0x20]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [0x598900]
test eax, eax
jne 0x4c540e
mov ecx, dword [esp + 0xc]
mov dword [ecx + 0x6b0], ebx
pop ebx
pop edi
pop esi
add esp, 0x4f4
ret 4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ebx
pop edi
pop esi
add esp, 0x4f4
ret 4