Function at 0x41d66f
Capabilities:
Write file on windows

Disassembly:
push ecx
push ecx
push ebx
push esi
mov esi, dword [esp + 0x14]
mov eax, dword [esi]
push edi
xor edi, edi
inc edi
xor ebx, ebx
mov dword [esp + 0xc], edi
cmp eax, ebx
je 0x41d69a
cmp dword [esi + 8], ebx
je 0x41d6c9
cmp dword [esi + 0xc], ebx
je 0x41d69a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi], ebx
cmp dword [esi + 8], ebx
je 0x41d6c9
cmp dword [esi], ebx
jne 0x41d6d1
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x41d6c9
push ebx
push pe_nt_image_headers32
push 2
push ebx
push edi
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi], eax
cmp eax, 0xffffffff
jne 0x41d6c9
mov dword [esi], ebx
cmp dword [esi], ebx
je 0x41d8cd
cmp dword [esi + 8], ebx
je 0x41d8b0
test byte [esi + 0x2c], 1
mov dword [esp + 0x18], 0x46609c
jne 0x41d6f0
mov dword [esp + 0x18], 0x466098
cmp dword [esi + 0x18], 0xfde9
push ebp
jne 0x41d6ff
push 5
pop ebp
jmp 0x41d701
xor ebp, ebp
mov edi, dword [esi + 0x1c]
jmp 0x41d75a
mov eax, dword [edi + 8]
push dword [edi + 0xc]
cmp eax, 1
jne 0x41d72f
call sub.MSVCRT.dll_strlen
test byte [esi + 0x2c], 2
pop ecx
lea ebp, [eax + ebp + 4]
je 0x41d758
push 0x466094
call sub.MSVCRT.dll_strlen
add ebp, eax
jmp 0x41d757
cmp eax, 2
jne 0x41d73f
call sub.MSVCRT.dll_strlen
lea ebp, [eax + ebp + 4]
jmp 0x41d757
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
pop ecx
mov edi, dword [edi]
cmp edi, ebx
jne 0x41d706
cmp ebp, ebx
jne 0x41d77a
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 0x41d8af
inc ebp
push ebp
push ebx
push dword [0x9e55a0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x41d8ad
cmp dword [esi + 0x18], 0xfde9
mov edi, ebx
jne 0x41d7c0
push 0x466090
push ebx
call sub.MSVCRT.dll_strcpy
push 0x466094
push ebx
call sub.MSVCRT.dll_strcat
push ebx
call sub.MSVCRT.dll_strlen
add esp, 0x14
lea edi, [ebx + eax]
mov ebp, dword [esi + 0x1c]
jmp 0x41d870
mov eax, dword [ebp + 8]
cmp eax, 1
jne 0x41d81c
test byte [esi + 0x2c], 2
je 0x41d7f3
cmp dword [esp + 0x10], 0
jne 0x41d7f3
push 0x466094
push edi
call sub.MSVCRT.dll_strcpy
push edi
call sub.MSVCRT.dll_strlen
add esp, 0xc
add edi, eax
push 0x46608c
push edi
call sub.MSVCRT.dll_strcpy
push dword [ebp + 0xc]
push edi
call sub.MSVCRT.dll_strcat
push 0x466088
push edi
call sub.MSVCRT.dll_strcat
add esp, 0x18
and dword [esp + 0x10], 0
jmp 0x41d857
cmp eax, 2
jne 0x41d83a
push 0x466084
push edi
call sub.MSVCRT.dll_strcpy
push dword [ebp + 0xc]
push edi
call sub.MSVCRT.dll_strcat
add esp, 0x10
jmp 0x41d857
push eax
push edi
call sub.MSVCRT.dll_strcpy
push dword [esp + 0x24]
push edi
call sub.MSVCRT.dll_strcat
push dword [ebp + 0xc]
push edi
call sub.MSVCRT.dll_strcat
add esp, 0x18
push 0x466094
push edi
call sub.MSVCRT.dll_strcat
push edi
call sub.MSVCRT.dll_strlen
mov ebp, dword [ebp]
add esp, 0xc
add edi, eax
test ebp, ebp
jne 0x41d7c8
xor eax, eax
push eax
push eax
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebp
lea eax, [esp + 0x18]
push eax
sub edi, ebx
push edi
push ebx
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push ebx
push ebp
push dword [0x9e55a0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor ebx, ebx
pop ebp
mov eax, dword [esi + 0x10]
cmp eax, ebx
je 0x41d8c5
push eax
push ebx
push dword [0x9e55a0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edi, [esi + 0x1c]
jmp 0x41d8e0
mov eax, dword [edi]
add eax, 8
push eax
push edi
call fcn.00430bc1
pop ecx
pop ecx
cmp dword [edi], ebx
jne 0x41d8d2
mov eax, dword [esi + 0x28]
cmp eax, ebx
je 0x41d8f9
push eax
push ebx
push dword [0x9e55a0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x41d90e
push eax
push ebx
push dword [0x9e55a0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push 0x30
push ebx
push esi
call sub.MSVCRT.dll_memset
add esp, 0xc
pop edi
pop esi
pop ebx
pop ecx
pop ecx
ret 4