Function at 0x41091f
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa0
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
cmp edi, 0xffffffff
mov ebx, ecx
jne 0x410944
push 6
call dword [sym.imp.kernel32.dll_SetLastError]
xor eax, eax
jmp 0x410fed
xor esi, esi
push esi
push esi
push esi
push edi
mov dword [ebx + 0x10], esi
mov dword [ebx + 0x14], esi
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x41093d
push dword [ebx + 0x6c]
mov ecx, ebx
push esi
push edi
call fcn.0040ff27
test eax, eax
je 0x41093d
mov eax, dword [ebx + 0x6c]
push edi
mov ecx, ebx
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], esi
call fcn.0040ffb9
test eax, eax
je 0x41093d
cmp word [ebx + 0x1e], si
mov dword [ebp - 8], esi
jbe 0x410a11
lea edi, [ebx + 0x120]
cmp dword [edi], esi
je 0x4109bd
push esi
push esi
push dword [edi + 4]
push dword [ebp + 8]
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x41093d
push dword [edi]
mov ecx, ebx
push dword [edi + 4]
push dword [ebp + 8]
call fcn.0040ff27
test eax, eax
je 0x41093d
mov eax, dword [edi + 4]
add eax, dword [edi]
mov edx, dword [ebx + 0x10]
cmp eax, edx
jbe 0x4109cb
mov edx, eax
mov ecx, dword [ebx + 0x14]
mov dword [ebx + 0x10], edx
mov eax, dword [edi - 8]
add eax, dword [edi - 4]
cmp eax, ecx
ja 0x4109dd
mov eax, ecx
mov dword [ebx + 0x14], eax
lea eax, [ebx + 0x398]
mov ecx, dword [eax]
cmp edx, ecx
jbe 0x4109ee
mov ecx, edx
push dword [ebp + 8]
mov dword [eax], ecx
mov ecx, ebx
call fcn.0040ffb9
test eax, eax
je 0x41093d
movzx eax, word [ebx + 0x1e]
inc dword [ebp - 8]
add edi, 0x28
cmp dword [ebp - 8], eax
jb 0x410993
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 4]
push eax
mov ecx, ebx
mov dword [ebp - 4], esi
mov dword [ebp - 8], esi
mov dword [ebp - 0xc], esi
call fcn.0041055d
test eax, eax
jne 0x410a3d
mov eax, dword [ebx + 4]
cmp dword [eax + 4], esi
je 0x410e1e
xor eax, eax
mov ax, word [ebx + 0x1e]
xor edi, edi
mov di, ax
push 0x30
push esi
inc eax
mov word [ebx + 0x1e], ax
lea eax, [ebp - 0xa0]
push eax
mov dword [ebp - 0x24], edi
call sub.msvcrt.dll_memset
lea eax, [edi + edi*4]
lea edi, [ebx + eax*8]
push 0x28
lea eax, [edi + 0x110]
push esi
push eax
call sub.msvcrt.dll_memset
mov eax, dword [ebx + 0x98]
mov dword [ebp - 0x90], eax
mov eax, dword [ebx + 0x9c]
mov dword [ebp - 0x8c], eax
mov eax, dword [ebx + 0xe8]
mov dword [ebp - 0x88], eax
mov eax, dword [ebx + 0xec]
mov dword [ebp - 0x84], eax
mov eax, dword [ebx + 0xf0]
mov dword [ebp - 0x80], eax
mov eax, dword [ebx + 0xf4]
mov dword [ebp - 0x7c], eax
mov eax, dword [ebx + 0x68]
mov dword [ebp - 0x78], eax
lea eax, [edi + 0x110]
push str..detour
push eax
mov dword [ebp - 0xa0], 0x30
mov dword [ebp - 0x9c], 0x727444
call sub.msvcrt.dll__mbscpy
mov edx, dword [ebp - 8]
mov dword [edi + 0x134], 0xc0000040
mov eax, dword [ebx + 0x14]
mov ecx, dword [ebx + 4]
mov dword [ebx + 0x3a0], eax
mov eax, dword [ebx + 0x10]
mov dword [ebx + 0x3a8], eax
mov dword [ebx + 0x3a4], esi
mov dword [ebp - 0x98], esi
mov eax, dword [ecx + 4]
mov dword [ebp - 0x94], eax
mov eax, dword [ebp - 4]
mov ecx, dword [ecx + 4]
lea eax, [eax + eax*4]
shl eax, 2
shl edx, 2
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], edx
add edx, 7
add eax, 7
and edx, 0xfffffff8
and eax, 0xfffffff8
lea eax, [eax + edx*2 + 0x30]
mov edx, dword [ebp - 0xc]
add edx, 7
add ecx, 7
and edx, 0xfffffff8
and ecx, 0xfffffff8
add eax, edx
add eax, ecx
add esp, 0x20
push eax
mov ecx, ebx
mov dword [ebp - 0x2c], esi
call fcn.0040fd73
test eax, eax
je 0x41093d
lea eax, [ebp - 0x18]
push eax
push 0x30
mov ecx, ebx
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x10], esi
call fcn.0040fe0b
cmp eax, esi
mov dword [ebp - 0x1c], eax
je 0x41093d
mov eax, dword [ebp - 8]
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 4]
mov ecx, ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x38], esi
call fcn.0040fe0b
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x64], eax
lea eax, [ebp - 0x60]
push eax
push dword [ebp - 4]
mov ecx, ebx
mov dword [ebp - 0x70], ebx
mov dword [ebp - 0x68], esi
call fcn.0040fe0b
lea ecx, [ebp - 0x44]
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0xc]
push ecx
push eax
mov ecx, ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x4c], esi
mov dword [ebp - 0x48], eax
call fcn.0040fe0b
mov dword [ebp - 0x50], eax
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebx + 4]
push dword [eax + 4]
mov ecx, ebx
call fcn.0040fe0b
cmp eax, esi
mov dword [ebp - 4], eax
je 0x41093d
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x18]
mov ecx, dword [ebx + 4]
mov dword [ebp - 0x98], eax
mov ecx, dword [ecx + 4]
add ecx, eax
push 0x30
lea eax, [ebp - 0xa0]
push eax
push dword [ebp - 0x1c]
mov dword [ebp - 0x94], ecx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebx + 4]
push dword [eax + 4]
push dword [eax]
push dword [ebp - 4]
call sub.msvcrt.dll_memcpy
add esp, 0x18
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x14]
mov ecx, ebx
call fcn.0040fe0b
cmp eax, esi
mov dword [ebp - 0xc], eax
je 0x41093d
mov eax, dword [ebx + 0x3b4]
jmp 0x410d4a
call sub.msvcrt.dll_memset
mov eax, dword [ebp - 0xc]
add esp, 0xc
add eax, 0xc
push eax
mov eax, dword [ebp - 8]
push dword [eax + 0x20]
lea ecx, [ebp - 0x54]
call fcn.0041102c
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
mov dword [eax + 4], esi
mov edx, dword [ecx + 0x18]
mov dword [eax + 8], edx
cmp dword [ecx + 4], esi
je 0x410cbf
push eax
push Ordinal_3
lea ecx, [ebp - 0x40]
call fcn.00410ff4
mov eax, dword [ebp - 0xc]
add eax, 0x10
push eax
push Ordinal_3
lea ecx, [ebp - 0x70]
call fcn.00410ff4
lea eax, [ebp - 0x28]
push eax
push esi
lea ecx, [ebp - 0x40]
call fcn.00410ff4
lea eax, [ebp - 0x28]
lea ecx, [ebp - 0x70]
jmp 0x410d3a
mov eax, dword [ebp - 8]
mov edx, dword [eax + 0x14]
mov ecx, dword [ebp - 0xc]
mov dword [ecx + 0x10], edx
xor edx, edx
inc edx
cmp edx, dword [ebp - 0x34]
mov dword [ebp - 4], esi
sbb edx, edx
and edx, dword [ebp - 0x30]
mov dword [ecx], edx
cmp dword [eax + 0xc], esi
jbe 0x410d34
mov dword [ebp - 0x10], esi
mov eax, dword [eax + 8]
add eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0xc]
cmp ecx, esi
je 0x410d0d
movzx eax, word [eax]
lea edx, [ebp - 0x18]
push edx
push eax
push ecx
lea ecx, [ebp - 0x54]
mov dword [ebp - 0x18], esi
call fcn.00411084
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x18]
jmp 0x410d1a
mov eax, dword [eax + 4]
lea ecx, [ebp - 0x1c]
push ecx
sub eax, 0x80000000
push eax
lea ecx, [ebp - 0x40]
call fcn.00410ff4
inc dword [ebp - 4]
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
add dword [ebp - 0x10], 0x10
cmp ecx, dword [eax + 0xc]
jb 0x410ce3
lea eax, [ebp - 0x1c]
lea ecx, [ebp - 0x40]
push eax
push esi
call fcn.00410ff4
mov eax, dword [ebp - 8]
add dword [ebp - 0xc], 0x14
mov eax, dword [eax]
cmp eax, esi
push 4
push esi
push dword [ebp - 0xc]
mov dword [ebp - 8], eax
jne 0x410c57
call sub.msvcrt.dll_memset
mov eax, dword [ebx + 0x3a4]
add dword [ebx + 0x14], eax
add esp, 0xc
push eax
mov ecx, ebx
call fcn.0040fe62
push dword [ebp + 8]
add dword [ebx + 0x10], eax
mov ecx, ebx
call fcn.0040ffb9
test eax, eax
je 0x41093d
mov eax, dword [ebx + 0x3a0]
mov dword [edi + 0x11c], eax
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebx + 0x3a4]
lea eax, [eax + eax*4 + 0x23]
mov dword [ebx + eax*8], ecx
mov eax, dword [ebx + 0x3a8]
mov dword [edi + 0x124], eax
push dword [ebx + 0x3a4]
mov ecx, ebx
call fcn.0040fe62
mov dword [edi + 0x120], eax
mov eax, dword [ebp - 0x2c]
push esi
mov dword [ebx + 0x98], eax
mov eax, dword [ebp - 0x14]
push esi
mov dword [ebx + 0x9c], eax
mov dword [ebx + 0xe8], esi
mov dword [ebx + 0xec], esi
push dword [edi + 0x124]
push dword [ebp + 8]
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x41093d
push esi
lea eax, [ebp - 0x20]
push eax
push dword [edi + 0x120]
push dword [ebx + 0x3ac]
push dword [ebp + 8]
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x41093d
mov ecx, dword [ebx + 0x10]
sub ecx, dword [ebx + 0x398]
xor edi, edi
cmp word [ebx + 0x1e], si
mov dword [ebp - 0x24], ecx
jbe 0x410e72
lea eax, [ebx + 0x128]
mov edx, dword [eax - 4]
cmp edx, dword [ebx + 0x398]
jbe 0x410e48
add edx, ecx
mov dword [eax - 4], edx
mov edx, dword [eax]
cmp edx, dword [ebx + 0x398]
jbe 0x410e56
add edx, ecx
mov dword [eax], edx
mov edx, dword [eax + 4]
cmp edx, dword [ebx + 0x398]
jbe 0x410e66
add edx, ecx
mov dword [eax + 4], edx
movzx edx, word [ebx + 0x1e]
inc edi
add eax, 0x28
cmp edi, edx
jb 0x410e38
mov eax, dword [ebx + 0x24]
cmp eax, dword [ebx + 0x398]
jbe 0x410e82
add eax, ecx
mov dword [ebx + 0x24], eax
mov eax, dword [ebx + 0x14]
mov edi, dword [ebx + 0xc0]
cmp edi, esi
mov dword [ebx + 0x68], eax
mov eax, dword [ebx + 0xc4]
mov dword [ebx + 0x70], esi
mov dword [ebp - 0x14], eax
je 0x410f2f
cmp eax, esi
je 0x410f2f
push edi
mov ecx, ebx
call fcn.0040fed9
push esi
push esi
push eax
push dword [ebp + 8]
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x41093d
push edi
mov ecx, ebx
call fcn.0040fe84
mov ecx, eax
cmp ecx, esi
je 0x41093d
mov eax, dword [ebp - 0x14]
push 0x1c
xor edx, edx
pop edi
div edi
mov dword [ebp - 0x10], esi
cmp eax, esi
mov dword [ebp - 0x28], eax
jbe 0x410f2f
mov dword [ebp - 4], ecx
mov esi, dword [ebp - 4]
mov eax, dword [ebp - 0x24]
push 7
pop ecx
lea edi, [ebp - 0x5c]
push 0
rep movsd dword es:[edi], dword [esi]
add dword [ebp - 0x44], eax
lea eax, [ebp - 0x20]
push eax
push 0x1c
lea eax, [ebp - 0x5c]
push eax
push dword [ebp + 8]
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x41093d
inc dword [ebp - 0x10]
mov eax, dword [ebp - 0x10]
add dword [ebp - 4], 0x1c
cmp eax, dword [ebp - 0x28]
jb 0x410ef0
xor esi, esi
mov eax, dword [ebx + 0x39c]
cmp eax, dword [ebx + 0x398]
jbe 0x410f76
push esi
push esi
push dword [ebx + 0x10]
push dword [ebp + 8]
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x41093d
mov eax, dword [ebx + 0x398]
mov ecx, dword [ebx + 0x39c]
sub ecx, eax
push ecx
push eax
push dword [ebp + 8]
mov ecx, ebx
call fcn.0040ff27
test eax, eax
je 0x41093d
push esi
push esi
push dword [ebx + 0x390]
push dword [ebp + 8]
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x41093d
mov edi, dword [sym.imp.kernel32.dll_WriteFile]
push esi
lea eax, [ebp - 0x20]
push eax
push 0xf8
lea eax, [ebx + 0x18]
push eax
push dword [ebp + 8]
call edi
test eax, eax
je 0x41093d
push esi
push esi
push dword [ebx + 0x394]
push dword [ebp + 8]
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x41093d
push esi
lea eax, [ebp - 0x20]
push eax
movzx eax, word [ebx + 0x1e]
lea eax, [eax + eax*4]
shl eax, 3
push eax
add ebx, 0x110
push ebx
push dword [ebp + 8]
call edi
neg eax
sbb eax, eax
neg eax
pop edi
pop esi
pop ebx
leave
ret 4