Function at 0x18004540
Capabilities:
Encode data using xor
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x478
mov eax, dword [0x1804e020]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
cmp dword [ebp + 0xc], 0xffffffff
push esi
lea ecx, [ebp - 0x440]
push edi
mov dword [ebp - 0x454], eax
mov dword [ebp - 0x444], ecx
mov dword [ebp - 0x448], ebx
mov byte [ebp - 0x14], 9
mov byte [ebp - 0x13], 8
mov byte [ebp - 0x12], 3
mov byte [ebp - 0x11], bl
mov byte [ebp - 0x10], 2
mov byte [ebp - 0xf], 5
mov byte [ebp - 0xe], 0xe
mov byte [ebp - 0xd], 0xb
mov byte [ebp - 0xc], 4
mov byte [ebp - 0xb], 7
mov byte [ebp - 0xa], 1
mov byte [ebp - 9], 0xf
mov byte [ebp - 8], 0xc
mov byte [ebp - 7], 0xa
mov byte [ebp - 6], 6
mov byte [ebp - 5], 0xd
je 0x180048d6
push 0x104
lea edx, [ebp - 0x434]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov eax, dword [0x180538b4]
cmp eax, ebx
jne 0x180045e5
call fcn.1800e370
mov eax, dword [0x180538b4]
cmp eax, ebx
je 0x180045f5
push 0x15
call eax
add esp, 4
cmp eax, ebx
mov eax, str.WinHDB90b.ini
jne 0x180045fa
mov eax, str.WinHDB90.ini
push eax
lea eax, [ebp - 0x434]
push 0x104
push eax
call dword [sym.imp.MSVCR90.dll_wcscat_s]
add esp, 0xc
cmp word [ebp - 0x434], bx
jne 0x18004623
mov eax, 0x18040a86
jmp 0x18004715
lea eax, [ebp - 0x434]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x18004630
sub eax, edx
sar eax, 1
mov esi, eax
lea eax, [ebp - 0x434]
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x18004650
sub eax, edx
sar eax, 1
lea ecx, [eax*4 + 0xc]
cmp ecx, 0x400
lea eax, [ebp - 0x434]
lea edx, [eax + 2]
jg 0x180046a0
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x18004677
sub eax, edx
sar eax, 1
lea eax, [eax*4 + 0xc]
call fcn.18029d50
mov eax, esp
cmp eax, ebx
je 0x180046cd
mov dword [eax], 0xcccc
jmp 0x180046ca
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x180046a0
sub eax, edx
sar eax, 1
lea edx, [eax*4 + 0xc]
push edx
call dword [sym.imp.MSVCR90.dll_malloc]
add esp, 4
cmp eax, ebx
je 0x180046cd
mov dword [eax], 0xdddd
add eax, 8
lea edi, [esi*4 + 4]
mov ebx, eax
lea esi, [ebp - 0x448]
call fcn.180022d0
xor eax, eax
cmp edi, 1
jle 0x1800470d
lea ecx, [ebp - 0x44c]
push ecx
push eax
push edi
push ebx
lea edx, [ebp - 0x434]
push edx
mov dword [ebp - 0x44c], eax
push eax
or eax, 0xffffffff
xor ecx, ecx
call fcn.1801f770
add esp, 0x18
mov byte [eax + ebx], 0
mov eax, ebx
xor ebx, ebx
push 0x18040994
push eax
lea eax, [ebp - 0x438]
push eax
call dword [sym.imp.MSVCR90.dll_fopen_s]
add esp, 0xc
test eax, eax
jne 0x180048ea
push 0x100
lea ecx, [ebp - 0x12c]
push ebx
push ecx
call sub.MSVCR90.dll_memset
mov edi, dword [sym.imp.MSVCR90.dll_fgetc]
add esp, 0xc
xor esi, esi
mov edx, dword [ebp - 0x438]
push edx
call dword [sym.imp.MSVCR90.dll_feof]
add esp, 4
test eax, eax
jne 0x1800477d
mov eax, dword [ebp - 0x438]
push eax
call edi
mov byte [ebp + esi - 0x12c], al
inc esi
add esp, 4
cmp esi, 0x10
jl 0x18004750
lea eax, [ebp - 0x12c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x18004786
sub eax, edx
shr eax, 1
mov esi, eax
xor eax, eax
cmp esi, ebx
jle 0x180047d1
lea esp, [esp]
movzx ecx, byte [ebp + eax - 0xc]
mov dl, byte [ebp + ecx - 0x12c]
movzx ecx, byte [ebp + eax - 0x14]
mov cl, byte [ebp + ecx - 0x12c]
mov byte [ebp + eax - 0x2c], dl
mov edx, eax
and edx, 7
xor cl, byte [ebp + edx - 0x2c]
inc eax
cmp eax, esi
mov byte [ebp + eax - 0x22d], cl
jl 0x180047a0
push 4
lea edx, [ebp - 0x22c]
push edx
lea eax, [ebp - 0x20]
mov byte [ebp + esi - 0x22c], bl
mov esi, dword [sym.imp.MSVCR90.dll_strncpy_s]
push 0xa
push eax
call esi
mov edi, dword [sym.imp.MSVCR90.dll_atoi]
lea ecx, [ebp - 0x20]
push ecx
mov byte [ebp - 0x1c], bl
call edi
push 2
sub eax, 0x76c
lea edx, [ebp - 0x228]
push edx
mov dword [ebp - 0x464], eax
lea eax, [ebp - 0x20]
push 0xa
push eax
call esi
lea ecx, [ebp - 0x20]
push ecx
mov byte [ebp - 0x1e], bl
call edi
push 2
dec eax
lea edx, [ebp - 0x226]
push edx
mov dword [ebp - 0x468], eax
lea eax, [ebp - 0x20]
push 0xa
push eax
call esi
lea ecx, [ebp - 0x20]
push ecx
mov byte [ebp - 0x1e], bl
call edi
lea edx, [ebp - 0x478]
push edx
mov dword [ebp - 0x46c], eax
mov dword [ebp - 0x470], ebx
mov dword [ebp - 0x458], ebx
mov dword [ebp - 0x474], ebx
mov dword [ebp - 0x478], ebx
mov dword [ebp - 0x460], ebx
mov dword [ebp - 0x45c], ebx
call dword [sym.imp.MSVCR90.dll__mktime64]
mov esi, eax
lea eax, [ebp - 0x450]
add esp, 0x40
push eax
mov edi, edx
call dword [sym.imp.MSVCR90.dll__time64]
mov ecx, dword [ebp - 0x44c]
mov edx, dword [ebp - 0x450]
push edi
push esi
push ecx
push edx
call fcn.18005540
fdiv qword [0x180437c0]
add esp, 0x14
fldz
fcomp st(1)
fnstsw ax
test ah, 0x41
jp 0x180048e8
fild dword [ebp + 0xc]
fcomp st(1)
fnstsw ax
test ah, 1
jne 0x180048e8
call fcn.18029c90
mov ecx, dword [ebp + 0xc]
sub ecx, eax
mov eax, dword [ebp - 0x454]
mov dword [eax], ecx
lea edi, [ebp - 0x448]
call fcn.18002330
mov eax, 1
jmp 0x1800493c
fstp st(0)
mov ecx, dword [ebp - 0x448]
mov edi, dword [sym.imp.MSVCR90.dll_free]
xor esi, esi
cmp ecx, ebx
jle 0x18004929
lea esp, [esp]
mov edx, dword [ebp - 0x444]
mov eax, dword [edx + esi*4]
cmp eax, ebx
je 0x18004924
sub eax, 8
cmp dword [eax], 0xdddd
jne 0x18004924
push eax
call edi
mov ecx, dword [ebp - 0x448]
add esp, 4
inc esi
cmp esi, ecx
jl 0x18004900
cmp ecx, 2
jle 0x1800493a
mov eax, dword [ebp - 0x444]
push eax
call edi
add esp, 4
xor eax, eax
lea esp, [ebp - 0x484]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1802929c
mov esp, ebp
pop ebp
ret 8