Function at 0x4a9f50
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push ebx
push esi
xor eax, eax
mov esi, ecx
mov dword [ebp - 8], eax
xor ebx, ebx
mov dword [ebp - 0x20], eax
push edi
mov eax, dword [esi + 4]
add eax, 0x14
push eax
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 0x10], eax
call eax
mov ecx, esi
call fcn.004a8490
mov edi, dword [esi + 0x34]
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [ebp - 4], eax
test edi, edi
je 0x4aa583
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x1c], eax
mov eax, dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov dword [ebp - 0xc], eax
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x34], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x38], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x28], eax
mov ecx, dword [edi + 0x14]
test cl, 0x20
je 0x4a9fe1
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call dword [ebp - 4]
push 0xc8
call dword [ebp - 0x1c]
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call dword [ebp - 0x10]
jmp 0x4aa18e
mov eax, ecx
and eax, 3
cmp al, 3
jne 0x4aa583
or ecx, 0x20
mov dword [edi + 0x14], ecx
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call dword [ebp - 4]
mov edx, dword [esi + 0x14]
mov ecx, esi
lea eax, [edx + 0xc]
mov edx, dword [edx + 8]
push eax
call fcn.004a8540
add esp, 4
mov edx, ebx
mov ecx, esi
push dword [ebp - 8]
call fcn.004a9890
mov ecx, dword [esi + 4]
add esp, 4
add ecx, 0x14
mov dword [ebp - 0x24], eax
push ecx
call dword [ebp - 0x10]
cmp dword [ebp - 0x24], 0
je 0x4aa0e3
and dword [edi + 0x14], 0xffffffdf
mov eax, dword [esi + 8]
mov dword [ebp - 0x18], eax
push dword [eax + 0x1c]
call dword [ebp - 0x28]
cmp eax, 0xffffffff
mov eax, dword [ebp - 0x18]
je 0x4aa1cb
mov dword [eax + 0x20], 0
mov eax, dword [esi + 0x14]
cmp dword [eax + 8], 0
jne 0x4aa0da
cmp dword [ebp - 0x24], 1
jne 0x4aa080
cmp dword [ebp - 8], 0
mov ecx, dword [esi + 4]
jne 0x4aa1af
lea eax, [ecx + 0x14]
push eax
call dword [ebp - 4]
jmp 0x4aa0bc
test ebx, ebx
je 0x4aa098
push ebx
push 0x1cc15274
push ecx
mov ecx, dword [esi]
mov ecx, dword [ecx + 0x478]
call fcn.0045be00
inc ebx
cmp ebx, 3
jle 0x4aa17c
cmp dword [ebp - 8], 0
mov ecx, dword [esi + 4]
jne 0x4aa1ba
lea eax, [ecx + 0x14]
push eax
call dword [ebp - 4]
push dword [esi + 0x1c]
call dword [ebp - 0xc]
mov ecx, dword [esi]
lea eax, [ebp - 0x20]
push eax
mov edx, 0x50eb28
call fcn.00495800
mov eax, dword [ebp - 0x20]
add esp, 4
mov dword [ebp - 8], eax
jmp 0x4aa18e
cmp dword [ebp - 0x24], 1
jmp 0x4aa174
mov eax, dword [esi + 0x40]
mov eax, dword [eax + 0x28]
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 0x44]
mov dword [ebp - 0x30], eax
mov eax, dword [esi + 0x14]
cmp dword [eax + 8], 0
je 0x4aa4dc
push 0
push 0x80
mov eax, ebx
neg eax
push 3
push 0
sbb eax, eax
and eax, 7
push eax
push accept
push dword [esi + 0x20]
call dword [ebp - 0x34]
mov dword [ebp - 0x24], eax
cmp eax, 0xffffffff
jne 0x4aa225
mov eax, dword [esi + 8]
mov dword [ebp - 0x24], eax
push dword [eax + 0x1c]
call dword [ebp - 0x28]
cmp eax, 0xffffffff
mov eax, dword [ebp - 0x24]
je 0x4aa215
mov dword [eax + 0x20], 0
test ebx, ebx
je 0x4aa162
push ebx
push 0x1cc15274
push ecx
mov ecx, dword [esi]
mov ecx, dword [ecx + 0x478]
call fcn.0045be00
call dword [ebp - 0x38]
mov dword [ebp - 0x2c], eax
mov ecx, dword [edi + 0x14]
and ecx, 0xffffffdf
cmp eax, 2
mov dword [edi + 0x14], ecx
je 0x4aa1d7
inc ebx
cmp ebx, 3
jg 0x4aa1d7
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call dword [ebp - 4]
push 0x3e8
call dword [ebp - 0x1c]
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call dword [ebp - 0x10]
mov ecx, esi
call fcn.004a8490
mov edi, dword [esi + 0x34]
test edi, edi
jne 0x4a9fb8
jmp 0x4aa583
push edi
call fcn.004a6cd0
jmp 0x4aa583
push edi
call fcn.004a6cd0
push dword [esi + 0x1c]
call dword [ebp - 0xc]
jmp 0x4aa583
mov dword [eax + 0x20], 1
jmp 0x4aa583
mov ecx, dword [esi + 4]
push edi
call fcn.004a7cb0
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call dword [ebp - 4]
mov eax, dword [ebp - 8]
test eax, eax
je 0x4aa1fa
push eax
call fcn.004d9a63
add esp, 4
push dword [esi + 0x1c]
mov ebx, dword [ebp - 0xc]
call ebx
push dword [esi + 0x20]
call ebx
push dword [esi + 0x24]
call ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [eax + 0x20], 1
and dword [edi + 0x14], 0xffffffdf
jmp 0x4aa583
mov ecx, dword [esi + 4]
push edi
call fcn.004a6cd0
mov eax, dword [esi + 0x40]
mov ebx, dword [ebp - 0x18]
mov ecx, dword [eax + 0x30]
mov eax, dword [eax + 0x34]
mov dword [edi + 0x48], ecx
mov dword [edi + 0x4c], eax
mov eax, dword [esi + 0x40]
mov eax, dword [eax + 0x38]
mov dword [edi + 0x44], eax
cmp dword [esi + 0x50], ebx
jae 0x4aa292
push dword [esi + 0x54]
call fcn.004d9a63
add esp, 4
push dword [esi + 0x58]
call fcn.004d9a63
add esp, 4
mov dword [esi + 0x50], ebx
lea eax, [ebx*4]
push eax
call fcn.004d9a7e
mov dword [esi + 0x54], eax
add esp, 4
mov eax, dword [esi + 0x50]
shr eax, 1
lea eax, [eax*4 + 8]
push eax
call fcn.004d9a7e
add esp, 4
mov dword [esi + 0x58], eax
mov eax, dword [esi + 0x54]
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x28], eax
mov dword [ebp - 0xc], 0
test ebx, ebx
je 0x4aa322
mov ebx, dword [ebp - 0x30]
add ebx, 0x28
mov eax, dword [edi + 0x3c]
lea ecx, [ebx - 0x28]
dec eax
lea edx, [ebp - 0x1c]
and eax, dword [ecx]
push edx
push eax
push ecx
mov ecx, dword [esi + 4]
push edi
call fcn.004a6c00
test eax, eax
jne 0x4aa3dc
mov edx, dword [ebp - 0x1c]
mov dword [edx + 0x38], eax
mov eax, dword [ebx]
mov dword [edx + 0x3c], eax
mov eax, dword [ebx + 4]
mov dword [edx + 0x40], eax
mov eax, dword [ebx - 8]
mov ecx, dword [ebx - 4]
mov dword [edx + 0x48], eax
mov dword [edx + 0x4c], ecx
cmp dword [ebx], 0x40000
jbe 0x4aa2fe
mov dword [edx + 0x14], 0x1f
jmp 0x4aa313
mov eax, dword [ebp - 0x28]
mov dword [edx + 0x14], 0xf
mov dword [eax], edx
add eax, 4
inc dword [ebp - 0x20]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0xc]
add ebx, 0x30
inc eax
mov dword [ebp - 0xc], eax
cmp eax, dword [ebp - 0x18]
jb 0x4aa2b0
mov eax, dword [esi + 4]
mov ebx, dword [ebp - 4]
add eax, 0x14
push eax
call ebx
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x4aa4c7
push dword [esi + 0x58]
lea edx, [eax - 1]
xor ecx, ecx
push dword [esi + 0x54]
call fcn.004a9e70
mov ecx, dword [esi + 0x54]
add esp, 8
nop
mov eax, dword [ecx]
add ecx, 4
mov dword [ebp - 0xc], eax
add eax, 0x3c
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x38], ecx
push dword [eax]
mov eax, dword [esi + 4]
push 0
push dword [eax + 0x10]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0xc]
add eax, 0x48
push 0
push 0
mov dword [ebp - 0x28], eax
push dword [eax + 4]
push dword [eax]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov ecx, dword [ebp - 0x18]
lea eax, [ebp - 0x2c]
push 0
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax]
push ecx
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax]
cmp dword [ebp - 0x2c], ecx
je 0x4aa3ee
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call dword [ebp - 0x10]
push dword [ebp - 0x18]
mov eax, dword [esi + 4]
push 0
push dword [eax + 0x10]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp - 0xc]
mov ecx, dword [esi + 4]
call fcn.004a7cb0
jmp 0x4aa4b1
push dword [ebp - 0x24]
and dword [edi + 0x14], 0xffffffdf
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4aa583
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0x18]
push dword [eax + 4]
push dword [eax]
mov eax, dword [ebp - 0xc]
push dword [eax + 0x40]
push ecx
mov ecx, dword [esi + 0x5c]
call fcn.004bd830
add esp, 0x10
mov dword [ebp - 0x14], 1
lea eax, [ebp - 0x14]
push eax
push 0x20
lea eax, [edi + 0x18]
push eax
call fcn.004b2070
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp - 0xc]
push 0x20
add eax, 0x18
push eax
call fcn.004b2070
lea eax, [ebp - 0x14]
push eax
push 8
push dword [ebp - 0x28]
call fcn.004b2070
lea eax, [ebp - 0x14]
push eax
push 4
push dword [ebp - 0x1c]
call fcn.004b2070
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x1c]
push dword [eax]
push dword [ebp - 0x18]
call fcn.004b2070
mov eax, dword [ebp - 0xc]
mov ecx, dword [esi + 4]
add ecx, 0x14
push ecx
mov eax, dword [eax + 0x40]
cmp eax, dword [ebp - 0x14]
je 0x4aa493
call dword [ebp - 0x10]
push dword [ebp - 0x18]
mov eax, dword [esi + 4]
push 0
push dword [eax + 0x10]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp - 0xc]
mov ecx, dword [esi + 4]
call fcn.004a7cb0
jmp 0x4aa4b1
call dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x18]
mov dword [eax + 0x14], 0xe
mov dword [eax + 0x38], ecx
mov eax, dword [ebp - 0x1c]
mov ecx, dword [esi + 4]
mov eax, dword [eax]
add dword [ecx + 0x4c], eax
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call ebx
sub dword [ebp - 0x20], 1
mov ecx, dword [ebp - 0x38]
jne 0x4aa350
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call dword [ebp - 0x10]
jmp 0x4aa546
mov ecx, dword [esi + 4]
push edi
call fcn.004a6cd0
cmp dword [ebp - 0x18], 0
mov dword [ebp - 0x28], 0
jbe 0x4aa546
mov ebx, dword [ebp - 0x30]
mov eax, dword [edi + 0x3c]
lea ecx, [ebp - 0x1c]
push ecx
mov ecx, dword [esi + 4]
dec eax
and eax, dword [ebx]
push eax
push ebx
push edi
call fcn.004a6c00
test eax, eax
jne 0x4aa21c
mov edx, dword [ebp - 0x1c]
mov dword [edx + 0x14], 0xb
mov dword [edx + 0x38], eax
mov dword [edx + 0x3c], eax
mov dword [edx + 0x40], eax
mov eax, dword [ebx + 0x28]
mov dword [edx + 0x44], eax
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebx + 0x24]
add ebx, 0x30
mov dword [edx + 0x48], eax
mov eax, dword [ebp - 0x28]
inc eax
mov dword [edx + 0x4c], ecx
mov dword [ebp - 0x28], eax
cmp eax, dword [ebp - 0x18]
jb 0x4aa4f5
mov eax, dword [edi + 0x14]
and eax, 0xffffffdf
or eax, 8
cmp dword [ebp - 8], 0
mov dword [edi + 0x14], eax
je 0x4aa583
mov eax, dword [esi]
lea edx, [ebp - 0x38]
push 0x23ee676e
push edx
mov edi, dword [eax + 0x478]
mov ecx, dword [edi + 0x6c]
mov eax, dword [ecx]
call dword [eax]
test eax, eax
jne 0x4aa583
push dword [ebp - 0x38]
mov ecx, edi
push 0xbcd3f497
call fcn.0045bc70
mov eax, dword [esi + 4]
add eax, 0x14
push eax
call dword [ebp - 4]
mov eax, dword [ebp - 8]
test eax, eax
je 0x4aa59d
push eax
call fcn.004d9a63
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret