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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x78
mov eax, dword [0x3003fd00]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov dword [ebp - 0x68], eax
mov eax, dword [ebp + 0x10]
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x70], eax
mov eax, dword [edi]
test eax, eax
mov dword [ebp - 0x74], edi
mov ebx, 0x400
jne 0x300576bc
xor esi, esi
call fcn.300058b3
mov ecx, dword [eax]
push 0x400
push esi
push eax
call dword [ecx + 0x10]
test eax, eax
mov dword [ebp - 0x48], eax
je 0x30021eaf
lea esi, [eax + 4]
add eax, 0x400
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x68]
movzx eax, word [eax]
test ax, ax
je 0x30021e50
cmp ax, 0x25
mov edi, dword [ebp - 0x68]
je 0x30021ebd
cmp esi, dword [ebp - 0x50]
jae 0x30057ac2
mov ax, word [edi]
mov word [esi], ax
inc esi
inc esi
inc edi
inc edi
mov dword [ebp - 0x68], edi
mov eax, dword [ebp - 0x68]
movzx eax, word [eax]
test ax, ax
jne 0x30021e1f
mov edi, dword [ebp - 0x74]
cmp esi, dword [ebp - 0x50]
jae 0x30057af4
and word [esi], 0
mov eax, dword [ebp - 0x48]
sub esi, eax
inc esi
inc esi
sar esi, 1
sub esi, 3
push esi
lea ecx, [eax + 4]
push edi
mov dword [edi], ecx
call fcn.30005815
mov esi, eax
test esi, esi
jl 0x30021e7f
and dword [ebp - 0x48], 0
cmp dword [ebp - 0x48], 0
jne 0x30057b20
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.300023ac
leave
ret 0xc
cmp ax, 0x39
ja 0x30021eeb
jmp 0x30021ed3
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x68], eax
jmp 0x30021f7a
mov esi, 0x8007000e
jmp 0x30021e7f
mov esi, 0x80004005
jmp 0x30021e7f
inc edi
inc edi
movzx eax, word [edi]
movzx ecx, ax
add ecx, 0xffffffd0
cmp ecx, 9
ja 0x30021e2c
xor ecx, ecx
imul ecx, ecx, 0xa
movzx eax, ax
inc edi
inc edi
lea ecx, [ecx + eax - 0x30]
movzx eax, word [edi]
cmp ax, 0x30
mov dword [ebp - 0x68], edi
jae 0x30021e9c
cmp ecx, 1
jl 0x30021eb6
cmp ecx, 0x63
jg 0x30021eb6
dec ecx
cmp word [edi], 0x21
mov dword [ebp - 0x60], ecx
jne 0x30021f7a
push 2
pop ecx
mov dword [ebp - 0x68], edi
xor edx, edx
add edi, ecx
cmp word [edi], 0x2d
mov byte [ebp - 0x49], 0
mov byte [ebp - 0x61], 0
mov dword [ebp - 0x54], edx
mov dword [ebp - 0x6c], edx
je 0x300576c4
cmp word [edi], 0x30
je 0x300576cf
movzx eax, word [edi]
cmp ax, 0x30
jb 0x30021f3e
cmp ax, 0x39
jbe 0x300576d5
cmp word [edi], 0x2e
je 0x30057706
cmp edx, dword [ebp - 0x6c]
jl 0x30057717
movzx eax, word [edi]
add edi, ecx
cmp word [edi], 0x21
mov dword [ebp - 0x78], eax
jne 0x30021ea4
add edi, ecx
cmp ax, 0x73
mov dword [ebp - 0x68], edi
jne 0x30057848
test edx, edx
jne 0x30057722
mov eax, dword [ebp - 0x70]
mov ecx, dword [ebp - 0x60]
mov edi, dword [eax + ecx*4]
test edi, edi
je 0x30057a86
cmp word [edi], 0
je 0x30021e42
cmp esi, dword [ebp - 0x50]
jae 0x30057a90
mov ax, word [edi]
mov word [esi], ax
inc esi
inc esi
inc edi
inc edi
jmp 0x30021f8b
lea esi, [eax - 4]
jmp 0x30021ded
add edi, ecx
mov byte [ebp - 0x49], 1
jmp 0x30021f21
mov byte [ebp - 0x61], 1
jmp 0x300576e2
imul edx, edx, 0xa
movzx eax, ax
lea edx, [edx + eax - 0x30]
mov dword [ebp - 0x54], edx
add edi, ecx
jmp 0x30021f2b
cmp ax, 0x39
ja 0x30021f48
mov ecx, dword [ebp - 0x6c]
imul ecx, ecx, 0xa
movzx eax, ax
lea eax, [ecx + eax - 0x30]
push 2
mov dword [ebp - 0x6c], eax
pop ecx
add edi, ecx
movzx eax, word [edi]
cmp ax, 0x30
jb 0x30021f48
jmp 0x300576e9
mov edx, dword [ebp - 0x6c]
mov dword [ebp - 0x54], edx
jmp 0x30021f51
mov ecx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x70]
mov edi, dword [eax + ecx*4]
push edi
mov dword [ebp - 0x60], edi
call fcn.30005465
test edi, edi
mov dword [ebp - 0x58], eax
jne 0x30057742
mov dword [ebp - 0x60], 0x30029df4
mov eax, dword [ebp - 0x6c]
test eax, eax
je 0x30057751
cmp dword [ebp - 0x58], eax
jle 0x30057751
mov dword [ebp - 0x58], eax
cmp byte [ebp - 0x49], 0
je 0x30057795
jmp 0x3005779d
cmp esi, dword [ebp - 0x50]
jb 0x3005778b
add ebx, 0x400
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
mov word [esi], 0x20
inc esi
inc esi
dec dword [ebp - 0x54]
mov eax, dword [ebp - 0x54]
cmp eax, dword [ebp - 0x58]
jg 0x30057759
xor edi, edi
cmp dword [ebp - 0x58], edi
jle 0x300577e8
cmp esi, dword [ebp - 0x50]
jb 0x300577d6
add ebx, 0x400
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
mov eax, dword [ebp - 0x60]
mov ax, word [eax + edi*2]
mov word [esi], ax
inc esi
inc esi
inc edi
cmp edi, dword [ebp - 0x58]
jl 0x300577a4
cmp byte [ebp - 0x49], 0
je 0x30021e42
mov eax, dword [ebp - 0x58]
cmp dword [ebp - 0x54], eax
jle 0x30021e42
cmp esi, dword [ebp - 0x50]
jb 0x30057830
add ebx, 0x400
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
mov word [esi], 0x20
inc esi
inc esi
dec dword [ebp - 0x54]
mov eax, dword [ebp - 0x54]
cmp eax, dword [ebp - 0x58]
jle 0x30021e42
jmp 0x300577fe
cmp byte [ebp - 0x61], 0
mov byte [ebp - 0x59], 0
je 0x30057855
mov dword [ebp - 0x6c], edx
cmp ax, 0x64
lea edi, [ebp - 0x44]
mov dword [ebp - 0x58], edi
jne 0x3005789d
mov eax, dword [ebp - 0x70]
mov ecx, dword [ebp - 0x60]
mov eax, dword [eax + ecx*4]
test eax, eax
jne 0x30057879
mov word [ebp - 0x44], 0x30
lea edi, [ebp - 0x42]
jmp 0x300578e2
jge 0x30057881
mov byte [ebp - 0x59], 1
neg eax
test eax, eax
jbe 0x300578e5
xor edx, edx
push 0xa
pop ecx
div ecx
add edx, 0x30
mov word [edi], dx
inc edi
inc edi
test eax, eax
ja 0x30057885
mov edx, dword [ebp - 0x54]
jmp 0x300578e2
cmp ax, 0x78
je 0x300578a9
cmp ax, 0x58
jne 0x300578e5
mov eax, dword [ebp - 0x70]
mov ecx, dword [ebp - 0x60]
mov ecx, dword [eax + ecx*4]
test ecx, ecx
je 0x3005786e
jbe 0x300578e5
mov eax, ecx
and eax, 0xf
shr ecx, 4
cmp eax, 9
jbe 0x300578d6
cmp word [ebp - 0x78], 0x78
jne 0x300578d1
add eax, 0x57
jmp 0x300578d9
add eax, 0x37
jmp 0x300578d9
add eax, 0x30
mov word [edi], ax
inc edi
inc edi
test ecx, ecx
ja 0x300578b8
mov dword [ebp - 0x58], edi
mov eax, edi
lea ecx, [ebp - 0x44]
sub eax, ecx
sar eax, 1
cmp byte [ebp - 0x59], 0
je 0x300578f5
inc eax
mov ecx, dword [ebp - 0x6c]
xor edi, edi
cmp eax, ecx
mov dword [ebp - 0x54], edi
mov dword [ebp - 0x60], edi
jge 0x3005790d
sub edx, ecx
sub ecx, eax
mov dword [ebp - 0x60], ecx
jmp 0x30057913
cmp eax, edx
jge 0x30057916
sub edx, eax
mov dword [ebp - 0x54], edx
cmp byte [ebp - 0x49], 0
jne 0x30057962
cmp dword [ebp - 0x54], edi
je 0x30057962
mov edi, 0x400
cmp esi, dword [ebp - 0x50]
jb 0x30057954
add ebx, edi
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
mov word [esi], 0x20
inc esi
inc esi
dec dword [ebp - 0x54]
je 0x30057967
jmp 0x30057926
mov edi, 0x400
cmp byte [ebp - 0x59], 0
je 0x300579a2
cmp esi, dword [ebp - 0x50]
jb 0x3005799b
add ebx, edi
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
mov word [esi], 0x2d
inc esi
inc esi
cmp dword [ebp - 0x60], 0
je 0x300579e2
cmp esi, dword [ebp - 0x50]
jb 0x300579d6
add ebx, edi
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
mov word [esi], 0x30
inc esi
inc esi
dec dword [ebp - 0x60]
jne 0x300579a8
lea eax, [ebp - 0x44]
cmp dword [ebp - 0x58], eax
jbe 0x30057a2e
sub dword [ebp - 0x58], 2
cmp esi, dword [ebp - 0x50]
jb 0x30057a1c
add ebx, edi
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
mov eax, dword [ebp - 0x58]
mov cx, word [eax]
mov word [esi], cx
inc esi
lea ecx, [ebp - 0x44]
inc esi
cmp eax, ecx
ja 0x300579ea
cmp byte [ebp - 0x49], 0
je 0x30021e42
cmp dword [ebp - 0x54], 0
je 0x30021e42
cmp esi, dword [ebp - 0x50]
jb 0x30057a74
add ebx, 0x400
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
mov word [esi], 0x20
inc esi
inc esi
dec dword [ebp - 0x54]
je 0x30021e42
jmp 0x30057a42
mov edi, 0x30029df4
jmp 0x30021f8b
add ebx, 0x400
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
jmp 0x30021f9e
add ebx, 0x400
call fcn.300058b3
mov ecx, dword [eax]
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
lea ecx, [eax + ebx]
mov dword [ebp - 0x50], ecx
jmp 0x30021e35
call fcn.300058b3
mov ecx, dword [eax]
add ebx, 0x400
push ebx
push dword [ebp - 0x48]
push eax
call dword [ecx + 0x10]
test eax, eax
je 0x30021eaf
mov ecx, eax
sub ecx, dword [ebp - 0x48]
mov dword [ebp - 0x48], eax
add esi, ecx
jmp 0x30021e59
call fcn.300058b3
push dword [ebp - 0x48]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x14]
jmp 0x30021e89