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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x84
mov eax, dword [0x5523d4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [0x4fb41c]
mov esi, ecx
push 2
lea ecx, [ebp - 0x2c]
push ecx
xor ebx, ebx
push 0x21
lea eax, [ebp - 0x84]
push 0x400
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x44], ebx
mov dword [esi + 0x8d8], eax
call edi
test eax, eax
je 0x48793f
movsx eax, byte [ebp - 0x2c]
sub eax, 0x30
je 0x48793f
dec eax
je 0x487936
dec eax
jne 0x48793f
mov dword [ebp - 0x48], 2
jmp 0x487942
mov dword [ebp - 0x48], 1
jmp 0x487942
mov dword [ebp - 0x48], ebx
push 2
lea edx, [ebp - 0x2c]
push edx
push 0x1d
push 0x400
call edi
lea ebx, [esi + 0xc8]
push ebx
mov eax, 4
mov dword [ebp - 0x40], 1
mov dword [ebp - 0x64], ebx
call fcn.00483a30
add esp, 4
test eax, eax
je 0x487dfe
push 4
push 0x553738
push ebx
call fcn.004945e1
add esp, 0xc
test eax, eax
jne 0x487e14
call fcn.00483050
test eax, eax
jne 0x487e03
movzx eax, word [esi + 0x10954]
push 2
push eax
mov edi, esi
call fcn.00484790
add esp, 8
test eax, eax
je 0x4879c0
mov dword [ebp - 0x30], eax
cmp eax, 1
jg 0x487e03
mov eax, dword [esi + 0x10918]
test eax, eax
je 0x4879dd
push eax
call fcn.00495660
add esp, 4
mov dword [esi + 0x10918], 0
movzx edi, word [esi + 0x10956]
test edi, edi
je 0x487a6f
mov eax, dword [esi + 0x10918]
test eax, eax
je 0x4879ff
push eax
call fcn.00495660
add esp, 4
push edi
call fcn.0049574c
add esp, 4
mov dword [esi + 0x10918], eax
test eax, eax
jne 0x487a5c
push 0x401
push edi
lea ebx, [esi + 0x8dc]
push 0x53a7e4
push ebx
call fcn.00494428
mov ecx, dword [esi + 0x10b54]
add esp, 0xc
push eax
push ebx
push esi
call ecx
mov edx, dword [esi + 0x10910]
sub edx, dword [esi + 0x10914]
sub edx, dword [esi + 0x108e4]
add edx, dword [esi + 0x108e8]
add edx, edi
push edx
call fcn.00483c50
add esp, 4
jmp 0x487a6f
push eax
mov eax, edi
call fcn.00483a30
add esp, 4
test eax, eax
je 0x487dfe
xor edi, edi
cmp dword [esi + 0x74], edi
jne 0x487afb
mov eax, dword [esi + 0x6c]
cmp eax, edi
je 0x487ab4
mov dword [ebp - 0x38], edi
jbe 0x487afb
lea ebx, [esi + 0x109f0]
lea esp, [esp]
mov eax, dword [esi + 0x18]
mov ecx, dword [esi + 0xc0]
mov ecx, dword [ecx + edi*4]
push eax
push ebx
push ecx
call fcn.00490460
add esp, 0xc
cmp eax, 1
je 0x487ab4
inc edi
cmp edi, dword [esi + 0x6c]
jb 0x487a90
jmp 0x487afb
xor edi, edi
mov dword [ebp - 0x38], 1
cmp dword [esi + 0x70], edi
jbe 0x487afb
lea ebx, [esi + 0x109f0]
jmp 0x487ad0
mov eax, dword [esi + 0x18]
mov edx, dword [esi + 0xc4]
mov ecx, dword [edx + edi*4]
push eax
push ebx
push ecx
call fcn.00490460
add esp, 0xc
cmp eax, 1
je 0x487af4
inc edi
cmp edi, dword [esi + 0x70]
jb 0x487ad0
jmp 0x487afb
mov dword [ebp - 0x38], 0
cmp dword [esi + 0x74], 0
jne 0x487b47
cmp dword [ebp - 0x38], 0
jne 0x487b47
movzx eax, word [esi + 0x10958]
test ax, ax
je 0x487de2
test eax, eax
je 0x487de2
mov ecx, dword [esi + 0x10910]
sub ecx, dword [esi + 0x10914]
sub ecx, dword [esi + 0x108e4]
add ecx, dword [esi + 0x108e8]
add ecx, eax
push ecx
call fcn.00483c50
add esp, 4
jmp 0x487de2
mov eax, dword [esi + 0x10918]
test eax, eax
je 0x487ba1
mov ecx, dword [esi + 0x10944]
lea edx, [ebp - 0x28]
push edx
movzx edx, word [esi + 0x10956]
push ecx
push 1
push edx
call fcn.004834c0
add esp, 0x10
test al, 1
je 0x487ba1
lea eax, [ebp - 0x20]
push eax
call fcn.004a8159
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x487ba1
mov edx, dword [ecx + 0xc]
mov eax, dword [ecx + 0x14]
mov edi, dword [ecx + 0x10]
mov dword [ebp - 0x2c], edx
cdq
mov ebx, 0x64
inc edi
idiv ebx
mov eax, dword [ecx + 8]
mov ecx, dword [ecx + 4]
jmp 0x487bd9
mov ecx, dword [esi + 0x10944]
mov eax, ecx
shr eax, 0x19
add eax, 0x50
xor edx, edx
mov edi, 0x64
div edi
mov eax, ecx
shr eax, 0x10
and eax, 0x1f
mov dword [ebp - 0x2c], eax
mov edi, ecx
mov eax, ecx
shr edi, 0x15
shr eax, 0xb
shr ecx, 5
and edi, 0xf
and eax, 0x1f
and ecx, 0x3f
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x48]
dec eax
mov dword [ebp - 0x5c], ecx
mov dword [ebp - 0x4c], edx
je 0x487bf7
dec eax
jne 0x487bff
mov eax, edi
mov edi, edx
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x4c], edx
jmp 0x487bfc
mov eax, edi
mov edi, dword [ebp - 0x2c]
mov dword [ebp - 0x2c], eax
movzx eax, word [esi + 0x10940]
mov edx, dword [esi + 0x1094c]
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x54], eax
test al, 1
je 0x487c1c
sub edx, 0xc
mov dword [ebp - 0x34], edx
mov ecx, dword [esi + 0x10950]
test ecx, ecx
jne 0x487c56
xor eax, eax
lea ecx, [eax + 5]
mov eax, 0x66666667
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp word [esi + 0x10942], 0xd
mov dword [ebp - 0x58], eax
jae 0x487ccb
movzx ebx, word [esi + 0x10942]
jmp 0x487cd0
cmp ecx, 0x1e8480
jbe 0x487c87
mov eax, 0x10624dd3
mul ecx
mov ebx, edx
shr ebx, 6
mov eax, ebx
xor edx, edx
shr eax, 1
cmp ecx, dword [ebp - 0x34]
jb 0x487c7e
sub eax, dword [ebp - 0x34]
add eax, ecx
div ebx
jmp 0x487cb7
sub eax, ecx
add eax, dword [ebp - 0x34]
div ebx
jmp 0x487cb5
cmp ecx, edx
jb 0x487ca1
mov eax, ecx
sub eax, edx
imul eax, eax, 0x3e8
mov edx, ecx
shr edx, 1
add eax, edx
xor edx, edx
div ecx
jmp 0x487cb7
mov eax, edx
sub eax, ecx
imul eax, eax, 0x3e8
mov edx, ecx
shr edx, 1
add eax, edx
xor edx, edx
div ecx
neg eax
test eax, eax
jns 0x487c28
mov ecx, 5
sub ecx, eax
jmp 0x487c2b
mov ebx, 0xd
lea eax, [ebx*8 + 0x53a6c0]
lea edx, [ebp - 0xc]
sub edx, eax
lea esp, [esp]
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x487ce0
cmp ebx, 8
je 0x487d14
cmp ebx, 9
je 0x487d14
cmp ebx, 0xd
jb 0x487d25
movzx eax, word [esi + 0x10942]
push eax
lea ecx, [ebp - 8]
push 0x54a168
push ecx
call fcn.00494428
add esp, 0xc
jmp 0x487d25
mov eax, dword [ebp - 0x54]
shr eax, 1
and eax, 3
mov dl, byte [eax + 0x53a6b8]
mov byte [ebp - 7], dl
mov cl, byte [esi + 0x10940]
mov eax, dword [esi + 0x10b68]
and cl, 1
neg cl
sbb cl, cl
and cl, 0x25
add cl, 0x20
movzx edx, cl
mov ecx, dword [esi + 0x10948]
push edx
push ecx
lea edx, [ebp - 0xc]
mov dword [ebp - 0x54], eax
push edx
lea ebx, [esi + 0x8dc]
lea eax, [esi + 0x109f0]
call fcn.0048b340
push eax
mov eax, dword [esi + 0x8d8]
mov ecx, dword [eax + 0x18]
mov eax, dword [ebp - 0x5c]
and cl, 0x10
neg cl
sbb cl, cl
and cl, 0x3e
add cl, 0x20
movzx edx, cl
mov ecx, dword [ebp - 0x60]
push edx
mov edx, dword [ebp - 0x4c]
push eax
mov eax, dword [ebp - 0x2c]
push ecx
mov ecx, dword [ebp - 0x58]
push edx
mov edx, dword [ebp - 0x34]
push eax
mov eax, dword [esi + 0x10950]
push edi
push ecx
push edx
push eax
mov eax, dword [ebp - 0x54]
mov ecx, dword [eax + 0x10]
call ecx
mov edx, dword [esi + 0x38]
movzx eax, word [esi + 0x10958]
neg edx
sbb edx, edx
and edx, 0xfffffffb
add edx, 5
push edx
push eax
mov edi, esi
call fcn.00484790
add esp, 8
test eax, eax
je 0x487dd0
mov dword [ebp - 0x30], eax
cmp eax, 1
jg 0x487e03
mov ecx, dword [esi + 0x10950]
mov edx, dword [ebp - 0x34]
add dword [ebp - 0x44], ecx
add dword [ebp - 0x50], edx
inc dword [ebp - 0x3c]
mov ebx, dword [ebp - 0x64]
inc dword [ebp - 0x40]
push ebx
mov eax, 4
call fcn.00483a30
add esp, 4
test eax, eax
jne 0x487977
mov eax, 0x33
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00493825
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x40]
dec eax
cmp ax, word [esi + 0x1096e]
jne 0x487eea
cmp dword [esi + 0x38], 2
jge 0x487e84
mov edi, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x44]
call fcn.004883b0
test eax, eax
jns 0x487e43
mov ecx, 5
sub ecx, eax
jmp 0x487e46
lea ecx, [eax + 5]
mov eax, 0x66666667
imul ecx
mov ecx, dword [esi + 0x10b68]
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [ebp - 0x50]
mov dword [ecx + 0x18], edx
mov ecx, dword [esi + 0x10b68]
mov edx, dword [ebp - 0x44]
mov dword [ecx + 0x1c], edx
mov ecx, dword [esi + 0x10b68]
mov dword [ecx + 0x20], eax
mov edx, dword [esi + 0x10b68]
mov eax, dword [ebp - 0x3c]
mov dword [edx + 0x24], eax
push 4
push 0x553740
push ebx
call fcn.004945e1
add esp, 0xc
test eax, eax
je 0x487ec3
push 0x401
lea edi, [esi + 0x8dc]
push 0x53b0d8
push edi
call fcn.00494428
mov ecx, dword [esi + 0x10b54]
add esp, 8
push eax
push edi
push esi
call ecx
mov dword [ebp - 0x30], 1
cmp dword [ebp - 0x3c], 0
jne 0x487ed6
cmp dword [ebp - 0x30], 1
jg 0x487ed6
mov dword [ebp - 0x30], 0xb
mov eax, dword [ebp - 0x30]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00493825
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x40]
push 0x401
push edx
lea edi, [esi + 0x8dc]
push 0x53b130
push edi
call fcn.00494428
add esp, 0xc
push eax
mov eax, dword [esi + 0x10b54]
push edi
push esi
call eax
push 0x401
push 0x53b1a8
push edi
call fcn.00494428
mov ecx, dword [esi + 0x10b54]
add esp, 8
push eax
push edi
push esi
call ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 3
pop ebx
call fcn.00493825
mov esp, ebp
pop ebp
ret