Function at 0x40a770
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x4038
call fcn.0041afa0
push ebx
push ebp
mov ebp, ecx
push esi
mov ecx, dword [esp + 0x4048]
mov esi, 1
mov eax, dword [ebp + 0x4e8]
push edi
mov dword [esp + 0x18], esi
mov ebx, dword [eax + ecx*4]
mov eax, dword [ebp + 0x168]
test eax, eax
mov edx, dword [ebx + 0x20]
mov edi, dword [ebx + 0x24]
mov dword [esp + 0x40], edx
jne 0x40a7bb
mov eax, dword [ebp + 0x16c]
test eax, eax
jne 0x40a7bb
xor eax, eax
jmp 0x40a7c7
mov eax, dword [ebx + 0x28]
neg eax
sbb eax, eax
and al, 0xfb
add eax, 6
xor edx, edx
cmp eax, 6
sete dl
mov dword [esp + 0x14], eax
mov eax, edx
mov edx, dword [ebx + 0x28]
mov dword [esp + 0x3c], eax
test dh, 4
je 0x40a7f3
mov edx, dword [ebp + 0xec]
test dh, 0x20
jne 0x40a7f3
mov edx, 1
jmp 0x40a7f5
xor edx, edx
test eax, eax
mov dword [esp + 0x20], edx
mov dword [esp + 0x10], 0
lea eax, [ebp + 0x3d0]
jne 0x40a811
lea eax, [ebp + 0x3cc]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x4050]
inc ecx
mov dword [eax], ecx
mov ecx, dword [esp + 0x40]
or ecx, edi
jne 0x40a82b
test edx, edx
je 0x40a837
test dword [ebp + 0xec], 0x10000000
je 0x40a878
mov edx, dword [esp + 0x14]
push ebx
push 0
push edx
mov ecx, ebp
call fcn.0040d340
mov ecx, dword [esp + 0x14]
mov esi, eax
mov eax, 1
mov dword [esp + 0x18], esi
cmp ecx, eax
mov dword [esp + 0x10], eax
jne 0x40a869
test dword [ebp + 0xec], 0x10000000
je 0x40a878
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4038
ret 0xc
mov eax, dword [ebx + 0x2c]
cmp eax, 0xffffffff
jne 0x40a95d
cmp dword [esp + 0x14], 6
je 0x40a8a9
test edi, edi
jl 0x40a8a9
jg 0x40a899
mov eax, dword [esp + 0x40]
test eax, eax
jbe 0x40a8a9
mov eax, dword [ebx + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esp + 0x1c]
inc dword [eax]
mov ecx, dword [esp + 0x3c]
xor eax, eax
mov dword [ebx + 0x20], eax
cmp ecx, eax
mov dword [ebx + 0x24], eax
je 0x40a8cc
test dword [ebp + 0xec], 0x40000000
je 0x40a910
mov esi, 0x404710
jmp 0x40a8d1
mov esi, 0x4047b0
mov ecx, dword [esp + 0x4054]
mov edx, dword [esp + 0x404c]
mov eax, dword [ebp + 0x13c]
push ecx
push edx
push eax
mov ecx, ebp
call fcn.0040a6b0
mov ecx, dword [ebp + 0x150]
mov edx, dword [0x41b3f0]
imul edx, ecx
add edx, eax
push 1
push edx
push esi
mov ecx, ebp
call fcn.0040da40
cmp eax, 2
jne 0x40a932
test byte [ebp + 0xec], 1
je 0x40a932
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40a93a
mov eax, dword [esp + 0x14]
push ebx
push 0
push eax
mov ecx, ebp
call fcn.0040d340
jmp 0x40a93a
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40a94e
cmp dword [esp + 0x14], 1
jne 0x40a94e
push 0
push 0
push 7
mov ecx, ebp
call fcn.0040d340
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x4038
ret 0xc
mov ecx, dword [esp + 0x20]
test ecx, ecx
je 0x40aa34
lea ecx, [esp + 0x48]
push 0x4000
push ecx
push eax
call fcn.0041ae80
add esp, 0xc
mov dword [ebx + 0x60], eax
test eax, eax
jle 0x40a9e0
mov ecx, dword [ebx + 4]
lea edx, [esp + 0x2c]
push edx
mov edx, dword [ebx]
push ecx
push edx
cdq
push edx
push eax
mov eax, dword [ebx + 0x40]
mov ecx, ebp
add eax, 0x18
push eax
call fcn.0040d2c0
test eax, eax
je 0x40a9e0
mov ecx, dword [ebx + 0x60]
mov edi, dword [esp + 0x2c]
mov edx, ecx
lea esi, [esp + 0x48]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x2c]
and ecx, 3
push ebx
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x18]
push eax
push ecx
mov ecx, ebp
call fcn.0040d340
mov esi, dword [esp + 0x18]
mov dword [esp + 0x10], 1
jmp 0x40ac8a
mov edx, dword [esp + 0x4054]
mov eax, dword [esp + 0x404c]
mov ecx, dword [ebp + 0x13c]
push edx
push eax
push ecx
mov ecx, ebp
call fcn.0040a6b0
mov edx, dword [ebp + 0x150]
push 1
imul edx, dword [0x41b3f0]
add edx, eax
mov ecx, ebp
push edx
push 0x404798
call fcn.0040da40
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebp
mov ecx, dword [eax]
pop ebx
inc ecx
mov dword [eax], ecx
xor eax, eax
add esp, 0x4038
ret 0xc
push 0
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x40]
test edi, edi
mov dword [esp + 0x20], eax
jl 0x40ac8a
jg 0x40aa5b
test eax, eax
jbe 0x40ac8a
mov dword [esp + 0x28], 0
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40aa6f
xor eax, eax
jmp 0x40aa72
mov eax, dword [ebx + 0x40]
mov edx, dword [ebx + 4]
lea ecx, [esp + 0x2c]
push ecx
mov ecx, dword [ebx]
push edx
mov edx, dword [esp + 0x28]
push ecx
push edi
add eax, 0x18
push edx
push eax
mov ecx, ebp
call fcn.0040d2c0
test eax, eax
je 0x40abc9
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
lea eax, [esp + 0x28]
push 0
push eax
mov eax, dword [ebx + 0x2c]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
test esi, esi
jne 0x40ab02
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x57
je 0x40aad3
cmp dword [ebp + 0x24c], 0x800
jge 0x40abc9
mov eax, dword [ebp + 0x244]
cmp eax, 0x800
jg 0x40aae5
mov eax, 0x800
mov ecx, dword [ebp + 0x248]
mov dword [ebp + 0x244], eax
cmp eax, ecx
jg 0x40aaf7
mov eax, ecx
mov dword [ebp + 0x24c], eax
jmp 0x40aa63
mov ecx, dword [esp + 0x28]
mov eax, dword [esp + 0x30]
cmp ecx, eax
je 0x40ab24
xor eax, eax
cmp eax, edi
jl 0x40abc9
jg 0x40ab24
cmp ecx, dword [esp + 0x20]
jb 0x40abc9
mov edx, dword [ebp + 0x388]
mov eax, dword [esp + 0x10]
add edx, ecx
mov dword [ebp + 0x388], edx
mov ecx, dword [ebp + 0x38c]
adc ecx, 0
test eax, eax
mov dword [ebp + 0x38c], ecx
mov eax, 2
jne 0x40ab52
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x2c]
neg ecx
sbb ecx, ecx
not ecx
and ecx, ebx
push ecx
push edx
push eax
mov ecx, ebp
call fcn.0040d340
mov dword [esp + 0x10], 1
mov eax, dword [ebp + 0x3f4]
test eax, eax
je 0x40ab9b
xor eax, eax
cmp edi, eax
jl 0x40ab9b
jg 0x40ab92
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x28]
cmp eax, ecx
jbe 0x40ab9b
push 0
mov ecx, ebp
call fcn.0040de60
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x20]
sub edx, ecx
sbb edi, 0
mov dword [esp + 0x20], edx
test edi, edi
jg 0x40aa5b
jl 0x40ac8a
mov eax, edx
test eax, eax
ja 0x40aa5b
jmp 0x40ac8a
mov eax, dword [esp + 0x1c]
xor esi, esi
mov ecx, dword [eax]
inc ecx
mov dword [eax], ecx
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x40abef
test dword [ebp + 0xec], 0x40000000
je 0x40ac33
mov edi, 0x404784
jmp 0x40abf4
mov edi, 0x404778
mov edx, dword [esp + 0x4054]
mov eax, dword [esp + 0x404c]
mov ecx, dword [ebp + 0x13c]
push edx
push eax
push ecx
mov ecx, ebp
call fcn.0040a6b0
mov ecx, dword [ebp + 0x150]
mov edx, dword [0x41b3f0]
imul edx, ecx
add edx, eax
push 1
push edx
push edi
mov ecx, ebp
call fcn.0040da40
cmp eax, 2
jne 0x40ac8a
xor eax, eax
mov dword [ebx + 0x20], eax
mov dword [ebx + 0x24], eax
mov cl, byte [ebp + 0xec]
mov dword [esp + 0x30], eax
test cl, 1
mov ecx, dword [esp + 0x10]
jne 0x40ac59
cmp ecx, eax
je 0x40ac8a
mov eax, 3
jmp 0x40ac68
cmp ecx, eax
je 0x40ac64
mov eax, 3
jmp 0x40ac68
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x2c]
neg ecx
sbb ecx, ecx
not ecx
and ecx, ebx
push ecx
push edx
push eax
mov ecx, ebp
call fcn.0040d340
mov dword [esp + 0x10], 1
cmp dword [esp + 0x14], 1
jne 0x40add1
test esi, esi
je 0x40adb2
mov edi, dword [esp + 0x4050]
mov eax, dword [ebp + 0x3f8]
test eax, eax
jne 0x40ace6
mov eax, dword [edi]
mov ecx, dword [ebp + 0x4ec]
cmp eax, ecx
jge 0x40ace6
mov ecx, dword [ebp + 0x4e8]
mov edx, dword [ecx + eax*4]
mov ecx, dword [edx + 0x28]
test ecx, ecx
jne 0x40ace6
mov ecx, dword [esp + 0x4054]
push ecx
push edi
push eax
mov ecx, ebp
call fcn.0040a770
mov esi, eax
test esi, esi
jne 0x40aca4
jmp 0x40adb2
test esi, esi
je 0x40adb2
mov eax, dword [ebx + 0x4c]
test eax, eax
je 0x40ad50
mov eax, dword [ebx + 4]
mov ecx, dword [ebx]
lea edx, [esp + 0x2c]
push edx
push eax
mov eax, dword [ebx + 0x50]
push ecx
cdq
push edx
mov edx, dword [ebx + 0x40]
add edx, 0x18
push eax
push edx
mov ecx, ebp
call fcn.0040d2c0
mov esi, eax
test esi, esi
mov dword [esp + 0x18], esi
je 0x40adb2
mov ecx, dword [ebx + 0x50]
mov esi, dword [ebx + 0x4c]
mov edi, dword [esp + 0x2c]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x30]
push ecx
push 4
mov ecx, ebp
call fcn.0040d340
mov dword [esp + 0x18], eax
mov esi, eax
test esi, esi
je 0x40adb2
mov eax, dword [ebx + 0x54]
test eax, eax
je 0x40adb2
mov eax, dword [ebx + 4]
mov ecx, dword [ebx]
lea edx, [esp + 0x2c]
push edx
push eax
mov eax, dword [ebx + 0x58]
push ecx
cdq
push edx
mov edx, dword [ebx + 0x40]
add edx, 0x18
push eax
push edx
mov ecx, ebp
call fcn.0040d2c0
mov esi, eax
test esi, esi
mov dword [esp + 0x18], esi
je 0x40adb2
mov ecx, dword [ebx + 0x58]
mov esi, dword [ebx + 0x54]
mov edi, dword [esp + 0x2c]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x30]
push ecx
push 5
mov ecx, ebp
call fcn.0040d340
mov dword [esp + 0x18], eax
mov esi, eax
mov eax, dword [ebp + 0x3f8]
test eax, eax
jne 0x40add1
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40add1
push 0
push 0
push 7
mov ecx, ebp
call fcn.0040d340
test esi, esi
je 0x40a94e
mov eax, dword [ebp + 0x3f8]
test eax, eax
jne 0x40a94e
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x4038
ret 0xc