Function at 0x4107c0
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x60
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x14], edx
push edi
mov ecx, 0x402554
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x50], 1
mov dword [ebp - 0x58], 1
mov dword [ebp - 0x44], 0x3b
call fcn.004100ca
mov ecx, dword [esi + 0x4c]
mov ebx, 1
mov dword [ebp - 0x2c], eax
xor edi, edi
xor eax, eax
mov dword [ebp - 0x40], 0
mov dword [ebp - 8], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x10], edi
test ecx, ecx
je 0x4109b7
mov dword [ebp - 4], ecx
movzx edx, word [ecx]
cmp edx, 0x22
jne 0x4218d5
lea eax, [ecx + 2]
mov esi, edx
mov dword [ebp - 0x18], esi
mov ecx, eax
mov dword [ebp - 4], ecx
test eax, eax
je 0x4109b4
movzx edx, word [ecx]
test dx, dx
je 0x41091a
lea esp, [esp]
cmp dx, 0x20
jbe 0x410dc2
cmp word [ecx], si
je 0x41091a
push 8
push 0x402514
push ecx
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x4110ef
push 7
push 0x402534
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x4218e8
push 4
push 0x402528
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x4110d2
push 7
push 0x402544
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x410cef
mov ebx, dword [ebp - 4]
add ebx, 0xe
mov ecx, ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 4], ecx
movzx eax, word [ecx]
test ax, ax
je 0x410cad
mov esi, ebx
mov edx, eax
mov ebx, dword [ebp - 0x18]
mov edi, edi
cmp dx, bx
je 0x410caa
cmp dx, 0x20
je 0x410ca0
lea ecx, [esi + 2]
mov dword [ebp - 4], ecx
mov esi, ecx
movzx eax, word [ecx]
mov edx, eax
test ax, ax
jne 0x4108f0
jmp 0x410caa
cmp ebx, 1
jle 0x4109b4
mov esi, dword [ebp - 8]
mov ebx, dword [ebp - 0x14]
add esi, ebx
mov ecx, dword [0x4397b8]
lea edx, [esi*2 + 2]
call fcn.0040cc10
mov ecx, dword [0x4397b4]
lea edx, [esi*4 + 4]
mov dword [0x4397b8], eax
call fcn.0040cc10
mov edx, eax
mov eax, dword [0x4397b8]
mov dword [0x4397b4], edx
test eax, eax
je 0x42191a
test edx, edx
je 0x42191a
mov edi, dword [ebp - 0x1c]
lea edx, [edx + ebx*4]
add edx, 4
mov ecx, 1
inc ebx
lea esi, [eax + ebx*2]
mov ebx, dword [ebp - 8]
mov ax, word [edi + 0x44]
lea esi, [esi + 2]
add ax, cx
lea edx, [edx + 4]
mov word [esi - 2], ax
inc ecx
mov dword [edx - 4], 0
cmp ecx, ebx
jl 0x410986
add ecx, dword [ebp - 0x14]
xor edx, edx
mov eax, dword [0x4397b8]
mov edi, dword [ebp - 0x10]
mov word [eax + ecx*2], dx
mov esi, dword [ebp - 0x1c]
mov esi, dword [esi + 0x3c]
mov eax, edi
neg eax
mov dword [ebp - 0x10], esi
sbb eax, eax
and eax, 5
add eax, 0x22
neg edi
movzx ebx, ax
sbb edi, edi
mov dword [ebp - 0x60], ebx
and edi, 0x39
add edi, 0x27
movzx ecx, di
mov dword [ebp - 0x5c], ecx
test esi, esi
je 0x410fe5
movzx eax, word [esi]
mov edx, eax
cmp ax, cx
je 0x4109fa
cmp ax, bx
jne 0x410fe5
mov dword [ebp - 0x4c], 0
test dx, dx
je 0x410c6c
lea ebx, [ebx]
cmp byte [0x4397bc], 0
jne 0x410c6c
cmp dword [0x4397b0], 0
jne 0x42193b
cmp dword [0x435614], 0
jne 0x42195e
mov eax, dword [ebp - 0x40]
mov edx, esi
xor edi, edi
mov dword [ebp - 4], 0
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x54], eax
lea ecx, [edx + 2]
mov edi, edi
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x410a50
movzx eax, word [esi]
sub edx, ecx
mov ecx, dword [ebp - 0x5c]
sar edx, 1
mov dword [ebp - 0x28], edx
cmp ax, cx
je 0x410e87
cmp ax, bx
jne 0x410ffd
cmp edx, 1
jle 0x410ffd
cmp word [esi + edx*2 - 2], bx
jne 0x410ffd
mov eax, 0xa
mov word [esi + edx*2 - 2], ax
add esi, 2
sub edx, 2
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x28], edx
mov dword [ebp - 4], esi
lea eax, [edx + 1]
lea eax, [esi + eax*2]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 4], eax
jae 0x410c4b
lea esp, [esp]
cmp byte [0x4397bc], 0
jne 0x410c48
cmp dword [0x435614], 0
jne 0x42198a
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 0x410c48
cmp eax, esi
jbe 0x410b08
cmp word [eax - 2], 0xd
jne 0x410b08
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 0x41112c
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
cmp ecx, 1
jg 0x410ddb
shl eax, 2
mov dword [ebp - 0x30], eax
movzx eax, word [esi]
xor edi, edi
xor edx, edx
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x18], edx
test ax, ax
je 0x410c3c
mov ebx, dword [ebp - 0x2c]
mov dword [ebp - 0x34], 1
movzx ecx, ax
push ecx
push ebx
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x410e3f
test edi, edi
je 0x410bfd
mov eax, dword [ebp - 0x48]
mov edi, esi
test eax, eax
jne 0x410e06
movzx eax, word [esi]
test ax, ax
je 0x410bd8
mov ecx, eax
push ecx
push ebx
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x410ba3
movzx eax, word [esi + 2]
add esi, 2
mov ecx, eax
test ax, ax
jne 0x410b86
cmp edi, esi
je 0x410bd8
mov edx, dword [ebp - 0x38]
cmp edx, 0x20
jge 0x410bd8
mov ecx, edx
mov eax, 1
shl eax, cl
inc edx
mov dword [ebp - 0x38], edx
and eax, dword [ebp - 0x24]
je 0x410bd8
mov ecx, dword [ebp - 0x30]
mov eax, dword [0x4397b4]
inc dword [ebp - 0x18]
mov dword [ecx + eax], edi
add ecx, 4
inc dword [ebp - 0x34]
mov dword [ebp - 0x30], ecx
movzx eax, word [esi]
mov ecx, eax
test ax, ax
je 0x410bed
xor eax, eax
mov word [esi], ax
add esi, 2
movzx ecx, word [esi]
movzx eax, cx
test cx, cx
je 0x410c09
mov edi, dword [ebp - 0x38]
jmp 0x410b51
mov eax, dword [ebp - 0x44]
cmp word [esi], ax
jne 0x410b6f
mov edx, dword [ebp - 0x18]
test edx, edx
je 0x410c3c
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x50]
mov ecx, dword [eax + 0x40]
call fcn.00410784
mov ebx, dword [ebp - 0x4c]
mov dword [ebp - 0x58], eax
test ebx, ebx
jne 0x410dfa
mov ebx, dword [0x4397f0]
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x50], 0
mov eax, dword [ebp - 0x3c]
cmp dword [ebp - 4], eax
jb 0x410ac0
mov edi, dword [ebp - 0xc]
test edi, edi
jne 0x410e56
mov esi, dword [ebp - 0x10]
mov eax, dword [ebp - 0x28]
lea esi, [esi + eax*2]
add esi, 2
mov dword [ebp - 0x10], esi
cmp word [esi], 0
jne 0x42199c
cmp dword [ebp - 8], 1
jle 0x410c94
mov eax, dword [0x4397b8]
test eax, eax
je 0x410c94
cmp word [eax], 0
je 0x410c94
mov ecx, dword [ebp - 0x14]
xor edx, edx
mov word [eax + ecx*2 + 2], dx
mov eax, dword [0x4397b4]
mov dword [eax + ecx*4 + 4], edx
mov eax, dword [ebp - 0x58]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp word [ecx + 2], bx
je 0x410903
mov ebx, dword [ebp - 0x54]
movzx esi, word [ecx]
xor eax, eax
mov word [ecx], ax
mov ecx, dword [ebp - 0x2c]
call fcn.0040cb50
mov ecx, ebx
call fcn.004100ca
mov ebx, dword [ebp - 8]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 4]
mov word [eax], si
mov ecx, dword [ebp - 4]
cmp word [ecx], 0
je 0x410cdf
add ecx, 2
mov dword [ebp - 4], ecx
mov esi, dword [ebp - 0x18]
test ecx, ecx
jne 0x410840
jmp 0x41091a
push 5
push 0x402600
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x411135
push 7
push 0x40260c
push dword [ebp - 4]
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x4218fe
mov ecx, dword [ebp - 4]
xor ebx, ebx
add ecx, 0xe
mov dword [ebp - 0x24], eax
mov dword [ebp - 4], ecx
movzx eax, word [ecx]
test ax, ax
je 0x410db1
jmp 0x410d40
cmp ax, si
je 0x410db1
cmp ax, 0x2a
je 0x41111d
push 0
lea eax, [ebp - 4]
push eax
push ecx
call dword [sym.imp.msvcrt.dll_wcstol]
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x4218fe
mov ecx, dword [ebp - 4]
cmp word [ecx], 0x2d
je 0x410e62
mov edx, esi
cmp edx, 0x20
jae 0x410da4
cmp esi, edx
jg 0x410da4
mov eax, edx
inc ebx
sub eax, esi
add ebx, eax
mov dword [ebp - 0x54], ebx
mov ebx, dword [ebp - 0x24]
mov edi, edi
lea eax, [esi - 1]
inc esi
bts ebx, eax
cmp esi, edx
jle 0x410d90
mov edi, dword [ebp - 0x10]
mov dword [ebp - 0x24], ebx
mov ebx, dword [ebp - 0x54]
movzx eax, word [ecx]
cmp eax, 0x2c
je 0x410e25
cmp eax, 0x2a
je 0x410e2b
cmp ebx, dword [ebp - 8]
jle 0x4110e7
mov dword [ebp - 8], ebx
jmp 0x410cdf
add ecx, 2
mov dword [ebp - 4], ecx
movzx eax, word [ecx]
mov edx, eax
test ax, ax
jne 0x410850
jmp 0x41085a
mov edi, dword [0x4397b4]
lea ebx, [eax*4]
add edi, 4
mov dword [ebp - 0x30], ebx
add edi, ebx
dec ecx
xor eax, eax
rep stosd dword es:[edi], eax
jmp 0x410b31
mov ecx, ebx
call fcn.0041173f
jmp 0x410c32
cmp dword [ebp - 0x34], eax
jne 0x410b7c
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x14]
mov eax, dword [0x4397b4]
add ecx, edx
inc edx
mov dword [eax + ecx*4], esi
jmp 0x410c0c
add ecx, 2
mov dword [ebp - 4], ecx
movzx eax, word [ecx]
mov esi, dword [ebp - 0x18]
test ax, ax
jne 0x410d40
jmp 0x410db1
movzx eax, word [esi + 2]
add esi, 2
mov ecx, eax
test ax, ax
jne 0x410b54
jmp 0x410b67
mov ecx, edi
call fcn.0040cb50
jmp 0x410c53
push 0
lea eax, [ebp - 4]
push eax
lea eax, [ecx + 2]
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
mov edx, eax
add esp, 0xc
test edx, edx
jle 0x4218fe
mov ecx, dword [ebp - 4]
jmp 0x410d78
cmp edx, 1
jle 0x410a71
cmp word [esi + edx*2 - 2], cx
jne 0x410a71
add esi, 2
sub edx, 2
xor eax, eax
mov dword [ebp - 0x10], esi
push 0x4026b8
push esi
mov dword [ebp - 0x28], 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 0x4219dd
push eax
xor esi, esi
xor edi, edi
xor ebx, ebx
call dword [sym.imp.msvcrt.dll_feof]
add esp, 4
test eax, eax
jne 0x410f3b
jmp 0x410ee0
push dword [ebp - 0x18]
call dword [sym.imp.msvcrt.dll_ferror]
add esp, 4
test eax, eax
jne 0x410f3b
mov eax, esi
sub eax, edi
cmp eax, 0x200
jae 0x410f1a
add esi, 0x100
test ebx, ebx
jne 0x411105
mov ecx, esi
call fcn.0040cbc0
mov ebx, eax
test ebx, ebx
je 0x4219ab
push dword [ebp - 0x18]
mov eax, esi
mov byte [ebx + edi], 0
sub eax, edi
lea ecx, [ebx + edi]
push eax
push ecx
call dword [sym.imp.msvcrt.dll_fgets]
add esp, 0xc
test eax, eax
jne 0x4110a9
push dword [ebp - 0x18]
call dword [sym.imp.msvcrt.dll__pclose]
add esp, 4
lea edx, [edi*2 + 4]
mov ecx, ebx
call fcn.0040cc10
mov dword [ebp - 0xc], eax
test eax, eax
je 0x421968
mov ebx, eax
cmp dword [0x4397b8], 0
je 0x4219c1
cmp dword [0x4397b4], 0
je 0x4219c1
test ebx, ebx
je 0x4219c1
push edi
lea eax, [ebx + edi]
push ebx
push eax
call sub.msvcrt.dll_memmove
add esp, 0xc
mov dword [ebp - 0x20], edi
mov ecx, dword [0x435618]
lea esi, [edi + ebx]
call fcn.0040d13e
test eax, eax
je 0x421983
mov eax, 1
push edi
push ebx
push edi
push esi
push eax
push ecx
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_MultiByteToWideChar]
mov edi, dword [ebp - 0xc]
mov dword [ebp - 4], edi
lea eax, [edi + eax*2]
mov dword [ebp - 0x3c], eax
cmp eax, edi
je 0x411096
cmp word [eax - 2], 0xa
jne 0x411096
xor ecx, ecx
mov word [eax], cx
jmp 0x410ab0
push 0
xor edx, edx
mov ecx, esi
call fcn.0040ab20
mov esi, eax
mov dword [ebp - 0x10], esi
movzx edx, word [esi]
jmp 0x4109fa
cmp eax, 0x22
je 0x411161
push 0
push 0
push 3
push 0
push 5
push 0x80000000
push esi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x421a09
push 2
push 0
push 0
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
push 0
push 0
push 0
push ebx
mov edi, eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
lea ecx, [edi*2 + 4]
call fcn.0040cbc0
mov dword [ebp - 0xc], eax
test eax, eax
je 0x4219f8
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_1_0.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 0x421979
mov eax, dword [ebp - 0x20]
cmp eax, edi
jne 0x421994
mov ebx, dword [ebp - 0xc]
jmp 0x410f95
mov ecx, 0xa
mov word [eax], cx
add eax, 2
mov dword [ebp - 0x3c], eax
jmp 0x410fdb
mov edi, ebx
lea ecx, [edi + 1]
mov edi, edi
mov al, byte [edi]
inc edi
test al, al
jne 0x4110b0
push dword [ebp - 0x18]
sub edi, ecx
call dword [sym.imp.msvcrt.dll_feof]
add esp, 4
test eax, eax
je 0x410ee0
jmp 0x410f3b
mov ecx, dword [ebp - 4]
movzx eax, word [ecx + 8]
add ecx, 0xa
mov dword [ebp - 0x44], eax
mov dword [ebp - 4], ecx
jmp 0x410cdf
mov ebx, dword [ebp - 8]
jmp 0x410cdf
mov ecx, dword [ebp - 4]
mov edi, 1
add ecx, 0x10
mov dword [ebp - 0x10], edi
mov dword [ebp - 4], ecx
jmp 0x410cdf
mov edx, esi
mov ecx, ebx
call fcn.0040cc10
test eax, eax
je 0x4219a4
mov ebx, eax
jmp 0x410f1a
add ecx, 2
inc ebx
mov dword [ebp - 4], ecx
mov dword [ebp - 0x48], ebx
jmp 0x410db1
dec eax
mov dword [ebp - 0x54], eax
jmp 0x410c3c
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 - 0x40], eax
test eax, eax
jle 0x4218fe
mov ecx, dword [ebp - 4]
jmp 0x410cdf
add esi, 2
dec edx
mov dword [ebp - 0x10], esi
mov eax, esi
mov dword [ebp - 0x28], edx
mov ecx, esi
cmp word [esi], di
je 0x41117e
mov ecx, eax
add eax, 2
cmp word [eax], di
jne 0x411174
mov dword [ebp - 4], ecx
cmp word [ecx], 0x22
jne 0x411006
jmp 0x411190
xor eax, eax
mov word [ecx], ax
mov ecx, dword [ebp - 4]
sub ecx, 2
mov dword [ebp - 4], ecx
cmp ecx, esi
jb 0x411006
cmp word [ecx], 0x20
jne 0x411006
jmp 0x411190
cmp edx, 0x27
je 0x41082b
xor esi, esi
mov dword [ebp - 0x18], esi
jmp 0x410840
mov ecx, dword [ebp - 4]
mov edi, 1
add ecx, 0xe
mov dword [ebp - 0x10], edi
mov dword [ebp - 4], ecx
jmp 0x410cdf
push dword [ebp - 4]
push 1
push 0x234a
call fcn.004128ff
add esp, 0xc
mov eax, 1
jmp 0x410c97
push 0
push 0x2374
call fcn.004128ff
add esp, 8
call fcn.0042ce7c
push 1
push 0x443a98
call dword [sym.imp.msvcrt.dll_longjmp]
mov eax, dword [0x44c1c0]
mov dword [0x4397b8], eax
mov eax, dword [0x44c1bc]
mov dword [0x4397b0], 0
mov dword [0x4397b4], eax
jmp 0x410a2a
call fcn.0042ce09
jmp 0x410a37
mov ecx, ebx
call fcn.0040cb50
xor ebx, ebx
mov dword [ebp - 0xc], ebx
jmp 0x410f62
xor eax, eax
mov dword [ebp - 0x20], eax
jmp 0x411086
xor eax, eax
jmp 0x410fb0
call fcn.0042ce09
jmp 0x410ada
mov edi, dword [ebp - 0xc]
jmp 0x410e56
mov ebx, dword [ebp - 0x60]
jmp 0x410a10
mov ecx, ebx
call fcn.0040cb50
push dword [ebp - 0x18]
call dword [sym.imp.msvcrt.dll__pclose]
add esp, 4
mov eax, 8
jmp 0x410c97
push dword [ebp - 0x10]
push 1
push 0x2374
call fcn.004128ff
add esp, 0xc
mov eax, 8
jmp 0x410c97
push esi
push 1
push 0x2331
call fcn.004128ff
add esp, 0xc
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
jmp 0x410c97
push ebx
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
mov eax, 8
jmp 0x410c97
push esi
push 1
push 0x2363
call fcn.004128ff
add esp, 0xc
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
jmp 0x410c97