Function at 0x46ed25
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push ebx
mov eax, 0x6840
call fcn.004d7290
sub esp, eax
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
mov dword [esp + 8], 0x400
mov dword [esp + 4], 0
lea eax, [ebp - 0x4424]
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x46ed99
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x4fc3bc
mov dword [esp + 4], 0x3ff
lea eax, [ebp - 0x4424]
mov dword [esp], eax
call sym._snprintf_46
jmp 0x46ee7d
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
test eax, eax
je 0x46ee7d
mov dword [ebp - 0x14], 0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
mov dword [esp + 4], 0x4fc428
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x46ee7d
mov dword [ebp - 0x6823], 0
lea eax, [ebp - 0x681f]
mov ecx, 0x3fb
mov ebx, 0
mov dword [eax], ebx
mov dword [eax + ecx - 4], ebx
lea edx, [eax + 4]
and edx, 0xfffffffc
sub eax, edx
add ecx, eax
and ecx, 0xfffffffc
shr ecx, 2
mov edi, edx
mov eax, ebx
rep stosd dword es:[edi], eax
mov dword [ebp - 0x18], 0
mov eax, dword [ebp - 0x14]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x3fe
mov dword [esp + 4], 1
lea eax, [ebp - 0x6823]
mov dword [esp], eax
call sym._fread
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x46ee72
lea edx, [ebp - 0x6823]
mov eax, dword [ebp - 0x18]
add eax, edx
mov byte [eax], 0
lea eax, [ebp - 0x6823]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x4fc3bc
mov dword [esp + 4], 0x3ff
lea eax, [ebp - 0x4424]
mov dword [esp], eax
call sym._snprintf_46
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fclose
mov dword [esp + 8], 0x2000
mov dword [esp + 4], 0
lea eax, [ebp - 0x4024]
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x14]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
lea ecx, [ebp - 0x4424]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.client_id_sscopehttps:___s_.defaultgrant_typeclient_credentialsclient_secret_s
mov dword [esp + 4], 0x1fff
lea eax, [ebp - 0x4024]
mov dword [esp], eax
call sym._snprintf_46
mov dword [esp + 8], 0x2000
mov dword [esp + 4], 0
lea eax, [ebp - 0x2024]
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp + 8]
mov edx, dword [eax]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.https:___s__s_oauth2_v2.0_token
mov dword [esp + 4], 0x1fff
lea eax, [ebp - 0x2024]
mov dword [esp], eax
call sym._snprintf_46
lea eax, [ebp - 0x2024]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Office_365_API_access_token_URL:__s
mov dword [esp + 0xc], global___func__.195
mov dword [esp + 8], 0x22a
mov dword [esp + 4], str.wazuh_modules_wm_office365.c
mov dword [esp], str.wazuh_modulesd:office365
call dbg._mtdebug1
mov dword [esp + 8], str.Content_Type:_application_x_www_form_urlencoded
mov dword [esp + 4], 0x1fff
lea eax, [ebp - 0x6424]
mov dword [esp], eax
call sym._snprintf_46
mov dword [esp + 4], 4
mov dword [esp], 2
call sym._calloc
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x46efdf
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp], eax
call sym._strerror
mov ebx, eax
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x4fc4fc
mov dword [esp + 8], global___func__.195
mov dword [esp + 4], 0x22f
mov dword [esp], str.wazuh_modules_wm_office365.c
call dbg._merror_exit
mov eax, dword [ebp - 0x10]
lea edx, [ebp - 0x6424]
mov dword [eax], edx
mov eax, dword [ebp - 0x10]
add eax, 4
mov dword [eax], 0
mov dword [esp + 0x14], 0x3c
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x4024]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x2024]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x10]
mov dword [esp + 4], eax
mov dword [esp], str.POST
call dbg.wurl_http_request
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x46f219
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x1c]
movzx eax, byte [eax + 0xc]
test al, al
je 0x46f07c
mov dword [esp + 0x10], str.Libcurl_error__reached_maximum_response_size.
mov dword [esp + 0xc], global___func__.195
mov dword [esp + 8], 0x239
mov dword [esp + 4], str.wazuh_modules_wm_office365.c
mov dword [esp], str.wazuh_modulesd:office365
call dbg._mtdebug1
jmp 0x46f20c
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sym._cJSON_Parse_4
sub esp, 4
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x46f1e0
mov dword [esp + 4], str.access_token
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._cJSON_GetObjectItem_8
sub esp, 8
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 8]
cmp eax, 0xc8
jne 0x46f134
cmp dword [ebp - 0x24], 0
je 0x46f134
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0xc]
cmp eax, 0x10
jne 0x46f134
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0x10]
mov dword [esp], eax
call sym._strdup
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x46f1d0
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp], eax
call sym._strerror
mov ebx, eax
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x4fc4fc
mov dword [esp + 8], global___func__.195
mov dword [esp + 4], 0x23e
mov dword [esp], str.wazuh_modules_wm_office365.c
call dbg._merror_exit
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sym._strdup
mov edx, eax
mov eax, dword [ebp + 0x10]
mov dword [eax], edx
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
test eax, eax
jne 0x46f19a
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp], eax
call sym._strerror
mov ebx, eax
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x4fc4fc
mov dword [esp + 8], global___func__.195
mov dword [esp + 4], 0x240
mov dword [esp], str.wazuh_modules_wm_office365.c
call dbg._merror_exit
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 4]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.Error_while_getting_access_token:__s
mov dword [esp + 0xc], global___func__.195
mov dword [esp + 8], 0x241
mov dword [esp + 4], str.wazuh_modules_wm_office365.c
mov dword [esp], str.wazuh_modulesd:office365
call dbg._mtdebug1
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._cJSON_Delete_4
sub esp, 4
jmp 0x46f20c
mov dword [esp + 0x10], str.Error_while_parsing_access_token_JSON_response.
mov dword [esp + 0xc], global___func__.195
mov dword [esp + 8], 0x245
mov dword [esp + 4], str.wazuh_modules_wm_office365.c
mov dword [esp], str.wazuh_modulesd:office365
call dbg._mtdebug1
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call dbg.wurl_free_response
jmp 0x46f245
mov dword [esp + 0x10], str.Unknown_error_while_getting_access_token.
mov dword [esp + 0xc], global___func__.195
mov dword [esp + 8], 0x249
mov dword [esp + 4], str.wazuh_modules_wm_office365.c
mov dword [esp], str.wazuh_modulesd:office365
call dbg._mtdebug1
cmp dword [ebp - 0x10], 0
je 0x46f25d
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._free
mov dword [ebp - 0x10], 0
mov eax, dword [ebp - 0xc]
lea esp, [ebp - 8]
pop ebx
pop edi
pop ebp
ret