Function at 0x4c5a50
Capabilities:
Get file size
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x558bbb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x1c0
push ebx
push esi
mov esi, ecx
push edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x48], esi
mov eax, dword [esi + 0x54]
test eax, eax
je 0x4c5cdb
mov eax, dword [esi + 0x20]
lea ecx, [ebp - 0x1cc]
inc eax
mov dword [ebp - 4], 0
push eax
push str.insert_from_reg__ID___d_n
push ecx
call fcn.0051d0e8
add esp, 0xc
lea edx, [ebp - 0x1cc]
mov ecx, esi
push edx
call fcn.004c2cc0
mov eax, dword [esi + 0x20]
lea ecx, [ebp - 0x24]
inc eax
mov dword [ebp - 0x2c], 0x10
push eax
push 0x597df0
push ecx
call fcn.0051d0e8
add esp, 0xc
lea edx, [ebp - 0x2c]
lea eax, [ebp - 0x3c]
lea ecx, [ebp - 0x24]
push edx
mov edx, dword [esi + 0x54]
push eax
push 0
push 0
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x4c5cdb
mov eax, dword [ebp - 0x38]
push 0x30
mov dword [ebp - 0x40], eax
call fcn.005380a1
mov ecx, eax
add esp, 4
mov dword [ebp - 0x28], ecx
test ecx, ecx
mov byte [ebp - 4], 1
je 0x4c5b17
call fcn.004c6e10
mov ebx, eax
jmp 0x4c5b19
xor ebx, ebx
test ebx, ebx
mov byte [ebp - 4], 0
je 0x4c5cdb
mov ecx, dword [esi + 0x4c]
mov dword [ebx + 0x28], ecx
mov edx, dword [esi + 0x54]
mov dword [ebx + 0x2c], edx
mov eax, dword [esi + 0x14]
or ecx, 0xffffffff
mov edi, dword [eax + 0x10]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 9
push ecx
call fcn.005380a1
mov edi, eax
add esp, 4
test edi, edi
mov dword [ebp - 0x14], edi
jne 0x4c5b62
mov ecx, ebx
call fcn.004c6e30
push ebx
jmp 0x4c5cd3
mov edx, dword [esi + 0x20]
mov ecx, dword [esi + 0x68]
inc edx
mov eax, edx
mov dword [esi + 0x20], edx
cmp ecx, eax
jge 0x4c5b75
mov dword [esi + 0x68], eax
mov dword [ebx + 0x24], eax
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 0x20]
mov eax, dword [edx + 0x10]
push ecx
push eax
push str._s_d
push edi
call fcn.0051d0e8
add esp, 0x10
mov ecx, ebx
push edi
call fcn.004c6ea0
test eax, eax
jne 0x4c5cc2
push eax
push eax
push 3
push eax
push 1
push 0x80000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x28], eax
je 0x4c5c53
lea ecx, [ebp - 0x44]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
xor eax, eax
cmp edi, 0xffffffff
mov dword [ebp - 0x18], eax
jne 0x4c5c14
test eax, eax
jne 0x4c5c14
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4c5c14
push eax
lea edx, [ebp - 0x1cc]
push str.Error_during_GetFileSize____errcode___ld._n
push edx
call fcn.0051d0e8
add esp, 0xc
lea eax, [ebp - 0x1cc]
mov ecx, esi
push eax
call fcn.004c2cc0
xor eax, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov edi, eax
jmp 0x4c5c30
mov ecx, dword [ebp - 0x44]
push 1
push 0
push 0
push ecx
call fcn.0051ec30
add edi, eax
mov eax, dword [ebp - 0x18]
adc eax, edx
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or edi, dword [ebp - 0x18]
je 0x4c5c85
mov edi, dword [ebp + 8]
mov edx, dword [ebp - 0x14]
push edx
lea ecx, [edi + 0x10]
mov dword [ebp + 8], ecx
call fcn.004c9af0
jmp 0x4c5c97
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
lea eax, [ebp - 0x1cc]
push str.Error_opening_file__s_to_get_size__errcode___ld._n
push eax
call fcn.0051d0e8
add esp, 0x10
lea ecx, [ebp - 0x1cc]
push ecx
mov ecx, esi
call fcn.004c2cc0
xor eax, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov edi, dword [ebp + 8]
mov eax, dword [ebp - 0x14]
push eax
lea ecx, [edi + 0x10]
mov dword [ebp + 8], ecx
call fcn.004c9aa0
test eax, eax
je 0x4c5cf0
mov edi, dword [ebp - 0x14]
push eax
push edi
lea ecx, [ebp - 0x1cc]
push str.Error_opening_file__s__errcode___ld._n
push ecx
call fcn.0051d0e8
add esp, 0x10
lea edx, [ebp - 0x1cc]
mov ecx, esi
push edx
call fcn.004c2cc0
mov ecx, ebx
call fcn.004c6e30
push ebx
call fcn.005380ca
add esp, 4
push edi
call fcn.005380ca
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 4
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
mov dword [ebx], edi
mov eax, dword [ebp - 0x34]
add eax, ecx
mov ecx, dword [ebp - 0x30]
mov dword [edi + 0x20], eax
mov eax, dword [ebp - 0x38]
adc ecx, edx
cmp eax, 0xffffffff
mov dword [edi + 0x24], ecx
jne 0x4c5d8b
mov edx, dword [esi + 0x68]
mov eax, dword [esi + 0x14]
mov dword [esi + 0x44], 0
mov dword [esi + 0x20], edx
mov ecx, dword [eax]
mov edx, dword [edi + 0x20]
mov eax, dword [ecx + 0x18]
cmp edx, eax
mov ecx, dword [ecx + 0x1c]
jne 0x4c5d7a
mov edx, dword [edi + 0x24]
cmp edx, ecx
jne 0x4c5d7a
push str.The_last_chunk_is_full._n
mov ecx, esi
call fcn.004c2cc0
mov eax, dword [ebp - 0x14]
push eax
call fcn.005380ca
mov ecx, dword [esi + 0x18]
add esp, 4
mov edx, dword [ecx + 0x1c]
mov ecx, dword [ebp + 8]
mov dword [ebx + 0x1c], edx
mov eax, dword [esi + 0x18]
mov dword [eax + 0x1c], ebx
mov dword [esi + 0x18], ebx
mov dword [ebx + 0x14], 1
call fcn.004c9a80
mov dword [ebx], 0
jmp 0x4c5cdb
sub eax, 1
sbb ecx, 0
mov dword [edi + 0x30], eax
mov dword [edi + 0x34], ecx
jmp 0x4c5e2a
push eax
lea ecx, [ebp - 0x24]
push 0x597df0
push ecx
call fcn.0051d0e8
add esp, 0xc
lea edx, [ebp - 0x2c]
lea eax, [ebp - 0x3c]
lea ecx, [ebp - 0x24]
push edx
mov edx, dword [esi + 0x54]
push eax
push 0
push 0
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x4c5e11
push eax
lea eax, [ebp - 0x1cc]
push str.error_reading_registry__d_n
push eax
call fcn.0051d0e8
add esp, 0xc
lea ecx, [ebp - 0x1cc]
push ecx
mov ecx, esi
call fcn.004c2cc0
mov edx, dword [esi + 0x68]
mov eax, dword [esi + 0x14]
mov dword [esi + 0x44], 0
mov dword [esi + 0x20], edx
mov ecx, dword [eax]
mov edx, dword [edi + 0x20]
mov eax, dword [ecx + 0x18]
cmp edx, eax
mov ecx, dword [ecx + 0x1c]
jne 0x4c5d7a
mov edx, dword [edi + 0x24]
cmp edx, ecx
jne 0x4c5d7a
jmp 0x4c5d42
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x3c]
sub ecx, 1
sbb edx, 0
mov dword [edi + 0x30], ecx
dec eax
mov dword [edi + 0x34], edx
mov dword [esi + 0x20], eax
mov ecx, dword [edi + 0x64]
xor eax, eax
mov dword [edi + 0x38], eax
mov dword [edi + 0x3c], eax
mov edx, dword [ecx + 4]
push edx
mov edx, dword [edi + 0x30]
mov eax, dword [ecx]
mov ecx, dword [edi + 0x34]
push eax
mov eax, dword [ebp - 0x18]
push ecx
mov ecx, dword [ebp - 0x1c]
push edx
mov edx, dword [ebp - 0x14]
push eax
mov eax, dword [ebx]
push ecx
push edx
mov ecx, dword [eax + 0x24]
push ecx
lea ecx, [ebp - 0x1cc]
mov edx, dword [eax + 0x20]
mov eax, dword [ebx + 0x24]
push edx
push eax
push str.new_listitem_id___d__startpos___I64d__file__s___ndownloaded___I64d__endpos___I64d__totaldownloaded___I64d_n
push ecx
call fcn.0051d0e8
add esp, 0x30
lea edx, [ebp - 0x1cc]
mov ecx, esi
push edx
call fcn.004c2cc0
mov eax, dword [ebp - 0x14]
push eax
call fcn.005380ca
mov ecx, dword [esi + 0x18]
add esp, 4
mov edx, dword [ecx + 0x1c]
mov dword [ebx + 0x1c], edx
mov eax, dword [esi + 0x18]
mov dword [eax + 0x1c], ebx
mov eax, dword [ebp - 0x40]
mov dword [edi + 0x60], ebx
cmp eax, 0xffffffff
mov dword [esi + 0x18], ebx
je 0x4c5eb2
push eax
push ebx
mov ecx, esi
call fcn.004c6070
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 4