1// Reconstructed from the compiled program by revrsly.
2// Read from the bytecode: instruction names and discriminators; each instruction's accounts in
3// order, with the types and attributes their loaders' checks imply (◇ inferred: the error codes
4// they raise, the account type whose discriminator they compare, the program ids they compare
5// with); the program's error enum; event and account type names. `/* … */` is a value not
6// recovered. Handler bodies are the register-level logic of each instruction's own handler.
7// Argument names come from a published IDL when there is one, else they are placeholders; struct
8// fields are not recovered. This is a reconstruction, NOT the author's source, and will not
9// compile as-is.
10// Program: EPAAwc1SGWCheofexAqLVZ7jm1nk2ahrqX5pev1bMyo6 (mainnet)
11
12use anchor_lang::prelude::*;
13
14declare_id!("EPAAwc1SGWCheofexAqLVZ7jm1nk2ahrqX5pev1bMyo6");■ string · 44 B
15
16// Accounts — each instruction's accounts, in order, as its account loader (try_accounts) checks them.
17
18#[derive(Accounts)]
19pub struct AddAgents<'info> {◇ 4 accounts · order, types and checks inferred
20 #[account(mut)]
21 pub admin: Signer<'info>,
22 #[account(mut)]
23 pub payer: Signer<'info>,
24 #[account(mut, seeds = [b"registry"], bump)]■ string · 8 B
25 pub registry: AccountInfo<'info>,
26 pub system_program: Program<'info, System>,
27}
28
29▸ 6 more #[derive(Accounts)] structs · lines 29–86
87
88#[program]
89pub mod program {
90 use super::*;
91
92 // discriminator 1e3074b76381d66d● found in the code at .text+0x3ce0
93 // arg layout: @0: u32, @4: u32, @8: u16, @10: u64, @18: u8 | bool, @19: u64, @27: u64, @35: u8 | bool
94 // argument names are placeholders; offsets, sizes (hence types) inferred from the handler's data reads
95 ▾ pub fn add_agents(ctx: Context<AddAgents>, arg_0: u32, arg_4: u32, arg_8: u16, arg_a: u64, arg_12: u8, arg_13: u64, arg_1b: u64, arg_23: u8) -> Result<()> {● its sha256 matches the discriminator
96 // ◇ The program's own handler (`add_agents` in reconstructed.rs), register-level. Anchor's wrapper
97 // (`add_agents_handler`) loads the accounts, then calls it with r1 = where its Result is written,
98 // r2 = &Context. Calls to other fn_* are in reconstructed.rs.
99 // 72 stack slots (local_…) used below; declared in reconstructed.rs.
100 r9 = *((r2 + 0x10) as *const u64);
101 if (r9 + -1) >= 0x18 {
102 r0 = fn_e068(&local_120, 0x24848); // .rodata+0x518
103 r0 = fn_1130(&local_108, 0);
104 local_138_u64 = 0x24878; // .rodata+0x548
105 local_f0_u8 = 2;
106 local_128_u32 = 0x5d;
107 local_130 = 0x1e;
108 local_140_u64 = 0;
109 local_a8 = 0x1770; // custom Anchor error 6000 (#0)?
110 r0 = fn_158b0(&local_140_u64);
111 return r0;
112 }
113 r1 = *((r1 + 8) as *const u64);
114 local_148 = r1;
115 r4 = *((r1 + 0x10) as *const u64);
116 r3 = *((r4 + 8) as *const u64);
117 r1 = *((r3) as *const u64) + 1;
118 r0 = 1;
119 if r1 != 0 {
120 r0 = 0;
121 }
122 r5 = *((r4) as *const u64);
123 *((r3) as *mut u64) = r1;
124 if r0 != 1 {
125 r1 = *((r4 + 0x10) as *const u64);
126 r0 = *((r1) as *const u64) + 1;
127 r6 = 1;
128 if r0 != 0 {
129 r6 = 0;
130 }
131 *((r1) as *mut u64) = r0;
132 if r6 != 1 {
133 r6 = r2;
134 r2 = *((r4 + 0x18) as *const u64);
135 r0 = *((r4 + 0x20) as *const u64);
136 r7 = *((r4 + 0x28) as *const u8);
137 r8 = *((r4 + 0x29) as *const u8);
138 local_76 = *((r4 + 0x2a) as *const u8);
139 local_77 = r8;
140 local_78 = r7;
141 local_80 = r0;
142 local_98 = r3;
143 local_a0 = r5;
144 local_88 = r2;
145 local_90 = r1;
146 r3 = *((*((local_148) as *const u64)) as *const u64);
147 local_128_u64 = *((r3 + 0x18) as *const u64);
148 local_130 = *((r3 + 0x10) as *const u64);
149 local_138_u64 = *((r3 + 8) as *const u64);
150 local_140_u64 = *((r3) as *const u64);
151 r0 = fn_3090(r1, r2, &local_140_u64);
152 local_180 = &local_90;
153 local_188 = &local_98;
154 local_178 = r0;
155 if r0 == 2 {
156 r7 = *((r6 + 8) as *const u64);
157 local_58 = *((r7 + 0x18) as *const u64);
158 local_60 = *((r7 + 0x10) as *const u64);
159 local_68 = *((r7 + 8) as *const u64);
160 local_70 = *((r7) as *const u64);
161 r8 = 0;
162 r1 = local_90;
163 r2 = *((r1 + 0x10) as *const u64);
164 if r2 <= 0x7ffffffffffffffe {
165 local_190 = &local_4c;
166 local_198 = &local_134;
167 r3 = r1 + 0x10;
168 r7 += 0x20;
169 r9 = (r9 << 5) + -0x20;
170 loop {
171 r8 = r3;
172 *((r1 + 0x10) as *mut u64) = r2 + 1;
173 r2 = *((r1 + 0x20) as *const u64);
174 if r2 > 0x2f {
175 r1 = *((r1 + 0x18) as *const u64);
176 r6 = *((r1 + 0x2c) as *const u32);
177 r0 = fn_2ca0(r1, r2, r6, &local_70);
178 *((r8) as *mut u64) = *((r8) as *const u64) + -1;
179 if (r0 & 1) == 0 {
180 L_6680:
181 if r9 != 0 {
182 local_58 = *((r7 + 0x18) as *const u64);
183 local_60 = *((r7 + 0x10) as *const u64);
184 local_68 = *((r7 + 8) as *const u64);
185 local_70 = *((r7) as *const u64);
186 r9 += -0x20;
187 r7 += 0x20;
188 r1 = local_90;
189 r3 = r1 + 0x10;
190 r2 = *((r1 + 0x10) as *const u64);
191 if r2 < 0x7fffffffffffffff {
192 continue;
193 }
194 r8 >>= 0x20;
195 L_6718:
196 r1 = 0xb;
197 r2 = r8;
198 L_6728:
199 r0 = fn_15938(r1, r2);
200 L_6730:
201 r2 = local_98;
202 r3 = *((r2) as *const u64) + -1;
203 *((r2) as *mut u64) = r3;
204 if r3 == 0 {
205 r6 = r1;
206 r7 = r0;
207 r0 = fn_195b8(local_188);
208 r0 = r7;
209 r1 = r6;
210 }
211 r2 = local_90;
212 r3 = *((r2) as *const u64) + -1;
213 *((r2) as *mut u64) = r3;
214 if r3 == 0 {
215 r6 = r1;
216 r7 = r0;
217 r0 = fn_19568(local_180);
218 r0 = r7;
219 r1 = r6;
220 }
221 r2 = local_178;
222 return r0;
223 }
224 r1 = local_98;
225 r2 = *((r1) as *const u64) + -1;
226 *((r1) as *mut u64) = r2;
227 if r2 == 0 {
228 r0 = fn_195b8(local_188);
229 }
230 r1 = local_90;
231 r2 = *((r1) as *const u64) + -1;
232 *((r1) as *mut u64) = r2;
233 if r2 == 0 {
234 r0 = fn_19568(local_180);
235 }
236 r0 = 2;
237 return r0;
238 }
239 local_158 = r1;
240 r0 = rent_get(&local_140_u64);
241 if local_140_u32 == 0 {
242 local_168 = r8;
243 local_160 = r7;
244 r7 = r6 + 1;
245 local_170 = r7;
246 r7 = (r7 << 5) + 0x30;
247 r4 = local_198;
248 r2 = local_138_u32;
249 r3 = local_190;
250 *((r3 + 0x10) as *mut u32) = *((r4 + 0x10) as *const u32);
251 *((r3 + 8) as *mut u64) = *((r4 + 8) as *const u64);
252 *((r3) as *mut u64) = *((r4) as *const u64);
253 local_50 = r2;
254 r0 = fn_184f0(&local_50, r7);
255 r8 = r0;
256 r0 = fn_19608(&local_a0);
257 local_150 = r9;
258 if r8 <= r0 {
259 L_6448:
260 r0 = fn_196e8(&local_a0, r7);
261 r2 = r1;
262 if (r0 << 0x20 >> 0x20) == 0x1a {
263 r9 = local_90;
264 if *((r9 + 0x10) as *const u64) == 0 {
265 *((r9 + 0x10) as *mut u64) = -1;
266 r2 = local_158;
267 if r2 <= 0x7ffffffffffffff {
268 r2 <<= 5;
269 r7 = r2 + 0x30;
270 r1 = 1;
271 if r7 < r2 {
272 L_6500:
273 if (r1 & 1) == 0 {
274 r8 = r7 + 0x20;
275 r1 = 1;
276 if r8 < r7 {
277 L_6538:
278 if (r1 & 1) == 0 {
279 r6 = (r6 << 5) + 0x30;
280 if r6 >= r7 {
281 r2 = *((r9 + 0x20) as *const u64);
282 if r6 <= r2 {
283 r6 -= r7;
284 if r8 <= (r2 - r6) {
285 r1 = *((r9 + 0x18) as *const u64);
286 r0 = memmove(r1 + r8, r1 + r7, r6);
287 r2 = *((r9 + 0x20) as *const u64);
288 if r8 <= r2 {
289 if (r8 - r7) == 0x20 {
290 r1 = *((r9 + 0x18) as *const u64) + r7;
291 *((r1 + 0x18) as *mut u64) = local_58;
292 *((r1 + 0x10) as *mut u64) = local_60;
293 *((r1 + 8) as *mut u64) = local_68;
294 *((r1) as *mut u64) = local_70;
295 r2 = *((r9 + 0x20) as *const u64);
296 if r2 > 0x2f {
297 *((*((r9 + 0x18) as *const u64) + 0x2c) as *mut u32) = local_170;
298 *((r9 + 0x10) as *mut u64) = *((r9 + 0x10) as *const u64) + 1;
299 r9 = local_150;
300 r7 = local_160;
301 r8 = local_168;
302 /* continues at L_6680; not expressible as structured Rust */● an edge Rust can't hold
303 }
304 r0 = fn_206b0(0x30, r2, &Location("programs\\nauto_hook\\src\\lib.rs:123:14"));■ string · 37 B
305 }
306 r0 = fn_206c0(0x20, 0x20, &Location("programs\\nauto_hook\\src\\lib.rs:122:28"));■ string · 37 B
307 }
308 r0 = fn_206b0(r8, r2, &Location("programs\\nauto_hook\\src\\lib.rs:122:14"));■ string · 37 B
309 }
310 local_140_u64 = 0x27c18; // &"dest is out of bounds"
311 local_120 = 0;
312 local_138_u64 = 1;
313 local_128_u64 = 0;
314 local_130 = 8;
315 r0 = fn_1d7c0(&local_140_u64, &Location("programs\\nauto_hook\\src\\lib.rs:121:15"));■ string · 37 B
316 }
317 r0 = fn_206b0(r6, r2, &Location("programs\\nauto_hook\\src\\lib.rs:121:15"));■ string · 37 B
318 }
319 r0 = fn_206b8(r7, r6, &Location("programs\\nauto_hook\\src\\lib.rs:121:15"));■ string · 37 B
320 }
321 r0 = fn_219f0(&Location("programs\\nauto_hook\\src\\lib.rs:121:52"));■ string · 37 B
322 }
323 r1 = 0;
324 /* continues at L_6538; not expressible as structured Rust */● an edge Rust can't hold
325 }
326 r0 = fn_219f0(&Location("programs\\nauto_hook\\src\\lib.rs:120:22"));■ string · 37 B
327 }
328 r1 = 0;
329 /* continues at L_6500; not expressible as structured Rust */● an edge Rust can't hold
330 }
331 r0 = fn_21aa0(&Location("programs\\nauto_hook\\src\\lib.rs:120:31"));■ string · 37 B
332 }
333 r1 = 0xb;
334 r2 = 0;
335 /* continues at L_6728; not expressible as structured Rust */● an edge Rust can't hold
336 }
337 r1 = r0;
338 /* continues at L_6728; not expressible as structured Rust */● an edge Rust can't hold
339 }
340 local_218 = r7;
341 r7 = local_148;
342 r0 = fn_14780(&local_50, *((*((r7 + 8) as *const u64)) as *const u64), local_a0, r8 - r0);
343 r2 = *((r7 + 8) as *const u64);
344 r4 = *((r2 + 8) as *const u64);
345 r1 = *((r4) as *const u64) + 1;
346 r3 = 1;
347 if r1 == 0 {
348 L_6028:
349 r5 = *((r2) as *const u64);
350 *((r4) as *mut u64) = r1;
351 if r3 != 1 {
352 r0 = *((r2 + 0x10) as *const u64);
353 r1 = *((r0) as *const u64) + 1;
354 r3 = 1;
355 if r1 == 0 {
356 L_6070:
357 *((r0) as *mut u64) = r1;
358 if r3 != 1 {
359 r7 = local_98;
360 r1 = *((r7) as *const u64) + 1;
361 r3 = 1;
362 if r1 == 0 {
363 L_60b0:
364 local_1b8 = *((r2 + 0x2a) as *const u8);
365 local_1b0 = *((r2 + 0x29) as *const u8);
366 local_1a8 = *((r2 + 0x28) as *const u8);
367 local_1a0 = *((r2 + 0x20) as *const u64);
368 r8 = *((r2 + 0x18) as *const u64);
369 r2 = local_a0;
370 *((r7) as *mut u64) = r1;
371 if r3 != 1 {
372 local_1c0 = r2;
373 r3 = local_90;
374 r1 = *((r3) as *const u64) + 1;
375 r2 = 1;
376 if r1 == 0 {
377 L_6148:
378 *((r3) as *mut u64) = r1;
379 if r2 != 1 {
380 local_1e8 = r8;
381 local_1e0 = r7;
382 local_1d8 = r0;
383 local_1d0 = r5;
384 local_1c8 = r4;
385 r1 = *((local_148 + 0x18) as *const u64);
386 r2 = *((r1 + 8) as *const u64);
387 r4 = *((r2) as *const u64) + 1;
388 r7 = 1;
389 if r4 == 0 {
390 L_61c0:
391 local_1f8 = *((r1) as *const u64);
392 local_1f0 = local_76;
393 r9 = local_77;
394 r8 = local_78;
395 r0 = local_80;
396 r5 = local_88;
397 *((r2) as *mut u64) = r4;
398 if r7 != 1 {
399 local_200 = r2;
400 r4 = *((r1 + 0x10) as *const u64);
401 r7 = *((r4) as *const u64) + 1;
402 r2 = 1;
403 if r7 == 0 {
404 L_6248:
405 *((r4) as *mut u64) = r7;
406 if r2 != 1 {
407 local_210 = *((r1 + 0x18) as *const u64);
408 r7 = *((r1 + 0x20) as *const u64);
409 r2 = *((r1 + 0x28) as *const u8);
410 local_208 = r3;
411 r3 = *((r1 + 0x29) as *const u8);
412 local_b6 = *((r1 + 0x2a) as *const u8);
413 local_b7 = r3;
414 local_b8 = r2;
415 local_c0 = r7;
416 local_c8 = local_210;
417 local_d0 = r4;
418 local_d8 = local_200;
419 local_e0 = local_1f8;
420 local_e6 = local_1f0;
421 local_e7 = r9;
422 local_e8 = r8;
423 local_f0_u64 = r0;
424 local_f8 = r5;
425 local_100 = local_208;
426 local_108 = local_1e0;
427 local_110 = local_1c0;
428 local_116 = local_1b8;
429 local_117 = local_1b0;
430 local_118 = local_1a8;
431 local_120 = local_1a0;
432 local_128_u64 = local_1e8;
433 local_130 = local_1d8;
434 local_138_u64 = local_1c8;
435 local_140_u64 = local_1d0;
436 r0 = fn_11090(&local_50, &local_140_u64, 3);
437 r2 = r1;
438 if (r0 << 0x20 >> 0x20) == 0x1a {
439 r0 = fn_1608(&local_140_u64);
440 r9 = local_150;
441 r7 = local_218;
442 /* continues at L_6448; not expressible as structured Rust */● an edge Rust can't hold
443 }
444 break;
445 }
446 abort(); // abort the program■ syscall
447 }
448 r2 = 0;
449 /* continues at L_6248; not expressible as structured Rust */● an edge Rust can't hold
450 }
451 abort(); // abort the program■ syscall
452 }
453 r7 = 0;
454 /* continues at L_61c0; not expressible as structured Rust */● an edge Rust can't hold
455 }
456 abort(); // abort the program■ syscall
457 }
458 r2 = 0;
459 /* continues at L_6148; not expressible as structured Rust */● an edge Rust can't hold
460 }
461 abort(); // abort the program■ syscall
462 }
463 r3 = 0;
464 /* continues at L_60b0; not expressible as structured Rust */● an edge Rust can't hold
465 }
466 abort(); // abort the program■ syscall
467 }
468 r3 = 0;
469 /* continues at L_6070; not expressible as structured Rust */● an edge Rust can't hold
470 }
471 abort(); // abort the program■ syscall
472 }
473 r3 = 0;
474 /* continues at L_6028; not expressible as structured Rust */● an edge Rust can't hold
475 }
476 r2 = local_138_u32;
477 r1 = local_13c;
478 /* continues at L_6728; not expressible as structured Rust */● an edge Rust can't hold
479 }
480 r0 = fn_206b0(0x30, r2, &Location("programs\\nauto_hook\\src\\lib.rs:243:25"));■ string · 37 B
481 }
482 r0 = fn_15938(r0, r2);
483 r6 = r0;
484 r7 = r1;
485 r0 = fn_1608(&local_140_u64);
486 r0 = r6;
487 r1 = r7;
488 /* continues at L_6730; not expressible as structured Rust */● an edge Rust can't hold
489 }
490 /* continues at L_6718; not expressible as structured Rust */● an edge Rust can't hold
491 }
492 /* continues at L_6730; not expressible as structured Rust */● an edge Rust can't hold
493 }
494 }
495 abort(); // abort the program■ syscall
496 }
497