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

Disassembly:
push 0x90
mov eax, 0x100d293f
call fcn.1000240f
mov eax, dword [ebp + 8]
and dword [ebp - 0x28], 0
push eax
mov dword [ebp - 0x2c], eax
call fcn.1004f109
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 0x1004fdad
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 0x1004fdd0
ja 0x1004fdc1
cmp ecx, esi
jbe 0x1004fdd0
push 0x80070057
push 0x2e6e7432
call fcn.10042515
mov eax, edi
or eax, ebx
je 0x10050212
cmp dword [ebp + 0xc], 1
jne 0x1004fdf3
test ebx, ebx
jne 0x1004fded
cmp edi, 0xffffffff
ja 0x1004fded
mov esi, edi
jmp 0x1004fe31
call dword [sym.imp.MSVCR100.dll__invalid_parameter_noinfo_noreturn]
test ebx, ebx
jne 0x1004fe2c
cmp edi, 0xc0000
ja 0x1004fe2c
test ebx, ebx
jne 0x1004fe25
cmp edi, 0x30000
ja 0x1004fe25
test ebx, ebx
jne 0x1004fe1e
cmp edi, 0x6000
ja 0x1004fe1e
mov esi, 0x180
jmp 0x1004fe31
mov esi, 0xc00
jmp 0x1004fe31
mov esi, 0x6000
jmp 0x1004fe31
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.10044d4f
mov eax, dword [ebp + 0xc]
and dword [ebp - 4], 0
sub eax, 0
je 0x10050206
dec eax
je 0x1004ff60
dec eax
je 0x1004fe7a
dec eax
je 0x1004ff8d
push 0x80070057
push 0x2e6e7433
call fcn.10042515
jmp 0x1004ff8d
lea eax, [ebp - 0x50]
push eax
lea ecx, [ebp - 0x14]
call fcn.10044df9
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x28]
mov byte [ecx], al
lea ecx, [ebp - 0x50]
call fcn.10044b6c
lea eax, [ebp - 0x94]
push eax
lea ecx, [ebp - 0x14]
call fcn.10044df9
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x2c]
mov byte [ecx + 1], al
lea ecx, [ebp - 0x94]
call fcn.10044b6c
lea eax, [ebp - 0x84]
push eax
lea ecx, [ebp - 0x14]
call fcn.10044df9
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x30]
mov byte [ecx + 2], al
lea ecx, [ebp - 0x84]
call fcn.10044b6c
mov esi, dword [ebp - 0x18]
push 3
pop ecx
mov dword [ebp - 0x34], ecx
cmp esi, ecx
jbe 0x1004ff4e
lea eax, [ebp - 0x5c]
push eax
lea ecx, [ebp - 0x14]
call fcn.10044df9
mov edi, eax
lea eax, [ebp - 0x74]
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.10044df9
mov edx, dword [edi + 4]
mov edi, dword [ebp - 0x34]
cmp edi, esi
ja 0x1004fded
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.10044b6c
lea ecx, [ebp - 0x5c]
mov byte [ebp - 4], 0
call fcn.10044b6c
add edi, edi
mov dword [ebp - 0x34], edi
cmp esi, edi
ja 0x1004fee9
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 0x1004ff8a
lea eax, [ebp - 0x64]
push eax
lea ecx, [ebp - 0x14]
call fcn.10044df9
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.10044b6c
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 0x1004ffa8
push 0
push esi
push 0x11
lea ecx, [ebp - 0x30]
call fcn.10044d4f
push 0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp - 0x2c]
call fcn.1004f165
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x44], ebx
push esi
push ebx
push edi
call fcn.1005a998
test al, al
je 0x1004ffcf
lea edi, [ebp - 0x18]
jmp 0x1004ffe8
test ebx, ebx
ja 0x1004fded
jb 0x1004ffe2
cmp edi, 0xffffffff
ja 0x1004fded
mov dword [ebp - 0x54], edi
lea edi, [ebp - 0x54]
cmp dword [ebp + 0xc], 3
mov edi, dword [edi]
jne 0x1004fffb
push 0
lea eax, [ebp - 0x14]
push eax
call fcn.1005217f
cmp byte [ebp + 0x20], 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x50], xmm0
je 0x1005001c
push 1
push 0
push 0
push dword [ebp - 0x2c]
call fcn.1004f165
mov dword [ebp - 0x34], edx
jmp 0x10050025
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.10044df9
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 0x10050058
mov byte [ebp - 0x21], 0
cmp edi, dword [ebp - 0x1c]
je 0x1005005c
mov byte [ebp - 0x21], 1
mov eax, dword [ebp - 0x28]
test al, 1
je 0x10050071
and eax, 0xfffffffe
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x28], eax
call fcn.10044b6c
cmp byte [ebp - 0x21], 0
je 0x10050096
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1005008b
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x2e6e7434
call fcn.10042515
cmp byte [ebp + 0x20], 0
je 0x10050189
push 0
push dword [ebp - 0x34]
push dword [ebp - 0x40]
push dword [ebp - 0x2c]
call fcn.1004f165
lea eax, [ebp - 0x7c]
push eax
lea ecx, [ebp - 0x30]
call fcn.10044df9
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 0x100500e5
mov byte [ebp - 0x21], 0
cmp edi, dword [ebp - 0x20]
je 0x100500e9
mov byte [ebp - 0x21], 1
test bl, 2
je 0x100500fc
and ebx, 0xfffffffd
lea ecx, [ebp - 0x7c]
mov dword [ebp - 0x28], ebx
call fcn.10044b6c
cmp byte [ebp - 0x21], 0
je 0x10050121
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x10050116
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x2e6e7435
call fcn.10042515
lea eax, [ebp - 0x9c]
push eax
lea ecx, [ebp - 0x30]
call fcn.10044df9
mov ebx, eax
lea eax, [ebp - 0x8c]
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 3
call fcn.10044df9
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.10044b6c
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 2
call fcn.10044b6c
test bl, bl
jne 0x10050186
push 0x80004005
push 0x2e6e7436
call fcn.10042515
mov ebx, dword [ebp - 0x3c]
push esi
push ebx
push dword [ebp - 0x38]
call fcn.1005a9b3
test al, al
jne 0x100501b2
push esi
lea eax, [ebp - 0x48]
push eax
call fcn.1005a969
mov ebx, dword [ebp - 0x44]
mov edi, dword [ebp - 0x48]
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], edi
jmp 0x1004ffbe
cmp byte [ebp + 0x20], 0
je 0x100501c0
lea ecx, [ebp - 0x30]
call fcn.10044ebc
lea ecx, [ebp - 0x14]
call fcn.10044ebc
cmp byte [ebp + 0x24], 0
je 0x100501fa
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x100501fa
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x100501ef
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x2e6e7437
call fcn.10042515
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 0
call fcn.10044efc
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.10044efc
call fcn.10002550
ret 0x2c