Function at 0x402190
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x348
mov eax, dword [0x4132bc]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
push edi
push 0x600
mov esi, ecx
push 0x104
lea ecx, [ebp - 0x108]
push ecx
push eax
mov dword [ebp - 0x330], esi
call dword [sym.imp.CoreFoundation.dll_CFStringGetCString]
add esp, 0x10
push 0
push 0x80
push 3
push 0
push 0
push 1
lea edx, [ebp - 0x108]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0x33c], edi
cmp edi, 0xffffffff
jne 0x402212
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._sendFileToDeviceByPipe
push str._s:_CreateFileW_failed:__lu
call fcn.00403900
add esp, 0xc
jmp 0x402454
lea eax, [ebp - 0x32c]
push eax
push 0
lea ecx, [ebp - 0x108]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesExA]
test eax, eax
je 0x402439
mov eax, dword [ebp - 0x30c]
mov dword [ebp - 0x344], eax
cmp eax, 0x2000000
ja 0x40241d
cmp byte [ebp + 0xc], 0
push ebx
mov dword [ebp - 0x334], 0
je 0x402271
push eax
mov ecx, esi
lea ebx, [ebp - 0x334]
call fcn.00401de0
mov ebx, dword [ebp - 0x334]
add esp, 4
jmp 0x40229f
mov esi, dword [esi + 0x18]
push 0
push 0
push 1
mov ebx, 0x8000
push 0
xor edi, edi
mov cl, 2
mov dword [ebp - 0x334], ebx
call fcn.00401410
mov esi, dword [ebp - 0x330]
mov edi, dword [ebp - 0x33c]
add esp, 0x10
mov dword [ebp - 0x330], eax
test eax, eax
je 0x4022c7
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x330]
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004048d2
mov esp, ebp
pop ebp
ret
push ebx
call fcn.0040499f
mov edi, eax
mov eax, dword [ebp - 0x344]
add esp, 4
mov dword [ebp - 0x348], edi
mov dword [ebp - 0x338], eax
test eax, eax
jle 0x402382
lea esp, [esp]
cmp eax, ebx
jb 0x4022f6
mov eax, ebx
push 0
lea edx, [ebp - 0x340]
push edx
push eax
mov eax, dword [ebp - 0x33c]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x402378
cmp dword [esi + 0x1c], 0
mov ebx, dword [ebp - 0x340]
jne 0x402329
mov eax, esi
call fcn.00401ab0
test eax, eax
jne 0x402341
movzx ecx, byte [esi + 0x24]
push ebx
push edi
mov edi, dword [esi + 0x1c]
push ecx
call fcn.00401b70
mov edi, dword [ebp - 0x348]
add esp, 0xc
mov dword [ebp - 0x330], eax
test eax, eax
jne 0x402382
mov eax, dword [ebp - 0x340]
mov ecx, dword [ebp - 0x338]
cmp ecx, eax
sete dl
sub ecx, eax
sets al
or al, dl
mov dword [ebp - 0x338], ecx
jne 0x402382
mov ebx, dword [ebp - 0x334]
mov eax, ecx
jmp 0x4022f0
mov dword [ebp - 0x330], 0xd
mov edx, dword [ebp - 0x33c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.00404965
add esp, 4
cmp byte [ebp + 0xc], 1
jne 0x402406
cmp dword [ebp - 0x338], 0
jne 0x402406
mov eax, dword [ebp - 0x344]
push eax
push str.setenv_filesize__d
lea ecx, [ebp - 0x308]
push 0x200
push ecx
call fcn.00404a33
lea edx, [ebp - 0x308]
push edx
call dword [sym.imp.CoreFoundation.dll___CFStringMakeConstantString]
add esp, 0x14
cmp byte [esi + 0x20], 1
mov edi, eax
jne 0x4023eb
push 0
push edi
mov ecx, esi
call fcn.004020d0
add esp, 8
jmp 0x4023f6
push edi
mov ebx, esi
call fcn.00401eb0
add esp, 4
push edi
mov dword [ebp - 0x330], eax
call dword [sym.imp.CoreFoundation.dll_CFRelease]
add esp, 4
mov eax, dword [ebp - 0x330]
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004048d2
mov esp, ebp
pop ebp
ret
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov eax, 1
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004048d2
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._sendFileToDeviceByPipe:_GetFileAttributesExA_failed:__lu:
call fcn.00403900
add esp, 8
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
mov eax, 0xb
pop esi
call fcn.004048d2
mov esp, ebp
pop ebp
ret