Function at 0x51e6678f
Capabilities:
Identify system language via api

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x51e8c344]
push ebx
push esi
push edi
push dword [eax]
call fcn.51e1637c
and dword [ebp - 0x10], 0
cmp dword [ebp + 0x10], 0xffffffff
mov ebx, dword [ebp + 8]
mov edi, eax
mov eax, dword [0x51e8c348]
mov dword [ebp - 0x18], 0xff
mov esi, dword [eax + 0x34]
pop ecx
mov dword [ebp - 0xc], edi
jne 0x51e667d0
push ebx
call fcn.51e6676d
pop ecx
mov dword [ebp + 0x10], eax
push dword [ebp + 0x10]
call fcn.51e16386
pop ecx
mov ecx, dword [ebp + 0xc]
sub ecx, eax
cmp ecx, dword [ebp + 0x10]
mov dword [ebp - 8], ecx
jl 0x51e667ec
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 8], ecx
test ecx, ecx
jge 0x51e667f4
and dword [ebp - 8], 0
push ebx
call fcn.51e16d90
mov eax, dword [0x51e8c348]
cmp dword [eax + 0x15c], 0
pop ecx
je 0x51e66811
push edi
call fcn.51e03933
jmp 0x51e66816
call fcn.51e16d81
mov ecx, dword [0x51e8c348]
test byte [ecx + 8], 0x40
lea eax, [edi + eax*2]
mov dword [ebp - 4], eax
je 0x51e6685e
mov eax, dword [ecx + 0xc]
mov ebx, dword [eax + 8]
mov esi, dword [ebp - 8]
mov eax, esi
cdq
idiv ebx
mov edx, dword [ebp + 8]
mov ecx, dword [ecx + 0x28]
add edx, eax
cmp edx, ecx
jae 0x51e66844
mov ecx, edx
imul eax, ebx
push ebx
sub esi, eax
push esi
push 0x64
lea edi, [edi + ecx*2]
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov dword [ebp - 0x14], eax
jmp 0x51e669e4
push 0
call fcn.51e115e1
test eax, eax
pop ecx
je 0x51e669be
and dword [ebp - 0x14], 0
lea eax, [ebx + ebx]
add edi, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [0x51e8c348]
test byte [eax + 8], 1
mov dword [ebp - 0xc], edi
jne 0x51e6689d
push dword [ebp - 4]
push edi
call fcn.51e0af33
pop ecx
pop ecx
push edi
call fcn.51e03933
mov esi, eax
jmp 0x51e66902
cmp esi, ebx
ja 0x51e668d7
push 1
push dword [eax + 0xdc]
lea eax, [ebp - 0x48]
push eax
call fcn.51e033b1
lea eax, [ebp - 0x48]
push eax
call fcn.51e038e8
add esp, 0x10
jmp 0x51e668d3
mov eax, dword [ebp - 0x3c]
add esi, dword [eax]
cmp esi, ebx
ja 0x51e668d7
lea eax, [ebp - 0x48]
push eax
call fcn.51e038e8
pop ecx
test eax, eax
jne 0x51e668c0
call fcn.51e16d81
cmp esi, eax
jb 0x51e668e7
call fcn.51e16d81
mov esi, eax
cmp esi, ebx
jae 0x51e66900
mov eax, dword [ebp - 4]
sub eax, edi
sar eax, 1
mov ecx, 0x1fe
cmp eax, ecx
jl 0x51e668fd
mov eax, ecx
lea esi, [eax + ebx]
sub esi, ebx
cmp si, 0x1fe
mov dword [ebp - 0x10], esi
jb 0x51e66913
mov dword [ebp - 0x10], 0x1fe
mov eax, dword [0x51e8c348]
mov ecx, dword [eax + 0xc]
mov dword [0x51eb3d58], ecx
xor ecx, ecx
mov cl, byte [eax + 0x151]
push ecx
push 0x51eb3d58
lea ecx, [ebp + 0xe]
push ecx
lea ecx, [ebp - 0x18]
push ecx
mov ecx, dword [0x51e8b69c]
push dword [ecx + 0x5380]
xor ecx, ecx
mov cl, byte [eax + 0x13c]
push ecx
movzx ecx, byte [eax + 0x135]
push ecx
push edi
push dword [ebp - 0x10]
push dword [ebp - 8]
push edi
push dword [eax + 4]
call fcn.51e589dc
movsx eax, ax
lea edi, [edi + eax*2]
mov eax, dword [0x51e8c348]
lea ecx, [eax + 0x140]
add esp, 0x30
cmp dword [ecx], 0xffffffff
jne 0x51e66987
movzx edx, word [ebp + 0xe]
mov dword [eax + 0x144], edx
movzx edx, word [ebp + 0xe]
mov dword [eax + 0x148], edx
mov eax, dword [ebp - 0x1c]
sub dword [ebp - 0xc], eax
mov dword [ecx], edx
jmp 0x51e669a9
mov eax, dword [0x51e8c348]
inc edi
inc edi
or dword [eax + 0x140], 0xffffffff
push edi
call fcn.51e6a173
test eax, eax
pop ecx
jne 0x51e6699b
cmp edi, dword [ebp - 4]
jbe 0x51e669e7
mov edi, dword [ebp - 4]
jmp 0x51e669e4
lea eax, [ebp - 0x14]
push eax
mov eax, dword [0x51e8c348]
push dword [eax + 4]
push dword [eax + 0xc]
lea eax, [ebp - 8]
push eax
push 7
push dword [ebp - 4]
lea eax, [edi + ebx*2]
push eax
call fcn.51e16249
add esp, 0x1c
mov edi, eax
cmp edi, dword [ebp - 4]
jae 0x51e66a54
mov eax, dword [0x51e8c348]
test byte [eax + 9], 0x20
mov eax, dword [0x51e8b69c]
jne 0x51e66a02
cmp byte [eax + 0xa4], 0
je 0x51e66a45
test eax, eax
jne 0x51e66a2e
mov esi, dword [sym.imp.KERNEL32.dll_GetUserDefaultLangID]
call esi
cmp ax, 0x411
je 0x51e66a37
call esi
cmp ax, 0x404
je 0x51e66a37
call esi
cmp ax, 0x412
je 0x51e66a37
call esi
cmp ax, 0x804
jne 0x51e66a54
jmp 0x51e66a37
cmp dword [eax + 0x53b8], 0
je 0x51e66a54
mov eax, dword [0x51e8c348]
test byte [eax + 0x11c], 0x10
je 0x51e66a54
cmp dword [ebp - 0x14], 0x32
jl 0x51e66a54
push edi
call fcn.51e64c25
pop ecx
mov edi, eax
mov ecx, dword [0x51e8c348]
xor eax, eax
cmp dword [ecx + 0x15c], eax
je 0x51e66a7b
movzx ecx, word [ebp - 0x10]
add ecx, dword [ebp + 8]
mov eax, edi
sub eax, dword [ebp - 0xc]
sar eax, 1
sub eax, ecx
neg eax
sbb eax, eax
inc eax
jmp 0x51e66a8c
mov ecx, dword [ebp + 0x10]
cmp dword [ebp - 8], ecx
jge 0x51e66a89
cmp dword [ebp - 0x14], 0x32
jl 0x51e66a8c
xor eax, eax
inc eax
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
mov eax, edi
sub eax, dword [ebp - 0xc]
pop edi
pop esi
sar eax, 1
pop ebx
leave
ret