Function at 0x4e9940
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x25c
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__dup]
mov edi, dword [esp + 0x274]
mov eax, dword [esp + 0x284]
and edi, 8
mov dword [esp], eax
mov dword [esp + 0x38], edi
call ebx
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x288]
mov dword [esp], eax
call ebx
mov dword [esp + 0x30], eax
test edi, edi
je 0x4e9c10
mov eax, dword [esp + 0x2c]
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__get_osfhandle]
mov dword [esp], eax
call ebx
mov esi, eax
mov eax, dword [esp + 0x30]
mov dword [esp], eax
call ebx
mov dword [esp + 0x3c], 0
mov ebx, eax
mov ebp, eax
lea eax, [esp + 0xb0]
mov dword [esp + 0xb0], 0x94
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
sub esp, 4
cmp dword [esp + 0xc0], 1
mov dword [esp + 0x34], 0
jne 0x4e9ba0
lea edx, [esp + 0x70]
xor eax, eax
mov ecx, 0xd
mov dword [esp + 0xa8], ebp
mov edi, edx
lea ebp, [esp + 0x5c]
mov edx, dword [esp + 0x274]
mov dword [esp + 0xa4], esi
rep stosd dword es:[edi], eax
lea eax, [esp + 0x6c]
mov dword [esp + 0xc], ebp
mov ecx, dword [esp + 0x27c]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x34]
shr edx, 1
and edx, 1
mov dword [esp + 0x6c], 0x44
mov dword [esp + 4], eax
mov eax, dword [esp + 0x280]
mov dword [esp + 0x98], 0x100
mov dword [esp], eax
mov eax, dword [esp + 0x278]
mov dword [esp + 0xac], ebx
call sym._win32_spawn
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__close]
mov esi, eax
cmp eax, 0xffffffff
je 0x4e9ad0
mov eax, dword [esp + 0x284]
test eax, eax
jne 0x4e9b80
cmp dword [esp + 0x288], 1
jne 0x4e9b60
mov ecx, dword [esp + 0x38]
test ecx, ecx
jne 0x4e9b2e
mov eax, dword [esp + 0x3c]
cmp eax, 2
je 0x4e9b2e
mov dword [esp], eax
call edi
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call edi
mov eax, dword [esp + 0x30]
mov dword [esp], eax
call edi
mov eax, dword [esp + 0x28c]
mov dword [esp], eax
call edi
add esp, 0x25c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [esp + 0x48], eax
call eax
mov eax, dword [eax]
mov dword [esp + 4], 0
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x278]
mov dword [esp], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__open_1]
mov ebx, eax
test eax, eax
jns 0x4e9c60
lea esi, [esi]
nop
mov eax, dword [esp + 0x48]
call eax
mov ebx, dword [esp + 0x44]
mov dword [eax], ebx
mov eax, dword [esp + 0x298]
mov dword [eax], 2
mov eax, dword [esp + 0x294]
mov dword [eax], str.CreateProcess
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call edi
mov eax, dword [esp + 0x30]
mov dword [esp], eax
call edi
mov edx, dword [esp + 0x38]
test edx, edx
je 0x4e9ab2
add esp, 0x25c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x288]
mov dword [esp], eax
call edi
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x4e9a8e
jmp 0x4e9b2e
mov eax, dword [esp + 0x284]
mov dword [esp], eax
call edi
cmp dword [esp + 0x288], 1
je 0x4e9a82
jmp 0x4e9b60
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 0x40000000
mov dword [esp], str.CONOUT_
call dword [sym.imp.KERNEL32.dll_CreateFileA]
sub esp, 0x1c
mov dword [esp + 0x34], 0x8000000
cmp eax, 0xffffffff
je 0x4e99e0
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov dword [esp + 0x34], 0
jmp 0x4e99e0
mov eax, dword [esp + 0x28c]
mov dword [esp], eax
call ebx
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__get_osfhandle]
mov edi, eax
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call ebx
mov esi, eax
mov eax, dword [esp + 0x30]
mov dword [esp], eax
call ebx
mov dword [esp], edi
mov ebp, eax
call ebx
mov ebx, eax
mov eax, dword [esp + 0x28c]
mov dword [esp + 0x28c], edi
mov dword [esp + 0x3c], eax
jmp 0x4e99ac
lea edx, [esp + 0x147]
mov dword [esp + 8], 0x108
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__read_1]
mov dword [esp], ebx
mov dword [esp + 0x40], eax
call edi
mov ecx, dword [esp + 0x40]
cmp ecx, 3
jle 0x4e9b08
lea edx, [esp + 0x147]
mov byte [esp + ecx + 0x147], 0
mov dword [esp + 4], 0xa
mov dword [esp], edx
call sym._strchr
test eax, eax
je 0x4e9b08
cmp word [esp + 0x147], 0x2123
jne 0x4e9b08
lea esi, [esi]
mov byte [eax], 0
movzx edx, byte [eax - 1]
sub eax, 1
mov ecx, edx
and ecx, 0xfffffffb
cmp cl, 9
je 0x4e9cd0
cmp dl, 0x20
je 0x4e9cd0
movzx eax, byte [esp + 0x149]
cmp al, 9
je 0x4e9e00
cmp al, 0x20
lea ebx, [esp + 0x149]
sete al
mov dword [esp + 0x40], ebx
test al, al
jne 0x4e9e00
mov eax, dword [esp + 0x40]
jmp 0x4e9d23
mov byte [eax], 0x5c
mov dword [esp + 4], 0x2f
mov dword [esp], eax
call sym._strchr
test eax, eax
jne 0x4e9d20
mov eax, dword [esp + 0x27c]
mov edx, dword [eax]
test edx, edx
je 0x4e9e21
mov ebx, eax
lea esi, [esi]
mov eax, dword [ebx + 4]
add ebx, 4
test eax, eax
jne 0x4e9d50
sub ebx, dword [esp + 0x27c]
lea eax, [ebx + 8]
add ebx, 4
mov dword [esp], eax
call sym._xmalloc
mov ecx, eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x4c], ecx
mov dword [ecx], eax
lea eax, [ecx + 4]
mov dword [esp + 8], ebx
mov ebx, dword [esp + 0x27c]
mov dword [esp], eax
mov dword [esp + 4], ebx
lea ebx, [esp + 0x6c]
call sym._memcpy
mov eax, dword [esp + 0x40]
mov dword [esp + 4], 0x5c
mov dword [esp], eax
call sym._strrchr
mov dword [esp + 8], ebx
mov ebx, dword [esp + 0x34]
mov edx, 1
mov dword [esp + 0xc], ebp
mov ecx, dword [esp + 0x4c]
add eax, 1
mov dword [esp + 4], ebx
mov ebx, dword [esp + 0x280]
mov dword [esp + 0x34], ecx
mov dword [esp], ebx
call sym._win32_spawn
mov ecx, dword [esp + 0x34]
mov ebx, eax
mov dword [esp], ecx
call sym._free
cmp ebx, 0xffffffff
je 0x4e9b08
mov esi, ebx
jmp 0x4e9a65
lea eax, [esp + 0x149]
movzx edx, byte [eax + 1]
add eax, 1
cmp dl, 0x20
je 0x4e9e07
cmp dl, 9
je 0x4e9e07
mov dword [esp + 0x40], eax
jmp 0x4e9d11
mov ebx, 4
mov eax, 8
jmp 0x4e9d67