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

Disassembly:
push 0x90
mov eax, 0x100cfdf3
call fcn.10002415
mov eax, dword [ebp + 8]
and dword [ebp - 0x28], 0
push eax
mov dword [ebp - 0x2c], eax
call fcn.1004df61
mov edi, dword [ebp + 0x18]
mov ebx, dword [ebp + 0x1c]
mov ecx, edi
and ecx, ebx
mov esi, eax
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x3c], ebx
cmp ecx, 0xffffffff
jne 0x1004ec0d
mov edi, esi
sub edi, dword [ebp + 0x10]
mov ebx, edx
sbb ebx, dword [ebp + 0x14]
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x3c], ebx
mov ecx, edi
add ecx, dword [ebp + 0x10]
mov eax, ebx
adc eax, dword [ebp + 0x14]
cmp eax, edx
jb 0x1004ec30
ja 0x1004ec21
cmp ecx, esi
jbe 0x1004ec30
push 0x80070057
push 0x2e6e7432
call fcn.10041a9c
mov eax, edi
or eax, ebx
je 0x1004f072
cmp dword [ebp + 0xc], 1
jne 0x1004ec53
test ebx, ebx
jne 0x1004ec4d
cmp edi, 0xffffffff
ja 0x1004ec4d
mov esi, edi
jmp 0x1004ec91
call dword [sym.imp.MSVCR100.dll__invalid_parameter_noinfo_noreturn]
test ebx, ebx
jne 0x1004ec8c
cmp edi, 0xc0000
ja 0x1004ec8c
test ebx, ebx
jne 0x1004ec85
cmp edi, 0x30000
ja 0x1004ec85
test ebx, ebx
jne 0x1004ec7e
cmp edi, 0x6000
ja 0x1004ec7e
mov esi, 0x180
jmp 0x1004ec91
mov esi, 0xc00
jmp 0x1004ec91
mov esi, 0x6000
jmp 0x1004ec91
mov esi, 0x30000
and dword [ebp - 0x14], 0
push 0
push esi
push 0x11
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x18], esi
call fcn.10043d15
mov eax, dword [ebp + 0xc]
and dword [ebp - 4], 0
sub eax, 0
je 0x1004f066
dec eax
je 0x1004edc0
dec eax
je 0x1004ecda
dec eax
je 0x1004eded
push 0x80070057
push 0x2e6e7433
call fcn.10041a9c
jmp 0x1004eded
lea eax, [ebp - 0x50]
push eax
lea ecx, [ebp - 0x14]
call fcn.10043dbf
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x28]
mov byte [ecx], al
lea ecx, [ebp - 0x50]
call fcn.10043b32
lea eax, [ebp - 0x94]
push eax
lea ecx, [ebp - 0x14]
call fcn.10043dbf
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x2c]
mov byte [ecx + 1], al
lea ecx, [ebp - 0x94]
call fcn.10043b32
lea eax, [ebp - 0x84]
push eax
lea ecx, [ebp - 0x14]
call fcn.10043dbf
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x30]
mov byte [ecx + 2], al
lea ecx, [ebp - 0x84]
call fcn.10043b32
mov esi, dword [ebp - 0x18]
push 3
pop ecx
mov dword [ebp - 0x34], ecx
cmp esi, ecx
jbe 0x1004edae
lea eax, [ebp - 0x5c]
push eax
lea ecx, [ebp - 0x14]
call fcn.10043dbf
mov edi, eax
lea eax, [ebp - 0x74]
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.10043dbf
mov edx, dword [edi + 4]
mov edi, dword [ebp - 0x34]
cmp edi, esi
ja 0x1004ec4d
mov eax, dword [eax + 4]
push edi
mov ecx, esi
sub ecx, edi
push edx
push ecx
add eax, edi
push eax
mov dword [ebp - 0x40], ecx
call dword [sym.imp.MSVCR100.dll_memcpy_s]
add esp, 0x10
lea ecx, [ebp - 0x74]
call fcn.10043b32
lea ecx, [ebp - 0x5c]
mov byte [ebp - 4], 0
call fcn.10043b32
add edi, edi
mov dword [ebp - 0x34], edi
cmp esi, edi
ja 0x1004ed49
mov edi, dword [ebp - 0x38]
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 0x1004edea
lea eax, [ebp - 0x64]
push eax
lea ecx, [ebp - 0x14]
call fcn.10043dbf
mov ecx, dword [eax + 4]
movzx eax, byte [ebp + 0x28]
push esi
push eax
push ecx
call sub.MSVCR100.dll_memset
add esp, 0xc
lea ecx, [ebp - 0x64]
call fcn.10043b32
mov byte [ebp + 0x28], 0
mov esi, dword [ebp - 0x18]
and dword [ebp - 0x30], 0
cmp byte [ebp + 0x20], 0
mov byte [ebp - 4], 2
je 0x1004ee08
push 0
push esi
push 0x11
lea ecx, [ebp - 0x30]
call fcn.10043d15
push 0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp - 0x2c]
call fcn.1004dfbd
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x44], ebx
push esi
push ebx
push edi
call fcn.10059778
test al, al
je 0x1004ee2f
lea edi, [ebp - 0x18]
jmp 0x1004ee48
test ebx, ebx
ja 0x1004ec4d
jb 0x1004ee42
cmp edi, 0xffffffff
ja 0x1004ec4d
mov dword [ebp - 0x54], edi
lea edi, [ebp - 0x54]
cmp dword [ebp + 0xc], 3
mov edi, dword [edi]
jne 0x1004ee5b
push 0
lea eax, [ebp - 0x14]
push eax
call fcn.10050f40
cmp byte [ebp + 0x20], 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x50], xmm0
je 0x1004ee7c
push 1
push 0
push 0
push dword [ebp - 0x2c]
call fcn.1004dfbd
mov dword [ebp - 0x34], edx
jmp 0x1004ee85
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x6c]
push eax
lea ecx, [ebp - 0x14]
call fcn.10043dbf
or dword [ebp - 0x28], 1
push 0
lea ecx, [ebp - 0x1c]
push ecx
push edi
push dword [eax + 4]
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1004eeb8
mov byte [ebp - 0x21], 0
cmp edi, dword [ebp - 0x1c]
je 0x1004eebc
mov byte [ebp - 0x21], 1
mov eax, dword [ebp - 0x28]
test al, 1
je 0x1004eed1
and eax, 0xfffffffe
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x28], eax
call fcn.10043b32
cmp byte [ebp - 0x21], 0
je 0x1004eef6
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1004eeeb
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x2e6e7434
call fcn.10041a9c
cmp byte [ebp + 0x20], 0
je 0x1004efe9
push 0
push dword [ebp - 0x34]
push dword [ebp - 0x40]
push dword [ebp - 0x2c]
call fcn.1004dfbd
lea eax, [ebp - 0x7c]
push eax
lea ecx, [ebp - 0x30]
call fcn.10043dbf
mov ebx, dword [ebp - 0x28]
push 0
lea ecx, [ebp - 0x20]
push ecx
push edi
push dword [eax + 4]
or ebx, 2
push dword [ebp - 0x2c]
mov dword [ebp - 0x28], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1004ef45
mov byte [ebp - 0x21], 0
cmp edi, dword [ebp - 0x20]
je 0x1004ef49
mov byte [ebp - 0x21], 1
test bl, 2
je 0x1004ef5c
and ebx, 0xfffffffd
lea ecx, [ebp - 0x7c]
mov dword [ebp - 0x28], ebx
call fcn.10043b32
cmp byte [ebp - 0x21], 0
je 0x1004ef81
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1004ef76
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x2e6e7435
call fcn.10041a9c
lea eax, [ebp - 0x9c]
push eax
lea ecx, [ebp - 0x30]
call fcn.10043dbf
mov ebx, eax
lea eax, [ebp - 0x8c]
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 3
call fcn.10043dbf
push edi
push dword [ebx + 4]
push dword [eax + 4]
call sub.MSVCR100.dll_memcmp
add esp, 0xc
test eax, eax
lea ecx, [ebp - 0x8c]
sete bl
call fcn.10043b32
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 2
call fcn.10043b32
test bl, bl
jne 0x1004efe6
push 0x80004005
push 0x2e6e7436
call fcn.10041a9c
mov ebx, dword [ebp - 0x3c]
push esi
push ebx
push dword [ebp - 0x38]
call fcn.10059793
test al, al
jne 0x1004f012
push esi
lea eax, [ebp - 0x48]
push eax
call fcn.10059749
mov ebx, dword [ebp - 0x44]
mov edi, dword [ebp - 0x48]
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], edi
jmp 0x1004ee1e
cmp byte [ebp + 0x20], 0
je 0x1004f020
lea ecx, [ebp - 0x30]
call fcn.10043e82
lea ecx, [ebp - 0x14]
call fcn.10043e82
cmp byte [ebp + 0x24], 0
je 0x1004f05a
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x1004f05a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1004f04f
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x2e6e7437
call fcn.10041a9c
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 0
call fcn.10043ec2
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.10043ec2
call fcn.10002556
ret 0x2c