Function at 0x4ad0309d
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
push ebx
push esi
push edi
push 1
pop edi
mov dword [ebp - 0x40], 0x3b
push 8
mov dword [ebp - 0x4c], edi
call fcn.4ad0da4c
xor esi, esi
mov dword [ebp - 0x18], eax
cmp eax, esi
je 0x4ad030da
mov eax, 0x4ad01378
mov ecx, eax
test ecx, ecx
je 0x4ad030da
push eax
push dword [ebp - 0x18]
call dword [sym.imp.MSVCRT.dll_wcscpy]
pop ecx
pop ecx
mov eax, dword [ebp + 8]
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x24], edi
mov eax, dword [eax + 0x4c]
mov dword [ebp - 0x44], esi
cmp eax, esi
mov dword [ebp - 0x20], esi
je 0x4ad033f0
mov ecx, eax
mov dword [ebp - 4], ecx
mov ax, word [ecx]
cmp ax, 0x22
je 0x4ad03110
cmp ax, 0x27
je 0x4ad03110
mov dword [ebp - 0x28], esi
jmp 0x4ad03118
inc ecx
mov dword [ebp - 0x28], eax
inc ecx
mov dword [ebp - 4], ecx
cmp ecx, esi
je 0x4ad03371
mov ebx, dword [sym.imp.MSVCRT.dll__wcsnicmp]
mov ax, word [ecx]
test ax, ax
je 0x4ad03371
cmp ax, 0x20
ja 0x4ad03145
inc ecx
inc ecx
mov dword [ebp - 4], ecx
mov ax, word [ecx]
test ax, ax
jne 0x4ad03132
mov edi, dword [ebp - 0x28]
cmp word [ecx], di
je 0x4ad03371
push 8
push 0x4ad01488
push ecx
call ebx
add esp, 0xc
test eax, eax
jne 0x4ad03172
add dword [ebp - 4], 0x10
mov dword [ebp - 0x20], 1
jmp 0x4ad03366
push 7
push 0x4ad01478
push dword [ebp - 4]
call ebx
add esp, 0xc
test eax, eax
jne 0x4ad03195
add dword [ebp - 4], 0xe
mov dword [ebp - 0x20], 1
jmp 0x4ad03366
push 4
push 0x4ad0146c
push dword [ebp - 4]
call ebx
add esp, 0xc
test eax, eax
jne 0x4ad031bc
mov eax, dword [ebp - 4]
mov ax, word [eax + 8]
add dword [ebp - 4], 0xa
mov word [ebp - 0x40], ax
jmp 0x4ad03366
push 7
push 0x4ad0145c
push dword [ebp - 4]
call ebx
add esp, 0xc
test eax, eax
jne 0x4ad0324d
mov eax, dword [ebp - 4]
add eax, 0xe
mov dword [ebp - 4], eax
mov esi, eax
mov cx, word [eax]
test cx, cx
je 0x4ad031fa
cmp cx, di
je 0x4ad031fa
cmp cx, 0x20
jne 0x4ad031f3
cmp word [eax + 2], di
jne 0x4ad031fa
inc eax
inc eax
mov dword [ebp - 4], eax
jmp 0x4ad031da
push dword [ebp - 0x18]
call fcn.4ad0d8c7
mov eax, dword [ebp - 4]
sub eax, esi
sar eax, 1
lea eax, [eax + eax + 2]
push eax
call fcn.4ad0da4c
mov edi, eax
mov eax, dword [ebp - 4]
sub eax, esi
mov dword [ebp - 0x18], edi
sar eax, 1
push eax
push esi
push edi
call dword [sym.imp.MSVCRT.dll_wcsncpy]
mov eax, dword [ebp - 4]
add esp, 0xc
sub eax, esi
sar eax, 1
and word [edi + eax*2], 0
mov eax, dword [ebp - 4]
cmp word [eax], 0
je 0x4ad03366
add dword [ebp - 4], 2
jmp 0x4ad03366
push 5
push 0x4ad01450
push dword [ebp - 4]
call ebx
add esp, 0xc
test eax, eax
jne 0x4ad03285
add dword [ebp - 4], 0xa
push eax
lea eax, [ebp - 4]
push eax
push dword [ebp - 4]
call dword [sym.imp.MSVCRT.dll_wcstol]
add esp, 0xc
mov dword [ebp - 0x10], eax
test eax, eax
jle 0x4ad038f6
jmp 0x4ad03366
push 7
push 0x4ad01440
push dword [ebp - 4]
call ebx
add esp, 0xc
test eax, eax
jne 0x4ad038f6
add dword [ebp - 4], 0xe
mov eax, dword [ebp - 4]
xor edi, edi
mov ax, word [eax]
mov dword [ebp - 0x24], edi
cmp ax, di
je 0x4ad0335e
cmp ax, word [ebp - 0x28]
je 0x4ad0335e
cmp ax, 0x2a
je 0x4ad03356
lea eax, [ebp - 4]
push 0
push eax
push dword [ebp - 4]
call dword [sym.imp.MSVCRT.dll_wcstol]
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x4ad038f6
mov eax, dword [ebp - 4]
cmp word [eax], 0x2d
jne 0x4ad0330a
lea ecx, [ebp - 4]
push 0
add eax, 2
push ecx
push eax
call dword [sym.imp.MSVCRT.dll_wcstol]
add esp, 0xc
test eax, eax
jle 0x4ad038f6
jmp 0x4ad0330c
mov eax, esi
cmp eax, 0x20
jge 0x4ad0332d
cmp esi, eax
jg 0x4ad0332d
mov ecx, eax
sub ecx, esi
lea edi, [edi + ecx + 1]
push 1
lea ecx, [esi - 1]
pop edx
shl edx, cl
or dword [ebp - 0x24], edx
inc esi
cmp esi, eax
jle 0x4ad0331d
mov eax, dword [ebp - 4]
mov ax, word [eax]
cmp ax, 0x2c
jne 0x4ad0333f
add dword [ebp - 4], 2
jmp 0x4ad03345
cmp ax, 0x2a
jne 0x4ad0335e
mov eax, dword [ebp - 4]
mov ax, word [eax]
test ax, ax
jne 0x4ad032b4
jmp 0x4ad0335e
add dword [ebp - 4], 2
inc edi
mov dword [ebp - 0x44], edi
cmp edi, dword [ebp - 0x14]
jle 0x4ad03366
mov dword [ebp - 0x14], edi
mov ecx, dword [ebp - 4]
test ecx, ecx
jne 0x4ad03126
mov ebx, dword [ebp - 0x14]
cmp ebx, 1
jle 0x4ad033f0
mov edi, dword [ebp + 0xc]
lea esi, [ebx + edi]
lea eax, [esi + esi]
push eax
push dword [0x4ad1cf48]
call fcn.4ad0da67
mov dword [0x4ad1cf48], eax
mov eax, esi
shl eax, 2
push eax
push dword [0x4ad1cf4c]
call fcn.4ad0da67
push 1
mov dword [0x4ad1cf4c], eax
pop edx
cmp ebx, edx
jle 0x4ad033e4
lea ecx, [edi*4 + 4]
lea eax, [edi + edi + 2]
mov ebx, dword [ebp + 8]
mov si, dx
add si, word [ebx + 0x44]
mov ebx, dword [0x4ad1cf48]
mov word [ebx + eax], si
mov esi, dword [0x4ad1cf4c]
and dword [esi + ecx], 0
inc edx
inc eax
add ecx, 4
inc eax
cmp edx, dword [ebp - 0x14]
jl 0x4ad033bb
mov eax, dword [0x4ad1cf48]
add edx, edi
and word [eax + edx*2], 0
mov eax, dword [ebp + 8]
xor esi, esi
cmp dword [ebp - 0x20], esi
mov edi, dword [eax + 0x3c]
je 0x4ad0340d
mov dword [ebp - 0x2c], 0x60
mov dword [ebp - 0x30], 0x27
jmp 0x4ad0341b
mov dword [ebp - 0x2c], 0x27
mov dword [ebp - 0x30], 0x22
cmp edi, esi
je 0x4ad0342e
mov ax, word [edi]
cmp ax, word [ebp - 0x2c]
je 0x4ad03438
cmp ax, word [ebp - 0x30]
je 0x4ad03438
push esi
push esi
push edi
call fcn.4ad12e5a
mov edi, eax
mov eax, dword [ebp - 0x10]
cmp word [edi], si
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x48], esi
je 0x4ad038c5
cmp byte [0x4ad1cf44], 0
jne 0x4ad038c5
call fcn.4ad02c3e
call fcn.4ad12d3c
mov eax, dword [ebp - 0x50]
xor ebx, ebx
cmp edi, ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x10], eax
je 0x4ad03480
push edi
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
jmp 0x4ad03482
xor eax, eax
mov dx, word [edi]
mov ecx, dword [ebp - 0x2c]
cmp dx, cx
mov dword [ebp - 0x28], eax
jne 0x4ad035a2
cmp eax, 1
jle 0x4ad035a2
cmp word [edi + eax*2 - 2], cx
jne 0x4ad035a2
inc edi
inc edi
dec eax
dec eax
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x28], eax
mov word [edi + eax*2], bx
inc eax
push eax
call fcn.4ad0d9ca
mov esi, eax
cmp esi, ebx
je 0x4ad0385b
xor eax, eax
push eax
push eax
push dword [ebp - 0x28]
push esi
push 0xffffffffffffffff
push edi
push eax
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0x4ad0143c
push esi
call dword [sym.imp.MSVCRT.dll__popen]
mov ebx, eax
pop ecx
test ebx, ebx
pop ecx
je 0x4ad0386d
mov eax, dword [ebx + 0xc]
xor esi, esi
test al, 0x10
mov dword [ebp - 0xc], esi
mov dword [ebp - 8], esi
jne 0x4ad03571
test al, 0x20
jne 0x4ad03571
mov eax, dword [ebp - 0xc]
sub eax, esi
cmp eax, 0x200
jae 0x4ad0353b
add dword [ebp - 0xc], 0x100
cmp dword [ebp - 8], 0
push dword [ebp - 0xc]
je 0x4ad0352b
push dword [ebp - 8]
call fcn.4ad0da67
jmp 0x4ad03530
call fcn.4ad0d9ca
test eax, eax
mov dword [ebp - 8], eax
je 0x4ad03877
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
sub ecx, esi
add eax, esi
push ebx
push ecx
and byte [eax], 0
push eax
call dword [sym.imp.MSVCRT.dll_fgets]
add esp, 0xc
test eax, eax
je 0x4ad03571
mov edi, dword [ebp - 8]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov eax, dword [ebx + 0xc]
mov edi, dword [ebp - 0x3c]
not ecx
dec ecx
test al, 0x10
mov esi, ecx
je 0x4ad03501
push ebx
call dword [sym.imp.MSVCRT.dll__pclose]
pop ecx
lea eax, [esi + esi + 4]
push eax
push dword [ebp - 8]
call fcn.4ad0da67
mov ebx, eax
push esi
push ebx
lea eax, [esi + ebx]
push eax
call dword [sym.imp.MSVCRT.dll_memmove]
add esp, 0xc
mov dword [ebp - 8], ebx
mov dword [ebp - 0x34], esi
jmp 0x4ad0366b
mov ecx, dword [ebp - 0x30]
cmp dx, cx
jne 0x4ad035d0
cmp eax, 1
jle 0x4ad035d0
add eax, eax
cmp word [edi + eax - 2], cx
jne 0x4ad035d0
mov word [edi + eax - 2], 0xa
inc edi
inc edi
mov dword [ebp - 4], edi
lea eax, [edi + eax - 2]
mov dword [ebp - 0x20], eax
jmp 0x4ad036aa
cmp dx, 0x22
jne 0x4ad035fc
inc edi
inc edi
push edi
call fcn.4ad1948c
mov dword [ebp - 4], eax
cmp word [eax], 0x22
jne 0x4ad035fc
mov word [eax], bx
mov eax, dword [ebp - 4]
dec eax
dec eax
cmp eax, edi
mov dword [ebp - 4], eax
jb 0x4ad035fc
cmp word [eax], 0x20
je 0x4ad035e7
xor eax, eax
push eax
push eax
push 3
push eax
push 5
push 0x80000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4ad03891
push 2
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
xor eax, eax
push eax
push eax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esi + esi + 4]
push eax
call fcn.4ad0d9ca
test eax, eax
mov dword [ebp - 8], eax
je 0x4ad038a9
lea eax, [ebp - 0x34]
or dword [ebp - 0x34], 0xffffffff
push 0
push eax
mov eax, dword [ebp - 8]
push esi
add eax, esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x34], esi
jne 0x4ad036aa
mov ebx, dword [ebp - 8]
push esi
push ebx
push esi
lea eax, [ebx + esi]
push eax
push 1
push dword [0x4ad22874]
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [ebx + eax*2]
mov dword [ebp - 4], ebx
cmp eax, ebx
mov dword [ebp - 0x20], eax
je 0x4ad0369c
cmp word [eax - 2], 0xa
je 0x4ad036a6
mov word [eax], 0xa
inc eax
inc eax
mov dword [ebp - 0x20], eax
and word [eax], 0
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0x20]
jae 0x4ad03838
xor ebx, ebx
cmp byte [0x4ad1cf44], 0
jne 0x4ad0383a
call fcn.4ad12d3c
mov esi, dword [ebp - 4]
push 0xa
push esi
call dword [sym.imp.MSVCRT.dll_wcschr]
pop ecx
cmp eax, ebx
pop ecx
mov dword [ebp - 4], eax
je 0x4ad0383a
cmp eax, esi
jbe 0x4ad036f5
cmp word [eax - 2], 0xd
jne 0x4ad036f5
mov word [eax - 2], bx
mov eax, dword [ebp - 4]
mov word [eax], bx
add dword [ebp - 4], 2
cmp dword [ebp - 0x10], ebx
jne 0x4ad03827
mov ecx, dword [ebp - 0x14]
cmp ecx, 1
jle 0x4ad03727
mov eax, dword [ebp + 0xc]
dec ecx
lea eax, [eax*4 + 4]
mov edx, dword [0x4ad1cf4c]
mov dword [edx + eax], ebx
add eax, 4
dec ecx
jne 0x4ad03718
cmp word [esi], bx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0xc], ebx
je 0x4ad037ff
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x3c], 1
shl eax, 2
mov dword [ebp - 0x38], eax
call fcn.4ad12d3c
mov ax, word [esi]
test ax, ax
je 0x4ad03767
push eax
push dword [ebp - 0x18]
call dword [sym.imp.MSVCRT.dll_wcschr]
pop ecx
test eax, eax
pop ecx
je 0x4ad03767
inc esi
inc esi
jmp 0x4ad0374b
cmp dword [ebp - 0x1c], 0
jne 0x4ad0377a
mov ax, word [esi]
cmp ax, word [ebp - 0x40]
je 0x4ad037ff
mov eax, dword [ebp - 0x44]
mov ebx, esi
test eax, eax
je 0x4ad03788
cmp dword [ebp - 0x3c], eax
je 0x4ad037ec
mov ax, word [esi]
test ax, ax
je 0x4ad037a4
push eax
push dword [ebp - 0x18]
call dword [sym.imp.MSVCRT.dll_wcschr]
pop ecx
test eax, eax
pop ecx
jne 0x4ad037a4
inc esi
inc esi
jmp 0x4ad03788
cmp ebx, esi
je 0x4ad037d5
cmp dword [ebp - 0x1c], 0x20
jge 0x4ad037d5
mov ecx, dword [ebp - 0x1c]
push 1
pop eax
shl eax, cl
and eax, dword [ebp - 0x24]
inc dword [ebp - 0x1c]
test eax, eax
je 0x4ad037d5
mov eax, dword [0x4ad1cf4c]
mov ecx, dword [ebp - 0x38]
inc dword [ebp - 0xc]
add dword [ebp - 0x38], 4
inc dword [ebp - 0x3c]
mov dword [eax + ecx], ebx
xor eax, eax
cmp word [esi], ax
je 0x4ad037ff
mov word [esi], ax
inc esi
inc esi
cmp word [esi], ax
jne 0x4ad03746
jmp 0x4ad037ff
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0xc]
add ecx, eax
mov eax, dword [0x4ad1cf4c]
inc dword [ebp - 0xc]
mov dword [eax + ecx*4], esi
xor ebx, ebx
cmp dword [ebp - 0xc], ebx
je 0x4ad0382a
push dword [ebp + 0x10]
mov eax, dword [ebp + 8]
push dword [eax + 0x40]
call fcn.4ad03b9f
push dword [ebp - 0x48]
mov dword [ebp - 0x4c], eax
call fcn.4ad03ee7
mov dword [ebp - 0x48], eax
mov dword [ebp + 0x10], ebx
jmp 0x4ad0382a
dec dword [ebp - 0x10]
mov eax, dword [ebp - 0x20]
cmp dword [ebp - 4], eax
jb 0x4ad036b8
jmp 0x4ad0383a
xor ebx, ebx
cmp dword [ebp - 8], ebx
je 0x4ad03847
push dword [ebp - 8]
call fcn.4ad0d8c7
mov eax, dword [ebp - 0x28]
cmp word [edi + eax*2 + 2], bx
lea edi, [edi + eax*2 + 2]
jne 0x4ad0344a
jmp 0x4ad038c5
push edi
push 1
push 0x2374
call fcn.4ad1393b
add esp, 0xc
jmp 0x4ad038c0
push edi
push 1
push 0x2331
jmp 0x4ad03899
push edi
push 1
push 0x2374
call fcn.4ad1393b
add esp, 0xc
push ebx
call dword [sym.imp.MSVCRT.dll__pclose]
pop ecx
jmp 0x4ad038c0
push edi
push 1
push 0x2363
call fcn.4ad1393b
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4ad038ef
push edi
push 1
push 0x2374
call fcn.4ad1393b
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 8
pop eax
jmp 0x4ad038ef
cmp dword [ebp - 0x14], 1
jle 0x4ad038ec
mov eax, dword [0x4ad1cf48]
xor edx, edx
cmp eax, edx
je 0x4ad038ec
cmp word [eax], dx
je 0x4ad038ec
mov ecx, dword [ebp + 0xc]
mov word [eax + ecx*2 + 2], dx
mov eax, dword [0x4ad1cf4c]
mov dword [eax + ecx*4 + 4], edx
mov eax, dword [ebp - 0x4c]
pop edi
pop esi
pop ebx
leave
ret 0xc
push dword [ebp - 4]
push 1
push 0x234a
call fcn.4ad1393b
add esp, 0xc
push 1
jmp 0x4ad038c2