Function at 0x405c30
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push 1
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x405c4f
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x24], 0xffffffff
jne 0x405c59
mov eax, 9
jmp 0x405ede
mov edx, dword [ebp + 8]
mov dword [edx + 8], 0
mov eax, dword [ebp + 0x14]
and eax, 1
je 0x405cea
mov ecx, dword [ebp + 8]
movzx edx, word [ecx + 0x58]
test edx, edx
jne 0x405ca0
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00406020
add esp, 8
mov edx, dword [ebp + 8]
cmp dword [edx + 8], 0
je 0x405c94
jmp 0x405ecc
mov eax, 1
mov ecx, dword [ebp + 8]
mov word [ecx + 0x58], ax
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0x20]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00401a10
add esp, 0xc
mov ecx, dword [ebp + 0x10]
mov dword [ecx + 0x20], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 8], 0
jne 0x405cd2
mov eax, dword [ebp + 8]
cmp dword [eax + 0x8c], 0
jne 0x405ce0
xor ecx, ecx
mov edx, dword [ebp + 8]
mov word [edx + 0x58], cx
jmp 0x405ecc
mov eax, 5
jmp 0x405ede
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 4]
and ecx, 0x10
je 0x405d3d
mov edx, dword [ebp + 0x14]
and edx, 2
je 0x405d36
mov eax, dword [ebp + 0x14]
and eax, 0x80000000
je 0x405d1a
push 1
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.00405af0
add esp, 8
mov dword [ebp + 0x14], eax
jmp 0x405d2b
push 1
mov edx, dword [ebp + 0xc]
push edx
call fcn.004059c0
add esp, 8
mov dword [ebp + 0x14], eax
cmp dword [ebp + 0x14], 0
jne 0x405d36
jmp 0x405dda
xor eax, eax
jmp 0x405ede
cmp dword [ebp + 0x14], 4
jne 0x405d4e
mov eax, dword [ebp + 0xc]
mov dword [ebp - 4], eax
jmp 0x405dd4
mov ecx, dword [ebp + 0x14]
and ecx, 0x80000000
je 0x405d6c
push 0
mov edx, dword [ebp + 0xc]
push edx
call fcn.00405af0
add esp, 8
mov dword [ebp - 8], eax
jmp 0x405d7d
push 0
mov eax, dword [ebp + 0xc]
push eax
call fcn.004059c0
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x405d85
jmp 0x405dda
mov ecx, dword [ebp + 0x14]
and ecx, 0x80000000
je 0x405db3
push 0
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 4]
push eax
push 2
push 0
push 0
push 0x40000000
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 4], eax
jmp 0x405dd4
push 0
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 4]
push eax
push 2
push 0
push 0
push 0x40000000
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
jne 0x405de9
mov edx, dword [ebp + 8]
mov dword [edx + 8], 1
jmp 0x405ecc
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00406020
add esp, 8
mov edx, dword [ebp + 8]
cmp dword [edx + 8], 0
jne 0x405e94
mov eax, dword [ebp + 8]
cmp dword [eax + 0x34], 0
jne 0x405e35
push 0x4000
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x34], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 0x34], 0
jne 0x405e35
mov eax, dword [ebp + 8]
mov dword [eax + 8], 2
mov ecx, dword [ebp + 8]
cmp dword [ecx + 8], 0
jne 0x405e94
push 0x4000
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x34]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00401a10
add esp, 0xc
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x405e61
jmp 0x405e94
push 0
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x34]
push edx
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x405e88
mov ecx, dword [ebp - 0x10]
cmp ecx, dword [ebp - 0xc]
je 0x405e92
mov edx, dword [ebp + 8]
mov dword [edx + 8], 3
jmp 0x405e35
mov eax, dword [ebp + 8]
cmp dword [eax + 8], 0
jne 0x405ebc
mov ecx, dword [ebp + 0x10]
add ecx, 0x18
push ecx
mov edx, dword [ebp + 0x10]
add edx, 8
push edx
mov eax, dword [ebp + 0x10]
add eax, 0x10
push eax
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 4
je 0x405ecc
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 8]
push eax
call fcn.00405ef0
add esp, 4
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 8]
mov esp, ebp
pop ebp
ret