Function at 0x10046ac
Capabilities:
Validate payment card number using luhn algorithm

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x30
push 0x288
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
mov dword [ebp - 0x1c], eax
je 0x1004a03
and dword [ebp - 4], 0
push esi
mov esi, dword [ebp + 0x10]
push edi
lea edi, [esi + 0x258]
mov dword [ebp - 0x14], edi
push ebx
mov ecx, dword [ebp - 4]
xor eax, eax
inc eax
shl eax, cl
test dword [ebp + 0x14], eax
je 0x10049e1
push 0
push 0
push ecx
push dword [ebp + 0xc]
call sub.IMM32.dll_ImmGetCandidateListW
mov ebx, eax
test ebx, ebx
je 0x1004a07
cmp dword [edi + 0x88], ebx
je 0x1004726
mov eax, dword [edi]
test eax, eax
je 0x100472b
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [edi + 0x88], 0
and dword [edi], 0
cmp dword [edi], 0
jne 0x1004744
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
mov dword [edi], eax
je 0x1004a07
mov dword [edi + 0x88], ebx
mov edi, dword [edi]
push ebx
push edi
push dword [ebp - 4]
push dword [ebp + 0xc]
call sub.IMM32.dll_ImmGetCandidateListW
mov ecx, dword [edi + 8]
cmp ecx, 1
jbe 0x1004785
mov edx, dword [edi + 0xc]
cmp edx, ebx
jae 0x10049f4
mov eax, dword [edi + 0x10]
cmp eax, ebx
jae 0x10049f4
cmp dword [edi + edx*4 + 0x18], ebx
jae 0x10049f4
cmp dword [edi + eax*4 + 0x18], ebx
jae 0x10049f4
movsx edx, word [esi + 8]
mov eax, 0x80
cmp edx, eax
mov dword [ebp + 0x10], edx
jbe 0x1004798
mov dword [ebp + 0x10], eax
push 0xc
pop eax
cmp dword [ebp + 0x10], eax
jae 0x10047a3
mov dword [ebp + 0x10], eax
sub dword [ebp + 0x10], 8
mov eax, dword [ebp + 0x10]
push 5
add eax, 0xfffffff9
xor edx, edx
pop ebx
div ebx
mov ebx, eax
cmp ebx, 9
jbe 0x10047be
push 9
pop ebx
xor edx, edx
mov eax, ecx
div ebx
add eax, 0xa
cmp eax, 0x64
ja 0x10047cf
push 0x64
pop eax
xor edx, edx
inc edx
xor ebx, ebx
cmp ecx, edx
jb 0x10047e2
lea edx, [edx + edx*4]
shl edx, 1
inc ebx
cmp edx, ecx
jbe 0x10047d8
lea ecx, [ebx + ebx + 1]
mov dword [ebp - 0x18], ecx
mov ecx, eax
shl ecx, 2
cmp dword [esi + 0x36c], ecx
mov dword [ebp - 0x10], ecx
je 0x1004819
lea ebx, [esi + 0x368]
mov eax, dword [ebx]
test eax, eax
je 0x1004819
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [ebx], 0
and dword [esi + 0x36c], 0
mov ecx, dword [ebp - 0x10]
cmp dword [esi + 0x368], 0
jne 0x1004842
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
mov dword [esi + 0x368], eax
je 0x1004a07
mov eax, dword [ebp - 0x10]
mov dword [esi + 0x36c], eax
cmp dword [ebp + 0x18], 0
je 0x100484f
and dword [esi + 0x360], 0
mov eax, dword [esi + 0x368]
mov ecx, dword [esi + 0x360]
mov dword [eax], ecx
mov eax, dword [edi + 0x18]
add eax, edi
push eax
mov dword [ebp - 0xc], 1
call fcn.0100354e
mov ebx, eax
xor eax, eax
inc eax
add ebx, 3
cmp dword [edi + 8], eax
mov dword [ebp - 8], eax
jbe 0x10048e3
mov eax, dword [ebp + 0x10]
sub eax, dword [ebp - 0x18]
mov dword [ebp - 0x20], eax
lea eax, [edi + 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
add eax, edi
push eax
call fcn.0100354e
lea ebx, [ebx + eax + 3]
cmp ebx, dword [ebp - 0x20]
mov dword [ebp - 0x24], eax
ja 0x10048bf
mov eax, dword [esi + 0x368]
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
sub ecx, dword [eax + edx*4 - 4]
cmp ecx, 9
jb 0x10048d4
mov eax, dword [ebp - 0x24]
mov ebx, dword [ebp - 0xc]
mov ecx, dword [esi + 0x368]
mov edx, dword [ebp - 8]
inc dword [ebp - 0xc]
mov dword [ecx + ebx*4], edx
lea ebx, [eax + 3]
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
add dword [ebp - 0x10], 4
cmp eax, dword [edi + 8]
jb 0x100488e
mov eax, dword [ebp - 0xc]
mov ecx, dword [esi + 0x368]
mov edx, dword [ebp - 8]
mov ebx, dword [ebp + 0x10]
mov dword [ecx + eax*4], edx
mov dword [esi + 0x364], eax
lea eax, [ebx + ebx*2 + 4]
cmp dword [esi + 0x2dc], eax
jae 0x100494b
mov eax, dword [esi + 0x2d8]
test eax, eax
je 0x1004926
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [esi + 0x2d8], 0
and dword [esi + 0x2dc], 0
lea eax, [ebx + ebx*2 + 4]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
mov dword [esi + 0x2d8], eax
je 0x1004a07
lea eax, [ebx + ebx*2 + 4]
mov dword [esi + 0x2dc], eax
mov eax, dword [esi + 0x2d8]
push esi
push dword [ebp - 0x18]
lea ecx, [ebx + ebx + 4]
mov dword [eax], ecx
push ebx
add ecx, eax
push ecx
add eax, 4
push eax
push edi
call fcn.01004020
mov edi, eax
mov eax, dword [esi + 0x368]
mov dword [esi + 0x370], 1
shl edi, 2
push dword [eax + edi]
push dword [ebp - 4]
push 0x16
push dword [ebp + 0xc]
call sub.IMM32.dll_ImmNotifyIME
mov eax, dword [esi + 0x368]
add eax, edi
mov ecx, dword [eax + 4]
sub ecx, dword [eax]
push ecx
push dword [ebp - 4]
push 0x17
push dword [ebp + 0xc]
call sub.IMM32.dll_ImmNotifyIME
mov eax, dword [ebp - 0x1c]
and dword [esi + 0x370], 0
push eax
push esi
mov dword [ebp - 0x30], 0x4b425931
mov dword [ebp - 0x2c], 0x288
mov dword [ebp - 0x28], eax
call fcn.01003493
test eax, eax
je 0x10049de
lea eax, [ebp - 0x30]
push eax
push dword [ebp + 8]
push dword [esi + 4]
call fcn.01001981
mov edi, dword [ebp - 0x14]
inc dword [ebp - 4]
add edi, 4
cmp dword [ebp - 4], 0x20
mov dword [ebp - 0x14], edi
jb 0x10046df
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor eax, eax
inc eax
pop ebx
pop edi
pop esi
leave
ret 0x14
xor eax, eax
jmp 0x1004a00