Function at 0x100af480
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push ebx
push esi
push edi
mov edi, edx
mov ebx, ecx
mov dword [ebp - 8], ebx
cmp edi, 1
je 0x100af4a3
cmp edi, 2
je 0x100af4a3
cmp edi, 4
jne 0x100af596
push 4
lea eax, [ebp - 4]
push eax
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__read]
add esp, 0xc
cmp eax, 4
jne 0x100af596
mov cx, word [ebp - 2]
test cx, cx
jns 0x100af4f1
movzx eax, word [ebp - 4]
push 1
sub eax, 4
push eax
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__lseek]
add esp, 0xc
cmp word [ebp - 2], 0xffff
jne 0x100af596
call dword [sym.imp.HncFoundation.dll_HncGetKSTblPtr]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [0x100edc64]
test esi, esi
je 0x100af535
nop dword [eax + eax]
cmp dword [esi + 4], edi
jne 0x100af52f
mov ax, word [esi + 0x2c]
cmp ax, word [ebp - 4]
jne 0x100af52f
cmp word [esi + 0x2e], cx
jne 0x100af52f
push 0x20
push dword [ebp + 8]
lea eax, [esi + 0xc]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncmp]
add esp, 0xc
test eax, eax
je 0x100af59f
mov cx, word [ebp - 2]
mov esi, dword [esi]
test esi, esi
jne 0x100af500
movzx eax, word [ebp - 4]
xor ecx, ecx
cmp edi, 1
setne cl
lea ecx, [ecx*8 + 0x2e]
add ecx, eax
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov esi, eax
add esp, 4
test esi, esi
je 0x100af596
mov ecx, dword [ebp - 4]
lea ebx, [esi + 0x30]
mov dword [esi + 0x2c], ecx
lea eax, [ebx + 8]
movzx ecx, word [ebp - 4]
sub ecx, 4
cmp edi, 1
push ecx
cmove eax, ebx
push eax
push dword [ebp - 8]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__read]
movzx ecx, word [ebp - 4]
add esp, 0xc
sub ecx, 4
cmp eax, ecx
je 0x100af5c0
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
inc dword [esi + 8]
movzx eax, word [ebp - 4]
push 1
sub eax, 4
push eax
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__lseek]
add esp, 0xc
lea eax, [esi + 0x30]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [0x100edc64]
push 0x20
push dword [ebp + 8]
mov dword [esi], eax
lea eax, [esi + 0xc]
push 0x20
push eax
mov dword [esi + 4], edi
mov dword [esi + 8], 1
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy_s]
add esp, 0x10
mov dword [0x100edc64], esi
cmp edi, 2
je 0x100af5f9
cmp edi, 4
jne 0x100af687
mov dword [ebx + 4], 0
mov dword [ebx], 0
cmp edi, 4
jne 0x100af646
movzx eax, byte [ebx + 0xcd]
movzx ecx, byte [ebx + 0xce]
mov dl, byte [ebx + 0xb]
imul ecx, eax
movzx eax, byte [ebx + 0xcc]
imul ecx, eax
lea eax, [ebx + 0x130]
lea ecx, [ecx + ecx*2]
add eax, ecx
test dl, 1
je 0x100af63e
mov dword [ebx], eax
lea eax, [eax + ecx*2]
test dl, 2
je 0x100af646
mov dword [ebx + 4], eax
xor esi, esi
test byte [ebp + 0xc], 1
je 0x100af657
dec byte [ebx + 8]
dec byte [ebx + 9]
dec byte [ebx + 0xa]
lea eax, [ebx + 0xc]
xor edi, edi
mov dword [ebp - 8], eax
nop
xor edx, edx
movzx ecx, word [eax]
lea eax, [eax + 2]
mov word [eax - 2], si
inc edx
add esi, ecx
movzx ecx, byte [ebx + edi + 8]
cmp edx, ecx
jle 0x100af662
mov eax, dword [ebp - 8]
inc edi
add eax, 0x40
mov dword [ebp - 8], eax
cmp edi, 3
jl 0x100af660
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret