Function at 0x422a80
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4cdd0d
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x514080]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
call fcn.004046f0
mov edi, eax
test edi, edi
je 0x422ca9
mov edx, dword [edi]
mov esi, dword [edx + 0xc]
mov ecx, esi
call dword [0x4e1514]
mov ecx, edi
call esi
add eax, 0x10
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], 1
call fcn.004046f0
mov edi, eax
test edi, edi
je 0x422ca9
mov ecx, dword [edi]
mov esi, dword [ecx + 0xc]
mov ecx, esi
call dword [0x4e1514]
mov ecx, edi
call esi
add eax, 0x10
mov dword [ebp - 0x18], eax
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x18]
push 0x4ef868
call fcn.00403700
test al, al
jne 0x422b21
push 3
push 0x4ef868
lea ecx, [ebp - 0x18]
call fcn.00403890
mov byte [ebp - 4], 3
lea eax, [ebp - 0x14]
push 0x4ef868
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.00423110
mov byte [ebp - 0xf], al
mov byte [ebp - 4], 1
or edi, 0xffffffff
mov edx, dword [ebp - 0x18]
mov ecx, edi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ecx
dec ecx
test ecx, ecx
jg 0x422b6d
mov edi, dword [edx]
push edx
mov eax, dword [edi]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x4e1514]
mov ecx, edi
call esi
mov al, byte [ebp - 0xf]
or edi, 0xffffffff
test al, al
jne 0x422b7d
push 0x18
push str.Unable_to_get_temp_file
jmp 0x422c23
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x20], 0x4ec614
mov dword [ebp - 0x1c], esi
mov byte [ebp - 4], 5
cmp esi, 0xffffffff
jne 0x422bbb
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x4ec614
push eax
jmp 0x422c0f
mov eax, 0xfeff
mov dword [ebp - 0x18], 0
push 0
mov word [ebp - 0x10], ax
lea eax, [ebp - 0x18]
push eax
push 2
lea eax, [ebp - 0x10]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x422bff
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x18]
push 0
push edx
mov ecx, dword [eax]
mov eax, dword [ecx - 0xc]
add eax, eax
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x422c3e
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x4ec614
test esi, esi
je 0x422c1c
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x1c], 0
push 0x1b
push str.Unable_to_save_script_file
lea ecx, [ebx + 4]
call fcn.00403890
mov eax, dword [ebp - 0x14]
lea ecx, [ebx + 4]
push dword [eax - 0xc]
push eax
call fcn.004025b0
xor bl, bl
jmp 0x422c68
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x4ec614
test esi, esi
je 0x422c5b
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x1c], 0
lea eax, [ebp - 0x14]
mov ecx, ebx
push eax
call fcn.00422cd0
mov bl, al
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x14]
add ecx, 0xfffffff0
lock xadd dword [ecx + 0xc], edi
dec edi
test edi, edi
jg 0x422c93
mov edi, dword [ecx]
push ecx
mov eax, dword [edi]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x4e1514]
mov ecx, edi
call esi
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0x80004005
call fcn.00402720
int3