Function at 0x40c504
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov ecx, 6
push 0
push 0
dec ecx
jne 0x40c50c
push ebx
push esi
push edi
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00403a84
mov edi, 0x41dcb4
xor eax, eax
push ebp
push 0x40d25a
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, 0x41db54
mov edx, 0x40d270
call fcn.00403770
call fcn.00408b38
mov eax, dword [ebp - 8]
call fcn.0040371c
xor ebx, ebx
mov eax, 0x41db54
mov edx, 0x40d2a8
call fcn.00403770
mov eax, dword [ebp - 4]
call fcn.00403894
cmp eax, 0x7f
jge 0x40c59b
push 0
push 0x41dc28
mov eax, dword [ebp - 4]
call fcn.00403a94
push eax
call sub.kernel32.dll_OpenFile
mov dword [0x41dbd4], eax
cmp dword [0x41dbd4], 0xffffffff
jne 0x40c5ce
mov ebx, 1
jmp 0x40c5ce
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
mov eax, dword [ebp - 4]
call fcn.00403a94
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [0x41dbd4], eax
cmp dword [0x41dbd4], 0xffffffff
jne 0x40c5ce
mov ebx, 2
test ebx, ebx
jbe 0x40c641
mov eax, 0x41db54
mov edx, 0x40d370
call fcn.00403770
call sub.kernel32.dll_GetLastError_1
mov ebx, eax
mov eax, ebx
cmp eax, 0xcf
ja 0x40c5f8
bt dword [0x40d398], eax
jb 0x40c631
cmp ebx, 0x4cf
je 0x40c631
push 0x40d3bc
push dword [ebp - 4]
push 0x40d3cc
lea edx, [ebp - 0x10]
mov eax, ebx
call fcn.004062c0
push dword [ebp - 0x10]
lea eax, [ebp - 0xc]
mov edx, 4
call fcn.00403954
mov eax, dword [ebp - 0xc]
call fcn.0041a4a8
mov eax, dword [0x41dbd4]
push eax
call sub.kernel32.dll_CloseHandle_1
jmp 0x40d237
mov eax, 0x41dc04
call fcn.0040371c
mov eax, 0x41dc08
call fcn.0040371c
mov eax, 0x41dc0c
call fcn.0040371c
xor eax, eax
mov dword [0x41dbf8], eax
xor eax, eax
mov dword [0x41dbfc], eax
mov eax, 0x41db54
mov edx, 0x40d3d8
call fcn.00403770
xor eax, eax
mov dword [0x41dc00], eax
xor eax, eax
mov dword [0x41dbf4], eax
mov eax, 0x41dc10
mov edx, 0x12
call fcn.00403bc4
mov eax, 0x41dc14
mov edx, 0x20
call fcn.00403bc4
mov eax, 0x41dc18
mov edx, 0x1a
call fcn.00403bc4
mov eax, 0x41dc1c
mov edx, 0x2f
call fcn.00403bc4
mov eax, 0x41dc20
mov edx, 0x12
call fcn.00403bc4
mov eax, 0x41db54
mov edx, 0x40d45c
call fcn.00403770
mov eax, 0x41dc24
mov edx, 0x20
call fcn.00403bc4
mov eax, dword [edi]
mov byte [eax], 0
jmp 0x40d14a
cmp dword [0x41dbd8], 0x32
jb 0x40d176
cmp dword [0x41dbd8], 0x100000
jae 0x40c723
mov eax, dword [edi]
mov edx, dword [0x41dbd8]
mov byte [eax + edx + 1], 0
mov byte [0x41dcb0], 0
mov byte [0x41dcb1], 0
mov byte [0x41dcb2], 0
mov esi, dword [0x41dbd8]
test esi, esi
jbe 0x40d13f
mov ebx, 1
cmp byte [0x41dcb2], 0
jne 0x40c76b
mov eax, dword [edi]
cmp byte [eax + ebx], 8
jne 0x40c931
inc byte [0x41dcb2]
jmp 0x40c931
cmp byte [0x41dcb2], 1
jne 0x40c7b2
mov eax, dword [edi]
mov al, byte [eax + ebx]
mov edx, eax
and dl, 0xf
cmp dl, 9
jne 0x40c7a6
and eax, 0xff
shr eax, 4
cmp eax, 0xff
ja 0x40c799
bt dword [0x41c260], eax
jae 0x40c7a6
inc byte [0x41dcb2]
jmp 0x40c931
mov byte [0x41dcb2], 0
jmp 0x40c931
cmp byte [0x41dcb2], 1
jbe 0x40c7f2
cmp byte [0x41dcb2], 9
jae 0x40c7f2
mov eax, dword [edi]
mov al, byte [eax + ebx]
xor edx, edx
mov dl, al
shr edx, 4
cmp edx, 0xa
jae 0x40c7e6
and al, 0xf
cmp al, 0xa
jae 0x40c7e6
inc byte [0x41dcb2]
jmp 0x40c931
mov byte [0x41dcb2], 0
jmp 0x40c931
mov al, byte [0x41dcb2]
add al, 0xf7
sub al, 7
jae 0x40c81c
mov eax, dword [edi]
cmp byte [eax + ebx], 0
jne 0x40c810
inc byte [0x41dcb2]
jmp 0x40c931
mov byte [0x41dcb2], 0
jmp 0x40c931
cmp byte [0x41dcb2], 0x10
jne 0x40c931
mov eax, 0x41db54
mov edx, 0x40d4e0
call fcn.00403770
mov eax, dword [0x41dc20]
call fcn.00403a94
mov edx, eax
xor eax, eax
mov al, byte [0x41dcb2]
mov ecx, ebx
sub ecx, eax
mov eax, dword [edi]
add eax, ecx
mov ecx, 9
call fcn.00406550
mov eax, dword [0x41dc20]
call fcn.004064ec
test al, al
je 0x40c92a
mov eax, dword [0x41dc24]
call fcn.00403a94
mov edx, eax
mov eax, dword [edi]
add eax, ebx
mov ecx, 0x10
call fcn.00406550
mov eax, dword [0x41dc24]
call fcn.004064ec
test al, al
je 0x40c92a
mov edx, dword [0x41dc0c]
mov eax, dword [0x41dc24]
call fcn.00403b7c
test eax, eax
jne 0x40c92a
push dword [0x41dc0c]
push 0x40d3cc
push 0x40d558
mov eax, dword [0x41dbf4]
add eax, ebx
xor edx, edx
mov dl, byte [0x41dcb2]
sub eax, edx
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x14]
call fcn.00405358
push dword [ebp - 0x14]
push 0x40d568
push dword [0x41dc20]
push 0x40d574
push 0x40d580
mov eax, dword [0x41dbf4]
add eax, ebx
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x18]
call fcn.00405358
push dword [ebp - 0x18]
push 0x40d568
push dword [0x41dc24]
mov eax, 0x41dc0c
mov edx, 0xb
call fcn.00403954
inc dword [0x41dc00]
mov byte [0x41dcb2], 0
cmp byte [0x41dcb0], 0
jne 0x40c951
mov eax, dword [edi]
cmp byte [eax + ebx], 0x30
jne 0x40cce7
inc byte [0x41dcb0]
jmp 0x40cce7
cmp byte [0x41dcb0], 1
jne 0x40c996
mov eax, dword [edi]
cmp byte [eax + ebx], 0x38
jne 0x40c974
inc byte [0x41dcb0]
mov byte [0x41dcb1], 2
jmp 0x40d137
mov byte [0x41dcb0], 0
mov byte [0x41dcb1], 0
mov eax, 0x41db54
mov edx, 0x40d590
call fcn.00403770
jmp 0x40cce7
cmp byte [0x41dcb0], 2
jne 0x40c9dd
mov eax, dword [edi]
mov al, byte [eax + ebx]
and eax, 0xff
bt dword [0x41c240], eax
jae 0x40c9d1
mov eax, dword [edi]
mov al, byte [eax + ebx - 3]
and eax, 0xff
bt dword [0x41c220], eax
jae 0x40c9d1
inc byte [0x41dcb0]
jmp 0x40cce7
mov byte [0x41dcb0], 0
jmp 0x40cce7
cmp byte [0x41dcb0], 3
jne 0x40ca05
mov eax, dword [edi]
cmp byte [eax + ebx], 0x39
jne 0x40c9f9
inc byte [0x41dcb0]
jmp 0x40cce7
mov byte [0x41dcb0], 0
jmp 0x40cce7
cmp byte [0x41dcb0], 3
jbe 0x40ca41
cmp byte [0x41dcb0], 0x11
jae 0x40ca41
mov eax, dword [edi]
mov al, byte [eax + ebx]
and eax, 0xff
bt dword [0x41c1e0], eax
jae 0x40ca35
inc byte [0x41dcb0]
jmp 0x40cce7
mov byte [0x41dcb0], 0
jmp 0x40cce7
cmp byte [0x41dcb0], 0x11
jne 0x40cce7
mov eax, dword [edi]
mov al, byte [eax + ebx]
and eax, 0xff
bt dword [0x41c1e0], eax
jae 0x40cce7
mov eax, dword [edi]
mov al, byte [eax + ebx + 1]
and eax, 0xff
bt dword [0x41c220], eax
jae 0x40cce7
xor eax, eax
mov al, byte [0x41dcb0]
mov edx, ebx
sub edx, eax
mov dword [0x41dbdc], edx
mov byte [0x41dcb0], 0
mov eax, 0x41dc10
call fcn.00403aec
mov edx, dword [edi]
mov ecx, dword [0x41dbdc]
add edx, ecx
mov ecx, 0x12
call fcn.0040492c
mov eax, dword [0x41dc10]
call fcn.004064ec
test al, al
je 0x40cce7
push dword [0x41dc04]
push 0x40d3cc
push 0x40d650
mov eax, dword [0x41dbf4]
add eax, dword [0x41dbdc]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x1c]
call fcn.00405358
push dword [ebp - 0x1c]
push 0x40d568
push dword [0x41dc10]
mov eax, 0x41dc04
mov edx, 6
call fcn.00403954
cmp dword [0x41dbdc], 0xc8
jbe 0x40cb26
mov eax, dword [0x41dbdc]
sub eax, 0xc8
mov dword [0x41dbe4], eax
jmp 0x40cb30
mov dword [0x41dbe4], 1
mov eax, dword [0x41dbdc]
add eax, 0xc8
mov dword [0x41dbec], eax
mov eax, dword [0x41dbec]
add eax, 0x20
cmp eax, dword [0x41dbd8]
jbe 0x40cb59
mov eax, dword [0x41dbd8]
mov dword [0x41dbec], eax
mov eax, dword [0x41dbe4]
cmp eax, dword [0x41dbec]
ja 0x40cce0
mov eax, dword [0x41dbe4]
cmp eax, dword [0x41dbdc]
jbe 0x40cb85
cmp ebx, dword [0x41dbe4]
jbe 0x40cb85
mov dword [0x41dbe4], ebx
cmp byte [0x41dcb0], 0x1f
jae 0x40cbbe
mov eax, dword [edi]
mov edx, dword [0x41dbe4]
mov al, byte [eax + edx]
and eax, 0xff
bt dword [0x41c200], eax
jae 0x40cbb2
inc byte [0x41dcb0]
jmp 0x40ccc9
mov byte [0x41dcb0], 0
jmp 0x40ccc9
cmp byte [0x41dcb0], 0x1f
jne 0x40ccc9
mov eax, dword [edi]
mov edx, dword [0x41dbe4]
mov al, byte [eax + edx]
and eax, 0xff
bt dword [0x41c200], eax
jae 0x40ccc2
mov eax, dword [edi]
mov edx, dword [0x41dbe4]
mov al, byte [eax + edx + 1]
and eax, 0xff
bt dword [0x41c220], eax
jae 0x40ccc2
mov eax, dword [edi]
mov edx, dword [0x41dbe4]
mov al, byte [eax + edx - 0x20]
and eax, 0xff
bt dword [0x41c220], eax
jae 0x40ccc2
mov eax, 0x41dc14
call fcn.00403aec
xor edx, edx
mov dl, byte [0x41dcb0]
mov ecx, dword [0x41dbe4]
sub ecx, edx
mov edx, dword [edi]
add edx, ecx
mov ecx, 0x20
call fcn.0040492c
mov eax, dword [0x41dc14]
call fcn.004064ec
test al, al
je 0x40ccc2
mov edx, dword [0x41dc04]
mov eax, dword [0x41dc14]
call fcn.00403b7c
test eax, eax
jne 0x40ccc2
push dword [0x41dc04]
push 0x40d574
push 0x40d660
mov eax, dword [0x41dbf4]
add eax, dword [0x41dbe4]
xor edx, edx
mov dl, byte [0x41dcb0]
sub eax, edx
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x20]
call fcn.00405358
push dword [ebp - 0x20]
push 0x40d568
push dword [0x41dc14]
mov eax, 0x41dc04
mov edx, 6
call fcn.00403954
inc dword [0x41dbf8]
mov byte [0x41dcb0], 0
inc dword [0x41dbe4]
mov eax, dword [0x41dbe4]
cmp eax, dword [0x41dbec]
jbe 0x40cb6a
mov byte [0x41dcb0], 0
cmp byte [0x41dcb1], 1
jbe 0x40d137
cmp byte [0x41dcb1], 2
jne 0x40cd1c
mov eax, dword [edi]
cmp byte [eax + ebx], 0x20
jne 0x40cd10
inc byte [0x41dcb1]
jmp 0x40d137
mov byte [0x41dcb1], 0
jmp 0x40d137
cmp byte [0x41dcb1], 3
jne 0x40cd4f
mov eax, dword [edi]
mov al, byte [eax + ebx]
and eax, 0xff
bt dword [0x41c240], eax
jae 0x40cd43
inc byte [0x41dcb1]
jmp 0x40d137
mov byte [0x41dcb1], 0
jmp 0x40d137
cmp byte [0x41dcb1], 4
jne 0x40cd77
mov eax, dword [edi]
cmp byte [eax + ebx], 0x39
jne 0x40cd6b
inc byte [0x41dcb1]
jmp 0x40d137
mov byte [0x41dcb1], 0
jmp 0x40d137
mov al, byte [0x41dcb1]
cmp al, 0x1f
ja 0x40cd8a
and eax, 0x7f
bt dword [0x40d664], eax
jae 0x40cdab
mov eax, dword [edi]
cmp byte [eax + ebx], 0x20
jne 0x40cd9f
inc byte [0x41dcb1]
jmp 0x40d137
mov byte [0x41dcb1], 0
jmp 0x40d137
mov al, byte [0x41dcb1]
cmp al, 0x1f
ja 0x40cdbe
and eax, 0x7f
bt dword [0x40d668], eax
jae 0x40cdea
mov eax, dword [edi]
mov al, byte [eax + ebx]
and eax, 0xff
bt dword [0x41c1e0], eax
jae 0x40cdde
inc byte [0x41dcb1]
jmp 0x40d137
mov byte [0x41dcb1], 0
jmp 0x40d137
cmp byte [0x41dcb1], 0x19
jne 0x40d137
mov eax, dword [edi]
mov al, byte [eax + ebx]
and eax, 0xff
bt dword [0x41c1e0], eax
jae 0x40d137
mov eax, dword [edi]
mov al, byte [eax + ebx + 1]
and eax, 0xff
bt dword [0x41c220], eax
jae 0x40d137
mov eax, dword [edi]
mov al, byte [eax + ebx - 0x1a]
and eax, 0xff
bt dword [0x41c220], eax
jae 0x40d137
xor eax, eax
mov al, byte [0x41dcb1]
mov edx, ebx
sub edx, eax
mov dword [0x41dbe0], edx
mov byte [0x41dcb1], 0
mov eax, dword [edi]
mov edx, dword [0x41dbe0]
lea edx, [eax + edx]
mov eax, 0x41dc18
mov ecx, 0x1a
call fcn.0040380c
lea edx, [ebp - 0x24]
mov eax, dword [0x41dc18]
call fcn.00406464
mov edx, dword [ebp - 0x24]
mov eax, 0x41dc18
call fcn.00403770
mov eax, dword [0x41dc18]
call fcn.004064ec
test al, al
je 0x40d137
push dword [0x41dc08]
push 0x40d3cc
push 0x40d674
mov eax, dword [0x41dbf4]
add eax, dword [0x41dbe0]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x28]
call fcn.00405358
push dword [ebp - 0x28]
push 0x40d568
push dword [0x41dc18]
mov eax, 0x41dc08
mov edx, 6
call fcn.00403954
cmp dword [0x41dbe0], 0xc8
jbe 0x40cefd
mov eax, dword [0x41dbe0]
sub eax, 0xc8
mov dword [0x41dbe8], eax
jmp 0x40cf07
mov dword [0x41dbe8], 1
mov eax, dword [0x41dbe0]
add eax, 0xc8
mov dword [0x41dbf0], eax
mov eax, dword [0x41dbf0]
add eax, 0x2f
cmp eax, dword [0x41dbd8]
jbe 0x40cf30
mov eax, dword [0x41dbd8]
mov dword [0x41dbf0], eax
mov eax, dword [0x41dbe8]
cmp eax, dword [0x41dbf0]
ja 0x40d130
mov eax, 0x41db54
mov edx, 0x40d684
call fcn.00403770
mov eax, dword [0x41dbe8]
cmp eax, dword [0x41dbe0]
jbe 0x40cf6b
cmp ebx, dword [0x41dbe8]
jbe 0x40cf6b
mov dword [0x41dbe8], ebx
mov al, byte [0x41dcb1]
cmp al, 0x2f
ja 0x40cf7e
and eax, 0x7f
bt dword [0x40d6d4], eax
jae 0x40cfb0
mov eax, dword [edi]
mov edx, dword [0x41dbe8]
mov al, byte [eax + edx]
and eax, 0xff
bt dword [0x41c200], eax
jae 0x40cfa4
inc byte [0x41dcb1]
jmp 0x40d10a
mov byte [0x41dcb1], 0
jmp 0x40d10a
mov al, byte [0x41dcb1]
cmp al, 0x2f
ja 0x40cfc3
and eax, 0x7f
bt dword [0x40d6dc], eax
jae 0x40cfea
mov eax, dword [edi]
mov edx, dword [0x41dbe8]
cmp byte [eax + edx], 0x20
jne 0x40cfde
inc byte [0x41dcb1]
jmp 0x40d10a
mov byte [0x41dcb1], 0
jmp 0x40d10a
cmp byte [0x41dcb1], 0x2e
jne 0x40d10a
mov eax, dword [edi]
mov edx, dword [0x41dbe8]
mov al, byte [eax + edx]
and eax, 0xff
bt dword [0x41c200], eax
jae 0x40d103
mov eax, dword [edi]
mov edx, dword [0x41dbe8]
mov al, byte [eax + edx + 1]
and eax, 0xff
bt dword [0x41c220], eax
jae 0x40d103
mov eax, dword [edi]
mov edx, dword [0x41dbe8]
mov al, byte [eax + edx - 0x2f]
and eax, 0xff
bt dword [0x41c220], eax
jae 0x40d103
xor eax, eax
mov al, byte [0x41dcb1]
mov edx, dword [0x41dbe8]
sub edx, eax
mov eax, dword [edi]
lea edx, [eax + edx]
mov eax, 0x41dc1c
mov ecx, 0x2f
call fcn.0040380c
lea edx, [ebp - 0x2c]
mov eax, dword [0x41dc1c]
call fcn.00406464
mov edx, dword [ebp - 0x2c]
mov eax, 0x41dc1c
call fcn.00403770
mov eax, dword [0x41dc1c]
call fcn.004064ec
test al, al
je 0x40d103
mov edx, dword [0x41dc08]
mov eax, dword [0x41dc1c]
call fcn.00403b7c
test eax, eax
jne 0x40d103
push dword [0x41dc08]
push 0x40d574
push 0x40d6ec
mov eax, dword [0x41dbf4]
add eax, dword [0x41dbe8]
xor edx, edx
mov dl, byte [0x41dcb1]
sub eax, edx
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x30]
call fcn.00405358
push dword [ebp - 0x30]
push 0x40d568
push dword [0x41dc1c]
mov eax, 0x41dc08
mov edx, 6
call fcn.00403954
inc dword [0x41dbfc]
mov byte [0x41dcb1], 0
inc dword [0x41dbe8]
mov eax, 0x41db54
mov edx, 0x40d6fc
call fcn.00403770
mov eax, dword [0x41dbe8]
cmp eax, dword [0x41dbf0]
jbe 0x40cf41
mov byte [0x41dcb1], 0
inc ebx
dec esi
jne 0x40c74b
mov eax, dword [0x41dbd8]
add dword [0x41dbf4], eax
push 0
push 0x41dbd8
push 0x100000
mov eax, dword [edi]
inc eax
push eax
mov eax, dword [0x41dbd4]
push eax
call sub.kernel32.dll_ReadFile_1
test eax, eax
je 0x40d176
cmp dword [0x41dbd8], 0
ja 0x40c6fd
cmp dword [0x41dbf8], 0
jbe 0x40d19c
mov eax, dword [ebp - 8]
push dword [eax]
push dword [0x41dc04]
push 0x40d3cc
mov eax, dword [ebp - 8]
mov edx, 3
call fcn.00403954
cmp dword [0x41dbfc], 0
jbe 0x40d1c2
mov eax, dword [ebp - 8]
push dword [eax]
push dword [0x41dc08]
push 0x40d3cc
mov eax, dword [ebp - 8]
mov edx, 3
call fcn.00403954
cmp dword [0x41dc00], 0
jbe 0x40d1e8
mov eax, dword [ebp - 8]
push dword [eax]
push dword [0x41dc0c]
push 0x40d3cc
mov eax, dword [ebp - 8]
mov edx, 3
call fcn.00403954
mov eax, 0x41db54
mov edx, 0x40d75c
call fcn.00403770
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00403894
cmp eax, 0xed800
jle 0x40d21d
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 8]
mov eax, dword [eax]
mov ecx, 0xed800
xor edx, edx
call fcn.00403af4
mov eax, dword [0x41dbd4]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, 0x41db54
mov edx, 0x40d780
call fcn.00403770
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40d261
lea eax, [ebp - 0x30]
mov edx, 0xa
call fcn.00403740
lea eax, [ebp - 4]
call fcn.0040371c
ret