Function at 0x40d397
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x4271b8
call fcn.004268b0
sub esp, 0x24
push ebx
push esi
mov esi, ecx
push edi
mov eax, dword [esi]
call dword [eax + 0x24]
mov edi, eax
push edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x24], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor ebx, ebx
cmp byte [esi + 0x41e], bl
mov dword [ebp - 4], ebx
je 0x40d603
cmp byte [esi + 0x40c], bl
jne 0x40d5fc
cmp byte [esi + 0x41d], bl
jne 0x40d5fc
lea edi, [esi + 0x410]
push ebx
push edi
push 0x2000
push dword [esi + 0x2a0]
push dword [esi + 0x408]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, ebx
jne 0x40d4c5
cmp dword [edi], ebx
je 0x40d418
mov byte [esi + 0x41d], 1
mov ecx, dword [esi + 0x420]
mov dword [ebp - 0x14], ebx
cmp ecx, ebx
je 0x40d4d9
mov eax, dword [esi + 0x424]
cmp eax, dword [esi + 0x428]
jge 0x40d4d9
add eax, ecx
push 4
push eax
lea eax, [ebp - 0x14]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
cmp dword [ebp - 0x14], ebx
je 0x40d4d9
add dword [esi + 0x424], 4
push ebx
push ebx
push ebx
call fcn.004220a6
push dword [edi]
push dword [esi + 0x2a0]
push eax
call fcn.004220a6
add esp, 0x18
cmp eax, dword [ebp - 0x14]
jne 0x40d4d9
mov eax, dword [edi]
push 7
mov ecx, eax
mov dword [ebp - 0x18], eax
shl ecx, 0x10
and eax, 0xff00
push 0xc
or ecx, eax
xor eax, eax
mov ah, byte [ebp - 0x16]
mov byte [ebp - 0x30], 7
shl ecx, 8
or ecx, eax
mov byte [ebp - 0x2f], 5
movzx eax, byte [edi + 3]
or ecx, eax
lea eax, [ebp - 0x30]
mov dword [ebp - 0x28], ecx
mov ecx, dword [esi + 0xc8]
push eax
mov dword [ebp - 0x2c], 0x2000000
call fcn.0041e017
jmp 0x40d5df
cmp dword [edi], ebx
jne 0x40d418
mov byte [esi + 0x40c], 1
jmp 0x40d5e7
cmp byte [esi + 0x41c], bl
mov ecx, 0x2400
mov dword [ebp - 0x1c], ecx
mov byte [ebp - 0xd], bl
je 0x40d539
push dword [edi]
lea eax, [ebp - 0x1c]
push dword [esi + 0x2a0]
push eax
push dword [esi + 0x2a4]
call fcn.0042208b
add esp, 0x10
cmp eax, ebx
je 0x40d532
push eax
push str.C:DATASCZ_SCwinvncwinvnc_vncclient.cpp_:_Compress_returned_error_in_File_Send_:_d_n
push 9
push 0x4378c8
call fcn.004053a7
add esp, 0x10
mov ecx, esi
mov byte [esi + 0x41d], 1
call fcn.0040d619
jmp 0x40d5f7
mov ecx, dword [ebp - 0x1c]
mov byte [ebp - 0xd], 1
mov eax, dword [edi]
cmp ecx, eax
mov dword [ebp - 0x18], eax
jbe 0x40d545
mov byte [ebp - 0xd], bl
mov dl, byte [ebp - 0xd]
mov byte [ebp - 0x30], 7
neg dl
sbb edx, edx
mov byte [ebp - 0x2f], 5
and edx, 0x1000000
cmp byte [ebp - 0xd], bl
mov dword [ebp - 0x2c], edx
je 0x40d58a
mov eax, ecx
mov edx, ecx
and eax, 0xff0000
shr edx, 0x10
or eax, edx
mov edx, ecx
and edx, 0xff00
shl ecx, 0x10
or edx, ecx
shr eax, 8
shl edx, 8
or eax, edx
mov dword [ebp - 0x28], eax
jmp 0x40d5a9
mov ecx, eax
and eax, 0xff00
shl ecx, 0x10
or ecx, eax
xor eax, eax
mov ah, byte [ebp - 0x16]
shl ecx, 8
or ecx, eax
movzx eax, byte [edi + 3]
or ecx, eax
mov dword [ebp - 0x28], ecx
mov ecx, dword [esi + 0xc8]
push 7
lea eax, [ebp - 0x30]
push 0xc
push eax
call fcn.0041e017
cmp byte [ebp - 0xd], bl
mov ecx, dword [esi + 0xc8]
je 0x40d5d2
push dword [ebp - 0x1c]
push dword [esi + 0x2a4]
jmp 0x40d5da
push dword [edi]
push dword [esi + 0x2a0]
call fcn.0041e052
mov eax, dword [edi]
add dword [esi + 0x414], eax
push ebx
push esi
push dword [0x4379d8]
call fcn.0041cfd5
add esp, 0xc
push dword [ebp - 0x20]
jmp 0x40d604
mov ecx, esi
call fcn.0040d619
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret