Function at 0x1002ccfc
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], esi
mov dword [ebp - 0xc], ebx
mov edi, ecx
mov esi, edx
mov ebx, eax
test ebx, ebx
je 0x1002d01d
mov eax, dword [ebx + 0xb4]
movzx ecx, byte [ebx + 0x130]
mov dword [ebp - 4], eax
mov edx, ecx
and edx, 0x20
shr edx, 5
mov dword [ebp - 0x18], edx
mov edx, dword [ebx + 0x108]
and ecx, 0x40
shr ecx, 6
mov dword [ebp - 0x1c], ecx
test edi, edi
jne 0x1002cda6
test ebx, ebx
je 0x1002cfae
movzx eax, byte [ebx + 0x12d]
test al, 1
jne 0x1002cd64
mov eax, 1
jmp 0x1002cf93
mov esi, dword [ebp - 4]
lea eax, [ebp - 8]
push 0
mov ecx, dword [ebx + 0x38]
mov edx, dword [ebx + 0x40]
push eax
sub edx, ecx
push edx
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebx + 0x38]
add edx, dword [ebx + 0xc0]
test eax, eax
mov dword [ebx + 0x44], edx
jne 0x1002cd93
mov eax, 0xffffffff
mov dword [ebx + 0x40], 0
and byte [ebx + 0x12d], 0xfe
jmp 0x1002cf93
test ebx, ebx
je 0x1002cde8
mov eax, dword [ebx + 0x40]
test eax, eax
je 0x1002cde8
cmp esi, eax
je 0x1002cde8
mov ecx, dword [ebx + 0x38]
mov dword [ebp - 0x24], ecx
sub eax, ecx
je 0x1002cde8
lea ecx, [ebp - 8]
push 0
mov dword [ebp - 0x20], edx
push ecx
push eax
mov eax, dword [ebp - 0x24]
push eax
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x20]
test eax, eax
jne 0x1002cde8
mov eax, 0xffffffff
jmp 0x1002cf93
mov eax, dword [0x100d9158]
test eax, eax
je 0x1002ce82
test edx, edx
jne 0x1002ce00
mov eax, 0xffffffff
jmp 0x1002ce75
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x1002ce10
cmp edx, 0xfffffffa
je 0x1002d00a
cmp edx, 2
je 0x1002ce1a
cmp edx, 1
jne 0x1002ce35
call fcn.1007ee18
mov dword [ebp - 0x24], eax
mov eax, dword [0x100d9158]
test eax, eax
je 0x1002ce5c
mov eax, 1
mov dword [ebp - 0x20], eax
jmp 0x1002ce3d
xor eax, eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x1002ce55
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x1002ce55
mov eax, dword [ebp - 0x24]
push eax
call fcn.1007ed44
pop ecx
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x1002ce82
mov eax, dword [ebp - 0x24]
push 0
push eax
push edi
push esi
call fcn.1007ed04
add esp, 0x10
cmp eax, edi
je 0x1002ce75
mov eax, 0xffffffff
test ebx, ebx
jne 0x1002cf93
jmp 0x1002cfa1
test ebx, ebx
je 0x1002cf01
movzx eax, byte [ebx + 0x131]
test al, 0x10
jne 0x1002ce99
mov eax, dword [ebx + 0x40]
mov dword [ebp - 0x20], eax
jmp 0x1002cee5
movzx eax, byte [ebx + 0x12e]
test al, 0x20
je 0x1002ceac
mov eax, dword [ebx + 0x40]
mov dword [ebp - 0x20], eax
jmp 0x1002cee5
mov eax, dword [ebx + 0x38]
mov dword [ebp - 0x24], eax
cmp esi, eax
je 0x1002cec2
mov eax, dword [ebx + 0x40]
mov dword [ebp - 0x20], eax
cmp esi, eax
jne 0x1002cef4
jmp 0x1002cec8
mov eax, dword [ebx + 0x40]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x24]
add eax, dword [ebx + 0xbc]
mov edx, dword [ebx + 0xc0]
mov ecx, dword [ebx + 0x3c]
lea ecx, [ecx + edx*2]
cmp eax, ecx
ja 0x1002cf7f
mov eax, dword [ebp - 0x20]
cmp esi, eax
jne 0x1002cef4
add edi, dword [ebp - 0x20]
mov esi, dword [ebx + 0x38]
sub edi, esi
mov eax, dword [ebx + 0x104]
cmp eax, 0x40000
ja 0x1002cf06
mov eax, 0x40000
cmp edi, eax
jbe 0x1002cf4d
test ebx, ebx
je 0x1002cf1b
mov eax, dword [ebx + 0x104]
cmp eax, 0x40000
ja 0x1002cf20
mov eax, 0x40000
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x1c], ebx
mov ebx, eax
mov ecx, dword [ebp - 4]
lea edx, [ebp - 8]
push 0
push edx
push ebx
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 1
je 0x1002cfb5
mov ebx, dword [ebp - 0x1c]
test eax, eax
jne 0x1002cf5f
mov eax, 0xffffffff
jmp 0x1002cf5f
mov edx, dword [ebp - 4]
lea eax, [ebp - 8]
push 0
push eax
push edi
push esi
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test ebx, ebx
je 0x1002cfa1
mov edx, dword [ebx + 0x38]
add edx, dword [ebx + 0xc0]
mov dword [ebx + 0x44], edx
and byte [ebx + 0x12d], 0xfe
mov dword [ebx + 0x40], 0
jmp 0x1002cf93
or byte [ebx + 0x12d], 1
add esi, edi
mov dword [ebx + 0x40], esi
mov eax, 1
add dword [ebx + 0x44], edx
xor edx, edx
mov dword [ebx + 0xa0], edx
mov dword [ebx + 0xa4], edx
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 0x10]
mov edi, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret
mov eax, 1
jmp 0x1002cfa1
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0x20]
mov edi, dword [ebp - 0x1c]
add esi, edx
sub ecx, edx
test edi, edi
mov dword [ebp - 0x20], ecx
je 0x1002cfdc
mov ecx, edi
mov edi, dword [ecx + 0x104]
mov dword [ebp - 0x24], edi
cmp edi, 0x40000
ja 0x1002cfe4
mov ecx, 0x40000
mov dword [ebp - 0x24], ecx
mov ecx, dword [ebp - 0x20]
mov edi, dword [ebp - 0x24]
cmp ecx, edi
ja 0x1002cff6
mov ebx, ecx
test ebx, ebx
jne 0x1002cffa
jmp 0x1002d002
test ecx, ecx
je 0x1002d002
test edx, edx
ja 0x1002cf28
mov ebx, dword [ebp - 0x1c]
jmp 0x1002cf5f
mov eax, dword [ebp - 4]
mov dword [ebp - 0x24], eax
mov edx, 1
mov dword [ebp - 0x20], edx
jmp 0x1002ce44
mov eax, dword [0x100d9158]
test eax, eax
jne 0x1002d046
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 4], eax
mov eax, dword [0x100d9158]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], eax
mov edx, 1
jmp 0x1002cd43
call fcn.1007ee18
jmp 0x1002d02e