Function at 0x403320
Capabilities:
Encode data using xor
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
mov eax, dword [esp + 0x78]
mov ecx, dword [esp + 0x74]
mov ebp, dword [esp + 0x70]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x2c], eax
mov eax, ecx
sar eax, 0x1f
xor ecx, eax
sub ecx, eax
mov eax, ecx
cdq
cmp ecx, 1
jle 0x403878
mov ecx, 1
lea esi, [esi]
shrd eax, edx, 1
shr edx, 1
add ecx, 1
mov ebx, eax
mov esi, edx
xor ebx, 1
or esi, ebx
jne 0x403360
mov eax, 1
shl eax, cl
mov dword [esp + 0x20], eax
sar eax, 0x1f
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0x1cc]
mov esi, dword [esp + 0x80]
xor edi, edi
test byte [eax], 1
jne 0x403718
mov eax, dword [esp + 0x28]
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], edi
mov dword [esp + 4], eax
mov eax, dword [esp + 0x2c]
mov dword [esp], ebp
mov dword [esp + 8], eax
call sym.reallocTrigBuffers_ci250_t__unsigned_long_long__unsigned_long_long_
mov edx, eax
mov eax, 1
test edx, edx
jne 0x403589
mov eax, dword [esp + 0x20]
mov dword [esp + 0x28], 0
mov dword [esp + 0x38], 0
lea edi, [eax + eax]
mov dword [esp + 0x4c], eax
sub eax, 1
mov dword [esp + 0x40], edi
mov edi, dword [ebp + 0x1e8]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], edi
mov edi, dword [ebp + 0x1ec]
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
mov ebx, edi
cmp dword [esp + 0x30], eax
sbb ebx, edx
jae 0x403598
mov eax, dword [esp + 0x40]
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._calloc
mov dword [esp + 0x48], eax
test eax, eax
je 0x4038dd
mov eax, dword [esp + 0x28]
mov eax, dword [ebp + eax*4 + 0x1d0]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x30]
or eax, edi
jne 0x403818
mov edx, dword [esp + 0x3c]
test edx, edx
je 0x403478
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp + 0x1e8]
mov edi, dword [ebp + 0x1ec]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
mov esi, dword [esp + 0x48]
mov dword [ebp + eax*4 + 0x1d0], esi
mov edx, dword [esp + 0x38]
mov esi, dword [ebp + 0x1cc]
mov eax, dword [esp + 0x40]
add eax, edx
test byte [esi], 1
cmove eax, edx
add dword [esp + 0x28], 1
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x28]
cmp eax, 3
jne 0x403403
mov eax, dword [esp + 0x4c]
mov edx, dword [esp + 0x24]
mov ebx, edi
shl eax, 2
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x30], eax
sbb ebx, edx
jb 0x403650
mov ebx, dword [esp + 0x4c]
mov esi, dword [ebp + 0x1dc]
xor eax, eax
xor edx, edx
sub ebx, 1
lea esi, [esi]
mov ecx, dword [ebp + 0x1e0]
mov edi, dword [ebp + 0x1f0]
sub ecx, eax
and edi, ecx
and ecx, ebx
add eax, 1
mov edi, dword [esi + edi*4]
adc edx, 0
cmp dword [esp + 0x20], eax
mov dword [esi + ecx*4], edi
mov edi, dword [esp + 0x24]
sbb edi, edx
jae 0x4034e8
mov eax, dword [esp + 0x28]
mov dword [esp], esi
mov dword [esp + 4], eax
call sym._realloc
mov esi, dword [ebp + 0x1cc]
mov dword [ebp + 0x1dc], eax
mov edi, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
add eax, edi
test byte [esi], 1
mov dword [ebp + 0x1f0], ebx
cmove eax, edi
and dword [ebp + 0x1e0], ebx
mov dword [ebp + 0x1ec], edx
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x20]
mov dword [ebp + 0x1e8], eax
mov eax, dword [esi]
and eax, 1
je 0x403589
mov eax, dword [esp + 0x38]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x18c]
mov dword [esp], str.DEBUG:_d:USB_MEM_reallocRFFifoBuffers:_memsize__ld_n
mov dword [esp + 4], eax
call sym._pprintf
xor eax, eax
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x28]
mov ebx, dword [ebp + eax*4 + 0x1d0]
xor eax, eax
cmp byte [ebp + 0x1f4], 0
sete al
xor edx, edx
add eax, dword [esp + 0x20]
adc edx, dword [esp + 0x24]
or edx, eax
je 0x40361c
mov eax, dword [ebp + 0x1f0]
mov dword [esp + 0x70], ebp
xor esi, esi
xor edi, edi
mov ecx, dword [ebp + 0x1e0]
mov dword [esp + 0x30], eax
lea esi, [esi]
mov eax, dword [esp + 0x30]
and eax, ecx
movzx edx, word [ebx + eax*2]
mov eax, dword [esp + 0x2c]
and eax, ecx
add esi, 1
mov word [ebx + eax*2], dx
mov eax, dword [esp + 0x70]
adc edi, 0
sub ecx, 1
mov ebp, edi
cmp byte [eax + 0x1f4], 0
sete al
xor edx, edx
movzx eax, al
add eax, dword [esp + 0x20]
adc edx, dword [esp + 0x24]
cmp esi, eax
sbb ebp, edx
jb 0x4035d8
mov ebp, dword [esp + 0x70]
mov eax, dword [esp + 0x40]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._realloc
mov edi, dword [esp + 0x28]
mov dword [ebp + edi*4 + 0x1d0], eax
mov eax, dword [ebp + 0x1e8]
mov edi, dword [ebp + 0x1ec]
mov dword [esp + 0x30], eax
jmp 0x403487
mov eax, dword [esp + 0x28]
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._calloc
mov dword [esp + 0x3c], eax
test eax, eax
je 0x40388d
mov eax, dword [ebp + 0x1dc]
mov ebx, dword [esp + 0x4c]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x30]
sub ebx, 1
or eax, edi
je 0x4036eb
mov edx, dword [ebp + 0x1f0]
xor ecx, ecx
mov eax, dword [ebp + 0x1e0]
mov dword [esp + 0x48], esi
mov dword [esp + 0x44], edi
mov dword [esp + 0x40], edx
xor edx, edx
mov dword [esp + 0x70], ebp
mov ebp, ebx
mov ebx, ecx
mov ecx, edx
nop
mov edx, dword [esp + 0x40]
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x3c]
and edx, eax
mov esi, dword [esi + edx*4]
mov edx, eax
and edx, ebp
mov dword [edi + edx*4], esi
mov edx, ecx
add ecx, 1
mov esi, ebx
adc ebx, 0
xor edx, dword [esp + 0x30]
xor esi, dword [esp + 0x44]
sub eax, 1
or esi, edx
jne 0x4036b0
mov ebx, ebp
mov esi, dword [esp + 0x48]
mov ebp, dword [esp + 0x70]
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x403705
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sym._free
mov esi, dword [ebp + 0x1cc]
mov eax, dword [esp + 0x3c]
mov dword [ebp + 0x1dc], eax
jmp 0x40352e
mov eax, dword [esp + 0x28]
mul dword [esp + 0x80]
mov ecx, dword [esp + 0x2c]
imul ecx, dword [esp + 0x80]
mov dword [esp + 0x30], eax
mov eax, dword [ebp + 0x2d8]
mov dword [esp + 0x34], edx
mul dword [ebp + 0x2c8]
add dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x30]
sub ecx, eax
mov eax, dword [esp + 0x20]
sub eax, dword [ebp + 0x1e8]
lea eax, [eax + eax*4]
lea edx, [ecx + ecx*2]
add eax, eax
lea eax, [eax + edx*2]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x18c]
mov dword [esp], str.DEBUG:_d:reallocRFFifoBuffers__:_addmem__ld_Bytes_n
mov dword [esp + 4], eax
call sym._pprintf
mov eax, dword [ebp + 0x2d8]
mov edx, dword [ebp + 0x2c8]
mov ebx, eax
sar ebx, 0x1f
imul edx, ebx
mov ebx, dword [esp + 0x34]
mov ecx, edx
mov edx, dword [ebp + 0x2cc]
imul edx, eax
add ecx, edx
mul dword [ebp + 0x2c8]
mov dword [esp + 0xc], ebx
add edx, ecx
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
mov dword [esp + 8], ecx
mov eax, dword [ebp + 0x18c]
mov dword [esp], str.DEBUG:_d:reallocRFFifoBuffers__:triggerBufferSizenew_and_old____lld_:___lld_n
mov dword [esp + 4], eax
call sym._pprintf
mov eax, dword [ebp + 0x1e8]
mov edx, dword [ebp + 0x1ec]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x24]
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov eax, dword [ebp + 0x18c]
mov dword [esp], str.DEBUG:_d:reallocRFFifoBuffers__:rfsize_new_and_old_____lld_:___lld_n
mov dword [esp + 4], eax
call sym._pprintf
jmp 0x40339e
mov ebx, dword [ebp + 0x1f0]
mov eax, dword [ebp + 0x1e0]
mov dword [esp + 0x70], ebp
xor esi, esi
mov ebp, dword [esp + 0x48]
mov dword [esp + 0x44], ebx
xor ebx, ebx
lea esi, [esi]
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x3c]
and edx, eax
movzx ecx, word [ecx + edx*2]
mov edx, dword [esp + 0x2c]
and edx, eax
mov word [ebp + edx*2], cx
mov edx, ebx
mov ecx, esi
add ebx, 1
adc esi, 0
xor edx, dword [esp + 0x30]
xor ecx, edi
sub eax, 1
or ecx, edx
jne 0x403838
mov ebp, dword [esp + 0x70]
jmp 0x403454
mov dword [esp + 0x20], 2
mov dword [esp + 0x24], 0
jmp 0x403386
mov eax, dword [ebp + 0x18c]
mov dword [esp], str.ERROR:_d:reallocRFFifoBuffers__Failed_allocate_RF_FIFO_LF_index_memory_n
mov dword [esp + 4], eax
call sym._pprintf
mov eax, dword [ebp + 0x2d8]
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x2c8]
mov edx, dword [ebp + 0x2cc]
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov eax, dword [ebp + 0x2c0]
mov dword [esp], ebp
mov dword [esp + 4], eax
call sym._reallocRFFifoBuffers
mov eax, 1
jmp 0x403589
mov edi, dword [esp + 0x28]
mov dword [esp + 8], edi
mov eax, dword [ebp + 0x18c]
mov dword [esp], str.ERROR:_d:reallocRFFifoBuffers__Failed_allocate_RSSI_FIFO_memory__d_n
mov dword [esp + 4], eax
call sym._pprintf
mov eax, dword [ebp + 0x2d8]
test edi, edi
jne 0x4038a9
mov dword [esp + 0xc], eax
sar eax, 0x1f
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x2c8]
mov edx, dword [ebp + 0x2cc]
mov dword [esp], ebp
mov dword [esp + 4], eax
mov dword [esp + 8], edx
call sym.reallocTrigBuffers_ci250_t__unsigned_long_long__unsigned_long_long_
mov eax, 1
jmp 0x403589