Function at 0x1000a420
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
test esi, esi
je 0x1000a472
mov ebx, dword [ebp + 8]
mov dword [ebp - 4], 0
cmp ebx, 0xffffffff
je 0x1000a443
mov eax, ebx
jmp 0x1000a446
or eax, 0xffffffff
mov edi, dword [ebp + 0xc]
lea ecx, [ebp - 4]
push 0
push ecx
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1000a509
mov ecx, dword [ebp + 0x14]
mov eax, dword [ebp - 4]
test ecx, ecx
je 0x1000a47b
cmp eax, esi
jbe 0x1000a470
mov eax, esi
mov dword [ecx], eax
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, esi
jae 0x1000a472
nop
mov ecx, esi
mov dword [ebp - 8], 0
sub ecx, eax
lea edx, [eax + edi]
cmp ebx, 0xffffffff
je 0x1000a497
mov eax, ebx
jmp 0x1000a49a
or eax, 0xffffffff
push 0
lea esi, [ebp - 8]
push esi
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [ebp + 0x10]
test eax, eax
je 0x1000a4d0
mov ecx, dword [ebp - 8]
test ecx, ecx
je 0x1000a5e0
mov eax, dword [ebp - 4]
add eax, ecx
mov dword [ebp - 4], eax
cmp eax, esi
jb 0x1000a480
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.1000ab30
add esp, 4
cmp eax, 0xffffff68
jne 0x1000a474
push ebx
call fcn.100311e0
xor ecx, ecx
sub esi, dword [ebp - 4]
sbb ecx, ecx
add eax, esi
adc edx, ecx
push edx
push eax
push ebx
call fcn.10009a10
add esp, 0x10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 8
jne 0x1000a5fd
mov ebx, esi
xor eax, eax
shr ebx, 1
mov dword [ebp - 4], eax
cmp ebx, 0x8000
jbe 0x1000a530
mov ebx, 0x8000
jmp 0x1000a540
add ebx, 0xff
and ebx, 0xffffff00
lea esp, [esp]
mov edi, esi
sub edi, eax
cmp ebx, edi
ja 0x1000a54a
mov edi, ebx
mov ecx, dword [ebp + 0xc]
add ecx, eax
mov dword [ebp - 8], 0
mov eax, dword [ebp + 8]
cmp eax, 0xffffffff
jne 0x1000a560
or eax, eax
push 0
lea edx, [ebp - 8]
push edx
push edi
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1000a589
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 8
jne 0x1000a5ac
cmp ebx, eax
jbe 0x1000a5ac
mov eax, dword [ebp - 4]
shr ebx, 1
jmp 0x1000a59f
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 8]
add eax, ecx
mov edx, dword [ebp + 0x14]
mov dword [ebp - 4], eax
test edx, edx
jne 0x1000a5ec
test ecx, ecx
je 0x1000a5e0
cmp eax, esi
jb 0x1000a540
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push eax
call fcn.1000ab30
add esp, 4
cmp eax, 0xffffff68
jne 0x1000a474
mov esi, dword [ebp + 8]
push esi
call fcn.100311e0
add eax, edi
adc edx, 0
push edx
push eax
push esi
call fcn.10009a10
add esp, 0x10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0xffffff90
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, esi
jbe 0x1000a5f2
mov eax, esi
pop edi
pop esi
mov dword [edx], eax
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push eax
call fcn.1000ab30
add esp, 4
cmp eax, 0xffffff68
jne 0x1000a474
push ebx
call fcn.100311e0
add eax, esi
adc edx, 0
push edx
push eax
push ebx
call fcn.10009a10
add esp, 0x10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret