Function at 0x41f66b
Capabilities:
Write file on windows

Disassembly:
push ebx
push esi
mov esi, dword [esp + 0xc]
xor ebx, ebx
cmp dword [esi + 8], ebx
push edi
je 0x41f6a4
cmp dword [esi], ebx
jne 0x41f6ac
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x41f6a4
push ebx
push pe_nt_image_headers32
push 4
push ebx
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi], eax
jne 0x41f6a4
mov dword [esi], ebx
cmp dword [esi], ebx
je 0x41f833
cmp dword [esi + 8], ebx
je 0x41f816
cmp dword [esi + 0x14], 0xfde9
push ebp
jne 0x41f6c4
push 5
pop ebp
jmp 0x41f6c6
xor ebp, ebp
mov edi, dword [esi + 0x18]
jmp 0x41f704
mov eax, dword [edi + 8]
cmp eax, 1
je 0x41f6f5
cmp eax, 2
je 0x41f6f5
push dword [edi + 0xc]
call sub.MSVCRT.dll_strlen
push dword [edi + 8]
mov ebx, eax
call sub.MSVCRT.dll_strlen
add eax, ebp
lea ebp, [eax + ebx + 5]
pop ecx
xor ebx, ebx
jmp 0x41f701
push dword [edi + 0xc]
call sub.MSVCRT.dll_strlen
lea ebp, [eax + ebp + 4]
mov edi, dword [edi]
pop ecx
cmp edi, ebx
jne 0x41f6cb
cmp ebp, ebx
jne 0x41f724
push ebx
push ebx
push ebx
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x41f815
inc ebp
push ebp
push ebx
push dword [0x4dd850]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebp, eax
cmp ebp, ebx
je 0x41f815
cmp dword [esi + 0x14], 0xfde9
mov edi, ebp
jne 0x41f760
push 0x42b0d8
push ebp
call sub.MSVCRT.dll_strcpy
push ebp
call sub.MSVCRT.dll_strlen
mov edi, eax
add esp, 0xc
add edi, ebp
mov ebx, dword [esi + 0x18]
jmp 0x41f7dc
mov eax, dword [ebx + 8]
cmp eax, 1
jne 0x41f788
push 0x42b0d4
push edi
call sub.MSVCRT.dll_strcpy
push dword [ebx + 0xc]
push edi
call sub.MSVCRT.dll_strcat
push 0x42b0d0
jmp 0x41f7bb
cmp eax, 2
jne 0x41f7a6
push 0x42b0cc
push edi
call sub.MSVCRT.dll_strcpy
push dword [ebx + 0xc]
push edi
call sub.MSVCRT.dll_strcat
add esp, 0x10
jmp 0x41f7c4
push eax
push edi
call sub.MSVCRT.dll_strcpy
push 0x42b0c8
push edi
call sub.MSVCRT.dll_strcat
push dword [ebx + 0xc]
push edi
call sub.MSVCRT.dll_strcat
add esp, 0x18
push 0x42b0c4
push edi
call sub.MSVCRT.dll_strcat
push edi
call sub.MSVCRT.dll_strlen
mov ebx, dword [ebx]
add esp, 0xc
add edi, eax
test ebx, ebx
jne 0x41f765
xor eax, eax
push eax
push eax
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [esp + 0x18]
push eax
sub edi, ebp
push edi
push ebp
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push ebp
push ebx
push dword [0x4dd850]
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop ebp
mov eax, dword [esi + 0xc]
cmp eax, ebx
je 0x41f82b
push eax
push ebx
push dword [0x4dd850]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edi, [esi + 0x18]
jmp 0x41f846
mov eax, dword [edi]
add eax, 8
push eax
push edi
call fcn.0042925f
pop ecx
pop ecx
cmp dword [edi], ebx
jne 0x41f838
mov eax, dword [esi + 0x24]
cmp eax, ebx
je 0x41f85f
push eax
push ebx
push dword [0x4dd850]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x41f874
push eax
push ebx
push dword [0x4dd850]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push 0x28
push ebx
push esi
call sub.MSVCRT.dll_memset
add esp, 0xc
pop edi
pop esi
pop ebx
ret 4