Function at 0x40b780
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov dword [ebp - 0x24], 0xc
mov dword [ebp - 0x20], 0
mov eax, dword [ebp + 0xc]
and eax, 0x80
test eax, eax
je 0x40b7ad
mov dword [ebp - 0x1c], 0
mov byte [ebp - 0x38], 0x10
jmp 0x40b7b8
mov dword [ebp - 0x1c], 1
mov byte [ebp - 0x38], 0
mov ecx, dword [ebp + 0xc]
and ecx, 0x8000
test ecx, ecx
jne 0x40b7f1
mov edx, dword [ebp + 0xc]
and edx, 0x4000
test edx, edx
je 0x40b7dc
mov al, byte [ebp - 0x38]
or al, 0x80
mov byte [ebp - 0x38], al
jmp 0x40b7f1
cmp dword [0x4174d4], 0x8000
je 0x40b7f1
mov cl, byte [ebp - 0x38]
or cl, 0x80
mov byte [ebp - 0x38], cl
mov edx, dword [ebp + 0xc]
and edx, 3
mov dword [ebp - 0x40], edx
cmp dword [ebp - 0x40], 0
je 0x40b80e
cmp dword [ebp - 0x40], 1
je 0x40b817
cmp dword [ebp - 0x40], 2
je 0x40b820
jmp 0x40b829
mov dword [ebp - 0x34], connect
jmp 0x40b845
mov dword [ebp - 0x34], 0x40000000
jmp 0x40b845
mov dword [ebp - 0x34], 0xc0000000
jmp 0x40b845
mov dword [0x4171c0], 0x16
mov dword [0x4171c4], 0
or eax, 0xffffffff
jmp 0x40bc32
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x44]
sub ecx, 0x10
mov dword [ebp - 0x44], ecx
cmp dword [ebp - 0x44], 0x30
ja case.0x40b865.4
mov eax, dword [ebp - 0x44]
xor edx, edx
mov dl, byte [eax + 0x40bc4a]
jmp dword [edx*4 + 0x40bc36]
mov dword [ebp - 8], 0
jmp 0x40b8ac
mov dword [ebp - 8], 1
jmp 0x40b8ac
mov dword [ebp - 8], 2
jmp 0x40b8ac
mov dword [ebp - 8], 3
jmp 0x40b8ac
mov dword [0x4171c0], 0x16
mov dword [0x4171c4], 0
or eax, 0xffffffff
jmp 0x40bc32
mov ecx, dword [ebp + 0xc]
and ecx, 0x700
mov dword [ebp - 0x48], ecx
cmp dword [ebp - 0x48], 0x100
jg 0x40b8d2
cmp dword [ebp - 0x48], 0x100
je 0x40b929
cmp dword [ebp - 0x48], 0
je 0x40b920
jmp 0x40b94d
cmp dword [ebp - 0x48], 0x300
jg 0x40b8ef
cmp dword [ebp - 0x48], 0x300
je 0x40b944
cmp dword [ebp - 0x48], 0x200
je 0x40b93b
jmp 0x40b94d
cmp dword [ebp - 0x48], 0x500
jg 0x40b90c
cmp dword [ebp - 0x48], 0x500
je 0x40b932
cmp dword [ebp - 0x48], 0x400
je 0x40b920
jmp 0x40b94d
cmp dword [ebp - 0x48], 0x600
je 0x40b93b
cmp dword [ebp - 0x48], 0x700
je 0x40b932
jmp 0x40b94d
mov dword [ebp - 0x18], 3
jmp 0x40b969
mov dword [ebp - 0x18], 4
jmp 0x40b969
mov dword [ebp - 0x18], 1
jmp 0x40b969
mov dword [ebp - 0x18], 5
jmp 0x40b969
mov dword [ebp - 0x18], 2
jmp 0x40b969
mov dword [0x4171c0], 0x16
mov dword [0x4171c4], 0
or eax, 0xffffffff
jmp 0x40bc32
mov dword [ebp - 0x28], pe_nt_image_headers32
mov edx, dword [ebp + 0xc]
and edx, 0x100
test edx, edx
je 0x40b9ba
lea eax, [ebp + 0x14]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x2c]
add ecx, 4
mov dword [ebp - 0x2c], ecx
mov edx, dword [ebp - 0x2c]
mov eax, dword [edx - 4]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x2c], 0
mov ecx, dword [0x4171c8]
not ecx
mov edx, dword [ebp - 0x10]
and edx, ecx
and edx, 0x80
test edx, edx
jne 0x40b9ba
mov dword [ebp - 0x28], 1
mov eax, dword [ebp + 0xc]
and eax, 0x40
test eax, eax
je 0x40b9dc
mov ecx, dword [ebp - 0x28]
or ecx, 0x4000000
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x34]
or edx, 0x10000
mov dword [ebp - 0x34], edx
mov eax, dword [ebp + 0xc]
and eax, 0x1000
test eax, eax
je 0x40b9f1
mov ecx, dword [ebp - 0x28]
or ch, 1
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp + 0xc]
and edx, 0x20
test edx, edx
je 0x40ba08
mov eax, dword [ebp - 0x28]
or eax, 0x8000000
mov dword [ebp - 0x28], eax
jmp 0x40ba1e
mov ecx, dword [ebp + 0xc]
and ecx, 0x10
test ecx, ecx
je 0x40ba1e
mov edx, dword [ebp - 0x28]
or edx, 0x10000000
mov dword [ebp - 0x28], edx
call fcn.0040be50
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
jne 0x40ba48
mov dword [0x4171c0], 0x18
mov dword [0x4171c4], 0
or eax, 0xffffffff
jmp 0x40bc32
push 0
mov eax, dword [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
lea edx, [ebp - 0x24]
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x34]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
jne 0x40ba88
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0040b6b0
add esp, 4
or eax, 0xffffffff
jmp 0x40bc32
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x40babc
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0040b6b0
add esp, 4
or eax, 0xffffffff
jmp 0x40bc32
cmp dword [ebp - 0xc], 2
jne 0x40bacd
mov dl, byte [ebp - 0x38]
or dl, 0x40
mov byte [ebp - 0x38], dl
jmp 0x40badb
cmp dword [ebp - 0xc], 3
jne 0x40badb
mov al, byte [ebp - 0x38]
or al, 8
mov byte [ebp - 0x38], al
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call fcn.0040bf80
add esp, 8
mov al, byte [ebp - 0x38]
or al, 1
mov byte [ebp - 0x38], al
mov ecx, dword [ebp - 0x14]
sar ecx, 5
mov edx, dword [ebp - 0x14]
and edx, 0x1f
mov eax, dword [ecx*4 + 0x417500]
mov cl, byte [ebp - 0x38]
mov byte [eax + edx*8 + 4], cl
movsx edx, byte [ebp - 0x38]
and edx, 0x48
test edx, edx
jne 0x40bbe9
movsx eax, byte [ebp - 0x38]
and eax, 0x80
test eax, eax
je 0x40bbe9
mov ecx, dword [ebp + 0xc]
and ecx, 2
test ecx, ecx
je 0x40bbe9
push 2
push 0xffffffffffffffff
mov edx, dword [ebp - 0x14]
push edx
call fcn.0040b5c0
add esp, 0xc
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0xffffffff
jne 0x40bb76
cmp dword [0x4171c4], 0x83
je 0x40bb74
mov eax, dword [ebp - 0x14]
push eax
call fcn.0040bcc0
add esp, 4
or eax, 0xffffffff
jmp 0x40bc32
jmp 0x40bbe9
mov byte [ebp - 0x30], 0
push 1
lea ecx, [ebp - 0x30]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call fcn.004069c0
add esp, 0xc
test eax, eax
jne 0x40bbbf
movsx eax, byte [ebp - 0x30]
cmp eax, 0x1a
jne 0x40bbbf
mov ecx, dword [ebp - 0x3c]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call fcn.0040c580
add esp, 8
cmp eax, 0xffffffff
jne 0x40bbbf
mov eax, dword [ebp - 0x14]
push eax
call fcn.0040bcc0
add esp, 4
or eax, 0xffffffff
jmp 0x40bc32
push 0
push 0
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.0040b5c0
add esp, 0xc
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0xffffffff
jne 0x40bbe9
mov edx, dword [ebp - 0x14]
push edx
call fcn.0040bcc0
add esp, 4
or eax, 0xffffffff
jmp 0x40bc32
movsx eax, byte [ebp - 0x38]
and eax, 0x48
test eax, eax
jne 0x40bc2f
mov ecx, dword [ebp + 0xc]
and ecx, 8
test ecx, ecx
je 0x40bc2f
mov edx, dword [ebp - 0x14]
sar edx, 5
mov eax, dword [ebp - 0x14]
and eax, 0x1f
mov ecx, dword [edx*4 + 0x417500]
mov dl, byte [ecx + eax*8 + 4]
or dl, 0x20
mov eax, dword [ebp - 0x14]
sar eax, 5
mov ecx, dword [ebp - 0x14]
and ecx, 0x1f
mov eax, dword [eax*4 + 0x417500]
mov byte [eax + ecx*8 + 4], dl
mov eax, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret