Function at 0x405a20
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x448792
mov eax, dword fs:[0]
push eax
sub esp, 0x58
push ebx
push esi
push edi
mov eax, dword [0x45c070]
xor eax, esp
push eax
lea eax, [esp + 0x68]
mov dword fs:[0], eax
xor ebx, ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x28], ebx
push ebx
push 0x80
push 3
push ebx
push 1
mov dword [esp + 0x84], ebx
mov eax, dword [0x46024c]
push connect
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x405ac8
call fcn.00409020
cmp eax, ebx
je 0x405acc
mov esi, dword [0x45f3ec]
cmp dword [esi - 0xc], ebx
je 0x405bd4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x78
push str.AGENT_PROPERTIES::LoadFromFile
mov edx, str...Commonprotocol.cpp
mov ecx, esi
call fcn.00403b40
add esp, 0xc
xor eax, eax
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esp + 0x28], eax
mov edx, dword [esp + 0x28]
lea ecx, [esp + 0x60]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x5c], eax
cmp eax, 0xffffffff
jne 0x405af2
call fcn.00409020
cmp eax, ebx
jl 0x405afe
mov eax, dword [esp + 0x5c]
mov edi, eax
mov eax, dword [esp + 0x60]
mov dword [esp + 0x60], eax
jmp 0x405b02
mov edi, dword [esp + 0x5c]
mov edx, dword [0x45d48c]
mov eax, dword [edx + 0xc]
mov ecx, 0x45d48c
call eax
add eax, 0x10
mov dword [esp + 0x24], eax
mov byte [esp + 0x70], 1
mov ecx, 1
sub ecx, dword [eax - 4]
mov eax, dword [eax - 8]
sub eax, edi
or eax, ecx
jge 0x405b3a
mov ecx, edi
lea eax, [esp + 0x24]
call fcn.004075c0
cmp edi, ebx
jl 0x40604f
mov esi, dword [esp + 0x24]
cmp edi, dword [esi - 8]
jg 0x40604f
push ebx
lea ecx, [esp + 0x50]
push ecx
push edi
mov dword [esi - 0xc], edi
mov byte [edi + esi], bl
mov edi, dword [esp + 0x34]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, ebx
jne 0x405be9
call fcn.00409020
cmp eax, ebx
je 0x405be9
mov eax, dword [0x45f3ec]
cmp dword [eax - 0xc], ebx
je 0x405ba1
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x83
push str.AGENT_PROPERTIES::LoadFromFile
mov edx, str...Commonprotocol.cpp
mov ecx, esi
call fcn.00403b40
add esp, 0xc
mov byte [esp + 0x70], bl
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405bc5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x28]
cmp eax, ebx
je 0x405bd4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x28]
mov dword [esp + 0x30], ebx
push edx
lea ebx, [esp + 0x34]
call fcn.00406a20
lea eax, [esp + 0x34]
push eax
mov byte [esp + 0x74], 2
mov ecx, dword [esp + 0x24]
push 0x451eec
push ecx
call fcn.0042fe86
add esp, 0xc
cmp eax, 1
je 0x405c9d
mov edx, dword [0x45f3ec]
cmp dword [edx - 0xc], 0
je 0x405c49
push 0x8c
push str.AGENT_PROPERTIES::LoadFromFile
push str...Commonprotocol.cpp
mov ecx, str.CodePage_in_Agent_backup_file_not_found
call fcn.00403d80
add esp, 0xc
mov byte [esp + 0x70], 1
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405c6e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
mov byte [esp + 0x70], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405c8f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test edi, edi
je 0x405bd4
push edi
jmp 0x405bce
mov edx, dword [0x45d48c]
mov eax, dword [edx + 0xc]
mov ecx, 0x45d48c
mov dword [esp + 0x48], 0x45f3f0
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
mov byte [esp + 0x70], 3
mov edx, dword [0x45d48c]
mov eax, dword [edx + 0xc]
mov ecx, 0x45d48c
call eax
add eax, 0x10
mov dword [esp + 0x1c], eax
mov byte [esp + 0x70], 4
cmp dword [esp + 0x2c], 0xffffffff
je 0x405f9c
jmp 0x405cf0
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x28]
push edx
lea ebx, [esp + 0x34]
call fcn.00406a20
mov byte [esp + 0x70], 5
mov ecx, dword [eax]
mov edi, dword [esp + 0x20]
lea eax, [ecx - 0x10]
add edi, 0xfffffff0
cmp eax, edi
je 0x405d5a
cmp dword [edi + 0xc], 0
lea ebx, [edi + 0xc]
jl 0x405d4d
mov edx, dword [eax]
cmp edx, dword [edi]
jne 0x405d4d
call fcn.00407480
mov esi, eax
or eax, 0xffffffff
lock xadd dword [ebx], eax
dec eax
test eax, eax
jg 0x405d44
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
add esi, 0x10
mov dword [esp + 0x20], esi
jmp 0x405d5a
mov edi, dword [ecx - 0xc]
push ecx
lea eax, [esp + 0x24]
call fcn.004073e0
mov byte [esp + 0x70], 4
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405d7f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x34]
push ecx
lea edi, [esp + 0x20]
lea ebx, [esp + 0x24]
call fcn.00406060
lea edx, [esp + 0x14]
push edx
mov ecx, edi
call fcn.00406110
test al, al
je 0x405f89
mov esi, dword [0x4601e8]
lea edi, [esp + 0x14]
lea ebx, [esp + 0x50]
mov eax, 0x4601e4
call fcn.00407050
cmp dword [eax], esi
je 0x405e0c
mov eax, edi
push eax
lea ecx, [esp + 0x3c]
push ecx
mov ebx, 0x451f48
call fcn.00406e70
add esp, 8
mov edi, eax
mov byte [esp + 0x70], 6
or dword [esp + 0x18], 1
push 0x4601e4
lea ecx, [esp + 0x18]
call fcn.00406f50
mov eax, dword [eax]
mov edi, dword [edi]
mov esi, dword [esp + 0x1c]
push eax
push edi
push esi
call fcn.0042fca6
add esp, 0xc
cmp eax, 1
jne 0x405e10
mov bl, al
jmp 0x405e12
mov esi, dword [esp + 0x1c]
xor bl, bl
mov dword [esp + 0x70], 4
test byte [esp + 0x18], 1
je 0x405e46
mov eax, dword [esp + 0x38]
and dword [esp + 0x18], 0xfffffffe
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405e46
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
jne 0x405f89
mov ecx, dword [0x4601f8]
lea edi, [esp + 0x14]
lea ebx, [esp + 0x54]
mov eax, 0x4601f4
mov dword [esp + 0x3c], ecx
call fcn.00407050
mov edx, dword [esp + 0x3c]
cmp dword [eax], edx
je 0x405ec3
mov eax, edi
push eax
lea ecx, [esp + 0x48]
push ecx
mov ebx, 0x451f48
call fcn.00406e70
add esp, 8
mov edi, eax
mov byte [esp + 0x70], 7
or dword [esp + 0x18], 2
push 0x4601f4
lea ecx, [esp + 0x18]
call fcn.00406f50
mov edi, dword [edi]
mov ebx, dword [eax]
lea edx, [esp + 0x40]
push edx
push edi
push esi
call fcn.0042fca6
add esp, 0xc
cmp eax, 1
jne 0x405ec3
mov al, byte [esp + 0x40]
mov byte [ebx], al
mov bl, 1
jmp 0x405ec5
xor bl, bl
mov dword [esp + 0x70], 4
test byte [esp + 0x18], 2
je 0x405ef9
mov eax, dword [esp + 0x44]
and dword [esp + 0x18], 0xfffffffd
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405ef9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
jne 0x405f89
mov ecx, dword [0x460208]
lea edi, [esp + 0x14]
lea ebx, [esp + 0x58]
mov eax, 0x460204
mov dword [esp + 0x3c], ecx
call fcn.00407050
mov edx, dword [esp + 0x3c]
cmp dword [eax], edx
je 0x405f51
mov eax, dword [esp + 0x14]
mov edi, dword [esi - 0xc]
mov ebx, dword [eax - 0xc]
push 0x460204
lea ecx, [esp + 0x18]
call fcn.00406f50
mov ecx, dword [eax]
sub edi, ebx
dec edi
push edi
push ecx
lea eax, [esp + 0x24]
call fcn.00406270
test al, al
jne 0x405f89
mov esi, dword [0x460218]
lea edi, [esp + 0x14]
lea ebx, [esp + 0x5c]
mov eax, 0x460214
call fcn.00407050
cmp dword [eax], esi
je 0x405f89
push 0x460214
mov ecx, edi
call fcn.00406f50
mov edx, dword [eax]
push edx
lea ecx, [esp + 0x20]
lea ebx, [esp + 0x4c]
call fcn.00406320
cmp dword [esp + 0x2c], 0xffffffff
jne 0x405cf0
mov esi, dword [esp + 0x24]
mov edi, dword [esp + 0x28]
mov byte [esp + 0x70], 3
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405fc1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x70], 2
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405fe6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x70], 1
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40600b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
mov byte [esp + 0x70], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40602c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test edi, edi
je 0x406037
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.004036a0
int3