Function at 0x10041ece
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push 0xa0
mov eax, 0x100a4066
call fcn.10002f71
mov eax, dword [ebp + 8]
and dword [ebp - 0x2c], 0
push eax
mov dword [ebp - 0x30], eax
call fcn.1003276e
mov edi, dword [ebp + 0x18]
mov esi, eax
mov ebx, dword [ebp + 0x1c]
mov ecx, edi
and ecx, ebx
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x34], ebx
cmp ecx, 0xffffffff
jne 0x10041f14
mov edi, esi
mov ebx, edx
sub edi, dword [ebp + 0x10]
mov dword [ebp - 0x3c], edi
sbb ebx, dword [ebp + 0x14]
mov dword [ebp - 0x34], ebx
mov ecx, edi
mov eax, ebx
add ecx, dword [ebp + 0x10]
adc eax, dword [ebp + 0x14]
cmp eax, edx
jb 0x10041f37
ja 0x10041f28
cmp ecx, esi
jbe 0x10041f37
push 0x80070057
push 0x2e6e7432
call fcn.1003cf9b
mov eax, edi
or eax, ebx
je 0x100423a6
cmp dword [ebp + 0xc], 1
jne 0x10041f57
lea eax, [ebp - 0x40]
push eax
push ebx
push edi
call fcn.10029708
mov esi, dword [ebp - 0x40]
jmp 0x10041fa2
test ebx, ebx
jne 0x10041f90
cmp edi, 0xc0000
ja 0x10041f90
test ebx, ebx
jne 0x10041f89
cmp edi, 0x30000
ja 0x10041f89
test ebx, ebx
jne 0x10041f82
cmp edi, 0x6000
ja 0x10041f82
mov eax, 0x180
jmp 0x10041f95
mov eax, 0xc00
jmp 0x10041f95
mov eax, 0x6000
jmp 0x10041f95
mov eax, 0x30000
lea ecx, [ebp - 0x54]
push ecx
push eax
call fcn.10026b59
mov esi, dword [ebp - 0x54]
and dword [ebp - 0x14], 0
lea ecx, [ebp - 0x14]
push 0
push esi
push 0x11
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x28], esi
call fcn.1003aeea
mov eax, dword [ebp + 0xc]
and dword [ebp - 4], 0
sub eax, 0
je 0x10042397
sub eax, 1
je 0x100420de
sub eax, 1
je 0x10041ff4
sub eax, 1
je 0x10042114
push 0x80070057
push 0x2e6e7433
call fcn.1003cf9b
jmp 0x10042114
lea eax, [ebp - 0x64]
push eax
lea ecx, [ebp - 0x14]
call fcn.1002bbe6
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x28]
mov byte [ecx], al
lea ecx, [ebp - 0x64]
call fcn.10041988
lea eax, [ebp - 0x6c]
push eax
lea ecx, [ebp - 0x14]
call fcn.1002bbe6
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x2c]
mov byte [ecx + 1], al
lea ecx, [ebp - 0x6c]
call fcn.10041988
lea eax, [ebp - 0x74]
push eax
lea ecx, [ebp - 0x14]
call fcn.1002bbe6
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x30]
mov byte [ecx + 2], al
lea ecx, [ebp - 0x74]
call fcn.10041988
push 3
pop eax
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x24], eax
jbe 0x100420cc
mov ebx, eax
lea eax, [ebp - 0x84]
push eax
lea ecx, [ebp - 0x14]
call fcn.1002bbe6
mov esi, eax
lea eax, [ebp - 0x7c]
mov byte [ebp - 4], 2
push eax
lea ecx, [ebp - 0x14]
call fcn.1002bbe6
mov esi, dword [esi + 4]
mov edi, eax
and dword [ebp - 0x28], 0
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x44]
mov dword [ebp - 0x44], ebx
push eax
lea eax, [ebp - 0x24]
push eax
call fcn.1001cfba
mov eax, dword [edi + 4]
push ebx
push esi
push dword [ebp - 0x28]
add eax, ebx
push eax
call fcn.1001eb09
add esp, 0x10
lea ecx, [ebp - 0x7c]
call fcn.10041988
lea ecx, [ebp - 0x84]
mov byte [ebp - 4], 0
call fcn.10041988
add ebx, ebx
cmp dword [ebp - 0x24], ebx
ja 0x10042057
mov edi, dword [ebp - 0x3c]
mov ebx, dword [ebp - 0x34]
mov byte [ebp + 0x30], 0
mov al, byte [ebp + 0x30]
mov byte [ebp + 0x2c], al
mov al, byte [ebp + 0x2c]
mov byte [ebp + 0x28], al
jmp 0x1004210e
lea eax, [ebp - 0x8c]
push eax
lea ecx, [ebp - 0x14]
call fcn.1002bbe6
push esi
mov ecx, dword [eax + 4]
movzx eax, byte [ebp + 0x28]
push eax
push ecx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea ecx, [ebp - 0x8c]
call fcn.10041988
mov byte [ebp + 0x28], 0
mov esi, dword [ebp - 0x24]
mov dword [ebp - 0x28], esi
and dword [ebp - 0x38], 0
cmp byte [ebp + 0x20], 0
mov byte [ebp - 4], 3
je 0x1004212f
push 0
push esi
push 0x11
lea ecx, [ebp - 0x38]
call fcn.1003aeea
push 0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp - 0x30]
call fcn.1003abae
mov dword [ebp - 0x50], edi
mov dword [ebp - 0x4c], ebx
push esi
push ebx
push edi
call fcn.10029577
test al, al
je 0x10042156
mov dword [ebp - 0x24], esi
jmp 0x10042167
lea eax, [ebp - 0x5c]
push eax
push ebx
push edi
call fcn.10029708
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x24], eax
cmp dword [ebp + 0xc], 3
jne 0x10042178
push 0
lea eax, [ebp - 0x14]
push eax
call fcn.100313f0
cmp byte [ebp + 0x20], 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x48], xmm0
je 0x10042199
push 1
push 0
push 0
push dword [ebp - 0x30]
call fcn.1003abae
mov dword [ebp - 0x3c], edx
jmp 0x100421a2
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x48]
mov dword [ebp - 0x40], eax
lea ecx, [ebp - 0x14]
lea eax, [ebp - 0x94]
push eax
call fcn.1002bbe6
or dword [ebp - 0x2c], 1
lea ecx, [ebp - 0x18]
push 0
push ecx
push dword [ebp - 0x24]
push dword [eax + 4]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x100421dd
mov eax, dword [ebp - 0x24]
mov byte [ebp - 0x1d], 0
cmp eax, dword [ebp - 0x18]
je 0x100421e1
mov byte [ebp - 0x1d], 1
mov eax, dword [ebp - 0x2c]
test al, 1
je 0x100421f9
and eax, 0xfffffffe
lea ecx, [ebp - 0x94]
mov dword [ebp - 0x2c], eax
call fcn.10041988
cmp byte [ebp - 0x1d], 0
je 0x1004221e
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
cmovle ecx, eax
push ecx
push 0x2e6e7434
call fcn.1003cf9b
cmp byte [ebp + 0x20], 0
je 0x1004231f
push 0
push dword [ebp - 0x3c]
push dword [ebp - 0x40]
push dword [ebp - 0x30]
call fcn.1003abae
lea eax, [ebp - 0x9c]
push eax
lea ecx, [ebp - 0x38]
call fcn.1002bbe6
mov esi, dword [ebp - 0x24]
lea ecx, [ebp - 0x1c]
mov ebx, dword [ebp - 0x2c]
push 0
push ecx
push esi
push dword [eax + 4]
or ebx, 2
push dword [ebp - 0x30]
mov dword [ebp - 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10042273
mov byte [ebp - 0x1d], 0
cmp esi, dword [ebp - 0x1c]
je 0x10042277
mov byte [ebp - 0x1d], 1
test bl, 2
je 0x1004228d
and ebx, 0xfffffffd
lea ecx, [ebp - 0x9c]
mov dword [ebp - 0x2c], ebx
call fcn.10041988
cmp byte [ebp - 0x1d], 0
je 0x100422b2
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
cmovle ecx, eax
push ecx
push 0x2e6e7435
call fcn.1003cf9b
lea eax, [ebp - 0xac]
push eax
lea ecx, [ebp - 0x38]
call fcn.1002bbe6
mov esi, eax
lea eax, [ebp - 0xa4]
mov byte [ebp - 4], 4
push eax
lea ecx, [ebp - 0x14]
call fcn.1002bbe6
push dword [ebp - 0x24]
push dword [esi + 4]
push dword [eax + 4]
call sub.VCRUNTIME140.dll_memcmp
add esp, 0xc
lea ecx, [ebp - 0xa4]
test eax, eax
sete bl
call fcn.10041988
lea ecx, [ebp - 0xac]
mov byte [ebp - 4], 3
call fcn.10041988
test bl, bl
jne 0x10042319
push 0x80004005
push 0x2e6e7436
call fcn.1003cf9b
mov esi, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x34]
push esi
push ebx
push edi
call fcn.10029555
test al, al
jne 0x10042343
push esi
lea eax, [ebp - 0x50]
push eax
call fcn.100295c1
mov ebx, dword [ebp - 0x4c]
mov edi, dword [ebp - 0x50]
mov dword [ebp - 0x34], ebx
jmp 0x10042145
cmp byte [ebp + 0x20], 0
je 0x10042351
lea ecx, [ebp - 0x38]
call fcn.1003ab54
lea ecx, [ebp - 0x14]
call fcn.1003ab54
cmp byte [ebp + 0x24], 0
je 0x1004238b
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x1004238b
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
cmovle ecx, eax
push ecx
push 0x2e6e7437
call fcn.1003cf9b
lea ecx, [ebp - 0x38]
mov byte [ebp - 4], 5
call fcn.10039bb3
lea ecx, [ebp - 0x14]
mov dword [ebp - 4], 6
call fcn.10039bb3
call fcn.10003491
ret 0x2c