Function at 0x40cf7e
Capabilities:
Read file on windows

Disassembly:
add esi, 2
cmp word [esi], 0
jne 0x40d398
jmp 0x40d3ae
mov edx, dword [ebp - 4]
movzx eax, word [edx + 8]
add edx, 0xa
mov dword [ebp - 0x40], eax
mov dword [ebp - 4], edx
jmp 0x40d164
push 0
lea eax, [ebp - 4]
push eax
lea eax, [edx + 2]
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x41cb0e
mov edx, dword [ebp - 4]
jmp 0x40d114
add edx, 2
mov dword [ebp - 4], edx
jmp 0x40d5d5
mov edx, dword [ebp - 4]
mov ebx, 1
add edx, 0x10
mov dword [ebp - 8], ebx
mov dword [ebp - 4], edx
jmp 0x40d167
call fcn.004234e5
jmp 0x40d279
xor edx, edx
jmp 0x40d589
call fcn.004234e5
jmp 0x40d312
mov edi, 0x60
lea ebx, [edi - 0x39]
jmp 0x40d22f
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x60
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x10], edx
push edi
mov ecx, 0x40714c
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x50], 1
mov dword [ebp - 0x60], 1
mov dword [ebp - 0x40], 0x3b
call fcn.00405ad0
mov edx, dword [esi + 0x4c]
mov edi, 1
xor ebx, ebx
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x44], 0
mov dword [ebp - 8], ebx
test edx, edx
je 0x40d5b6
mov dword [ebp - 4], edx
movzx eax, word [edx]
cmp eax, 0x22
jne 0x41cae8
add edx, 2
mov esi, eax
mov dword [ebp - 4], edx
mov dword [ebp - 0x34], esi
test edx, edx
je 0x40d5c1
movzx eax, word [edx]
test ax, ax
je 0x40d528
lea esp, [esp]
cmp ax, 0x20
jbe 0x40dcd4
cmp word [edx], si
je 0x40d528
push 8
push 0x40d4cc
push edx
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x409860
push 7
push 0x40d4e0
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x41caf8
push 4
push 0x40d4f0
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x408bec
push 7
push 0x40d4fc
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x40dc6a
push 5
push 0x40d50c
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x40f680
push 7
push 0x40d518
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x41cb0e
mov edx, dword [ebp - 4]
xor ebx, ebx
add edx, 0xe
mov dword [ebp - 0x28], eax
mov dword [ebp - 4], edx
movzx eax, word [edx]
test ax, ax
je 0x40d15b
lea ecx, [ecx]
cmp ax, si
je 0x40d158
cmp ax, 0x2a
je 0x40d5c6
push 0
lea eax, [ebp - 4]
push eax
push edx
call dword [sym.imp.msvcrt.dll_wcstol]
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x41cb0e
mov edx, dword [ebp - 4]
cmp word [edx], 0x2d
je 0x4093d0
mov edi, esi
cmp edi, 0x20
jge 0x40d143
cmp esi, edi
jg 0x40d143
mov eax, edi
inc ebx
sub eax, esi
add ebx, eax
mov dword [ebp - 0x5c], ebx
mov ebx, dword [ebp - 0x28]
mov edi, edi
lea ecx, [esi - 1]
mov eax, 1
shl eax, cl
inc esi
or ebx, eax
cmp esi, edi
jle 0x40d12c
mov dword [ebp - 0x28], ebx
mov ebx, dword [ebp - 0x5c]
movzx eax, word [edx]
cmp eax, 0x2c
je 0x4093f5
cmp eax, 0x2a
je 0x40d5d5
mov edi, dword [ebp - 0xc]
cmp ebx, edi
jle 0x40d164
mov edi, ebx
mov dword [ebp - 0xc], edi
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0x34]
test edx, edx
jne 0x40cffe
cmp edi, 1
jle 0x40d5c1
mov esi, dword [ebp - 0x10]
mov ecx, dword [0x426050]
add esi, edi
lea edx, [esi*2 + 2]
call fcn.0040233f
mov ecx, dword [0x42604c]
lea edx, [esi*4 + 4]
mov dword [0x426050], eax
call fcn.0040233f
mov ecx, dword [0x426050]
mov dword [0x42604c], eax
test ecx, ecx
je 0x41cb2a
test eax, eax
je 0x41cb2a
mov edx, 1
cmp edi, edx
jle 0x40d209
mov ebx, dword [ebp - 0x10]
lea esi, [ebx + 1]
inc ebx
lea esi, [eax + esi*4]
lea edi, [ecx + ebx*2]
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x1c]
lea esp, [esp]
mov ax, word [ecx + 0x44]
lea edi, [edi + 2]
add ax, dx
lea esi, [esi + 4]
mov word [edi - 2], ax
inc edx
mov dword [esi - 4], 0
cmp edx, ebx
jl 0x40d1e3
mov ecx, dword [0x426050]
mov ebx, dword [ebp - 8]
mov eax, dword [ebp - 0x10]
mov esi, dword [ebp - 0x1c]
add eax, edx
xor edx, edx
mov word [ecx + eax*2], dx
mov esi, dword [esi + 0x3c]
mov dword [ebp - 8], esi
test ebx, ebx
jne 0x409891
mov edi, 0x27
mov ebx, 0x22
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x5c], edi
test esi, esi
je 0x40d556
movzx eax, word [esi]
cmp ax, bx
jne 0x40d54d
cmp word [esi], 0
mov dword [ebp - 0x4c], 0
je 0x40d497
cmp byte [0x426002], 0
jne 0x40d497
call fcn.00407e19
cmp dword [0x426124], 0
jne 0x409876
mov eax, dword [ebp - 0x3c]
mov edx, esi
mov dword [ebp - 4], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x54], eax
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40d292
movzx eax, word [esi]
sub edx, ecx
sar edx, 1
mov dword [ebp - 0x34], edx
cmp ax, di
je 0x40d820
cmp ax, bx
jne 0x40de45
cmp edx, 1
jle 0x40de45
cmp word [esi + edx*2 - 2], bx
jne 0x40de45
mov eax, 0xa
mov word [esi + edx*2 - 2], ax
add esi, 2
sub edx, 2
mov dword [ebp - 8], esi
mov dword [ebp - 0x34], edx
mov dword [ebp - 4], esi
lea eax, [edx + 1]
lea eax, [esi + eax*2]
mov dword [ebp - 0x38], eax
cmp dword [ebp - 4], eax
jae 0x40d46d
cmp byte [0x426002], 0
jne 0x40d46d
cmp dword [0x426124], 0
jne 0x409887
mov esi, dword [ebp - 4]
push 0xa
push esi
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
mov dword [ebp - 4], eax
test eax, eax
je 0x40d46d
cmp eax, esi
jbe 0x40d340
cmp word [eax - 2], 0xd
jne 0x40d340
xor ecx, ecx
mov word [eax - 2], cx
mov eax, dword [ebp - 4]
xor ecx, ecx
mov word [eax], cx
add dword [ebp - 4], 2
mov eax, dword [ebp - 0x54]
test eax, eax
jne 0x40f677
mov ecx, dword [ebp - 0xc]
cmp ecx, 1
jle 0x40d36d
mov edi, dword [ebp - 0x10]
dec ecx
mov eax, dword [0x42604c]
inc edi
lea edi, [eax + edi*4]
xor eax, eax
rep stosd dword es:[edi], eax
xor ecx, ecx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x18], ecx
cmp word [esi], cx
je 0x40d461
mov edx, dword [ebp - 0x10]
mov eax, 1
shl edx, 2
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x48], edx
cmp word [esi], 0
mov ebx, dword [ebp - 0x24]
je 0x40d3b4
movzx eax, word [esi]
push eax
push ebx
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x408861
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x14]
test ecx, ecx
je 0x40d530
mov edx, dword [ebp - 0x44]
mov edi, esi
test edx, edx
jne 0x40d5e9
cmp word [esi], 0
je 0x40d437
movzx eax, word [esi]
push eax
push ebx
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x40d3e9
add esi, 2
cmp word [esi], ax
jne 0x40d3cf
mov ecx, dword [ebp - 0x2c]
cmp edi, esi
je 0x40d41c
cmp ecx, 0x20
jge 0x40d41c
mov eax, 1
shl eax, cl
inc ecx
mov dword [ebp - 0x2c], ecx
and eax, dword [ebp - 0x28]
je 0x40d41c
mov edx, dword [ebp - 0x48]
mov eax, dword [0x42604c]
inc dword [ebp - 0x18]
mov dword [edx + eax], edi
add edx, 4
inc dword [ebp - 0x14]
mov dword [ebp - 0x48], edx
cmp word [esi], 0
je 0x40d42a
xor eax, eax
mov word [esi], ax
add esi, 2
cmp word [esi], 0
mov eax, dword [ebp - 0x14]
jne 0x40d38f
mov edx, dword [ebp - 0x18]
test edx, edx
je 0x40d461
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x50]
mov ecx, dword [eax + 0x40]
call fcn.0040d897
mov ecx, dword [ebp - 0x4c]
mov dword [ebp - 0x60], eax
call fcn.0040d9ff
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x50], 0
mov eax, dword [ebp - 0x38]
cmp dword [ebp - 4], eax
jb 0x40d2f8
mov eax, dword [ebp - 0x30]
test eax, eax
jne 0x40d541
mov esi, dword [ebp - 8]
mov eax, dword [ebp - 0x34]
mov ecx, dword [0x426050]
lea esi, [esi + eax*2]
add esi, 2
mov dword [ebp - 8], esi
cmp word [esi], 0
jne 0x41cb4b
cmp dword [ebp - 0xc], 1
jle 0x40d4be
test ecx, ecx
je 0x40d4be
cmp word [ecx], 0
je 0x40d4be
mov edx, dword [ebp - 0x10]
xor eax, eax
mov word [ecx + edx*2 + 2], ax
mov eax, dword [0x42604c]
mov dword [eax + edx*4 + 4], 0
mov eax, dword [ebp - 0x60]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ebx, dword [ebp - 8]
jmp 0x40d172
mov edx, dword [ebp - 0x40]
cmp word [esi], dx
jne 0x40d3bc
jmp 0x40d437
mov ecx, eax
call fcn.0040128b
jmp 0x40d478
cmp ax, di
je 0x40d249
push 0
xor edx, edx
mov ecx, esi
call fcn.00402014
mov ecx, dword [0x426050]
mov esi, eax
mov dword [ebp - 8], esi
jmp 0x40d249
mov ecx, dword [0x426120]
call fcn.00405f23
test eax, eax
je 0x409880
mov edx, 1
push edi
push ebx
push edi
lea eax, [ebx + edi]
push eax
push edx
push ecx
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_MultiByteToWideChar]
mov dword [ebp - 4], ebx
lea eax, [ebx + eax*2]
mov dword [ebp - 0x38], eax
cmp eax, ebx
je 0x40d607
cmp word [eax - 2], 0xa
jne 0x40d607
xor ecx, ecx
mov word [eax], cx
jmp 0x40d2ef
mov ecx, dword [0x426050]
jmp 0x40d217
mov esi, dword [ebp - 0x1c]
jmp 0x40d5b6
add edx, 2
inc ebx
mov dword [ebp - 4], edx
mov dword [ebp - 0x44], ebx
jmp 0x40d158
movzx eax, word [edx]
mov esi, dword [ebp - 0x34]
test ax, ax
jne 0x40d0dc
jmp 0x40d158
cmp eax, edx
jne 0x40d3c9
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x10]
mov eax, dword [0x42604c]
add ecx, edx
inc edx
mov dword [eax + ecx*4], esi
jmp 0x40d43a
mov ecx, 0xa
mov word [eax], cx
add eax, 2
xor ecx, ecx
mov dword [ebp - 0x38], eax
mov word [eax], cx
jmp 0x40d2ef
mov al, byte [edi]
inc edi
test al, al
jne 0x40d755
push dword [ebp - 0x18]
sub edi, ecx
call dword [sym.imp.msvcrt.dll_feof]
add esp, 4
test eax, eax
jne 0x40d7d0
push dword [ebp - 0x18]
call dword [sym.imp.msvcrt.dll_ferror]
add esp, 4
test eax, eax
jne 0x40d7d0
mov eax, ebx
sub eax, edi
cmp eax, 0x200
jae 0x40d7aa
add ebx, 0x100
test esi, esi
je 0x40d886
mov edx, ebx
mov ecx, esi
call fcn.0040233f
mov esi, eax
test esi, esi
je 0x41cb56
push dword [ebp - 0x18]
mov eax, ebx
mov byte [esi + edi], 0
sub eax, edi
lea ecx, [esi + edi]
push eax
push ecx
call dword [sym.imp.msvcrt.dll_fgets]
add esp, 0xc
test eax, eax
je 0x40d7d0
mov edi, esi
lea ecx, [edi + 1]
mov edi, edi
jmp 0x40d755
push dword [ebp - 0x18]
call dword [sym.imp.msvcrt.dll__pclose]
add esp, 4
lea edx, [edi*2 + 4]
mov ecx, esi
call fcn.0040233f
cmp dword [0x426050], 0
mov ebx, eax
mov dword [ebp - 0x30], ebx
je 0x41cb6c
cmp dword [0x42604c], 0
je 0x41cb6c
push edi
lea eax, [ebx + edi]
push ebx
push eax
call dword [sym.imp.msvcrt.dll_memmove]
add esp, 0xc
mov dword [ebp - 0x20], edi
jmp 0x40d571
cmp edx, 1
jle 0x40d2b0
cmp word [esi + edx*2 - 2], di
jne 0x40d2b0
add esi, 2
sub edx, 2
xor eax, eax
mov dword [ebp - 8], esi
push 0x40d880
push esi
mov dword [ebp - 0x34], edx
mov word [esi + edx*2], ax
call dword [sym.imp.msvcrt.dll__wpopen]
add esp, 8
mov dword [ebp - 0x18], eax
test eax, eax
je 0x41cb88
push eax
xor ebx, ebx
xor edi, edi
xor esi, esi
call dword [sym.imp.msvcrt.dll_feof]
add esp, 4
test eax, eax
jne 0x40d7d0
lea ecx, [ecx]
jmp 0x40d76e
mov ecx, ebx
call fcn.00401e20
jmp 0x40d7a0
mov eax, dword [ebp - 4]
add eax, 0xe
mov dword [ebp - 4], eax
mov edi, eax
movzx ecx, word [eax]
test cx, cx
je 0x40dc96
cmp cx, si
je 0x40dc96
cmp cx, 0x20
je 0x40dceb
add eax, 2
mov dword [ebp - 4], eax
movzx ecx, word [eax]
test cx, cx
jne 0x40dc7d
movzx esi, word [eax]
xor ecx, ecx
mov word [eax], cx
mov ecx, dword [ebp - 0x24]
call fcn.0040128b
mov ecx, edi
call fcn.00405ad0
mov ebx, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 4]
mov word [eax], si
mov edx, dword [ebp - 4]
cmp word [edx], 0
je 0x40d167
add edx, 2
mov dword [ebp - 4], edx
jmp 0x40d167
add edx, 2
mov dword [ebp - 4], edx
movzx eax, word [edx]
test ax, ax
jne 0x40d00d
jmp 0x40d017
cmp word [eax + 2], si
jne 0x40dc96
jmp 0x40dc88
cmp eax, 0x22
je 0x41635c
push 0
push 0
push 3
push 0
push 5
push 0x80000000
push esi
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x41cbb4
push 2
push 0
push 0
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
push 0
push 0
push 0
push ebx
mov edi, eax
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
lea ecx, [edi*2 + 4]
call fcn.00401e20
mov dword [ebp - 0x30], eax
test eax, eax
je 0x41cba3
push 0
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x20], 0xffffffff
push ecx
push edi
add eax, edi
push eax
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_ReadFile]
push ebx
mov esi, eax
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
test esi, esi
je 0x41639b
mov eax, dword [ebp - 0x20]
cmp eax, edi
jne 0x40d46d
mov ebx, dword [ebp - 0x30]
jmp 0x40d571
dec eax
mov dword [ebp - 0x54], eax
jmp 0x40d461
mov eax, dword [ebp - 4]
lea ecx, [ebp - 4]
push 0
add eax, 0xa
push ecx
push eax
mov dword [ebp - 4], eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
mov dword [ebp - 0x3c], eax
test eax, eax
jle 0x41cb0e
mov edx, dword [ebp - 4]
jmp 0x40d164
add esi, 2
dec edx
mov ecx, esi
mov dword [ebp - 8], esi
mov dword [ebp - 0x34], edx
call fcn.00402c6f
mov dword [ebp - 4], eax
cmp word [eax], 0x22
jne 0x40de4e
xor ecx, ecx
mov word [eax], cx
mov eax, dword [ebp - 4]
sub eax, 2
mov dword [ebp - 4], eax
cmp eax, esi
jb 0x40de4e
cmp word [eax], 0x20
je 0x41637a
jmp 0x40de4e
xor eax, eax
mov dword [ebp - 0x20], eax
jmp 0x40dece
cmp eax, 0x27
je 0x40cfeb
xor esi, esi
jmp 0x40cff3
mov edx, dword [ebp - 4]
mov ebx, 1
add edx, 0xe
mov dword [ebp - 8], ebx
mov dword [ebp - 4], edx
jmp 0x40d167
push dword [ebp - 4]
push 1
push 0x234a
call fcn.0040bd02
add esp, 0xc
mov eax, 1
jmp 0x40d4c1
push 0
push 0x2374
call fcn.0040bd02
add esp, 8
call fcn.00423557
push 1
push 0x4265e0
call dword [sym.imp.msvcrt.dll_longjmp]
mov ebx, dword [ebp - 0x58]
mov edi, dword [ebp - 0x5c]
jmp 0x40d25a
push dword [ebp - 0x18]
call dword [sym.imp.msvcrt.dll__pclose]
add esp, 4
mov eax, 8
jmp 0x40d4c1
push dword [ebp - 8]
push 1
push 0x2374
call fcn.0040bd02
add esp, 0xc
mov eax, 8
jmp 0x40d4c1
push esi
push 1
push 0x2331
call fcn.0040bd02
add esp, 0xc
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
jmp 0x40d4c1
push ebx
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
mov eax, 8
jmp 0x40d4c1
push esi
push 1
push 0x2363
call fcn.0040bd02
add esp, 0xc
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
jmp 0x40d4c1