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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0xc]
lea edx, [ecx + eax - 1]
mov eax, dword [ebp + 0x14]
sub eax, 1
not eax
and edx, eax
mov dword [ebp - 0xc], edx
push 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 4]
mov eax, dword [ebp + 8]
xor ecx, ecx
mov cx, word [eax + 0x40]
lea edx, [edx + ecx + 0x14]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
cmp eax, dword [edx + 0x18]
jae 0x40623e
mov dword [ebp - 0x3c], 0
jmp 0x406131
mov ecx, dword [ebp - 0x3c]
add ecx, 1
mov dword [ebp - 0x3c], ecx
mov edx, dword [ebp + 8]
xor eax, eax
mov ax, word [edx + 0x32]
cmp dword [ebp - 0x3c], eax
jge 0x4061ce
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
push 1
push 0x28
lea eax, [ebp - 0x38]
push eax
call sub.MSVCRT.dll_fread
add esp, 0x10
push 8
push 0x4012c0
lea ecx, [ebp - 0x38]
push ecx
call sub.MSVCRT.dll__strnicmp
add esp, 0xc
test eax, eax
jne 0x4061c9
mov edx, dword [ebp - 0xc]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x30], eax
push 1
push 0xffffffffffffffd8
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
push 1
push 0x28
lea edx, [ebp - 0x38]
push edx
call sub.MSVCRT.dll_fwrite
add esp, 0x10
mov eax, dword [ebp + 0x10]
sub eax, dword [ebp - 0x30]
add eax, dword [ebp + 0xc]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp - 0x10]
lea eax, [edx + ecx - 1]
mov ecx, dword [ebp + 0x18]
sub ecx, 1
not ecx
and eax, ecx
mov dword [ebp - 0x10], eax
jmp 0x4061ce
jmp 0x406128
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
mov ecx, 0x10
add ecx, 0x60
lea edx, [eax + ecx + 0x18]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
push 1
push 4
lea ecx, [ebp + 0xc]
push ecx
call sub.MSVCRT.dll_fwrite
add esp, 0x10
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
add eax, 0x4c
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
push 1
push 4
lea edx, [ebp - 0x10]
push edx
call sub.MSVCRT.dll_fwrite
add esp, 0x10
xor eax, eax
jmp 0x4063a2
mov dword [ebp - 8], 0
mov dword [ebp - 4], 0
jmp 0x406257
mov eax, dword [ebp - 4]
add eax, 1
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 8]
xor edx, edx
mov dx, word [ecx + 0x32]
cmp dword [ebp - 4], edx
jge 0x4062f8
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
push 1
push 0x28
lea edx, [ebp - 0x38]
push edx
call sub.MSVCRT.dll_fread
add esp, 0x10
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x2c]
cmp ecx, dword [eax + 0x14]
ja 0x406295
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x24]
cmp eax, dword [edx + 0x1c]
jbe 0x40629f
mov eax, 0x20000001
jmp 0x4063a2
cmp dword [ebp - 8], 0
jne 0x4062f3
push 8
push 0x4012c8
lea ecx, [ebp - 0x38]
push ecx
call sub.MSVCRT.dll__strnicmp
add esp, 0xc
test eax, eax
jne 0x4062f3
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call sub.MSVCRT.dll_ftell
add esp, 4
sub eax, 0x28
mov dword [ebp - 8], eax
mov ecx, dword [ebp + 0x10]
sub ecx, dword [ebp - 0x30]
add ecx, dword [ebp + 0xc]
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp - 0x10]
lea ecx, [eax + edx - 1]
mov edx, dword [ebp + 0x18]
sub edx, 1
not edx
and ecx, edx
mov dword [ebp - 0x10], ecx
jmp 0x40624e
push 0
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword [eax + 0x18], ecx
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov dword [edx + 0x10], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
push 1
push 0x28
mov eax, dword [ebp + 8]
add eax, 8
push eax
call sub.MSVCRT.dll_fwrite
add esp, 0x10
push 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 4]
mov eax, 0x10
add eax, 0x60
lea ecx, [edx + eax + 0x18]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
push 1
push 4
lea eax, [ebp + 0xc]
push eax
call sub.MSVCRT.dll_fwrite
add esp, 0x10
push 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 4]
add edx, 0x4c
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
push 1
push 4
lea ecx, [ebp - 0x10]
push ecx
call sub.MSVCRT.dll_fwrite
add esp, 0x10
xor eax, eax
mov esp, ebp
pop ebp
ret