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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
xor ecx, ecx
mov edx, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov dword [ebp - 0x4c], eax
push edi
mov eax, dword [ebx]
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x48], ecx
mov cl, 1
mov dword [ebp - 0x50], edx
mov dword [ebp - 8], ebx
test al, 5
je 0x1006d68c
xor cl, cl
or eax, 0x10
mov dword [ebx], eax
test byte [ebx], 8
mov eax, 0
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
movzx ebx, cl
cmovne ebx, eax
cmp byte [edi], al
je 0x1006d6be
cmp byte [edi + 1], al
je 0x1006d6ba
push 1
push eax
push eax
push dword [edi + 4]
call esi
sub eax, dword [edi + 0xc]
mov edx, dword [ebp - 0x50]
jmp 0x1006d6c1
xor eax, eax
jmp 0x1006d6c1
mov eax, dword [edi + 0x20]
mov dword [edx + 0x18], eax
test bl, bl
je 0x1006dace
lea esp, [esp]
cmp byte [edi], 0
je 0x1006d6ef
cmp byte [edi + 1], 0
je 0x1006d6eb
push 1
push 0
push 0
push dword [edi + 4]
call esi
sub eax, dword [edi + 0xc]
jmp 0x1006d6f2
xor eax, eax
jmp 0x1006d6f2
mov eax, dword [edi + 0x20]
inc eax
cmp eax, dword [edi + 0x10]
ja 0x1006dace
mov eax, dword [ebp - 0x4c]
cmp dword [eax], 0
jne 0x1006d791
cmp byte [edi], 0
je 0x1006d72c
cmp byte [edi + 1], 0
je 0x1006d728
push 1
push 0
push 0
push dword [edi + 4]
call esi
mov ebx, eax
mov eax, dword [ebp - 0x4c]
sub ebx, dword [edi + 0xc]
jmp 0x1006d72f
xor ebx, ebx
jmp 0x1006d72f
mov ebx, dword [edi + 0x20]
cmp byte [edi], 0
mov esi, 4
mov dword [ebp - 0x48], ebx
je 0x1006d75b
push 0
lea ecx, [ebp - 0x10]
push ecx
push esi
push eax
push dword [edi + 4]
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
call eax
test eax, eax
jne 0x1006d756
mov byte [edi + 8], 1
mov esi, dword [ebp - 0x10]
jmp 0x1006d782
mov ecx, dword [edi + 0x20]
mov edx, dword [edi + 0x1c]
lea eax, [ecx + 4]
cmp eax, edx
jbe 0x1006d76c
mov esi, edx
sub esi, ecx
mov eax, dword [edi + 0x18]
add eax, ecx
push esi
push eax
mov eax, dword [ebp - 0x4c]
push eax
call sub.MSVCR120.dll_memcpy
add esp, 0xc
add dword [edi + 0x20], esi
shr esi, 2
cmp esi, 1
jne 0x1006da38
mov eax, dword [ebp - 0x4c]
mov eax, dword [eax]
cmp eax, 0x2014b50
jne 0x1006dabb
cmp byte [edi], 0
mov esi, 0x2a
je 0x1006d7c9
push 0
lea eax, [ebp - 0x18]
push eax
push esi
lea eax, [ebp - 0x44]
push eax
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1006d7c4
mov byte [edi + 8], 1
mov esi, dword [ebp - 0x18]
jmp 0x1006d7f3
mov ebx, dword [edi + 0x20]
mov ecx, dword [edi + 0x1c]
lea eax, [ebx + 0x2a]
cmp eax, ecx
jbe 0x1006d7da
mov esi, ecx
sub esi, ebx
mov eax, dword [edi + 0x18]
add eax, ebx
push esi
push eax
lea eax, [ebp - 0x44]
push eax
call sub.MSVCR120.dll_memcpy
lea eax, [esi + ebx]
add esp, 0xc
mov dword [edi + 0x20], eax
mov eax, 0x86186187
mul esi
sub esi, edx
shr esi, 1
add esi, edx
shr esi, 5
cmp esi, 1
jne 0x1006da8b
mov cx, word [ebp - 0x2c]
test cx, cx
je 0x1006d86c
cmp byte [edi], 0
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
movzx esi, cx
je 0x1006d841
cmp byte [edi + 1], 0
je 0x1006d83d
push 1
push 0
push 0
push dword [edi + 4]
call ebx
sub eax, dword [edi + 0xc]
mov cx, word [ebp - 0x2c]
jmp 0x1006d844
xor eax, eax
jmp 0x1006d844
mov eax, dword [edi + 0x20]
add eax, esi
cmp eax, dword [edi + 0x10]
ja 0x1006da68
cmp byte [edi], 0
movzx eax, cx
je 0x1006d869
cmp byte [edi + 1], 0
je 0x1006d86c
push 1
push 0
push eax
push dword [edi + 4]
call ebx
jmp 0x1006d86c
add dword [edi + 0x20], eax
mov cx, word [ebp - 0x2a]
test cx, cx
je 0x1006d8cc
cmp byte [edi], 0
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
movzx esi, cx
je 0x1006d8a1
cmp byte [edi + 1], 0
je 0x1006d89d
push 1
push 0
push 0
push dword [edi + 4]
call ebx
sub eax, dword [edi + 0xc]
mov cx, word [ebp - 0x2a]
jmp 0x1006d8a4
xor eax, eax
jmp 0x1006d8a4
mov eax, dword [edi + 0x20]
add eax, esi
cmp eax, dword [edi + 0x10]
ja 0x1006da68
cmp byte [edi], 0
movzx eax, cx
je 0x1006d8c9
cmp byte [edi + 1], 0
je 0x1006d8cc
push 1
push 0
push eax
push dword [edi + 4]
call ebx
jmp 0x1006d8cc
add dword [edi + 0x20], eax
mov ecx, dword [ebp - 0x50]
lea eax, [ebp - 0x44]
push eax
call fcn.1006bc00
mov cx, word [ebp - 0x28]
mov esi, eax
test cx, cx
je 0x1006d9cc
cmp byte [edi], 0
movzx ebx, cx
je 0x1006d912
cmp byte [edi + 1], 0
je 0x1006d90e
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push dword [edi + 4]
call eax
sub eax, dword [edi + 0xc]
mov cx, word [ebp - 0x28]
jmp 0x1006d915
xor eax, eax
jmp 0x1006d915
mov eax, dword [edi + 0x20]
add eax, ebx
cmp eax, dword [edi + 0x10]
jbe 0x1006d93b
mov eax, dword [ebp - 8]
or dword [eax], 0x10
test esi, esi
jne 0x1006d943
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100944ae
mov esp, ebp
pop ebp
ret 0x10
test esi, esi
je 0x1006da13
mov eax, dword [esi + 0x34]
test eax, eax
je 0x1006d954
push eax
call dword [sym.imp.MSVCR120.dll_void___cdecl_operator_delete___void__]
add esp, 4
movzx eax, word [esi + 0x1c]
push eax
call fcn.1009427d
mov dword [esi + 0x34], eax
add esp, 4
cmp byte [edi], 0
movzx ebx, word [ebp - 0x28]
mov dword [ebp - 0xc], eax
mov ecx, ebx
mov dword [ebp - 0x54], ebx
je 0x1006d994
push 0
lea ecx, [ebp - 0x14]
push ecx
push ebx
push eax
push dword [edi + 4]
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
call eax
test eax, eax
jne 0x1006d98f
mov byte [edi + 8], 1
mov eax, dword [ebp - 0x14]
jmp 0x1006d9bf
mov edx, dword [edi + 0x20]
lea eax, [ebx + edx]
cmp eax, dword [edi + 0x1c]
jbe 0x1006d9a7
mov ecx, dword [edi + 0x1c]
sub ecx, edx
mov dword [ebp - 0x54], ecx
push ecx
mov ecx, dword [edi + 0x18]
add ecx, edx
push ecx
push dword [ebp - 0xc]
call sub.MSVCR120.dll_memcpy
mov eax, dword [ebp - 0x54]
add esp, 0xc
add dword [edi + 0x20], eax
xor edx, edx
div ebx
cmp eax, 1
jne 0x1006d926
test esi, esi
je 0x1006d9f4
movzx eax, word [ebp - 0x26]
mov word [esi + 0x1e], ax
movzx eax, word [ebp - 0x24]
mov word [esi + 0x20], ax
mov eax, dword [ebp - 0x22]
mov dword [esi + 0x22], eax
movzx eax, word [ebp - 0x44]
mov word [esi], ax
mov dword [esi + 0x38], 1
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp - 0x50]
mov eax, dword [ebp - 0x4c]
inc word [edx + 0x10]
inc word [edx + 0x12]
mov dword [eax], 0
jmp 0x1006d6d0
cmp byte [edi], 0
movzx eax, cx
je 0x1006da33
cmp byte [edi + 1], 0
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
je 0x1006d9fa
push 1
push 0
push eax
push dword [edi + 4]
call esi
jmp 0x1006d9fa
add dword [edi + 0x20], eax
jmp 0x1006d9f4
mov esi, dword [ebp - 8]
or dword [esi], 0x10
cmp byte [edi], 0
je 0x1006da63
cmp byte [edi + 1], 0
je 0x1006dad1
mov eax, dword [edi + 0xc]
push 0
push 0
add eax, ebx
push eax
push dword [edi + 4]
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
call eax
jmp 0x1006dad1
mov dword [edi + 0x20], ebx
jmp 0x1006dad1
mov esi, dword [ebp - 8]
or dword [esi], 0x10
cmp byte [edi], 0
je 0x1006dab3
cmp byte [edi + 1], 0
je 0x1006dad1
mov eax, dword [edi + 0xc]
add eax, dword [ebp - 0x48]
push 0
push 0
push eax
push dword [edi + 4]
call ebx
jmp 0x1006dad1
mov esi, dword [ebp - 8]
or dword [esi], 0x10
cmp byte [edi], 0
je 0x1006dab3
cmp byte [edi + 1], 0
je 0x1006dad1
mov eax, dword [edi + 0xc]
add eax, dword [ebp - 0x48]
push 0
push 0
push eax
push dword [edi + 4]
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
call eax
jmp 0x1006dad1
mov ecx, dword [ebp - 0x48]
mov dword [edi + 0x20], ecx
jmp 0x1006dad1
cmp eax, 0x6054b50
je 0x1006db8f
mov esi, dword [ebp - 8]
or dword [esi], 0x10
jmp 0x1006dad1
mov esi, dword [ebp - 8]
test byte [esi], 0x18
je 0x1006db86
mov ecx, dword [ebp - 0x50]
mov dword [ebp - 0xc], 0x2014b50
mov esi, dword [ecx]
cmp esi, dword [ecx + 4]
je 0x1006db86
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esi]
test eax, eax
je 0x1006db7a
cmp dword [eax + 0x38], 1
je 0x1006db7a
inc word [ecx + 0x10]
lea eax, [ebp - 8]
inc word [ecx + 0x12]
push 0
push eax
push 4
lea eax, [ebp - 0xc]
push eax
push dword [edi + 4]
call ebx
push 0
lea eax, [ebp - 8]
push eax
push 0x2a
push dword [esi]
push dword [edi + 4]
call ebx
mov ecx, dword [esi]
movzx eax, word [ecx + 0x18]
test ax, ax
je 0x1006db43
push 0
lea edx, [ebp - 8]
push edx
push eax
push dword [ecx + 0x2c]
push dword [edi + 4]
call ebx
mov ecx, dword [esi]
movzx eax, word [ecx + 0x1a]
test ax, ax
je 0x1006db5d
push 0
lea edx, [ebp - 8]
push edx
push eax
push dword [ecx + 0x30]
push dword [edi + 4]
call ebx
mov ecx, dword [esi]
movzx eax, word [ecx + 0x1c]
test ax, ax
je 0x1006db77
push 0
lea edx, [ebp - 8]
push edx
push eax
push dword [ecx + 0x34]
push dword [edi + 4]
call ebx
mov ecx, dword [ebp - 0x50]
add esi, 4
cmp esi, dword [ecx + 4]
jne 0x1006daf5
mov eax, dword [ebp - 0x4c]
mov dword [eax], 0
mov ecx, dword [ebp - 4]
mov al, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100944ae
mov esp, ebp
pop ebp
ret 0x10