Function at 0x1014d41c
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov dword [ebp - 8], edi
mov edi, eax
mov dword [ebp - 4], ebx
mov ebx, ecx
mov dword [ebp - 0xc], esi
mov esi, edx
test edi, edi
je 0x1014d995
movzx eax, byte [edi + 0x170]
and eax, 0x80
mov ecx, dword [edi + 0xe4]
shr eax, 7
movzx edx, byte [edi + 0x171]
mov dword [ebp - 0x18], ecx
and edx, 1
mov dword [ebp - 0x10], eax
xor eax, eax
mov dword [ebp - 0x14], edx
mov ecx, dword [edi + 0x140]
mov dword [edi + 0xc8], eax
mov dword [edi + 0xcc], eax
mov dword [edi + 0xf0], eax
test ebx, ebx
jne 0x1014d555
test edi, edi
je 0x1014d89b
test byte [edi + 0x16d], 4
jne 0x1014d4ac
xor eax, eax
mov esi, 1
mov dword [edi + 0xa8], eax
mov dword [edi + 0xac], eax
jmp 0x1014d88c
mov ebx, dword [edi + 0x40]
lea eax, [ebp - 0x1c]
push 0
sub ebx, dword [edi + 0x38]
push eax
push ebx
push dword [edi + 0x38]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
mov eax, ebx
mov edx, dword [edi + 0x38]
mov ecx, dword [edi + 0xf8]
jne 0x1014d4db
mov esi, 0xffffffff
add ecx, edx
mov dword [edi + 0x44], ecx
mov ecx, dword [edi + 0xc0]
mov dword [edi + 0x3c], edx
add ecx, ebx
cdq
mov eax, dword [edi + 0xc4]
adc eax, edx
and byte [edi + 0x16d], 0xfb
mov dword [edi + 0x40], 0
mov dword [edi + 0xc0], ecx
mov dword [edi + 0xc4], eax
test byte [edi + 0x171], 0x20
je 0x1014d536
xor edx, edx
mov dword [edi + 0xb8], ecx
mov dword [edi + 0xbc], eax
mov dword [edi + 0xa8], edx
mov dword [edi + 0xac], edx
jmp 0x1014d88c
add dword [edi + 0xb8], ebx
adc dword [edi + 0xbc], edx
xor edx, edx
mov dword [edi + 0xa8], edx
mov dword [edi + 0xac], edx
jmp 0x1014d88c
test edi, edi
je 0x1014d615
mov eax, dword [edi + 0x40]
test eax, eax
mov dword [ebp - 0x28], eax
je 0x1014d615
cmp esi, dword [ebp - 0x28]
je 0x1014d615
mov edx, dword [edi + 0x38]
sub dword [ebp - 0x28], edx
je 0x1014d615
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x28]
push edx
push dword [ebp - 0x18]
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x24]
test eax, eax
jne 0x1014d5b5
xor eax, eax
mov esi, 0xffffffff
mov dword [edi + 0xa8], eax
mov dword [edi + 0xac], eax
jmp 0x1014d88c
mov eax, dword [ebp - 0x28]
cdq
mov dword [ebp - 0x2c], esi
mov esi, dword [edi + 0xc0]
add esi, eax
mov dword [ebp - 0x20], ebx
mov ebx, edx
mov edx, dword [edi + 0xc4]
adc edx, ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x34], esi
mov dword [edi + 0xc0], esi
mov dword [edi + 0xc4], edx
mov ebx, dword [ebp - 0x20]
mov esi, dword [ebp - 0x2c]
test byte [edi + 0x171], 0x20
je 0x1014d603
mov eax, dword [ebp - 0x34]
mov dword [edi + 0xb8], eax
mov dword [edi + 0xbc], edx
jmp 0x1014d615
mov eax, dword [ebp - 0x28]
add dword [edi + 0xb8], eax
mov edx, dword [ebp - 0x30]
adc dword [edi + 0xbc], edx
cmp dword [0x103f788c], 0
je 0x1014d6cb
test ecx, ecx
jne 0x1014d630
mov esi, 0xffffffff
jmp 0x1014d6b0
cmp dword [ebp - 0x10], 0
je 0x1014d63f
cmp ecx, 0xfffffffa
je 0x1014d946
cmp ecx, 2
je 0x1014d649
cmp ecx, 1
jne 0x1014d669
mov dword [ebp - 0x24], ecx
call fcn.1017bf30
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x34], eax
cmp dword [0x103f788c], 0
je 0x1014d696
mov dword [ebp - 0x30], 1
jmp 0x1014d673
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x10], 0
je 0x1014d690
cmp dword [ebp - 0x14], 0
je 0x1014d690
push dword [ebp - 0x34]
mov dword [ebp - 0x24], ecx
call fcn.1017bf00
mov ecx, dword [ebp - 0x24]
add esp, 4
cmp dword [ebp - 0x30], 0
je 0x1014d6cb
push 0
push dword [ebp - 0x34]
push ebx
push esi
call fcn.1017bf00
add esp, 0x10
mov esi, eax
cmp esi, ebx
je 0x1014d6b0
mov esi, 0xffffffff
test edi, edi
je 0x1014d88c
xor edx, edx
mov dword [edi + 0xa8], edx
mov dword [edi + 0xac], edx
jmp 0x1014d88c
test edi, edi
je 0x1014d743
test byte [edi + 0x171], 0x40
jne 0x1014d6e0
mov eax, dword [edi + 0x40]
mov dword [ebp - 0x28], eax
jmp 0x1014d72c
test byte [edi + 0x16f], 1
je 0x1014d6f1
mov eax, dword [edi + 0x40]
mov dword [ebp - 0x28], eax
jmp 0x1014d72c
mov edx, dword [edi + 0x38]
cmp esi, edx
mov eax, dword [edi + 0x40]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x28], eax
je 0x1014d706
cmp esi, dword [ebp - 0x28]
jne 0x1014d739
mov dword [ebp - 0x20], ebx
mov ebx, dword [edi + 0xf8]
mov edx, dword [edi + 0x3c]
mov eax, dword [ebp - 0x30]
add eax, dword [edi + 0xec]
mov dword [ebp - 0x34], ebx
lea edx, [edx + ebx*2]
mov ebx, dword [ebp - 0x20]
cmp eax, edx
ja 0x1014d858
cmp esi, dword [ebp - 0x28]
jne 0x1014d739
add ebx, dword [ebp - 0x28]
mov esi, dword [edi + 0x38]
sub ebx, esi
mov eax, dword [edi + 0x13c]
test eax, eax
jne 0x1014d748
mov eax, 0x20000
cmp ebx, eax
jbe 0x1014d7ac
mov dword [ebp - 0x34], ebx
test edi, edi
je 0x1014d75d
mov edx, dword [edi + 0x13c]
test edx, edx
jne 0x1014d762
mov edx, 0x20000
mov eax, esi
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x20], ebx
mov ebx, eax
mov dword [ebp - 0x2c], esi
mov esi, edx
mov dword [ebp - 0x24], ecx
mov edi, dword [ebp - 0x18]
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp edi, eax
je 0x1014d8eb
push 0
lea ecx, [ebp - 0x1c]
push ecx
push esi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 1
je 0x1014d8a2
mov ebx, dword [ebp - 0x20]
mov esi, eax
mov ecx, dword [ebp - 0x24]
mov edi, dword [ebp - 0x30]
jmp 0x1014d7dc
mov dword [ebp - 0x24], ecx
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ecx, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x18]
je 0x1014d958
push 0
lea eax, [ebp - 0x1c]
push eax
push ebx
push esi
push dword [ebp - 0x18]
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x24]
mov esi, eax
test esi, esi
jne 0x1014d7ee
cmp ecx, 1
je 0x1014d930
mov esi, 0xffffffff
test edi, edi
je 0x1014d88c
mov ecx, dword [edi + 0x38]
mov eax, ebx
add ecx, dword [edi + 0xf8]
mov dword [edi + 0x44], ecx
mov ecx, dword [edi + 0xc0]
cdq
add ecx, ebx
mov eax, dword [edi + 0xc4]
adc eax, edx
and byte [edi + 0x16d], 0xfb
mov dword [edi + 0x40], 0
mov dword [edi + 0xc0], ecx
mov dword [edi + 0xc4], eax
test byte [edi + 0x171], 0x20
je 0x1014d536
xor edx, edx
mov dword [edi + 0xb8], ecx
mov dword [edi + 0xbc], eax
mov dword [edi + 0xa8], edx
mov dword [edi + 0xac], edx
jmp 0x1014d88c
mov eax, ebx
add esi, ebx
cdq
add dword [edi + 0xb8], ebx
mov ecx, dword [ebp - 0x34]
mov dword [edi + 0x40], esi
adc dword [edi + 0xbc], edx
xor ebx, ebx
mov esi, 1
or byte [edi + 0x16d], 4
add dword [edi + 0x44], ecx
mov dword [edi + 0xa8], ebx
mov dword [edi + 0xac], ebx
mov eax, esi
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
mov esi, 1
jmp 0x1014d88c
mov edx, dword [ebp - 0x1c]
sub dword [ebp - 0x34], edx
add ebx, edx
cmp dword [ebp - 0x30], 0
je 0x1014d8bd
mov ecx, dword [ebp - 0x30]
mov ecx, dword [ecx + 0x13c]
test ecx, ecx
jne 0x1014d8c2
mov ecx, 0x20000
cmp ecx, dword [ebp - 0x34]
jb 0x1014d8d0
mov esi, dword [ebp - 0x34]
test esi, esi
jne 0x1014d8d6
jmp 0x1014d8de
cmp dword [ebp - 0x34], 0
je 0x1014d8de
test edx, edx
ja 0x1014d777
mov ebx, dword [ebp - 0x20]
mov esi, eax
mov edi, dword [ebp - 0x30]
jmp 0x1014d7ee
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 2
jne 0x1014d787
push esi
push ebx
push 1
call fcn.1013c23e
add esp, 0xc
mov edx, eax
cmp edx, 0xffffffff
je 0x1014d918
mov dword [ebp - 0x1c], edx
mov eax, 1
jmp 0x1014d8a5
push 0
lea ecx, [ebp - 0x1c]
push ecx
push dword [ebp - 0x20]
push dword [ebp - 0x2c]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x1014d796
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 6
jne 0x1014d7e9
xor esi, esi
jmp 0x1014d7ee
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], 1
jmp 0x1014d679
push dword [ebp - 0x18]
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov ecx, dword [ebp - 0x24]
cmp eax, 2
jne 0x1014d7c3
push ebx
push esi
push 1
mov dword [ebp - 0x24], ecx
call fcn.1013c23e
mov ecx, dword [ebp - 0x24]
add esp, 0xc
cmp eax, 0xffffffff
je 0x1014d7c3
mov esi, 1
jmp 0x1014d7ee
cmp dword [0x103f788c], 0
jne 0x1014d9be
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 0x18], eax
mov eax, dword [0x103f788c]
mov ecx, 1
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], eax
jmp 0x1014d47b
call fcn.1017bf30
jmp 0x1014d9a6