Function at 0x4226a0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4cd40d
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.00404710
mov edi, eax
test edi, edi
je 0x4228c9
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.00404710
mov edi, eax
test edi, edi
je 0x4228c9
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.00403720
test al, al
jne 0x422741
push 3
push 0x4ef868
lea ecx, [ebp - 0x18]
call fcn.004038b0
mov byte [ebp - 4], 3
lea eax, [ebp - 0x14]
push 0x4ef868
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.00422d20
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 0x42278d
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 0x42279d
push 0x18
push str.Unable_to_get_temp_file
jmp 0x422843
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 0x4227db
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x4ec614
push eax
jmp 0x42282f
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 0x42281f
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 0x42285e
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x4ec614
test esi, esi
je 0x42283c
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.004038b0
mov eax, dword [ebp - 0x14]
lea ecx, [ebx + 4]
push dword [eax - 0xc]
push eax
call fcn.004025d0
xor bl, bl
jmp 0x422888
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x4ec614
test esi, esi
je 0x42287b
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.004228e0
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 0x4228b3
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.00402740
int3