Function at 0x440520
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x20
push ebx
mov ebx, dword [esp + 0x28]
push ebp
push esi
mov esi, ecx
mov ecx, dword [0x4a9c68]
push edi
mov dword [esp + 0x14], ecx
call fcn.00412b30
mov eax, dword [0x4a6440]
mov eax, dword [eax + 0xd8]
or ebp, 0xffffffff
and eax, 0x7fffffff
mov byte [esp + 0x12], 0
mov byte [esp + 0x1c], 0
mov dword [esp + 0x20], ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x2c], eax
mov eax, esi
mov cl, byte [eax]
cmp cl, 0x20
je 0x440573
cmp cl, 9
jne 0x440576
inc eax
jmp 0x440567
cmp byte [eax], 0x2a
jne 0x4406e2
movzx edi, byte [eax + 1]
lea esi, [eax + 1]
test edi, 0xffffff80
jne 0x4405a0
push 2
push edi
call fcn.0048633e
add esp, 8
test eax, eax
je 0x4405a0
and edi, 0xffffffdf
mov eax, edi
movsx eax, al
add eax, 0xffffffbd
cmp eax, 0x11
ja case.0x4405b8.68
movzx ecx, byte [eax + 0x440b40]
jmp dword [ecx*4 + 0x440b2c]
mov byte [esp + 0x1c], 1
jmp case.0x4405b8.68
lea edi, [esi + 1]
mov eax, edi
call fcn.0040cdb0
movzx edx, al
neg edx
sbb edx, edx
and edx, 6
add edx, 0xa
push edx
push 0
push edi
call fcn.00486c26
mov dword [esp + 0x2c], eax
mov al, byte [esi]
add esp, 0xc
mov dword [esp + 0x24], edx
test al, al
je 0x44061b
mov dl, al
lea esp, [esp]
mov ecx, 0x499ffc
mov al, 0x20
cmp dl, al
je 0x440653
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x440607
mov dl, byte [esi + 1]
inc esi
test dl, dl
jne 0x440600
mov eax, dword [0x4a6440]
cmp byte [eax + 0xe4], 0
mov dword [eax + 0x30], 0x57
jne 0x440b0e
mov eax, dword [0x4aa51c]
push 1
push 0
push ebp
push 0x499ee8
push eax
call fcn.00474ce0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
dec esi
jmp case.0x4405b8.68
lea eax, [esi + 1]
push eax
call fcn.00486386
mov dl, byte [esi]
add esp, 4
mov dword [esp + 0x2c], eax
test dl, dl
je 0x44068b
lea esp, [esp]
mov ecx, 0x499ffc
mov al, 0x20
cmp dl, al
je 0x440653
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x440677
mov dl, byte [esi + 1]
inc esi
test dl, dl
jne 0x440670
mov eax, dword [0x4a6440]
cmp byte [eax + 0xe4], 0
mov dword [eax + 0x30], 0x57
jne 0x440b0e
mov ecx, dword [0x4aa51c]
push 1
push 0
push ebp
push 0x499ee8
push ecx
call fcn.00474ce0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
mov byte [esp + 0x12], 1
cmp byte [esi], 0
je 0x440565
inc esi
cmp byte [esi], 0
je 0x440565
inc esi
jmp 0x440565
push 0
push 0x8000000
push 3
push 0
push 3
push SysReAllocString
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x44073d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x4a6440]
cmp byte [ecx + 0xe4], 0
mov dword [ecx + 0x30], eax
jne 0x440b0e
mov eax, dword [0x4aa51c]
push 1
push 0
push ebp
push 0x499ee8
push eax
call fcn.00474ce0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
mov ecx, ebp
call fcn.004730b0
mov ebx, eax
mov ecx, ebx
and ecx, edx
cmp ecx, 0xffffffff
jne 0x440779
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x4a6440]
push ebp
mov dword [edx + 0x30], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x34]
push eax
call fcn.004309b0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
mov eax, dword [esp + 0x24]
cmp edx, eax
jb 0x44078f
ja 0x440789
cmp ebx, dword [esp + 0x20]
jbe 0x44078f
mov ebx, dword [esp + 0x20]
mov edx, eax
test edx, edx
jne 0x440798
cmp ebx, 0xfffffffd
jbe 0x4407b7
mov ecx, dword [esp + 0x34]
push 0x4987f9
push 0
push str.Out_of_memory.
call fcn.0042e430
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
mov ecx, ebx
or ecx, edx
jne 0x4407f1
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4aa51c]
mov edx, dword [0x4a6440]
push 1
push 0
push 0xffffffffffffffff
push 0x498884
push eax
mov dword [edx + 0x30], 0
call fcn.00474ce0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
cmp byte [esp + 0x1c], 0
je 0x44086b
mov esi, dword [esp + 0x14]
mov al, byte [esi + 0x17]
test al, al
jne 0x440809
mov ecx, dword [esi + 0xc]
mov al, byte [ecx + 0x17]
cmp al, 2
je 0x44086b
push 0
push 1
lea edx, [ebx + 1]
push edx
push 0
push esi
mov byte [esp + 0x27], 1
call fcn.00474ce0
cmp eax, 1
jne 0x440858
cmp byte [esi + 0x17], 0
jne 0x440830
mov esi, dword [esi + 0xc]
test byte [esi + 0x15], 8
je 0x44083d
mov eax, esi
call fcn.00401150
mov al, byte [esi + 0x17]
cmp al, 1
jne 0x4408a9
test byte [esi + 0x15], 4
je 0x440851
mov eax, esi
call fcn.0042ec60
mov edi, dword [esi + 8]
test edi, edi
jne 0x4408bb
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
lea eax, [ebx + 2]
push eax
mov byte [esp + 0x17], 0
call fcn.00484fb9
mov edi, eax
add esp, 4
test edi, edi
jne 0x4408bb
mov ecx, dword [esp + 0x34]
push 0x4987f9
push eax
push str.Out_of_memory.
call fcn.0042e430
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
cmp al, 2
jne 0x4408b6
call fcn.00401000
mov edi, eax
jmp 0x440854
mov edi, 0x4ab626
push 0
lea ecx, [esp + 0x1c]
push ecx
push ebx
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
mov dword [esp + 0x20], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [0x4a6440]
push ebp
mov dword [edx + 0x30], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x440ab6
cmp byte [esp + 0x1c], 0
jne 0x440a49
mov eax, dword [esp + 0x18]
cmp eax, 3
jb 0x44092b
cmp byte [edi], 0xef
jne 0x44092b
cmp byte [edi + 1], 0xbb
jne 0x44092b
cmp byte [edi + 2], 0xbf
jne 0x44092b
mov esi, dword [esp + 0x14]
push 0xfde9
lea edx, [edi + 3]
push esi
lea ecx, [eax - 3]
call fcn.00475800
jmp 0x440956
cmp eax, 2
jb 0x44097a
cmp byte [edi], 0xff
jne 0x44097a
cmp byte [edi + 1], 0xfe
jne 0x44097a
mov cl, 1
mov ebx, edi
test cl, cl
je 0x440949
lea ebx, [edi + 2]
add eax, 0xfffffffe
mov esi, dword [esp + 0x14]
shr eax, 1
push eax
push esi
call fcn.004758d0
test eax, eax
jne 0x44095e
mov dword [esp + 0x20], eax
test edi, edi
je 0x44096b
push edi
call fcn.00484e18
add esp, 4
cmp byte [esi + 0x17], 0
jne 0x4409c3
mov ecx, dword [esp + 0x14]
mov esi, dword [ecx + 0xc]
jmp 0x4409c7
mov esi, dword [esp + 0x2c]
xor cl, cl
cmp esi, 0x4b0
je 0x44093d
test esi, esi
je 0x4409ad
call dword [sym.imp.KERNEL32.dll_GetACP]
cmp esi, eax
je 0x4409a9
mov ecx, dword [esp + 0x18]
push esi
mov esi, dword [esp + 0x18]
push esi
mov edx, edi
call fcn.00475800
jmp 0x440956
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
mov byte [eax + edi], 0
mov eax, dword [esp + 0x18]
push eax
mov eax, esi
call fcn.004753c0
jmp 0x44096b
mov esi, dword [esp + 0x14]
test byte [esi + 0x15], 8
je 0x4409d4
mov eax, esi
call fcn.00401150
mov al, byte [esi + 0x17]
cmp al, 1
jne 0x4409ed
test byte [esi + 0x15], 4
je 0x4409e8
mov eax, esi
call fcn.0042ec60
mov esi, dword [esi + 8]
jmp 0x4409ff
cmp al, 2
jne 0x4409fa
call fcn.00401000
mov esi, eax
jmp 0x4409ff
mov esi, 0x4ab626
cmp byte [esp + 0x12], 0
je 0x440ad8
mov ebx, dword [esp + 0x14]
mov eax, ebx
call fcn.00413010
push 0
push 0xffffffffffffffff
push 1
push 0x49dd50
mov dword [esp + 0x3c], eax
push 0x49d78c
push esi
lea eax, [esp + 0x44]
or ecx, 0xffffffff
call fcn.004728a0
mov edi, dword [esp + 0x44]
add esp, 0x18
mov eax, ebx
call fcn.00412fd0
jmp 0x440ad8
mov ecx, dword [esp + 0x14]
mov al, byte [ecx + 0x17]
test al, al
jne 0x440a5a
mov edx, dword [ecx + 0xc]
mov al, byte [edx + 0x17]
cmp al, 2
mov eax, dword [esp + 0x18]
jne 0x440aa5
push eax
mov ecx, edi
call fcn.00474b20
lea esi, [eax - 1]
add esp, 4
neg esi
push edi
sbb esi, esi
call fcn.00484e18
add esp, 4
inc esi
je 0x44085f
mov ecx, dword [0x4aa51c]
push 1
push 0
push 0xffffffffffffffff
push 0x498884
push ecx
call fcn.00474ce0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
mov esi, eax
mov byte [eax + edi], 0
mov eax, ecx
call fcn.00412fa0
mov dword [eax], esi
jmp 0x440ad8
mov eax, dword [esp + 0x14]
mov byte [edi], 0
call fcn.00412fa0
cmp byte [esp + 0x13], 0
mov dword [eax], 0
jne 0x440ad8
push edi
call fcn.00484e18
add esp, 4
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
push edx
call fcn.004130d0
test eax, eax
je 0x44085f
cmp dword [esp + 0x20], 0
mov edx, dword [esp + 0x34]
sete al
movzx ecx, al
push ecx
push edx
call fcn.0042e260
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
push 0x4987f9
push 0
push 0x499ee8
mov ecx, ebx
call fcn.0042e170
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4