Function at 0x51e0d0
Capabilities:
Identify system language via api

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53d29a
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x59a0a0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 4], 0
mov dword [ebp - 0x1c], 0
call fcn.00401980
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x51e122
push 0x80004005
call fcn.00401b40
mov eax, dword [edx]
mov esi, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x51e137
lock inc dword [edx + 0x14]
lea eax, [edx + 8]
jmp 0x51e13b
mov ecx, edx
call esi
add eax, 0x10
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], 1
call fcn.00401980
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x51e164
push 0x80004005
call fcn.00401b40
mov eax, dword [edx]
mov esi, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x51e179
lock inc dword [edx + 0x14]
lea eax, [edx + 8]
jmp 0x51e17d
mov ecx, edx
call esi
add eax, 0x10
mov dword [ebp - 0x18], eax
mov byte [ebp - 4], 2
call fcn.00401980
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x51e1a3
push 0x80004005
call fcn.00401b40
mov eax, dword [edx]
mov esi, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x51e1b8
lock inc dword [edx + 0x14]
lea eax, [edx + 8]
jmp 0x51e1bc
mov ecx, edx
call esi
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
mov byte [ebp - 4], 3
mov ecx, dword [ebp + 8]
push 0x571738
call fcn.00401ff0
lea eax, [ebp - 0x18]
mov dword [ebp - 0x1c], 1
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.0051dce0
lea eax, [ebp - 0x20]
push eax
call fcn.0051e4b0
mov byte [ebp - 4], 4
lea edi, [esi - 0x10]
mov edx, dword [eax]
lea ecx, [edx - 0x10]
cmp ecx, edi
je 0x51e231
cmp dword [edi + 0xc], 0
jl 0x51e222
mov eax, dword [ecx]
cmp eax, dword [edi]
jne 0x51e222
call fcn.004021e0
mov ecx, edi
mov esi, eax
call fcn.00402e90
add esi, 0x10
mov dword [ebp - 0x10], esi
jmp 0x51e231
push dword [edx - 0xc]
lea ecx, [ebp - 0x10]
push edx
call fcn.00402d50
mov esi, dword [ebp - 0x10]
mov byte [ebp - 4], 3
or eax, 0xffffffff
mov ecx, dword [ebp - 0x20]
add ecx, 0xfffffff0
lock xadd dword [ecx + 0xc], eax
dec eax
test eax, eax
jg 0x51e26b
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov edi, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x51e267
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x51e26b
mov ecx, edx
call edi
cmp dword [esi - 0xc], 0
mov ebx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
je 0x51e286
push esi
call fcn.0051e3a0
test eax, eax
je 0x51e286
lea eax, [ebp - 0x10]
jmp 0x51e2cf
call dword [sym.imp.KERNEL32.dll_GetUserDefaultUILanguage]
mov ecx, 0x804
cmp ax, cx
jne 0x51e2a7
mov ecx, dword [ebp + 8]
push 5
push 0x57172c
call fcn.00402d50
jmp 0x51e2d8
cmp dword [edi - 0xc], 0
je 0x51e2bc
push edi
call fcn.0051e3a0
test eax, eax
je 0x51e2bc
lea eax, [ebp - 0x18]
jmp 0x51e2cf
cmp dword [ebx - 0xc], 0
je 0x51e2d8
push ebx
call fcn.0051e3a0
test eax, eax
je 0x51e2d8
lea eax, [ebp - 0x14]
mov ecx, dword [ebp + 8]
push eax
call fcn.00401f90
lea ecx, [esi - 0x10]
mov byte [ebp - 4], 2
or esi, 0xffffffff
mov eax, esi
lock xadd dword [ecx + 0xc], eax
dec eax
test eax, eax
jg 0x51e318
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov ebx, dword [eax + 4]
mov dword [ebp - 0x20], ebx
mov ebx, dword [ebp - 0x14]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x51e313
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x51e318
mov ecx, edx
call dword [ebp - 0x20]
mov byte [ebp - 4], 1
add edi, 0xfffffff0
mov eax, esi
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x51e34e
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x51e34c
mov eax, dword [ecx + 4]
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
push 0
push dword [eax + 4]
call edi
jmp 0x51e354
call edx
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov byte [ebp - 4], 0
add ebx, 0xfffffff0
lock xadd dword [ebx + 0xc], esi
dec esi
test esi, esi
jg 0x51e382
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x51e380
mov eax, dword [ecx + 4]
push 0
push dword [eax + 4]
call edi
jmp 0x51e382
call edx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4