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

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, ecx
push esi
mov esi, edx
push ebx
sub esp, 0x24c
test edx, edx
jle 0x408bc5
mov al, byte [ecx]
lea edx, [eax - 0x2b]
and dl, 0xfd
jne 0x408bc5
fld1
cmp al, 0x2d
mov byte [ebp - 0x231], 1
mov ebx, 1
fchs
fld1
fcmove st(0), st(1)
fstp st(1)
jmp 0x408bd0
mov byte [ebp - 0x231], 0
fld1
xor ebx, ebx
lea eax, [ebx + 2]
cmp eax, esi
jge 0x408c4d
mov al, byte [edi + ebx]
mov edx, ebx
and eax, 0xffffffdf
cmp al, 0x4e
je 0x408bed
cmp al, 0x49
jne 0x408cb4
jmp 0x408c5d
fstp st(0)
mov al, byte [edi + ebx + 1]
and eax, 0xffffffdf
cmp al, 0x41
jne 0x409157
mov al, byte [edi + ebx + 2]
and eax, 0xffffffdf
cmp al, 0x4e
jne 0x409157
add ebx, 3
cmp ebx, esi
jge 0x408c3d
mov al, byte [edi + edx + 3]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x409157
lea edx, [eax - 0x30]
cmp dl, 9
jbe 0x409157
cmp al, 0x5f
je 0x409157
fld dword [0xe50a98]
mov eax, dword [ebp + 8]
fstp qword [eax]
jmp 0x40916f
mov dword [ebp - 0x224], 0xffffffff
cmp ebx, esi
jl 0x408cb4
jmp 0x408cd3
mov al, byte [edi + ebx + 1]
and eax, 0xffffffdf
cmp al, 0x4e
jne 0x40913d
mov al, byte [edi + ebx + 2]
and eax, 0xffffffdf
cmp al, 0x46
jne 0x409141
add ebx, 3
cmp ebx, esi
jge 0x408cab
mov al, byte [edi + edx + 3]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 0x19
jbe 0x409145
lea edx, [eax - 0x30]
cmp dl, 9
jbe 0x409149
cmp al, 0x5f
je 0x40914d
fld1
fldz
jmp 0x408f7e
mov dword [ebp - 0x224], 0xffffffff
movzx eax, byte [edi + ebx]
lea edx, [eax - 0x30]
cmp dl, 9
ja 0x408cd3
sub eax, 0x30
mov dword [ebp - 0x224], eax
mov dword [ebp - 0x22c], 0
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x21c], 0
cmp ebx, esi
jge 0x408e73
mov cl, byte [edi + ebx]
lea eax, [ecx - 0x30]
cmp al, 9
ja 0x408d65
imul eax, dword [ebp - 0x21c], 0xa
inc dword [ebp - 0x22c]
mov dword [ebp - 0x228], eax
mov eax, 0xa
mul dword [ebp - 0x220]
mov dword [ebp - 0x21c], edx
mov dword [ebp - 0x220], eax
mov eax, dword [ebp - 0x228]
add dword [ebp - 0x21c], eax
movzx eax, cl
sub eax, 0x30
cdq
add eax, dword [ebp - 0x220]
adc edx, dword [ebp - 0x21c]
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x21c], edx
inc ebx
cmp ebx, esi
je 0x408cf1
cmp byte [edi + ebx], 0x5f
je 0x408d58
jmp 0x408cf1
cmp cl, 0x2e
jne 0x408e73
inc ebx
cmp dword [ebp - 0x22c], 0
jne 0x408d98
xor edx, edx
mov eax, edx
cmp ebx, esi
jge 0x408d9a
cmp byte [edi + ebx], 0x30
jne 0x40915b
inc edx
inc ebx
cmp ebx, esi
je 0x408d7a
cmp byte [edi + ebx], 0x5f
je 0x408d8b
jmp 0x408d7a
xor eax, eax
cmp dword [ebp - 0x224], 0xffffffff
jne 0x408dc6
cmp ebx, esi
jge 0x408dc6
mov dword [ebp - 0x224], 0xffffffff
movzx edx, byte [edi + ebx]
lea ecx, [edx - 0x30]
cmp cl, 9
ja 0x408dc6
lea ecx, [edx - 0x30]
mov dword [ebp - 0x224], ecx
mov dword [ebp - 0x238], eax
mov dword [ebp - 0x23c], 0
mov eax, dword [ebp - 0x238]
mov dword [ebp - 0x228], eax
mov eax, dword [ebp - 0x23c]
mov dword [ebp - 0x230], eax
cmp ebx, esi
jge 0x408e87
mov cl, byte [edi + ebx]
lea eax, [ecx - 0x30]
cmp al, 9
ja 0x408e87
imul eax, dword [ebp - 0x21c], 0xa
inc dword [ebp - 0x23c]
inc dword [ebp - 0x238]
mov dword [ebp - 0x228], eax
mov eax, 0xa
mul dword [ebp - 0x220]
mov dword [ebp - 0x21c], edx
mov dword [ebp - 0x220], eax
mov eax, dword [ebp - 0x228]
add dword [ebp - 0x21c], eax
movzx eax, cl
sub eax, 0x30
cdq
add eax, dword [ebp - 0x220]
adc edx, dword [ebp - 0x21c]
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x21c], edx
inc ebx
cmp ebx, esi
je 0x408dd6
cmp byte [edi + ebx], 0x5f
je 0x408e5f
jmp 0x408dd6
mov dword [ebp - 0x228], 0
mov dword [ebp - 0x230], 0
mov eax, dword [ebp - 0x22c]
add eax, dword [ebp - 0x230]
mov dword [ebp - 0x238], eax
jne 0x408eb5
test ebx, ebx
je 0x40916d
cmp ebx, 1
jne 0x408eb5
cmp byte [ebp - 0x231], 0
jne 0x409151
lea edx, [ebx + 1]
cmp edx, esi
jge 0x408f27
mov al, byte [edi + ebx]
and eax, 0xffffffdf
cmp al, 0x45
jne 0x408f27
mov al, byte [edi + edx]
cmp al, 0x2b
je 0x408ed6
cmp al, 0x2d
jne 0x408ee0
or edx, 0xffffffff
jmp 0x408edb
mov edx, 1
add ebx, 2
jmp 0x408ee7
mov ebx, edx
mov edx, 1
mov al, byte [edi + ebx]
sub eax, 0x30
cmp al, 9
ja 0x409155
xor eax, eax
cmp ebx, esi
jge 0x408f2e
mov cl, byte [edi + ebx]
mov byte [ebp - 0x231], cl
sub ecx, 0x30
cmp cl, 9
ja 0x408f2e
imul eax, eax, 0xa
movzx ecx, byte [ebp - 0x231]
lea eax, [eax + ecx - 0x30]
inc ebx
cmp ebx, esi
je 0x408ef7
cmp byte [edi + ebx], 0x5f
je 0x408f1a
jmp 0x408ef7
mov edx, 1
xor eax, eax
imul eax, edx
sub eax, dword [ebp - 0x228]
mov esi, eax
neg eax
cmovs eax, esi
mov dword [ebp - 0x228], eax
cmp eax, 0x3e7
jg 0x408f56
cmp dword [ebp - 0x238], 0xf
jg 0x408f91
jmp 0x408fab
mov eax, dword [ebp - 0x21c]
or eax, dword [ebp - 0x220]
je 0x408f70
test esi, esi
fldz
js 0x408f85
fld1
fxch st(1)
jmp 0x408f7e
fstp st(0)
mov eax, dword [ebp + 8]
fldz
fstp qword [eax]
jmp 0x40916f
fdivp st(1)
jmp 0x40900b
fmulp st(1)
mov eax, dword [ebp + 8]
fstp qword [eax]
jmp 0x40916f
cmp dword [ebp - 0x238], 0x10
jne 0x40905b
cmp dword [ebp - 0x224], 9
je 0x40905f
cmp dword [ebp - 0x228], 0x16
jle 0x408fd7
mov eax, 0xf
sub eax, dword [ebp - 0x22c]
sub eax, dword [ebp - 0x230]
lea edx, [eax + 0x16]
cmp edx, dword [ebp - 0x228]
jge 0x409019
fstp st(0)
jmp 0x409065
fild qword [ebp - 0x220]
cmp dword [ebp - 0x21c], 0
jns 0x408fec
fadd dword [0xe50a9c]
fstp qword [ebp - 0x220]
fld qword [ebp - 0x220]
mov eax, dword [ebp - 0x228]
fmulp st(1)
fld qword [eax*8 + 0xe50620]
test esi, esi
js 0x409012
fmulp st(1)
jmp 0x409105
fdivp st(1)
jmp 0x409105
test esi, esi
js 0x409063
fild qword [ebp - 0x220]
cmp dword [ebp - 0x21c], 0
jns 0x409032
fadd dword [0xe50a9c]
mov edx, dword [ebp - 0x228]
fstp qword [ebp - 0x220]
fld qword [ebp - 0x220]
sub edx, eax
fmulp st(1)
fmul qword [eax*8 + 0xe50620]
fmul qword [edx*8 + 0xe50620]
jmp 0x409105
fstp st(0)
jmp 0x409065
fstp st(0)
jmp 0x409065
fstp st(0)
mov edx, 0x1f4
lea eax, [ebp - 0x20c]
call fcn.00403ae1
xor ecx, ecx
test ebx, ebx
je 0x4090a6
xor eax, eax
cmp byte [edi], 0x2e
sete al
cmp ebx, eax
jle 0x4090a6
mov dl, byte [edi + eax]
mov byte [ebp - 0x220], dl
sub edx, 0x2b
and dl, 0xfd
je 0x40910c
mov dl, byte [ebp - 0x220]
sub edx, 0x30
cmp dl, 9
jbe 0x40910c
mov eax, esi
mov esi, 0xa
mov dword [esp + 4], 0
sar eax, 0x1f
mov byte [ebp + ecx - 0x20c], 0x45
and eax, 2
add eax, 0x2b
mov byte [ebp + ecx - 0x20b], al
mov eax, dword [ebp - 0x228]
cdq
idiv esi
add edx, 0x30
mov byte [ebp + ecx - 0x208], dl
cdq
idiv esi
add eax, 0x30
add edx, 0x30
mov byte [ebp + ecx - 0x20a], al
lea eax, [ebp - 0x20c]
mov dword [esp], eax
mov byte [ebp + ecx - 0x209], dl
call fcn.0043b480
mov eax, dword [ebp + 8]
fstp qword [eax]
jmp 0x40916f
cmp ecx, 0x1ed
jg 0x409122
mov dl, byte [ebp - 0x220]
mov byte [ebp + ecx - 0x20c], dl
inc ecx
inc eax
cmp ebx, eax
je 0x409083
mov dl, byte [edi + eax]
cmp dl, 0x2e
je 0x409122
cmp dl, 0x5f
je 0x409122
jmp 0x409083
fstp st(0)
jmp 0x409157
fstp st(0)
jmp 0x409157
fstp st(0)
jmp 0x409157
fstp st(0)
jmp 0x409157
fstp st(0)
jmp 0x409157
fstp st(0)
jmp 0x409157
fstp st(0)
xor ebx, ebx
jmp 0x40916f
cmp dword [ebp - 0x224], 0xffffffff
jne 0x408dc6
jmp 0x408da7
fstp st(0)
add esp, 0x24c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret 4