Function at 0x309a90
Capabilities:
Write file on windows

Disassembly:
push edi
push esi
push ebp
push ebx
sub esp, 0x24
mov eax, dword [esp + 0x38]
test eax, eax
mov esi, dword [esp + 0x40]
je 0x309cd1
push 0
push dword [eax]
call fcn.00308194
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x309cd1
mov edx, dword [ebp + 0xc]
test edx, edx
je 0x309cba
test esi, esi
je 0x309ad2
mov ebx, dword [esi]
test ebx, ebx
jne 0x309aeb
push dword [esp + 0x44]
mov edx, dword [esp + 0x40]
push edx
call fcn.003098f8
mov ebx, eax
add esp, 8
mov edx, dword [esp + 0x3c]
sub ebx, edx
xor edx, edx
mov dword [esp], edx
mov dword [esp + 4], edx
mov dword [esp + 8], edx
mov dword [esp + 0xc], edx
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], edx
xor edx, edx
push edx
push edx
push 1
push edx
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [esp + 0x14], eax
test eax, eax
je 0x309cac
test ebx, ebx
je 0x309bc1
lea ecx, [esp + 0x18]
lea edx, [esp + 4]
push edx
push ecx
push ebx
mov edi, dword [esp + 0x48]
push edi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x309b66
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp edi, 0x3e5
je 0x309b66
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
add esp, 0x24
pop ebx
pop ebp
pop esi
pop edi
ret
lea ecx, [esp + 4]
lea edx, [esp]
push 1
push edx
push ecx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x309ba5
mov edx, dword [esp]
cmp edx, ebx
je 0x309bc4
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esp]
push esi
call fcn.00308b74
mov eax, 0x3e4
add esp, 0x2c
pop ebx
pop ebp
pop esi
pop edi
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
add esp, 0x24
pop ebx
pop ebp
pop esi
pop edi
ret
mov edx, dword [esp]
push edx
push esi
call fcn.00308b74
add esp, 8
lea ecx, [esp + 0x1c]
mov edx, dword [ebp + 4]
test dl, 0x10
je 0x309be4
mov byte [ecx], 0xd
lea ecx, [esp + 0x1d]
mov edx, dword [ebp + 4]
test dl, 0x20
je 0x309bef
mov byte [ecx], 0xa
add ecx, 1
lea edi, [esp + 0x1c]
xor ebx, ebx
mov byte [ecx], bl
xor eax, eax
mov dh, byte [edi]
mov ecx, edi
test dh, dh
je 0x309c0d
add ecx, 1
add eax, 1
mov dl, byte [ecx]
test dl, dl
jne 0x309c01
mov dword [esp], ebx
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x18]
lea ebx, [esp + 4]
push ebx
push edx
push eax
push ecx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x309c51
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp ebx, 0x3e5
je 0x309c51
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
add esp, 0x24
pop ebx
pop ebp
pop esi
pop edi
ret
lea ecx, [esp + 4]
lea edx, [esp]
push 1
push edx
push ecx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x309c85
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
add esp, 0x24
pop ebx
pop ebp
pop esi
pop edi
ret
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x309ca2
mov eax, dword [esp]
add eax, dword [esi]
push eax
push esi
call fcn.00308b74
add esp, 8
xor eax, eax
add esp, 0x24
pop ebx
pop ebp
pop esi
pop edi
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0x24
pop ebx
pop ebp
pop esi
pop edi
ret
push ebp
call fcn.003088c0
pop ecx
test eax, eax
je 0x309ac8
add esp, 0x24
pop ebx
pop ebp
pop esi
pop edi
ret
mov eax, 0x57
add esp, 0x24
pop ebx
pop ebp
pop esi
pop edi
ret