Function at 0x40613a
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 dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
cmp eax, dword [edx + 0x18]
jae 0x4062b2
mov dword [ebp - 0x3c], 0
jmp 0x40619d
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 0x40623e
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
push 1
push 0x28
lea eax, [ebp - 0x38]
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
push 8
push 0x4013e0
lea ecx, [ebp - 0x38]
push ecx
call dword [sym.imp.MSVCRT.dll__strnicmp]
add esp, 0xc
test eax, eax
jne 0x406239
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 dword [sym.imp.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 dword [sym.imp.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 0x40623e
jmp 0x406194
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 dword [sym.imp.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 dword [sym.imp.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 dword [sym.imp.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 dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
xor eax, eax
jmp 0x40641f
mov dword [ebp - 8], 0
mov dword [ebp - 4], 0
jmp 0x4062cb
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 0x40636f
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
push 1
push 0x28
lea edx, [ebp - 0x38]
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x2c]
cmp ecx, dword [eax + 0x14]
ja 0x40630a
mov edx, dword [ebp + 8]
mov eax, dword [ebp - 0x24]
cmp eax, dword [edx + 0x1c]
jbe 0x406314
mov eax, 0x20000001
jmp 0x40641f
cmp dword [ebp - 8], 0
jne 0x40636a
push 8
push 0x4013e8
lea ecx, [ebp - 0x38]
push ecx
call dword [sym.imp.MSVCRT.dll__strnicmp]
add esp, 0xc
test eax, eax
jne 0x40636a
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call dword [sym.imp.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 0x4062c2
push 0
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call dword [sym.imp.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 dword [sym.imp.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 dword [sym.imp.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 dword [sym.imp.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 dword [sym.imp.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 dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
xor eax, eax
mov esp, ebp
pop ebp
ret