Function at 0x10001ca0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
mov ebx, dword [ebp + 8]
push edi
mov edi, ecx
mov dword [ebp - 8], edi
cmp ebx, 0xffffffff
jne 0x10001cbf
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [edi + 0x24]
cmp dword [ecx], 0
je 0x10001cec
mov eax, dword [edi + 0x34]
mov ecx, dword [ecx]
mov edx, dword [eax]
add edx, ecx
cmp ecx, edx
jae 0x10001cec
dec dword [eax]
mov eax, dword [edi + 0x24]
mov ecx, dword [eax]
lea edx, [ecx + 1]
mov dword [eax], edx
pop edi
mov byte [ecx], bl
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp dword [edi + 0x54], 0
jne 0x10001cfd
pop edi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [edi + 0x10]
lea eax, [edi + 0x48]
cmp dword [ecx], eax
jne 0x10001d1b
mov edx, dword [edi + 0x3c]
mov eax, dword [edi + 0x40]
mov dword [ecx], edx
mov ecx, dword [edi + 0x20]
mov dword [ecx], eax
mov edx, dword [edi + 0x30]
sub eax, eax
mov dword [edx], eax
cmp dword [edi + 0x44], 0
jne 0x10001d40
mov edi, dword [edi + 0x54]
movsx eax, bl
push edi
push eax
call fcn.10004089
add esp, 8
cmp eax, 0xffffffff
je 0x10001cf2
pop edi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 4
push esi
lea esi, [ebp - 0x2c]
mov byte [ebp - 1], bl
call fcn.10002660
mov ebx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x1c]
mov esi, eax
cmp ebx, 0x10
jae 0x10001d61
lea esi, [ebp - 0x2c]
mov eax, esi
mov ecx, dword [edi + 0x44]
mov ebx, dword [ecx]
lea edi, [ebp - 0xc]
push edi
mov edi, dword [ebp - 8]
add edx, esi
push edx
push eax
lea edx, [ebp - 0x10]
push edx
lea eax, [ebp]
push eax
lea edx, [ebp - 1]
push edx
lea eax, [edi + 0x4c]
push eax
mov eax, dword [ebx + 0x14]
call eax
test eax, eax
js 0x10001ed8
cmp eax, 1
jg 0x10001e73
mov ebx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x2c]
mov edx, eax
cmp ebx, 0x10
jae 0x10001da7
lea edx, [ebp - 0x2c]
mov esi, dword [ebp - 0xc]
sub esi, edx
je 0x10001dd4
cmp ebx, 0x10
jae 0x10001db6
lea eax, [ebp - 0x2c]
mov ecx, dword [edi + 0x54]
push ecx
push esi
push 1
push eax
call fcn.100050f3
add esp, 0x10
cmp esi, eax
jne 0x10001ed8
mov ebx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x2c]
lea edx, [ebp - 1]
mov byte [edi + 0x49], 1
cmp dword [ebp - 0x10], edx
jne 0x10001eba
test esi, esi
jne 0x10001d52
mov edx, dword [ebp - 0x1c]
cmp edx, 0x20
jae 0x10001ed8
or ecx, 0xffffffff
sub ecx, edx
cmp ecx, 8
jbe 0x10001ece
lea esi, [edx + 8]
cmp esi, 0xfffffffe
ja 0x10001ece
cmp ebx, esi
jae 0x10001e5c
push edx
push esi
lea ecx, [ebp - 0x2c]
call fcn.10002e90
mov ebx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x2c]
test esi, esi
je 0x10001d55
mov ecx, eax
cmp ebx, 0x10
jae 0x10001e3b
lea ecx, [ebp - 0x2c]
xor eax, eax
mov dword [ecx + edx], eax
mov dword [ecx + edx + 4], eax
cmp dword [ebp - 0x18], 0x10
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x1c], esi
jae 0x10001e53
lea eax, [ebp - 0x2c]
mov byte [eax + esi], 0
jmp 0x10001d4c
test esi, esi
jne 0x10001e31
mov dword [ebp - 0x1c], esi
cmp ebx, 0x10
jae 0x10001e6b
lea eax, [ebp - 0x2c]
mov byte [eax], 0
jmp 0x10001d4c
cmp eax, 3
jne 0x10001ed8
mov edi, dword [edi + 0x54]
movsx edx, byte [ebp - 1]
push edi
push edx
call fcn.10004089
add esp, 8
cmp eax, 0xffffffff
je 0x10001ea4
mov esi, dword [ebp + 8]
lea ecx, [ebp - 0x2c]
call fcn.10001660
mov eax, esi
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 4
lea ecx, [ebp - 0x2c]
or esi, 0xffffffff
call fcn.10001660
mov eax, esi
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 4
lea ecx, [ebp - 0x2c]
call fcn.10001660
mov eax, dword [ebp + 8]
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 4
push str.string_too_long
call fcn.10003a2b
lea ecx, [ebp - 0x2c]
call fcn.10001660
pop esi
pop edi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret 4