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

Disassembly:
push 0xffffffffffffffff
push 0x43e548
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x30
push ebx
push ebp
mov ebp, ecx
push esi
push edi
lea ecx, [esp + 0x10]
xor ebx, ebx
call sub.MFC42.DLL_CString::CString_3
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x48], ebx
cmp eax, 0xb
je 0x406df1
cmp eax, 0x12
mov ebx, 7
je 0x406df1
cmp eax, 0xc
je 0x406dc2
cmp eax, 0x13
je 0x406dc2
lea ecx, [esp + 0x10]
mov dword [esp + 0x48], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov eax, 0xfffffff6
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
mov ecx, ebp
call fcn.00407040
lea ecx, [esp + 0x10]
mov esi, eax
mov dword [esp + 0x48], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov eax, esi
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
mov eax, dword [ebp + 0xc]
add eax, ebx
mov dl, byte [eax + 3]
mov al, byte [eax + 4]
movsx ecx, dl
movsx esi, al
lea ecx, [ecx + ecx*4]
lea ecx, [esi + ecx*2 - 0x210]
mov esi, dword [0x45ed98]
cmp esi, ecx
je 0x406e57
movsx eax, al
movsx ecx, dl
push eax
lea edx, [ebx + 5]
push ecx
lea eax, [ebx + 4]
push edx
push eax
push esi
lea ecx, [esp + 0x24]
push str.Different:_week_is__02d_but_barcode__d__d_digit._were__c_c
push ecx
call sub.MFC42.DLL_CString::Format
add esp, 0x1c
lea edx, [esp + 0x10]
push 1
push ecx
mov ecx, esp
mov dword [esp + 0x1c], esp
push edx
call sub.MFC42.DLL_CString::CString_1
mov ecx, dword [0x490c00]
call fcn.00439d10
mov eax, dword [ebp + 0xc]
xor edx, edx
mov esi, 0xa
mov cl, byte [ebx + eax + 2]
mov eax, dword [0x45ed9c]
div esi
movsx eax, cl
sub eax, 0x30
cmp edx, eax
je 0x406ed8
movsx ecx, cl
add ebx, 3
push ecx
push ebx
push edx
lea edx, [esp + 0x1c]
push str.Different:_year_is__d_but_barcode__d_digit._was__c
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0x14
lea eax, [esp + 0x10]
push 1
push ecx
mov ecx, esp
mov dword [esp + 0x1c], esp
push eax
call sub.MFC42.DLL_CString::CString_1
mov ecx, dword [0x490c00]
call fcn.00439d10
lea ecx, [esp + 0x10]
mov dword [esp + 0x48], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov eax, 0xffffffed
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
mov ecx, ebp
call fcn.00409dd0
test al, al
jne 0x406f0c
lea ecx, [esp + 0x10]
mov dword [esp + 0x48], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov eax, 0xfffffffb
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
mov edx, dword [ebp + 0xc]
lea ecx, [esp + 0x18]
lea esi, [ebx + edx]
mov edx, 4
lea eax, [esi + 0xa]
movsx edi, byte [eax]
sub edi, 0x30
dec eax
mov dword [ecx], edi
add ecx, 4
dec edx
jne 0x406f1e
mov ecx, 6
xor eax, eax
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
movsx eax, byte [esi + 5]
mov dword [0x45ed88], eax
mov dword [0x45f588], eax
mov dword [0x45fd88], eax
mov eax, dword [ebp + 0xc]
movsx eax, byte [ebx + eax + 6]
mov dword [0x45ed8c], eax
mov dword [0x45f58c], eax
mov dword [0x45fd8c], eax
xor eax, eax
cmp eax, 9
mov dword [esp + 0x14], eax
jge 0x406fac
mov edi, 9
lea ecx, [esp + 0x3c]
sub edi, eax
mov eax, dword [ecx]
lea edx, [eax + eax*4]
mov eax, dword [ecx - 4]
lea esi, [eax + edx*2]
mov eax, esi
cdq
and edx, 0xf
add eax, edx
sar eax, 4
and esi, 0x8000000f
mov dword [ecx], eax
jns 0x406f9f
dec esi
or esi, 0xfffffff0
inc esi
mov dword [ecx - 4], esi
add ecx, 0xfffffffc
dec edi
jne 0x406f7a
mov eax, dword [esp + 0x14]
inc eax
cmp eax, 9
mov dword [esp + 0x14], eax
jl 0x406f6f
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x24]
and edx, 0xf
shl ecx, 4
and ecx, 0xf0
or ecx, edx
mov dword [0x45ed90], ecx
mov dword [0x45f590], ecx
mov dword [0x45fd90], ecx
mov ecx, dword [esp + 0x20]
shl eax, 4
and eax, 0xf0
and ecx, 0xf
or eax, ecx
inc ebx
push ebx
push 0xa
mov ecx, ebp
mov dword [0x45ed94], eax
mov dword [0x45f594], eax
mov dword [0x45fd94], eax
call fcn.00407c50
lea ecx, [esp + 0x10]
mov dword [esp + 0x48], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x40]
pop edi
pop esi
pop ebp
mov eax, 1
mov dword fs:[0], ecx
pop ebx
add esp, 0x3c
ret