Function at 0x4c6b90
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x84
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor ebx, ebx
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push esi
xor edi, edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x4c6bf2
call fcn.004129d0
cmp eax, ebx
jge 0x4c6bf4
lea eax, [esi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4c6be6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edi, eax
push ebx
lea ecx, [esp + 0x14]
push ecx
push 0x4c
lea edx, [esp + 0x4c]
push edx
mov word [esp + 0x56], bx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x1c], ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
mov dword [esp + 0x54], 0x51505545
mov word [esp + 0x58], 1
call ebx
test eax, eax
jne 0x4c6c2f
call fcn.004129d0
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx + 4]
mov esi, dword [eax]
mov eax, ecx
mov dword [esp + 0x34], esi
mov dword [esp + 0x30], eax
test eax, eax
mov edx, dword [ecx + 4]
mov dword [esp + 0x3c], edx
je 0x4c6c50
cmp eax, ecx
je 0x4c6c59
call fcn.00578ff3
mov eax, dword [esp + 0x30]
cmp esi, dword [esp + 0x3c]
je 0x4c6d69
test eax, eax
jne 0x4c6c70
call fcn.00578ff3
mov eax, dword [esp + 0x30]
cmp esi, dword [eax + 4]
jne 0x4c6c7a
call fcn.00578ff3
push 0
lea eax, [esp + 0x18]
push eax
push 4
lea ecx, [esi + 0x14]
push ecx
push edi
call ebx
test eax, eax
jne 0x4c6c93
call fcn.004129d0
push 0
lea edx, [esp + 0x1c]
push edx
push 4
lea eax, [esi + 0x18]
push eax
push edi
call ebx
test eax, eax
jne 0x4c6cac
call fcn.004129d0
push 0
lea ecx, [esp + 0x20]
push ecx
push 4
lea edx, [esi + 0x1c]
push edx
push edi
call ebx
test eax, eax
jne 0x4c6cc5
call fcn.004129d0
push 0
lea ecx, [esp + 0x24]
push ecx
lea eax, [esi + 0x20]
push 4
push eax
push edi
mov dword [esp + 0x24], eax
call ebx
test eax, eax
jne 0x4c6ce2
call fcn.004129d0
push 0
lea edx, [esp + 0x28]
push edx
push 0x10
lea eax, [esi + 0x24]
push eax
push edi
call ebx
test eax, eax
jne 0x4c6cfb
call fcn.004129d0
push 0
lea ecx, [esp + 0x2c]
push ecx
push 1
lea edx, [esi + 0x34]
push edx
push edi
call ebx
test eax, eax
jne 0x4c6d14
call fcn.004129d0
mov esi, dword [esi + 0x38]
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4c6d20
push 0
lea ecx, [esp + 0x30]
push ecx
sub eax, edx
push eax
push esi
push edi
call ebx
test eax, eax
jne 0x4c6d40
call fcn.004129d0
mov edx, dword [esp + 0x10]
mov eax, dword [edx]
cmp eax, dword [esp + 0xc]
jbe 0x4c6d50
mov dword [esp + 0xc], eax
lea esi, [esp + 0x30]
call fcn.004c8610
mov esi, dword [esp + 0x34]
mov ecx, dword [ebp + 0xc]
mov eax, dword [esp + 0x30]
jmp 0x4c6c41
xor eax, eax
push eax
lea ecx, [esp + 0x38]
push ecx
push eax
push edi
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x4c6d8b
call fcn.004129d0
mov edx, dword [esp + 0xc]
push 0
lea eax, [esp + 0x30]
push eax
push 0x4c
lea ecx, [esp + 0x4c]
push ecx
push edi
mov dword [esp + 0x54], 0x51505545
mov word [esp + 0x58], 1
mov word [esp + 0x5a], 0
mov dword [esp + 0x5c], edx
call ebx
test eax, eax
jne 0x4c6dc3
call fcn.004129d0
test edi, edi
je 0x4c6dce
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4c6ded
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 8