Function at 0x422cd0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4ce5bd
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x515080]
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 0x422ef9
mov edx, dword [edi]
mov esi, dword [edx + 0xc]
mov ecx, esi
call dword [0x4e2514]
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 0x422ef9
mov ecx, dword [edi]
mov esi, dword [ecx + 0xc]
mov ecx, esi
call dword [0x4e2514]
mov ecx, edi
call esi
add eax, 0x10
mov dword [ebp - 0x18], eax
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x18]
push 0x4f0878
call fcn.00403700
test al, al
jne 0x422d71
push 3
push 0x4f0878
lea ecx, [ebp - 0x18]
call fcn.00403890
mov byte [ebp - 4], 3
lea eax, [ebp - 0x14]
push 0x4f0878
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.00423350
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 0x422dbd
mov edi, dword [edx]
push edx
mov eax, dword [edi]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x4e2514]
mov ecx, edi
call esi
mov al, byte [ebp - 0xf]
or edi, 0xffffffff
test al, al
jne 0x422dcd
push 0x18
push str.Unable_to_get_temp_file
jmp 0x422e73
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], 0x4ed624
mov dword [ebp - 0x1c], esi
mov byte [ebp - 4], 5
cmp esi, 0xffffffff
jne 0x422e0b
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x4ed624
push eax
jmp 0x422e5f
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 0x422e4f
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 0x422e8e
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x4ed624
test esi, esi
je 0x422e6c
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 0x422eb8
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0x4ed624
test esi, esi
je 0x422eab
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.00422f10
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 0x422ee3
mov edi, dword [ecx]
push ecx
mov eax, dword [edi]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x4e2514]
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