Function at 0x402c20
Capabilities:
Query or enumerate registry key
Query or enumerate registry value
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x8c
cmp word [ecx], 0
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x50], edx
mov dword [ebp - 0x6c], ecx
je 0x4033e7
mov eax, ecx
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x402c48
mov edi, dword [ebp - 0x6c]
mov ecx, dword [sym.imp.ucrtbase.dll_malloc]
sub eax, edi
mov dword [ebp - 0x70], ecx
add eax, 0xe
mov dword [esp], eax
call ecx
mov ebx, eax
mov eax, edi
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x402c70
sub eax, dword [ebp - 0x6c]
sar eax, 1
add eax, 7
mov edi, dword [ebp - 0x6c]
mov dword [esp + 8], str._r_n__s__r_n
mov dword [esp + 4], eax
mov dword [esp + 0xc], edi
mov dword [esp], ebx
call sym._swprintf
cmp word [ebx], 0
je 0x403404
mov eax, ebx
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x402cb0
sub eax, ebx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4c]
lea edi, [ebp - 0x1c]
mov dword [esp + 0xc], edi
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_WriteFile]
mov dword [esp + 0x10], 0
mov dword [esp + 4], ebx
mov dword [ebp - 0x58], eax
call eax
mov eax, dword [sym.imp.ucrtbase.dll_free]
sub esp, 0x14
mov dword [ebp - 0x64], eax
mov dword [esp], ebx
call eax
mov edi, dword [ebp - 0x70]
mov dword [esp], 0x200
call edi
mov dword [esp], 0x800
mov dword [ebp - 0x3c], eax
call edi
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x44], 0x800
mov dword [ebp - 0x48], 0x100
lea esi, [esi]
mov eax, dword [ebp - 0x48]
mov dword [esp + 0x10], 0
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x28]
mov dword [esp + 0x1c], eax
mov eax, dword [ebp - 0x40]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x24]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x50]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegEnumValueW]
sub esp, 0x20
test eax, eax
je 0x402db0
cmp eax, 0xea
jne 0x403248
mov ebx, dword [ebp - 0x28]
cmp ebx, dword [ebp - 0x44]
jbe 0x4030f0
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_realloc]
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x40], eax
jmp 0x402d28
mov ecx, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x28]
mov edx, 0x3d
mov eax, 0x409140
mov ebx, dword [ebp - 0x24]
test ecx, ecx
je 0x402ddc
cmp word [ecx], 0
je 0x402ddc
jmp 0x4031a8
movzx edx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x402dd8
sub eax, 0x409140
mov edx, 0x3d
sar eax, 1
mov dword [ebp - 0x20], eax
mov eax, 0x409140
jmp 0x402e04
movzx edx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x402e00
sub eax, 0x409140
lea esi, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp + 0xc], esi
mov dword [esp], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 4], 0x409140
call eax
sub esp, 0x14
mov esi, dword [ebp - 0x20]
cmp ebx, 1
je 0x403000
cmp ebx, 4
je 0x403118
cmp ebx, 3
jne 0x403120
mov eax, 0x65
mov edx, 0x409146
jmp 0x402e6c
movzx eax, word [edx + 2]
add edx, 2
test ax, ax
jne 0x402e68
sub edx, 0x409146
mov eax, 0x409146
mov ebx, edx
mov edx, 0x65
sar ebx, 1
jmp 0x402e94
movzx edx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x402e90
sub eax, 0x409146
lea ecx, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp + 0xc], ecx
mov dword [esp], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 4], 0x409146
call eax
sub esp, 0x14
test edi, edi
je 0x403098
lea eax, [edi + edi*2]
lea edx, [esi + ebx]
add eax, eax
mov dword [ebp - 0x54], edx
mov dword [esp], eax
mov eax, dword [ebp - 0x70]
call eax
mov edx, dword [ebp - 0x54]
mov ebx, eax
mov eax, dword [ebp - 0x40]
lea ecx, [eax + edi - 1]
add edi, eax
mov esi, eax
mov dword [ebp - 0x68], edi
xor edi, edi
mov dword [ebp - 0x60], ecx
mov ecx, edi
mov edi, edx
jmp 0x402f14
add esi, 1
cmp dword [ebp - 0x68], esi
je 0x40304e
movzx eax, byte [esi]
mov dword [esp + 8], str._02x
mov dword [esp + 4], 3
mov dword [esp + 0xc], eax
lea eax, [ebx + ecx*2]
mov dword [esp], eax
mov dword [ebp - 0x54], ecx
call sym._swprintf
mov ecx, dword [ebp - 0x54]
add eax, ecx
cmp dword [ebp - 0x60], esi
je 0x40304e
mov edx, 0x2c
add edi, 3
lea ecx, [eax + 1]
mov word [ebx + eax*2], dx
xor edx, edx
mov word [ebx + eax*2 + 2], dx
cmp edi, 0x4c
jbe 0x402f08
cmp word [ebx], 0
je 0x4033d2
mov eax, ebx
nop
add eax, 2
cmp word [eax], 0
jne 0x402f70
sub eax, ebx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4c]
lea edi, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 0xc], edi
mov dword [esp + 4], ebx
call eax
mov edx, 0xd
mov eax, str._r_n
sub esp, 0x14
jmp 0x402fb4
movzx edx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x402fb0
sub eax, str._r_n
lea edi, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp + 0xc], edi
mov edi, 2
mov dword [esp], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 4], str._r_n
call eax
xor ecx, ecx
sub esp, 0x14
jmp 0x402f08
mov eax, edi
lea ecx, [ebp - 0x1c]
shr eax, 1
sub eax, 1
test edi, edi
cmovne edi, eax
mov eax, dword [ebp - 0x40]
mov edx, edi
call dbg.escape_string
mov esi, eax
mov eax, dword [ebp - 0x1c]
lea edi, [eax + 3]
lea eax, [edi + edi]
mov dword [esp], eax
mov eax, dword [ebp - 0x70]
call eax
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0x409180
mov ebx, eax
mov dword [esp + 4], edi
mov dword [esp], eax
call sym._swprintf
mov dword [esp], esi
mov eax, dword [ebp - 0x64]
call eax
cmp word [ebx], 0
mov eax, ebx
je 0x4033cb
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x403060
sub eax, ebx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4c]
lea esi, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 0xc], esi
mov dword [esp + 4], ebx
call eax
mov eax, dword [ebp - 0x64]
sub esp, 0x14
mov dword [esp], ebx
call eax
mov edx, 0xa
mov eax, 0x40915c
jmp 0x4030ac
movzx edx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x4030a8
sub eax, 0x40915c
lea edi, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp + 0xc], edi
mov dword [esp], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 4], 0x40915c
call eax
add dword [ebp - 0x5c], 1
sub esp, 0x14
jmp 0x402d28
mov eax, dword [ebp - 0x48]
lea ebx, [eax + eax]
shl eax, 2
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_realloc]
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x3c], eax
jmp 0x402d28
test edi, edi
jne 0x403390
mov dword [esp], 0x1e
mov eax, dword [ebp - 0x70]
call eax
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str.hex__x_:
mov dword [esp + 4], 0xf
mov dword [esp], eax
mov dword [ebp - 0x54], eax
call sym._swprintf
mov edx, dword [ebp - 0x54]
mov ebx, eax
cmp word [edx], 0
je 0x4033d9
mov eax, edx
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x403160
sub eax, edx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4c]
lea ecx, [ebp - 0x1c]
mov dword [ebp - 0x54], edx
mov dword [esp + 0xc], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 0x10], 0
call eax
mov edx, dword [ebp - 0x54]
mov eax, dword [ebp - 0x64]
sub esp, 0x14
mov dword [esp], edx
call eax
jmp 0x402eca
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x3c]
lea ecx, [ebp - 0x20]
call dbg.escape_string
mov esi, dword [ebp - 0x20]
mov dword [ebp - 0x54], eax
lea edx, [esi + 4]
mov esi, dword [ebp - 0x70]
lea eax, [edx + edx]
mov dword [ebp - 0x60], edx
mov dword [esp], eax
call esi
mov edx, dword [ebp - 0x60]
mov dword [esp + 8], 0x409174
mov esi, eax
mov eax, dword [ebp - 0x54]
mov dword [esp + 4], edx
mov dword [esp + 0xc], eax
mov dword [esp], esi
call sym._swprintf
cmp word [esi], 0
mov dword [ebp - 0x20], eax
je 0x4033e0
mov eax, esi
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x403200
sub eax, esi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4c]
lea ecx, [ebp - 0x1c]
mov dword [esp + 0xc], ecx
mov dword [esp + 4], esi
mov dword [esp], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 0x10], 0
call eax
sub esp, 0x14
mov dword [esp], esi
mov esi, dword [ebp - 0x64]
call esi
mov eax, dword [ebp - 0x54]
mov dword [esp], eax
call esi
jmp 0x402e3a
mov eax, dword [ebp - 0x40]
mov esi, dword [ebp - 0x64]
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call esi
mov dword [esp], 0x202
mov eax, dword [ebp - 0x70]
call eax
mov ebx, eax
mov eax, dword [ebp - 0x6c]
cmp word [eax], 0
je 0x40340b
lea esi, [esi]
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x403280
sub eax, dword [ebp - 0x6c]
sar eax, 1
mov dword [ebp - 0x40], eax
mov eax, dword [ebp + 8]
xor edi, edi
or eax, 0x20019
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0x101
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x50]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegEnumKeyExW]
sub esp, 0x20
test eax, eax
jne 0x403378
mov ecx, dword [ebp - 0x40]
mov esi, dword [ebp - 0x6c]
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], ecx
mov dword [esp], esi
mov dword [esp + 0xc], eax
call dbg.build_subkey_path
lea ecx, [ebp - 0x1c]
mov dword [esp + 4], ebx
mov dword [esp + 0x10], ecx
mov esi, eax
mov ecx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x50]
mov dword [esp + 8], 0
mov dword [esp + 0xc], ecx
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegOpenKeyExW]
sub esp, 0x14
test eax, eax
je 0x403350
mov dword [esp], esi
mov eax, dword [ebp - 0x64]
add edi, 1
call eax
jmp 0x40329e
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x1c]
mov ecx, esi
mov dword [esp], eax
mov eax, dword [ebp - 0x4c]
call dbg.export_registry_data
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegCloseKey]
sub esp, 4
jmp 0x403337
mov dword [esp], ebx
mov eax, dword [ebp - 0x64]
call eax
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 0x1e
mov eax, dword [ebp - 0x70]
call eax
mov ebx, eax
mov eax, dword [ebp - 0x40]
mov eax, dword [eax]
mov dword [esp + 8], str.dword:_08x
mov dword [esp + 4], 0xf
mov dword [esp + 0xc], eax
mov dword [esp], ebx
call sym._swprintf
cmp word [ebx], 0
mov eax, ebx
jne 0x403060
xor eax, eax
jmp 0x40306b
xor eax, eax
jmp 0x402f7b
xor eax, eax
jmp 0x40316b
xor eax, eax
jmp 0x40320b
mov eax, dword [sym.imp.ucrtbase.dll_malloc]
mov dword [esp], 0xe
mov dword [ebp - 0x70], eax
call eax
mov ebx, eax
mov eax, 7
jmp 0x402c81
xor eax, eax
jmp 0x402cbb
mov dword [ebp - 0x40], 0
jmp 0x403291