aboutsummaryrefslogtreecommitdiffstats
path: root/fw/pseudo/gcp.gcp_cmdFE07_CreateAuthenticatedSession.after.c
blob: 914e1739536063238a78795f66232a713926ffa5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
int __fastcall gcp_cmdFE07_CreateAuthenticatedSession(struct gcp_ctx *ctx, struct ta_params *params)
{
  int v4; // r7
  struct gcp_auth_session *auth; // r6
  unsigned int *p_asd_refcount; // r0
  int v7; // r4
  __int64 v8; // kr00_8
  unsigned int v9; // r1
  unsigned __int64 arg10; // kr08_8
  unsigned int handle; // r0
  int v12; // r0

  v4 = 0;
  gcp_log(level: 0, fmt: aAmdTaGcpCreate);
  auth = ctx->auth;
  p_asd_refcount = &ctx->asd_refcount;
  while ( 1 )
  {
    if ( v4 == 0x10000000 )
    {
      v7 = 529;
      goto LABEL_10;
    }
    if ( *(_DWORD *)&auth->body[16] == 0 )
      break;
    ++auth;
    v4 += 0x1000000;
  }
  *(_DWORD *)&auth->body[16] = 1;
  auth->state = params->arg18;
  v8 = *(_QWORD *)p_asd_refcount;
  v9 = ctx->unk1E04 + 1;
  arg10 = params->arg10;
  ++*p_asd_refcount;
  ctx->unk1E04 = v9;
  handle = HIDWORD(v8) & 0xFFFFFF | v4;
  *(_QWORD *)&auth->body[8] = arg10;
  auth->handle = handle;
  if ( (_DWORD)v8 == 0 )
  {
    v12 = gcp_asd_rpc_305(arg: 1u);
    if ( v12 != 0 )
    {
      v7 = v12 | 0x20000000;
      goto LABEL_10;
    }
    handle = auth->handle;
  }
  v7 = 0;
  params->out1950 = handle;
  gcp_log(level: 0, fmt: aAmdTaGcpCreate_0);
LABEL_10:
  gcp_log(level: 0, fmt: (const char *)off_402F8C);
  return v7;
}