Function at 0x507990
Capabilities:
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5c5fdb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x288
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, ecx
xor ebx, ebx
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x40], edi
mov eax, dword [edi + 0x64]
mov dword [ebp - 4], ebx
cmp eax, ebx
je 0x507a31
push esi
call fcn.0050c120
cmp eax, ebx
je 0x507a31
mov eax, dword [esi + 0x20]
mov ecx, dword [esi + 0x24]
mov edx, dword [esi + 0x60]
mov dword [esi + 0x28], eax
mov dword [esi + 0x2c], ecx
mov dword [edx + 8], eax
mov dword [edx + 0xc], ecx
mov eax, dword [esi + 0x80]
cmp dword [eax + 0x24], 4
jne 0x507a12
mov byte [esi + 0x97], 1
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov ecx, esi
call fcn.0050ff10
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
push str.Insert_next_chunk_in_list_n
mov ecx, edi
mov byte [esi + 0x97], 0
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], ebx
call fcn.005070a0
mov al, byte [edi + 0x7c]
test al, al
je 0x507a8d
mov ecx, dword [edi + 0x70]
cmp dword [ecx], ebx
jne 0x507a8d
cmp dword [ebp + 0xc], ebx
jne 0x507a8d
cmp dword [edi + 0x64], ebx
jne 0x507a8d
lea edx, [ebp - 0x1c]
mov ecx, edi
push edx
mov dword [ebp - 0x3c], 1
call fcn.00508040
cmp eax, ebx
mov dword [ebp + 8], eax
je 0x507a8d
mov ecx, dword [ebp - 0x18]
cmp ecx, ebx
jg 0x507ab3
jl 0x507a8d
cmp dword [ebp - 0x1c], 0x5b43
jae 0x507ab3
mov ebx, dword [ebp + 0x10]
xor eax, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x1c]
push ebx
push eax
mov ecx, edi
call fcn.00508160
mov ecx, dword [ebp - 0x18]
mov dword [ebp + 8], eax
mov dword [ebp - 0x3c], 0
jmp 0x507ab6
mov ebx, dword [ebp + 0x10]
test eax, eax
je 0x507b5c
test ecx, ecx
jg 0x507ad8
jl 0x507acd
cmp dword [ebp - 0x1c], 0x5b43
jae 0x507ad8
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x507b5c
test ebx, ebx
je 0x507af3
xor eax, eax
lea ebx, [ebx + ebx*2]
cmp ecx, eax
jg 0x507af3
jl 0x507aec
cmp dword [ebp - 0x1c], ebx
jae 0x507af3
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x507b5c
push 0x50
call fcn.0059cff9
mov ecx, eax
add esp, 4
mov dword [ebp - 0x24], ecx
test ecx, ecx
mov byte [ebp - 4], 1
je 0x507b13
call fcn.0050d790
mov ebx, eax
jmp 0x507b15
xor ebx, ebx
test ebx, ebx
mov dword [ebp - 0x20], ebx
mov byte [ebp - 4], 0
je 0x507b5c
mov ecx, dword [edi + 0x6c]
mov dword [ebx + 0x44], ecx
mov edx, dword [edi + 0x74]
mov dword [ebx + 0x48], edx
mov eax, dword [edi + 0x20]
mov ecx, dword [eax + 0x10]
push ecx
call fcn.00584816
lea edx, [eax + eax + 0x14]
push edx
call fcn.0059cff9
add esp, 8
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x507b71
mov ecx, ebx
call fcn.0050d7d0
push ebx
call fcn.0059d022
add esp, 4
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [edi + 0x2c]
inc eax
mov dword [edi + 0x2c], eax
mov dword [ebx + 0x40], eax
mov ecx, dword [edi + 0x20]
mov eax, dword [edi + 0x2c]
push eax
mov eax, dword [ebp - 0x14]
mov edx, dword [ecx + 0x10]
push edx
push 0x66fe28
push eax
call fcn.0058572e
mov ecx, dword [ebp - 0x14]
add esp, 0x10
push ecx
mov ecx, ebx
call fcn.0050d860
test eax, eax
je 0x507bbc
mov ecx, ebx
call fcn.0050d7d0
push ebx
call fcn.0059d022
mov edx, dword [ebp - 0x14]
add esp, 4
push edx
jmp 0x507b54
mov eax, dword [ebp - 0x14]
lea ecx, [esi + 0x10]
push eax
call fcn.00511570
test eax, eax
je 0x507c09
mov esi, dword [ebp - 0x14]
push eax
push esi
lea ecx, [ebp - 0x294]
push str.Error_opening_file__s__errcode___ld._n
push ecx
call fcn.005851fa
add esp, 0x10
lea edx, [ebp - 0x294]
mov ecx, edi
push edx
call fcn.005070a0
mov ecx, ebx
call fcn.0050d7d0
push ebx
call fcn.0059d022
add esp, 4
push esi
jmp 0x507b54
mov eax, dword [ebp - 0x14]
push eax
call fcn.0059d022
add esp, 4
mov ecx, edi
push 0x66fe24
call fcn.005070a0
mov edx, dword [ebp + 8]
mov dword [ebx], esi
mov eax, dword [edx]
mov dword [ebp - 0x24], eax
mov ecx, dword [eax + 0x80]
cmp dword [ecx + 0x24], 4
jne 0x507d26
mov ecx, dword [eax + 0x9c]
test ecx, ecx
jne 0x507c4b
mov ecx, dword [eax + 0x98]
mov edx, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp + 0xc], ecx
mov eax, dword [edx + 0x38]
test eax, eax
je 0x507c6e
mov eax, dword [eax + 0x1c]
cmp eax, ecx
jbe 0x507cff
sub eax, ecx
mov ebx, eax
jmp 0x507cff
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0x80]
fld qword [eax + 0x2e0]
fmul qword [0x5d8a58]
call fcn.00584d08
cmp eax, dword [ebp + 0xc]
jbe 0x507cae
mov ecx, dword [ebp - 0x24]
mov eax, dword [ecx + 0x80]
fld qword [eax + 0x2e0]
fmul qword [0x5f5850]
call fcn.00584d08
mov ebx, dword [ebp + 0xc]
neg ebx
sub ebx, eax
mov edx, dword [esi + 0x80]
mov al, byte [edx + 0x2b3]
test al, al
jne 0x507cff
fld qword [edi + 0x18]
fcomp qword [0x5d5758]
mov ecx, dword [ebp + 0xc]
mov edx, ebx
fnstsw ax
test ah, 0x41
jne 0x507ce2
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0x98]
cmp ecx, eax
jb 0x507ce2
sub ecx, eax
lea eax, [ecx + ecx*4]
lea ebx, [ecx + 0x2da0]
cmp eax, 0x2da0
jb 0x507cf9
lea ebx, [ecx + ecx + 0x5b43]
cmp edx, ebx
jae 0x507cff
mov ebx, edx
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x20]
shr ebx, 1
add ebx, ecx
mov dword [eax + 0x1c], ebx
mov dword [esi + 0x98], ebx
mov edx, dword [eax + 0x1c]
mov ebx, eax
mov dword [esi + 0x20], edx
mov dword [esi + 0x24], 0
jmp 0x507dca
mov ecx, dword [eax + 0x30]
mov dword [esi + 0x30], ecx
mov eax, dword [eax + 0x34]
mov dword [esi + 0x34], eax
mov eax, dword [edi + 0x64]
test eax, eax
jne 0x507d87
mov eax, dword [ebp + 0xc]
test eax, eax
jne 0x507d87
mov eax, dword [edi + 0x20]
cmp edx, eax
jne 0x507d87
mov ecx, dword [eax + 0x38]
test ecx, ecx
jne 0x507d87
mov ecx, dword [edi + 0x70]
cmp dword [ecx], 0
jne 0x507d87
mov edx, dword [esi + 0x80]
cmp dword [edx + 0xb8], 2
jne 0x507d87
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x507d7f
jg 0x507d77
cmp dword [ebp - 0x1c], 0xb680
jbe 0x507d7f
mov eax, 0x5b40
cdq
jmp 0x507dba
mov eax, 0x2da0
cdq
jmp 0x507dba
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x507da9
mov ecx, dword [edi + 0x80]
mov dword [edi + 0x78], ebx
mov dword [esi + 0x20], ecx
mov edx, dword [edi + 0x84]
mov dword [esi + 0x24], edx
mov byte [edi + 0x7c], 0
jmp 0x507dca
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
push 0
push 2
push eax
push ecx
call fcn.00586630
mov ecx, dword [esi + 0x30]
sub ecx, eax
mov eax, dword [esi + 0x34]
sbb eax, edx
mov dword [esi + 0x20], ecx
mov dword [esi + 0x24], eax
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x507e6b
mov ebx, dword [ebp + 0x14]
mov ecx, dword [esi + 0x20]
mov edx, dword [esi + 0x24]
xor eax, eax
sub ecx, ebx
push eax
sbb edx, eax
mov eax, dword [ebp + 0x10]
push eax
push edx
push ecx
call fcn.005866e0
mov ecx, dword [ebp + 0x10]
xor edx, edx
sub ecx, eax
mov eax, dword [esi + 0x20]
add ecx, eax
mov eax, dword [esi + 0x24]
adc edx, eax
mov eax, dword [ebp + 8]
mov dword [esi + 0x20], ecx
mov dword [esi + 0x24], edx
mov ecx, dword [eax]
mov eax, 0
push eax
mov edx, dword [ecx + 0x4c]
mov ecx, dword [esi + 0x20]
mov dword [esi + 0x4c], edx
mov edx, dword [esi + 0x24]
sub ecx, ebx
sbb edx, eax
mov eax, dword [ebp + 0x10]
push eax
push edx
push ecx
call fcn.00586630
mov ecx, dword [esi + 0x4c]
mov dword [esi + 0x48], eax
cmp ecx, eax
jae 0x507e5f
push str.Err_in_Chl:Ins__endPacket___startPacket__n
mov ecx, edi
call fcn.005070a0
mov esi, dword [ebp - 0x20]
mov ecx, esi
call fcn.0050d7d0
push esi
call fcn.0059d022
mov ecx, dword [ebp - 0x14]
add esp, 4
push ecx
jmp 0x507b54
mov edx, dword [ebp + 8]
mov ebx, dword [ebp - 0x20]
dec eax
mov ecx, dword [edx]
mov dword [ecx + 0x4c], eax
mov edx, dword [esi + 0x20]
mov ecx, dword [esi + 0x24]
xor eax, eax
sub edx, 1
mov dword [esi + 0x38], eax
mov dword [esi + 0x3c], eax
sbb ecx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [eax + 0x30], edx
mov dword [eax + 0x34], ecx
mov eax, dword [edi + 0x74]
test eax, eax
je 0x507fd1
mov eax, dword [ebx + 0x40]
mov ecx, dword [ebx]
mov dword [ebp - 0x38], eax
mov edx, dword [ecx + 0x20]
mov dword [ebp - 0x30], edx
mov edx, dword [ebp + 8]
mov ecx, dword [ecx + 0x24]
mov dword [ebp - 0x2c], ecx
mov ecx, dword [edx + 0x38]
test ecx, ecx
je 0x507eba
mov ecx, dword [ecx + 0x40]
mov dword [ebp - 0x34], ecx
jmp 0x507ec1
mov dword [ebp - 0x34], 0xffffffff
push eax
lea edx, [ebp - 0x28]
push 0x656fa0
push edx
call fcn.005851fa
mov edx, dword [edi + 0x74]
add esp, 0xc
lea eax, [ebp - 0x38]
lea ecx, [ebp - 0x28]
push 0x10
push eax
push 0
push 0
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x30]
push eax
mov eax, dword [ebp - 0x38]
push ecx
push edx
push eax
lea ecx, [ebp - 0x140]
push str.Adding_record_to_registry_with_ID__d__startPos__I64d__nextID__d_n
push ecx
call fcn.005851fa
add esp, 0x18
lea edx, [ebp - 0x140]
mov ecx, edi
push edx
call fcn.005070a0
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x28]
mov ecx, dword [eax + 0x40]
push ecx
push 0x656fa0
push edx
call fcn.005851fa
add esp, 0xc
lea eax, [ebp + 0x10]
lea ecx, [ebp - 0x38]
lea edx, [ebp - 0x28]
push eax
mov eax, dword [edi + 0x74]
push ecx
push 0
push 0
push edx
push eax
mov dword [ebp + 0x10], 0x10
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x507f7d
push eax
lea ecx, [ebp - 0x140]
push str.Error_reading_registry__errCode___d._n
push ecx
call fcn.005851fa
add esp, 0xc
lea edx, [ebp - 0x140]
mov ecx, edi
push edx
call fcn.005070a0
mov eax, dword [ebx + 0x40]
lea ecx, [ebp - 0x38]
push 0x10
push ecx
mov dword [ebp - 0x34], eax
mov eax, dword [edi + 0x74]
push 0
lea edx, [ebp - 0x28]
push 0
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x30]
push ecx
mov ecx, dword [ebp - 0x38]
push edx
push eax
lea edx, [ebp - 0x28]
push ecx
push edx
lea eax, [ebp - 0x140]
push str.Updating_record_with_num__s:_set_ID__d__startPos__I64d__nextID__d_n
push eax
call fcn.005851fa
add esp, 0x1c
lea ecx, [ebp - 0x140]
push ecx
mov ecx, edi
call fcn.005070a0
mov edi, dword [ebp + 8]
mov edx, dword [edi + 0x38]
mov dword [ebx + 0x38], edx
mov dword [edi + 0x38], ebx
mov eax, dword [esi + 0x20]
mov dword [esi + 0x60], ebx
mov dword [ebx + 8], eax
mov ecx, dword [esi + 0x24]
mov dword [ebx + 0xc], ecx
mov edx, dword [esi + 0x20]
mov eax, dword [esi + 0x24]
mov dword [esi + 0x28], edx
mov ecx, esi
mov dword [esi + 0x2c], eax
call fcn.0050ff10
mov ecx, dword [edi]
call fcn.0050ff10
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov eax, 1
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 0x10