Function at 0x10d4687
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
mov ecx, dword [0x111024c]
mov ebx, 0x111024c
cmp ecx, ebx
je 0x10d46c5
test byte [ecx + 0x1c], 1
je 0x10d46c5
cmp byte [ecx + 0x19], 4
jb 0x10d46c5
push 0x100ffa4
push 0x60
push dword [ecx + 0x14]
push dword [ecx + 0x10]
call fcn.0101894a
mov ecx, dword [0x111024c]
or dword [ebp - 8], 0xffffffff
xor eax, eax
xor edx, edx
lea edi, [ebp - 0x18]
stosd dword es:[edi], eax
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x10], edx
mov byte [ebp - 1], dl
stosd dword es:[edi], eax
mov esi, 0x100ffb4
cmp dword [ebp + 8], edx
jne 0x10d46fb
push 0x1010178
push 0x947
push esi
call fcn.0107b644
mov ecx, dword [0x111024c]
cmp dword [ebp + 0xc], 0
jne 0x10d4717
push 0x101016c
push 0x948
push esi
call fcn.0107b644
mov ecx, dword [0x111024c]
cmp ecx, ebx
je 0x10d473f
test byte [ecx + 0x1c], 1
je 0x10d473f
cmp byte [ecx + 0x19], 4
jb 0x10d473f
push dword [ebp + 0xc]
push dword [ebp + 8]
push 0x100ffa4
push 0x61
push dword [ecx + 0x14]
push dword [ecx + 0x10]
call fcn.010197e6
mov esi, dword [ebp + 0x10]
test esi, esi
je 0x10d4750
cmp byte [ebp + 0x14], 0
je 0x10d4750
mov bl, 1
jmp 0x10d4752
xor bl, bl
test esi, esi
je 0x10d4760
cmp byte [ebp + 0x14], 0
mov byte [ebp + 0x17], 1
je 0x10d4764
mov byte [ebp + 0x17], 0
test bl, bl
je 0x10d477b
push 0
mov ecx, esi
call fcn.010d19a2
mov edi, eax
test edi, edi
jl 0x10d4982
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0xc]
push eax
push dword [ebp + 8]
call fcn.010f19ea
mov edi, eax
test edi, edi
jge 0x10d47d0
mov eax, dword [0x111024c]
cmp eax, 0x111024c
je 0x10d4987
test byte [eax + 0x1c], 1
je 0x10d4987
cmp byte [eax + 0x19], 2
jb 0x10d4987
push edi
push dword [ebp + 8]
push 0x100ffa4
push 0x62
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01048c37
jmp 0x10d4982
test bl, bl
je 0x10d47db
mov ecx, esi
call fcn.010d1aee
cmp byte [ebp + 0x17], 0
je 0x10d47f4
push 0
mov ecx, esi
call fcn.010d19a2
mov edi, eax
test edi, edi
jl 0x10d4982
lea eax, [ebp - 8]
push eax
xor eax, eax
push eax
push eax
push 0x80
push 2
pop ebx
push ebx
push eax
push 0xc0000000
push dword [ebp + 0xc]
call fcn.0107e47a
mov edi, eax
test edi, edi
jge 0x10d484c
mov eax, dword [0x111024c]
cmp eax, 0x111024c
je 0x10d4987
test byte [eax + 0x1c], 1
je 0x10d4987
cmp byte [eax + 0x19], bl
jb 0x10d4987
push edi
push dword [ebp + 0xc]
push 0x100ffa4
push 0x63
jmp 0x10d47c0
cmp byte [ebp + 0x17], 0
mov byte [ebp - 1], 1
je 0x10d485d
mov ecx, esi
call fcn.010d1aee
mov eax, dword [ebp - 0xc]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
test cx, cx
jne 0x10d4863
sub eax, edx
sar eax, 1
push 0
lea esi, [eax + eax + 2]
lea eax, [ebp - 0x10]
push eax
push esi
push dword [ebp - 0xc]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10d48d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x10d48a0
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
mov eax, dword [0x111024c]
cmp eax, 0x111024c
je 0x10d4987
test byte [eax + 0x1c], 1
je 0x10d4987
cmp byte [eax + 0x19], bl
jb 0x10d4987
push edi
push dword [ebp + 0xc]
push 0x100ffa4
push 0x64
jmp 0x10d47c0
cmp dword [ebp - 0x10], esi
je 0x10d4916
mov eax, dword [0x111024c]
cmp eax, 0x111024c
je 0x10d490f
test byte [eax + 0x1c], 1
je 0x10d490f
cmp byte [eax + 0x19], bl
jb 0x10d490f
push esi
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push 0x100ffa4
push 0x65
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01019c0f
mov eax, dword [0x111024c]
mov edi, 0x8007045d
jmp 0x10d4987
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x10d4971
call dword [sym.imp.ntdll.dll_RtlGetLastNtStatus]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x10d493f
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
mov eax, dword [0x111024c]
cmp eax, 0x111024c
je 0x10d4987
test byte [eax + 0x1c], 1
je 0x10d4987
cmp byte [eax + 0x19], bl
jb 0x10d4987
push esi
push edi
push dword [ebp + 0xc]
push 0x100ffa4
push 0x66
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01019c0f
jmp 0x10d4982
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 8], 0xffffffff
mov byte [ebp - 1], 0
mov eax, dword [0x111024c]
cmp dword [ebp - 8], 0xffffffff
je 0x10d499f
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 8], 0xffffffff
mov eax, dword [0x111024c]
cmp byte [ebp - 1], 0
je 0x10d49e8
push 0
push 0
push dword [ebp + 0xc]
call fcn.0107f40d
test eax, eax
jge 0x10d49e3
mov eax, dword [0x111024c]
cmp eax, 0x111024c
je 0x10d49e8
test byte [eax + 0x1c], 1
je 0x10d49e8
cmp byte [eax + 0x19], 3
jb 0x10d49e8
push edi
push dword [ebp + 0xc]
push 0x100ffa4
push 0x67
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01048c37
mov eax, dword [0x111024c]
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x10d49f9
call fcn.010d1aee
mov eax, dword [0x111024c]
cmp dword [ebp - 0xc], 0
je 0x10d4a11
push dword [ebp - 0xc]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
and dword [ebp - 0xc], 0
mov eax, dword [0x111024c]
cmp eax, 0x111024c
je 0x10d4a36
test byte [eax + 0x1c], 1
je 0x10d4a36
cmp byte [eax + 0x19], 4
jb 0x10d4a36
push 0x100ffa4
push 0x68
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.0101894a
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret 0x10