Function at 0x4023ea
Capabilities:
Write file on windows

Disassembly:
push ecx
push ebp
push esi
mov esi, dword [esp + 0x10]
mov eax, dword [esi]
xor ebp, ebp
cmp eax, ebp
je 0x40240c
cmp dword [esi + 8], ebp
je 0x40240c
cmp dword [esi + 0xc], ebp
je 0x40240c
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi], ebp
cmp dword [esi + 8], ebp
push edi
je 0x40243d
cmp dword [esi], ebp
jne 0x402445
mov eax, dword [esi + 4]
cmp eax, ebp
je 0x40243d
push ebp
push pe_nt_image_headers32
push 4
push ebp
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi], eax
jne 0x40243d
mov dword [esi], ebp
cmp dword [esi], ebp
je 0x4025d6
cmp dword [esi + 8], ebp
je 0x4025b9
cmp dword [esi + 0x18], 0xfde9
push ebx
jne 0x40245d
push 5
pop ebx
jmp 0x40245f
xor ebx, ebx
mov edi, dword [esi + 0x1c]
jmp 0x40249d
mov eax, dword [edi + 8]
cmp eax, 1
je 0x40248e
cmp eax, 2
je 0x40248e
push dword [edi + 0xc]
call sub.MSVCRT.dll_strlen
push dword [edi + 8]
mov ebx, eax
call sub.MSVCRT.dll_strlen
add eax, dword [esp + 0x20]
pop ecx
lea ebx, [eax + ebx + 5]
jmp 0x40249a
push dword [edi + 0xc]
call sub.MSVCRT.dll_strlen
lea ebx, [ebx + eax + 4]
mov edi, dword [edi]
pop ecx
cmp edi, ebp
mov dword [esp + 0x18], ebx
jne 0x402464
cmp ebx, ebp
jne 0x4024c1
push ebp
push ebp
push ebp
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x4025b8
inc ebx
push ebx
push ebp
push dword [0x40a4ec]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
cmp ebx, ebp
mov dword [esp + 0x18], ebx
je 0x4025b8
cmp dword [esi + 0x18], 0xfde9
mov edi, ebx
jne 0x402501
push 0x408014
push ebx
call sub.MSVCRT.dll_strcpy
push ebx
call sub.MSVCRT.dll_strlen
mov edi, eax
add esp, 0xc
add edi, ebx
mov ebx, dword [esi + 0x1c]
jmp 0x40257d
mov eax, dword [ebx + 8]
cmp eax, 1
jne 0x402529
push 0x408010
push edi
call sub.MSVCRT.dll_strcpy
push dword [ebx + 0xc]
push edi
call sub.MSVCRT.dll_strcat
push 0x40800c
jmp 0x40255c
cmp eax, 2
jne 0x402547
push 0x408008
push edi
call sub.MSVCRT.dll_strcpy
push dword [ebx + 0xc]
push edi
call sub.MSVCRT.dll_strcat
add esp, 0x10
jmp 0x402565
push eax
push edi
call sub.MSVCRT.dll_strcpy
push 0x408004
push edi
call sub.MSVCRT.dll_strcat
push dword [ebx + 0xc]
push edi
call sub.MSVCRT.dll_strcat
add esp, 0x18
push section..rdata
push edi
call sub.MSVCRT.dll_strcat
push edi
call sub.MSVCRT.dll_strlen
mov ebx, dword [ebx]
add esp, 0xc
add edi, eax
cmp ebx, ebp
jne 0x402506
push ebp
push ebp
push ebp
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebx, dword [esp + 0x18]
push ebp
lea eax, [esp + 0x14]
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 [0x40a4ec]
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop ebx
mov eax, dword [esi + 0x10]
cmp eax, ebp
je 0x4025ce
push eax
push ebp
push dword [0x40a4ec]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edi, [esi + 0x1c]
jmp 0x4025e9
mov eax, dword [edi]
add eax, 8
push eax
push edi
call fcn.004065be
pop ecx
pop ecx
cmp dword [edi], ebp
jne 0x4025db
mov eax, dword [esi + 0x28]
cmp eax, ebp
pop edi
je 0x402603
push eax
push ebp
push dword [0x40a4ec]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esi + 4]
cmp eax, ebp
je 0x402618
push eax
push ebp
push dword [0x40a4ec]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push 0x2c
push ebp
push esi
call sub.MSVCRT.dll_memset
add esp, 0xc
pop esi
pop ebp
pop ecx
ret 4