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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x30
and dword [ebp - 4], 0
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
lea edi, [esi + 0x258]
mov dword [ebp - 0x1c], edi
mov ecx, dword [ebp - 4]
xor eax, eax
inc eax
shl eax, cl
test dword [ebp + 0x14], eax
je 0x1004686
push 0
push 0
push ecx
push dword [ebp + 0xc]
call sub.IMM32.dll_ImmGetCandidateListW
mov ebx, eax
test ebx, ebx
je 0x10046a3
cmp dword [edi + 0x88], ebx
je 0x1004376
mov eax, dword [edi]
test eax, eax
je 0x100437b
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [edi + 0x88], 0
and dword [edi], 0
cmp dword [edi], 0
jne 0x1004394
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
mov dword [edi], eax
je 0x10046a3
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 0x10043d5
mov edx, dword [edi + 0xc]
cmp edx, ebx
jae 0x1004699
mov eax, dword [edi + 0x10]
cmp eax, ebx
jae 0x1004699
cmp dword [edi + edx*4 + 0x18], ebx
jae 0x1004699
cmp dword [edi + eax*4 + 0x18], ebx
jae 0x1004699
movsx edx, word [esi + 8]
mov eax, 0x80
cmp edx, eax
mov dword [ebp + 0x10], edx
jbe 0x10043e8
mov dword [ebp + 0x10], eax
push 0xc
pop eax
cmp dword [ebp + 0x10], eax
jae 0x10043f3
mov dword [ebp + 0x10], eax
mov eax, dword [ebp + 0x10]
push 5
add eax, 0xfffffff9
xor edx, edx
pop ebx
div ebx
mov ebx, eax
cmp ebx, 9
jbe 0x100440a
push 9
pop ebx
xor edx, edx
mov eax, ecx
div ebx
push 0x64
pop edx
add eax, 0xa
cmp eax, edx
mov dword [ebp - 0x10], eax
ja 0x1004420
mov dword [ebp - 0x10], edx
cmp dword [edi + 4], 2
jne 0x1004436
mov dword [ebp - 0x14], 1
mov dword [ebp - 0x18], 7
jmp 0x1004453
xor edx, edx
xor ebx, ebx
inc edx
cmp ecx, edx
mov dword [ebp - 0x14], ebx
jb 0x100444c
lea edx, [edx + edx*4]
shl edx, 1
inc ebx
cmp edx, ecx
jbe 0x1004442
lea eax, [ebx + ebx + 1]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x10]
shl ecx, 2
cmp dword [esi + 0x36c], ecx
mov dword [ebp - 0x10], ecx
je 0x1004484
lea ebx, [esi + 0x368]
mov eax, dword [ebx]
test eax, eax
je 0x1004484
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 0x10044ad
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
mov dword [esi + 0x368], eax
je 0x10046a3
mov eax, dword [ebp - 0x10]
mov dword [esi + 0x36c], eax
xor eax, eax
cmp dword [ebp - 0x14], eax
je 0x1004500
mov ecx, dword [esi + 0x368]
mov dword [ecx], eax
xor ecx, ecx
inc ecx
cmp dword [ebp + 0x18], eax
je 0x10044d4
mov eax, dword [edi + 0xc]
push 9
xor edx, edx
pop ebx
div ebx
mov dword [esi + 0x360], edx
mov ebx, dword [esi + 0x360]
jmp 0x10044e9
mov eax, dword [esi + 0x368]
mov dword [eax + ecx*4], ebx
inc ecx
add ebx, 9
cmp ebx, dword [edi + 8]
jb 0x10044dc
mov eax, dword [edi + 8]
cmp ebx, eax
jbe 0x10045a0
mov ebx, eax
jmp 0x10045a0
cmp dword [ebp + 0x18], eax
je 0x100450b
mov dword [esi + 0x360], eax
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 - 8], 1
call fcn.0100354e
xor ebx, ebx
add eax, 3
inc ebx
cmp dword [edi + 8], ebx
mov dword [ebp - 0xc], eax
jbe 0x100459d
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
mov ecx, dword [ebp - 0xc]
lea ecx, [ecx + eax + 3]
cmp ecx, dword [ebp - 0x20]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0xc], ecx
ja 0x100457e
mov eax, dword [esi + 0x368]
mov edx, dword [ebp - 8]
mov ecx, ebx
sub ecx, dword [eax + edx*4 - 4]
cmp ecx, 9
jb 0x1004593
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 8]
inc dword [ebp - 8]
mov ecx, dword [esi + 0x368]
add eax, 3
mov dword [ecx + edx*4], ebx
mov dword [ebp - 0xc], eax
add dword [ebp - 0x10], 4
inc ebx
cmp ebx, dword [edi + 8]
jb 0x1004548
mov ecx, dword [ebp - 8]
mov eax, dword [esi + 0x368]
mov dword [eax + ecx*4], ebx
mov dword [esi + 0x364], ecx
mov ecx, dword [ebp + 0x10]
lea ebx, [ecx + ecx*2 + 4]
cmp dword [esi + 0x2dc], ebx
jae 0x10045fd
mov eax, dword [esi + 0x2d8]
test eax, eax
je 0x10045dd
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [esi + 0x2d8], 0
and dword [esi + 0x2dc], 0
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
mov dword [esi + 0x2d8], eax
je 0x10046a3
mov ecx, dword [ebp + 0x10]
mov dword [esi + 0x2dc], ebx
push dword [ebp - 0x14]
mov eax, dword [esi + 0x2d8]
push esi
push dword [ebp - 0x18]
lea edx, [ecx + ecx + 4]
mov dword [eax], edx
push ecx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x30], 0x4b425935
mov dword [ebp - 0x2c], ebx
mov ecx, dword [eax]
add ecx, eax
push ecx
add eax, 4
push eax
push edi
call fcn.01003d17
mov edi, eax
mov eax, dword [esi + 0x368]
mov dword [esi + 0x370], 1
shl edi, 2
push dword [edi + eax]
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
and dword [esi + 0x370], 0
lea eax, [ebp - 0x30]
push eax
push dword [ebp + 8]
push dword [esi + 4]
call fcn.01001981
mov edi, dword [ebp - 0x1c]
inc dword [ebp - 4]
add edi, 4
cmp dword [ebp - 4], 0x20
mov dword [ebp - 0x1c], edi
jb 0x100432f
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
leave
ret 0x14
xor eax, eax
jmp 0x100469c