Function at 0x403095
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1038
call fcn.0040a780
mov edx, dword [0x412b48]
and dword [ebp - 0x20], 0
push ebx
xor ebx, ebx
and dword [ebp - 4], ebx
push esi
mov esi, dword [0x412b40]
xor eax, eax
xor ecx, ecx
mov dword [ebp - 8], ebx
mov bl, byte [edx]
push edi
mov dword [ebp - 0x34], esi
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x10], ecx
cmp dword [str.lmi_rescue.exe], eax
je 0x403103
mov eax, 0x411da0
push str.HEADER
push dword [eax]
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
mov ecx, dword [ebp - 0x10]
test eax, eax
je 0x403100
inc ecx
mov dword [ebp - 0x10], ecx
lea eax, [ecx*4 + 0x411da0]
cmp dword [eax], 0
jne 0x4030dc
mov edx, dword [ebp - 0xc]
cmp esi, 0xd
mov esi, dword [sym.imp.KERNEL32.dll_SetLastError]
jb 0x40333e
mov edi, dword [edx + 5]
shl ecx, 2
mov dword [ebp - 0x24], ecx
cmp edi, 0xffffffff
je 0x40333e
cmp edi, ecx
jb 0x40333e
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 8], eax
test eax, eax
jne 0x40314a
push 0xe
jmp 0x403340
cmp bl, 0xe1
jae 0x40333e
and dword [ebp - 0x30], 0
cmp bl, 0x2d
jb 0x403170
xor ah, ah
mov al, bl
mov cl, 0x2d
div cl
movzx eax, al
mov dword [ebp - 0x30], eax
add bl, 0xd3
dec eax
jne 0x40316a
xor ecx, ecx
mov dword [ebp - 0x14], ecx
cmp bl, 9
jb 0x403190
xor ah, ah
mov al, bl
mov cl, 9
div cl
movzx eax, al
mov ecx, eax
mov dword [ebp - 0x14], eax
add bl, 0xf7
dec eax
jne 0x40318a
movzx eax, bl
mov dword [ebp - 0x38], eax
add ecx, eax
mov eax, 0x300
shl eax, cl
lea eax, [eax*2 + 0xe6c]
push eax
push 0
mov dword [ebp - 0x2c], eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
mov dword [ebp - 4], ebx
test ebx, ebx
jne 0x4031cb
push 0xe
call esi
jmp 0x403345
mov ebx, dword [ebp - 8]
mov edx, dword [ebp - 0x2c]
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x34]
push edi
push ebx
mov ebx, dword [ebp - 4]
add eax, 0xfffffff3
push eax
mov eax, dword [ebp - 0xc]
add eax, 0xd
push eax
push dword [ebp - 0x30]
mov ecx, ebx
push dword [ebp - 0x14]
push dword [ebp - 0x38]
call fcn.00402210
add esp, 0x20
test eax, eax
jne 0x403337
cmp dword [ebp - 0x18], edi
jne 0x403337
mov ecx, dword [ebp - 8]
test dword [ecx], 0x80000000
je 0x403234
cmp dword [ecx], 0x80000001
jne 0x403337
push ecx
mov edx, edi
call fcn.00402f95
pop ecx
mov dword [ebp - 0x20], eax
jmp 0x403345
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x403337
and dword [ebp - 0xc], 0
mov edx, dword [ebp - 0x24]
test eax, eax
je 0x40330a
mov ebx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
sub ecx, 0x411da0
mov dword [ebp - 0x2c], ecx
mov ecx, dword [ecx + eax*4 + 0x411da0]
mov dword [ebp - 0x14], ecx
add ecx, edx
mov dword [ebp - 0x18], ecx
cmp ecx, edi
ja 0x40333e
push dword [eax*4 + 0x411da0]
lea eax, [ebp - 0x1038]
push eax
mov byte [ebp - 0x1038], 0
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0
push 0x8000080
push 2
push 0
push 1
push 0x40000000
lea eax, [ebp - 0x1038]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x1c], eax
cmp eax, 0xffffffff
je 0x403342
push 0
lea ecx, [ebp - 0x28]
push ecx
push dword [ebp - 0x14]
mov ecx, dword [ebp - 0x24]
add ecx, ebx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x403342
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 0x28], eax
jne 0x403342
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x2c]
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0xc]
inc eax
mov dword [ebp - 0x24], edx
mov dword [ebp - 0xc], eax
cmp eax, dword [ebp - 0x10]
jb 0x40325d
mov ecx, dword [ebp - 8]
mov ebx, dword [ebp - 4]
lea eax, [edx + 0x10]
cmp eax, edi
jae 0x40332a
add ecx, edx
test dword [ecx], 0x80000000
je 0x40332a
cmp dword [ecx], 0x80000001
jne 0x403337
sub edi, edx
jmp 0x403223
cmp edx, edi
jne 0x403337
mov dword [ebp - 0x20], 1
jmp 0x403345
push 0xd
jmp 0x4031c4
push 0xd
call esi
mov ebx, dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 8]
test eax, eax
je 0x403367
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
test ebx, ebx
je 0x403377
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x40338a
cmp eax, 0xffffffff
je 0x40338a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x28]
call esi
mov eax, dword [ebp - 0x20]
pop edi
pop esi
pop ebx
leave
ret